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 7BA9FA00E6 for ; Thu, 8 Aug 2019 10:24:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C28F04C96; Thu, 8 Aug 2019 10:23:10 +0200 (CEST) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 569AF2BA2 for ; Thu, 8 Aug 2019 10:22:58 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id p17so93966681wrf.11 for ; Thu, 08 Aug 2019 01:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=afZoqfzpWQuC9ViJWMOoQR0Yyw87jibufsab0QXr4mA=; b=Lg5QVWrWsphZ8oq8POUxSgc06S1+GuewoDAUqA68NSZh6bd9gLm3cyaiP23qPA2MAn j8dBezwVFd29bIVmkvAt9ra5+krHrV23EqMpycjCoyHbMi299WBm3M3fHCc/XMCRSPYe O9CpwiTo/siSx1QWzAwEpTCzUsCk4xDbqPyAM0bfVpfLguR9kG8WA3hqM9cezuIghpA6 iu7QI6DkjKTlkJ7g5uxxbPFZtNpFL/RpmTqjaLHS8rtYwvo3m/Wvapy5IVL2UjyUN9YZ RXT62NbMwTQzOAU2hpflV0lK/kdo60sOAJ65GhbSmCx/TXdX/yN/7GB1tiNXVRY0l3eb 28pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=afZoqfzpWQuC9ViJWMOoQR0Yyw87jibufsab0QXr4mA=; b=TKFXHBa/45HDXemgLusvKj5kGtoj1JyemyIR1yB/+kYnQNyQPm7AJfR30pbQanrO9E mKz8Cvrp9rrO0J9tmkapSSOMyjyWTWULZ1yPjqbnspjt0nedNKXwY+h5eB313bWu5o9V DA4TuC7F3mY7O5Av+lMFFJovSQeHQF5k+ehf6PaeCb/puDUX62A0s5zhHZ4Q6TgdSLL/ 2onlIJo226hBjT5WAs4GUl8bb2kq8tAjZmlpyLTc3nHoQrZk6OUPazeHPMuXYWMSXjjp EtdWHs0GMqyCOtJQEDa3qabSQWICLhOjCn1CsaMcP8BmiB4X8RPJEPld0K3svGlc58+P ZAPA== X-Gm-Message-State: APjAAAVe2l6dEQPNoCotPFgRr2zAchnMcXX/w35H71QdzJ96CL36bOwU ZvUPuZTBRv4eFDH9tG0TItxzzJ3jGg== X-Google-Smtp-Source: APXvYqyu+5tOn+EhLPL+KXH/KekugAltuIBkPnvrK0MH4iXMYpBCyempLWtHIGWhFXSWDI2kFF1ZTg== X-Received: by 2002:adf:93a4:: with SMTP id 33mr11253789wrp.187.1565252577937; Thu, 08 Aug 2019 01:22:57 -0700 (PDT) Received: from ascain.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id t13sm111437018wrr.0.2019.08.08.01.22.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Aug 2019 01:22:57 -0700 (PDT) From: Thierry Herbelot To: dev@dpdk.org Cc: Laurent Hardy , stable@dpdk.org, Thomas Monjalon Date: Thu, 8 Aug 2019 10:22:12 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 19.11 V3 07/12] net/i40e: set speed to undefined for default case in link update 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" From: Laurent Hardy 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: 4861cde46116 ('i40e: new poll mode driver') Cc: stable@dpdk.org Signed-off-by: Laurent Hardy --- drivers/net/i40e/i40e_ethdev.c | 4 ++-- drivers/net/i40e/i40e_ethdev_vf.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 4e40b7ab5250..76abe8209a10 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2743,7 +2743,7 @@ update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link, status = i40e_aq_get_link_info(hw, enable_lse, &link_status, NULL); if (unlikely(status != I40E_SUCCESS)) { - link->link_speed = ETH_SPEED_NUM_100M; + link->link_speed = ETH_SPEED_NUM_NONE; link->link_duplex = ETH_LINK_FULL_DUPLEX; PMD_DRV_LOG(ERR, "Failed to get link info"); return; @@ -2777,7 +2777,7 @@ update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link, link->link_speed = ETH_SPEED_NUM_40G; break; default: - link->link_speed = ETH_SPEED_NUM_100M; + link->link_speed = ETH_SPEED_NUM_NONE; break; } } diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 308fb9835ab1..bf707e57b29b 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -2143,13 +2143,15 @@ i40evf_dev_link_update(struct rte_eth_dev *dev, new_link.link_speed = ETH_SPEED_NUM_40G; break; default: - new_link.link_speed = ETH_SPEED_NUM_100M; + new_link.link_speed = ETH_SPEED_NUM_NONE; break; } /* full duplex only */ 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.11.0