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 D9373A034C for ; Thu, 28 Apr 2022 11:19:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0A434013F; Thu, 28 Apr 2022 11:19:13 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 441064013F for ; Thu, 28 Apr 2022 11:19:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651137552; x=1682673552; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YMoOWZPGvtB9t7t1wl//D4iERIdguJD2uDOcSOV5lEg=; b=lrGX9q8viOj2qmzCtuVUcHlbMPTcEJYZzUIp4AFwJabMlgOpnCHDEtrJ TlGIumKakEtYfvJk6GAi4j0fxOwb/trefE0UnjR4iRtU0KM/sfjLmWG0Z zHdmOd9DCUJzQu7TjI33Jhl91OQzt7sYkaY92RtEiotLtW5gbE2+gC4Ry Dzn6Cgj8ow3mqTbyYA9qfGwHvdSSYUe3OLoj98kcUH1NqX7psK/SLKLo9 fWRb3CeG8Ahd2LJF3pvMsPcfio5RjfdlvLZGZ43gVcWG92UtTaxRPe3v9 lTwUZ3KkWrXGFGpayUfl85HFwZuh1QpDCudrtWCIKJm3sFNiLCzT9zt95 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10330"; a="246137422" X-IronPort-AV: E=Sophos;i="5.90,295,1643702400"; d="scan'208";a="246137422" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 02:19:11 -0700 X-IronPort-AV: E=Sophos;i="5.90,295,1643702400"; d="scan'208";a="581173577" Received: from unknown (HELO localhost.localdomain) ([10.239.251.3]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 02:19:09 -0700 From: wenxuanx.wu@intel.com To: songx.jiale@intel.com Cc: Wenxuan Wu , stable@dpdk.org Subject: [PATCH] net/i40e: fix max frmame size config at port level Date: Thu, 28 Apr 2022 08:57:18 +0000 Message-Id: <20220428085718.51514-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 Max frame size of XL710 can only be set when link is up, and the wait time is 1 sec. But X722 consumes longer time which is too short to up would result in this error. Acctually, max frame size of X722 can be set regardless of link status. This fix resolve max frame size can only be set when link is up. 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 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 755786dc10..d3cc6a2769 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -12108,17 +12108,15 @@ i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size) update_link_reg(hw, &link); if (link.link_status) break; - rte_delay_ms(CHECK_INTERVAL); } while (--rep_cnt); - if (link.link_status) { + /* Only I40E_MAC_XL710 link up should be guaranteed */ + if (hw->mac.type == I40E_MAC_X722 || 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