From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5DC75A04FF for ; Thu, 28 Apr 2022 10:09:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54C4C41156; Thu, 28 Apr 2022 10:09:13 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id F378E410DC; Thu, 28 Apr 2022 10:09:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651133351; x=1682669351; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=nqqWqeoIOd3pn0Yx8mOC0vLjchsJbfjNGIbrgu5A/Eo=; b=JEqLJRvQQ2KdonDiP9POsnb+Nf6Hqd3WG/wSelNnvKrCLRyKHOheL+Qu dg7of7nh1CGdPYwZtmwBLe1onqaigkGBECi1YIt0Eea41r4ubp/zFVrJR i0XKMilvKefnO3ZysjF8E5eKnv5fHN3vcCBUx2IOaaNNB3mNBQu8uRWte 4XSHvX8YleWwXxkOYoTG+8MCNdv4iDpddo6nYNae7YzK9ifFppVSRGgPG DRta26p15rC/s+1G/to46vwNe36dTzgPUq4rR+K3X0fU/AaBiOH/wpckz fz3TAnWUZOZS+KcTcNtSyfR0XCDfTzXqMdEU35AIpxkHYDRG9Xn5tN6rc Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10330"; a="246119393" X-IronPort-AV: E=Sophos;i="5.90,295,1643702400"; d="scan'208";a="246119393" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 01:07:10 -0700 X-IronPort-AV: E=Sophos;i="5.90,295,1643702400"; d="scan'208";a="514147697" Received: from unknown (HELO localhost.localdomain) ([10.239.251.3]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 01:07:06 -0700 From: wenxuanx.wu@intel.com To: beilei.xing@intel.com, dev@dpdk.org Cc: wenxuanx.wu@intel.com, yidingx.zhou@intel.com, stable@dpdk.org Subject: [PATCH] driver/i40e: enable max frame at port level Date: Thu, 28 Apr 2022 07:45:12 +0000 Message-Id: <20220428074512.38423-1-wenxuanx.wu@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Wenxuan Wu This fix resolve max frame size can only be set when link is up. hw.type would result in different behavior: For X710, max frame size can be set regardless of link status. For X722, link up should be guaranteed. Fixes: a4ba77367923 Cc: stable@dpdk.org Signed-off-by: Wenxuan Wu --- drivers/net/i40e/i40e_ethdev.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 755786dc10..0bd9e5eac0 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -12104,20 +12104,18 @@ i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size) struct rte_eth_link link; enum i40e_status_code status; - do { - update_link_reg(hw, &link); - if (link.link_status) - break; - - rte_delay_ms(CHECK_INTERVAL); - } while (--rep_cnt); + if (hw->mac.type == I40E_MAC_XL710) { /* I40E_MAC_XL710 */ + do { + update_link_reg(hw, &link); + if (link.link_status) + break; + rte_delay_ms(CHECK_INTERVAL); + } while (--rep_cnt); - if (link.link_status) { + if (link.link_status) + status = i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL); + } else {/* I40E_MAC_X722 */ status = i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL); - if (status != I40E_SUCCESS) - PMD_DRV_LOG(ERR, "Failed to set max frame size at port level"); - } else { - PMD_DRV_LOG(ERR, "Set max frame size at port level not applicable on link down"); } } -- 2.25.1