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 171B5A00E6 for ; Wed, 7 Aug 2019 17:11:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4A4681B464; Wed, 7 Aug 2019 17:10:01 +0200 (CEST) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 64BBF2C16 for ; Wed, 7 Aug 2019 17:09:46 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id 10so406864wmp.3 for ; Wed, 07 Aug 2019 08:09:46 -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=ZXyRjiJ+pA41k6SbJRlip9Fymn/ToHqDsn9pGotD/z0mV1+Sm2vqMpaqpKlAI6GFa9 mMuLtSY2cEKWRuiPXRvt7eamHktK6Kiw/YoeEkmsPtMVoFJa8jCf77rU9ODHj1ErD7dk CPYrxGIxvTQMULNdQiLYKCat3g2a4Hjd38pwUQzqjkqw30JP/K1TXmOej+R+ZaklRszC Nz3zENRclCNjeK4R0HZ6aPYvwBldytpQcqy6xW8TGCFDr44xLJ2ubcAcz4FW8PL4+eRn rcOSwx/VkGvaFLBZvz73PIWQOy4ocx5d/Lm21KM7BMlnQTZ3/b7H/yP7vGab9fMLk4J7 gZVg== 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=Q/H4spA+3BWVwuQES5hG6ZRxehMo2CcJRT+PMJ/8NH1T0Goh/Pe7i14+US9IIjh2/J LaGI5Yh372r73WyVrYVr2K3hLCWF4bVlMnqKms1E7P+O4YFsZbuo6E7PRnr13idd5ODV ONTKxZCVjA0s+q60CHcxbHKhlToMWVVjghvNAZV5mE70v1OyKthg++odOYfHqkCf/rIT YoLZZ8VVDeE4g30J+fj+FUAGezAiXlmUeyxZxcHRF4NYVYNgCY6bhAoHv6jcFcDcaiGW Y624mUzj75zetWUy7I+kYEWKxISxEp3WlqZcgu8iF3lq1RHJOG1jmu4NcHOzuHj0Ysie Xj/A== X-Gm-Message-State: APjAAAVi3jzTSwyLjGokcnohO4PMmUAciHjg7GSVuiPvf1lHKVnGQjmi tMAsvREto5utZacGSb90UEIMFhgbQg== X-Google-Smtp-Source: APXvYqy28bJUk5U565z5V/UQMjP7yyJOS1zFA7VqWUYJ2KuBNFHJDVswLuThDBf/txXs6JvFfsP3oA== X-Received: by 2002:a1c:be19:: with SMTP id o25mr440486wmf.54.1565190584388; Wed, 07 Aug 2019 08:09:44 -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 r5sm382862wmh.35.2019.08.07.08.09.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Aug 2019 08:09:43 -0700 (PDT) From: Thierry Herbelot To: dev@dpdk.org Cc: Laurent Hardy , stable@dpdk.org, Thomas Monjalon Date: Wed, 7 Aug 2019 17:09:16 +0200 Message-Id: <22c111c3cd1eff557a5ea95997ba1033d9d31b5f.1565190405.git.thierry.herbelot@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 19.11 V2 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