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 D8677A00E6 for ; Wed, 7 Aug 2019 17:10:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0799FD187; 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 1FEDA2C0C for ; Wed, 7 Aug 2019 17:09:46 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id v15so425345wml.0 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=b8evctFkDoDIksOlGKRMmzlvfvfgIpdbvR8otTSB2zSM342tE5f0KglCcjeHjyIifJ VZ0/Azi97Y9G+X0lXfOgHrM+7aPpsX55nv8ppk+jPbGcNuC5fz9B+fMlv9suqiiz326z e/LGBvFTqMxCDKjK6qcnjGRltMFAd2HZvbUQ806AtheTV6yg2DdbttvBSxHVwyHqEH6Z zeJ3mjs43RGBDZMI1LpZDxZvwfuC/u28mQrS6Bf+yv3pA/pRjFHICGuP6oh8FzbAXJRB HhlU56YVCMGRJ/MOD8nMypgAc0TwUz4zye5CZoliiWAe6Oga9Lr/EZLKLMqGoWPNoJEv qmyA== X-Gm-Message-State: APjAAAVcCnixx5Uqk9oxn37J3eTcfQjlqV104p7pAqFWjHlJLiN7EVS0 3hfwuwBZeQUWTTo6lXQKQeQT 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-stable] [PATCH 19.11 V2 07/12] net/i40e: set speed to undefined for default case in link update X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" 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