From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C7B11A04D8; Tue, 11 Aug 2020 08:49:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E9B3A1C07D; Tue, 11 Aug 2020 08:49:31 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 750AE1C00D for ; Tue, 11 Aug 2020 08:49:29 +0200 (CEST) IronPort-SDR: PlbekWEbxeilZ5doQPj/hrcxksrHR7fEV7XIJwNMsYvlS07uTyUcv7F2TG2Qkf61X/qH7eIYT1 YWOsoodKcMSg== X-IronPort-AV: E=McAfee;i="6000,8403,9709"; a="171722156" X-IronPort-AV: E=Sophos;i="5.75,460,1589266800"; d="scan'208";a="171722156" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2020 23:49:29 -0700 IronPort-SDR: +cYmaH/yrmcWowajs2Ab7e1ChY/m1TYppkWQJRF0GlMdX1Xeb1IWXOHYZjkWEXi8Gx16t8//2d dMa3DiULQRlg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,460,1589266800"; d="scan'208";a="398445740" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.134]) by fmsmga001.fm.intel.com with ESMTP; 10 Aug 2020 23:49:27 -0700 From: SteveX Yang To: jingjing.wu@intel.com, beilei.xing@intel.com, dev@dpdk.org Cc: SteveX Yang Date: Tue, 11 Aug 2020 06:29:12 +0000 Message-Id: <20200811062917.7007-3-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200811062917.7007-1-stevex.yang@intel.com> References: <20200811062917.7007-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH 2/7] net/iavf: set speed to undefined for default case X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" During PF/VF link update, a default speed value of 100M will be set if get_link_info has failed or speed is unknown. Consequently if PF is put in no-carrier state, VFs will switch to "in carrier" state due to a link up + a link speed set to 100M (default value if no speed detected). To be consistent with linux drivers on which PF and VFs are in same carrier state, sets default speed to undefined (instead of 100M) and updates a link status of VF only if link is up and speed is different from undefined. Fixes: 48de41ca11f0 ("net/avf: enable link status update") Signed-off-by: SteveX Yang --- drivers/net/iavf/iavf_ethdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index f9dd5710c..ae508f2f0 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -620,8 +620,9 @@ iavf_dev_link_update(struct rte_eth_dev *dev, } new_link.link_duplex = ETH_LINK_FULL_DUPLEX; - new_link.link_status = vf->link_up ? ETH_LINK_UP : - ETH_LINK_DOWN; + new_link.link_status = (vf->link_up && + new_link.link_speed != ETH_SPEED_NUM_NONE) + ? ETH_LINK_UP : ETH_LINK_DOWN; new_link.link_autoneg = !(dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED); -- 2.17.1