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 787BAA00E6 for ; Wed, 7 Aug 2019 16:38:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7B6915424; Wed, 7 Aug 2019 16:38:15 +0200 (CEST) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 302E72C02 for ; Wed, 7 Aug 2019 16:37:58 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id p17so91618330wrf.11 for ; Wed, 07 Aug 2019 07:37: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=aluXQhFqKHvSpt/J7FslVOSjArgfppvuj0QkxyHz2OI=; b=QYbwziTFQzyDQBKUjpTdh9CuEOUOrqadUlq+6BQyzuSrZNsOBQ2nVmoyNSL7O8az+x rzbTZMlSy9DPgpC0fyqzFcuIEsi+YuFceCNvs+lo6Fa09Qc9id56Gi2YjvcZh804iR5e e8esFZTEfQEmJfbdgoS5HyB0WMlGjfKL1GeiL7rFZJBzb6G1Jo0FEAU5o2We5Vu5Q2zO SFA2SbfG0U8JOIX6IpSckKzQb6PHyEM57BUo7DPsQm1eGpwHj+QjMVLFba1P3kYE8sG0 Y5nnuO4kCuxumhl3nh0DnENGbINY6gjTn+d5k+axwCr8mu+WkvAaHexJuMAER+aVTlnr 8/rg== 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=aluXQhFqKHvSpt/J7FslVOSjArgfppvuj0QkxyHz2OI=; b=cfnYRtn2CUWxqcCKuo7aAZwtun+kfdluU4N9zHYaqDUQy/SDZGJENznI46EcwRVrHZ iE03Ce0QYWfJ91ju11FiBJ8UjqR4NDWh4KIgnY4oIR0KzDd+rsP+Zv0NgB4g2Jo7NkKH 6NGk0R30kTJo55EQjafkeI/MUxrv0OcUKdCqb0axZnm5cDgcNg0b5riU8yZ+aCt8gbgM xW7/JdxihLl4M7+zkPx7HxTHMLhBNfjpQkE3Kbwd1CuKwoNHH2MLwIrLzCvUxBsa7rav 4VJBTkJ6zRFcqkqnr/TF0EorRWwN0+LXTuWq6d9f9U+r+07PXbgp2lNsFVKz0+q4++3l yfIA== X-Gm-Message-State: APjAAAXDGyJ+FSkFi3IWjmQ5W7fuAgVr4gzHGDEBWYEGFOK1obBTYE4Q GEc5l8UBxab2JEnbcJecjJ1sxLVGRg== X-Google-Smtp-Source: APXvYqzFkmU/UX6W7DtuMuATASrecyq/8UX1iIHhAQlZLSpp+j2Pqi/0bUgkdcPsHu21HuIR1CwjsA== X-Received: by 2002:adf:f646:: with SMTP id x6mr12051850wrp.18.1565188677981; Wed, 07 Aug 2019 07:37: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 2sm133441211wrn.29.2019.08.07.07.37.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Aug 2019 07:37:57 -0700 (PDT) From: Thierry Herbelot To: dev@dpdk.org Cc: Laurent Hardy , stable@dpdk.org, Thomas Monjalon Date: Wed, 7 Aug 2019 16:37:26 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-stable] [PATCH 19.11 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 at 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..9ba351710b7a 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