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 8B9B1A034C; Thu, 28 Apr 2022 13:34:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3FC434281B; Thu, 28 Apr 2022 13:34:21 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id A57E240E50; Thu, 28 Apr 2022 13:34:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651145660; x=1682681660; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=0SvKaWTe1SL+OaFAA+yz7uFMRlgzLuDhvBs+0RsIkYA=; b=YMjY13yNn50bR6FlEzwXz7VJKAAkJjNvE7Obm8+zRh8xY4kI5cChLF+n lUndc6/nSAJpoplB+4Jv/PTDz6ZI8s+T4d89Q/t+/DjOXk+xgf0defHLX /bEhLdZ/DItqeqifCH2qEBwSijVcZFV/JogmDWs0GpDhTOYNCMggZq4ee pRmVX2GdVzMoU0OYOLBqZ87wsipqdUJFy7pSTdrzcjgmFtr41lWZrLvP2 xwX5tfMV5vG8IrsHqOwPF73XNYC/ribYw7qKXXwJT6zwQNzyGEdYe14HS O3XrlOKhrRZz97PiQUnRvoweDx0SqJU/qA1Bx7KyVwBow0YSz7ibHYJ8L g==; X-IronPort-AV: E=McAfee;i="6400,9594,10330"; a="263849127" X-IronPort-AV: E=Sophos;i="5.90,295,1643702400"; d="scan'208";a="263849127" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 04:34:18 -0700 X-IronPort-AV: E=Sophos;i="5.90,295,1643702400"; d="scan'208";a="533826316" Received: from unknown (HELO localhost.localdomain) ([10.239.251.3]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 04:34:16 -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] net/i40e: fix max frmame size config at port level Date: Thu, 28 Apr 2022 11:12:24 +0000 Message-Id: <20220428111224.57705-1-wenxuanx.wu@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Wenxuan Wu Previously, max frame size can only be set when link is up, and the wait time is 1 sec. But for nic media type of I40E_10G_BASET would consume longer time which is too short to up would result in error. Acctually, max frame size of media type I40E_MEDIA_TYPE_BASET can be set regardless of link status. This patch omit the 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 | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 755786dc10..5762cd526a 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -12102,23 +12102,21 @@ i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size) struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); uint32_t rep_cnt = MAX_REPEAT_TIME; struct rte_eth_link link; - enum i40e_status_code status; + enum i40e_status_code status = I40E_ERR_DEVICE_NOT_SUPPORTED; do { update_link_reg(hw, &link); if (link.link_status) break; - rte_delay_ms(CHECK_INTERVAL); } while (--rep_cnt); - if (link.link_status) { + /* Only I40E_MEDIA_TYPE_FIBER link up should be guaranteed */ + if (hw->phy.media_type == I40E_MEDIA_TYPE_BASET || link.link_status) 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"); - } + + if (status != I40E_SUCCESS) + PMD_DRV_LOG(ERR, "Failed to set max frame size at port level"); } RTE_LOG_REGISTER_SUFFIX(i40e_logtype_init, init, NOTICE); -- 2.25.1