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 34CC7A050B for ; Fri, 15 Apr 2022 05:37:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F6714003C; Fri, 15 Apr 2022 05:37:24 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id CEFBF4003C for ; Fri, 15 Apr 2022 05:37:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649993843; x=1681529843; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=a+0y+V5NVg1RYJ2/doKRQJHzu85Dzyxk8rpBDBvOmCI=; b=fxleZF4SPp+IpkCZLAWzTnTpgiWrCizl2Kp6r1CrkrmeKeMA3bGCJ+2P SPoltC+DMhoutASBx6QxpWyxT3ToANvXus81vQuyNbuQpAnuEFtPH3fBk B4xbpz6VlxD/x7lnWnwamlmqXuHRRuBnphLg3+g0JgfA4cH5A3hF+18f8 hXI2C2aeKwGpvmk4QEP24FFsqA1Vo1VUBjpZ44xd+fsTc8xeh8VuOtDuV qu+pmjkN0Qj0yqD5hMv8o+KtjsKAGsH5Xg2kJ9AUvh4lrHaO92/wRX1ok xhltEC6vcHgev4RWBqg+mqOuI83mMKlDPQgF+6oV2Vt7VwIb2iR8h1SxQ A==; X-IronPort-AV: E=McAfee;i="6400,9594,10317"; a="262529904" X-IronPort-AV: E=Sophos;i="5.90,261,1643702400"; d="scan'208";a="262529904" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 20:37:12 -0700 X-IronPort-AV: E=Sophos;i="5.90,261,1643702400"; d="scan'208";a="574137217" Received: from unknown (HELO localhost.localdomain) ([10.239.251.3]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 20:37:11 -0700 From: wenxuanx.wu@intel.com To: build_sh@intel.com Cc: Wenxuan Wu , stable@dpdk.org Subject: [DPDK] net/i40e: max frame size config regardless of link status Date: Fri, 15 Apr 2022 03:14:48 +0000 Message-Id: <20220415031448.313563-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 which is identical to ifconfig mtu config. 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