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 9398BA0506 for ; Wed, 18 May 2022 07:12:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DC5640685; Wed, 18 May 2022 07:12:54 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 8A4C640685; Wed, 18 May 2022 07:12:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652850772; x=1684386772; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4x26anhwYcVl3nfTcjg9/78FWtkKkY25SztRuyRhVSU=; b=LePKI3nOUsqQAqRMVHlP3ScA+sUqI1QSFmxSMDgTR8g44mM/amO0w8mk ekXY2/AHnpmg7LJ0pTDFYFl6b88BpVslovfXfRfEPiBlhswdFmSymOJbq pSoT5Np8B1/M439/P+nImuXwpnn9oT73QeZaj7VpXgkBPJVdDrnAylcFr oorrj4PiIQrQBSm5ZHgiQdCL0+r87vr1IlR8DrVY/ScxKgEj/9RUdOTAJ hj+Ano/aDH7WcSmIm9WiU2b7Oei6GZ4wltl9CnCI66by0MAeW45GlJwWu GUNWHbTopoiWDOSPcWUxMJ+2xuKvlJjwdaHtW+hRvwE5YtRM3c1tttxQc Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="252001379" X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="252001379" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 22:12:51 -0700 X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="569264535" Received: from unknown (HELO localhost.localdomain) ([10.239.251.3]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 22:12:49 -0700 From: wenxuanx.wu@intel.com To: beilei.xing@intel.com, yuying.zhang@intel.com, dev@dpdk.org Cc: wenxuanx.wu@intel.com, yidingx.zhou@intel.com, stable@dpdk.org Subject: [PATCH v4] net/i40e: fix max frame size config at port level Date: Wed, 18 May 2022 04:49:02 +0000 Message-Id: <20220518044902.270700-1-wenxuanx.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220513072049.149333-1-wenxuanx.wu@intel.com> References: <20220513072049.149333-1-wenxuanx.wu@intel.com> 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 Previously, max frame size can only be set when link is up, and the wait time is 1 sec. Startup time of 10G_BASET longer than 1s would result in failure. Acctually, max frame size of media type I40E_MEDIA_TYPE_BASET can be set regardless of link status. This patch omitted the link status check of 10G_MEDIA_TYPE_BASET. Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at port level") Cc: stable@dpdk.org Signed-off-by: Wenxuan Wu --- drivers/net/i40e/i40e_ethdev.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 755786dc10..50182e0ea3 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -12103,16 +12103,20 @@ i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size) uint32_t rep_cnt = MAX_REPEAT_TIME; struct rte_eth_link link; enum i40e_status_code status; + bool can_be_set = true; - do { - update_link_reg(hw, &link); - if (link.link_status) - break; - - rte_delay_ms(CHECK_INTERVAL); - } while (--rep_cnt); + /* I40E_MEDIA_TYPE_BASET link up can be ignored */ + if (hw->phy.media_type != I40E_MEDIA_TYPE_BASET) { + do { + update_link_reg(hw, &link); + if (link.link_status) + break; + rte_delay_ms(CHECK_INTERVAL); + } while (--rep_cnt); + can_be_set = !(!link.link_status); + } - if (link.link_status) { + if (can_be_set) { 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"); -- 2.25.1