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 3A901A0505 for ; Wed, 18 May 2022 07:23:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2CD3D4281D; Wed, 18 May 2022 07:23:03 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 31DB840685; Wed, 18 May 2022 07:23:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652851381; x=1684387381; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bq6VYeNyFcwbiP83PqkV78XmJA1jT31T3gWdTo2HarA=; b=Yvg3icppXMg3W7EhTUpJgW7a/bGvkkWIbGQcLj8FLS02kFvVSg2ozPQd TP0qRy0eob4tCf8/knqtUz+TzhJA/mJhdtKIhQ324Xpm2slJsv2q1vxE4 ybbikPCR82ZXC7WzLgik63bTs5AduAm5ceROMCjOPZQLGrdU3cc8sv+AH 0f9JchRZ6fQc0csZEiINdBhD8Ps9tmIjyXN/0FGX/TtKDShBYaovKx7UH mxiqe00kiFdb3DGqoYJnwo+LUsc15vdKS4ts20/j1N/3RU3e6HZsSA/n4 Vdi2WopEu8JQVXzBoGc74xtVJprG3ER22Xom0YdJiw7XxYltprSzj5ebZ Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="253533358" X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="253533358" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 22:22:59 -0700 X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="597531508" Received: from unknown (HELO localhost.localdomain) ([10.239.251.3]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 22:22:57 -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:59:14 +0000 Message-Id: <20220518045914.271215-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..7ffd7e7384 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