From patchwork Thu Nov 10 03:45:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Wang X-Patchwork-Id: 119694 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B2400A04FD; Thu, 10 Nov 2022 04:47:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5A8C4400EF; Thu, 10 Nov 2022 04:47:47 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 1BD58400D4; Thu, 10 Nov 2022 04:47:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668052065; x=1699588065; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bKRsBPbdDE98evRXqb4KjXzqv0hp8R77qV9I2wYu9Pg=; b=inXFPUVHfsS/XIxiUUVL5uBZav5Oe0Uv+v5dwijhaK8DtEGSKeC5+SRl b7yxsSGL4FvEqOrhXFnu/2dpBvDxGeKaR77lqXYU/D8B9ZH+St+O4ck7w BvHz9Noqjo9ppIVluIXWWJKl4HYhoHd5ThOVYNwUK4PC2L9Mf36Q9HtIL orsJsVWgsGQgEcoJjr/EjbDzyyu8Bk/3azPjwkyKKyOK7nLAIOtckLJ03 JyjEnQZLuTAN1o+25kW0myuwAuckR+vqwXGQmRIzZJhFdyYGly35rbwtP MvWzlz38HeCsMRFy0R4EVMsigH06dB9rqlC0V8bcZPkFak2XsypVSpJTT g==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="294544977" X-IronPort-AV: E=Sophos;i="5.96,152,1665471600"; d="scan'208";a="294544977" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 19:47:43 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="639452475" X-IronPort-AV: E=Sophos;i="5.96,152,1665471600"; d="scan'208";a="639452475" Received: from intel-cd-odc-gavin.cd.intel.com ([10.240.178.188]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 19:47:41 -0800 From: Jie Wang To: dev@dpdk.org Cc: stevex.yang@intel.com, qi.z.zhang@intel.com, qiming.yang@intel.com, beilei.xing@intel.com, yuying.zhang@intel.com, Jie Wang , stable@dpdk.org Subject: [PATCH] net/i40e: fix X722 NIC receives jumbo frame packets Date: Thu, 10 Nov 2022 11:45:24 +0800 Message-Id: <20221110034524.467431-1-jie1x.wang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org For NIC I40E_10G-10G_BASE_T_X722, when the port is configured with link speed, it cannot receive jumbo frame packets. Because it set maximum frame size failed when starts the port that the port link status is still down. This patch fix the error that starts the port will force set maximum frame size. Fixes: 2184f7cdeeaa ("net/i40e: fix max frame size config at port level") Cc: stable@dpdk.org Signed-off-by: Jie Wang Tested-by: Dukai Yuan --- drivers/net/i40e/i40e_ethdev.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 80fbcc847c..7726a89d99 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -12132,8 +12132,13 @@ i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size) enum i40e_status_code status; bool can_be_set = true; - /* I40E_MEDIA_TYPE_BASET link up can be ignored */ - if (hw->phy.media_type != I40E_MEDIA_TYPE_BASET) { + /* + * I40E_MEDIA_TYPE_BASET link up can be ignored + * I40E_MEDIA_TYPE_BASET link down that hw->phy.media_type + * is I40E_MEDIA_TYPE_UNKNOWN + */ + if (hw->phy.media_type != I40E_MEDIA_TYPE_BASET && + hw->phy.media_type != I40E_MEDIA_TYPE_UNKNOWN) { do { update_link_reg(hw, &link); if (link.link_status)