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 D7BCDA050D for ; Fri, 15 Apr 2022 05:56:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C85C14068A; Fri, 15 Apr 2022 05:56:48 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id CE82B4003C; Fri, 15 Apr 2022 05:56:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649995007; x=1681531007; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dhjXR+SyRY+Dr8bMnqo2bGIM36/Cg9bJzHvXeNGicr0=; b=ivCUj0CgdvDaNiFD4kiknApfh+nJ8T/FYXF4+8/i2vSyP/r94M6eY0bY VhgOT+JE247E8AxxTGM4vFMsO/Xn0Zm+ZB6a6ohAdiiI3+c9Ojr2umRYz Es+oFC01sLGsgCIjLGBzDZ9eqqzmUlziLnYwI+KwzwfzxglruWWARhSiE pFCyxrhutDVrKC+q2QsYA9nVWMfsRS8t3zWRmKBnXHXB6dLA0moqEhfs8 lQigUaV4B3xFxxLGHex3CChyu4FyG7zrWiLroFPXc/KGHkktl1cKIeQU/ MrHb9/RFTONdX9i2SusYH1lzBNeC5EnzyMwDbG/7nTiQ95IzRcQq3iOAA g==; X-IronPort-AV: E=McAfee;i="6400,9594,10317"; a="244974069" X-IronPort-AV: E=Sophos;i="5.90,261,1643702400"; d="scan'208";a="244974069" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 20:56:46 -0700 X-IronPort-AV: E=Sophos;i="5.90,261,1643702400"; d="scan'208";a="552989249" Received: from unknown (HELO localhost.localdomain) ([10.239.251.3]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 20:56:42 -0700 From: wenxuanx.wu@intel.com To: beilei.xing@intel.com, qiming.yang@intel.com, qi.z.zhang@intel.com, dev@dpdk.org, yidingx.zhou@intel.com Cc: Wenxuan Wu , stable@dpdk.org Subject: [PATCH] net/i40e: max frame size config regardless of link status Date: Fri, 15 Apr 2022 03:34:19 +0000 Message-Id: <20220415033419.316323-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 Previously, max frame size can only be set when link is up, testpmd configuration when port is down, so there is a confilict to apply this max frame size before link up. Actual results: Set max frame size at port level not applicable on link down ---- RX-packets: 0 RX-missed: 0 RX-bytes: 0 RX-errors: 1 RX-nombuf: 0 TX-packets: 0 TX-errors: 0 TX-bytes: 0 Throughput (since last show) Rx-pps: 0 Rx-bps: 0 Tx-pps: Expected results: ---- RX-packets: 1 RX-missed: 0 RX-bytes: 5061 RX-errors: 0 RX-nombuf: 0 TX-packets: 0 TX-errors: 0 TX-bytes: 0 Throughput (since last show) Rx-pps: 0 Rx-bps: 3464 Tx-pps: 0 Tx-bps: 0 This fix resolve max frame configuration regardless of link status, which means port mtu can be set whether link is down or up same as ifconfig mtu behavior. Fixes: a4ba77367923 Cc: stable@dpdk.org Signed-off-by: Wenxuan Wu --- drivers/net/i40e/i40e_ethdev.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 755786dc10..25c40ffceb 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -12100,25 +12100,12 @@ static void 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; - do { - update_link_reg(hw, &link); - if (link.link_status) - break; - - rte_delay_ms(CHECK_INTERVAL); - } while (--rep_cnt); - - if (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"); - } + status = i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL); + if (status) + PMD_DRV_LOG(ERR, "Failed to set max frame size at port level"); + return; } RTE_LOG_REGISTER_SUFFIX(i40e_logtype_init, init, NOTICE); -- 2.25.1