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 19C9EA00E6 for ; Wed, 7 Aug 2019 16:39:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A90A15B34; Wed, 7 Aug 2019 16:38:15 +0200 (CEST) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 6BFCE2BA8 for ; Wed, 7 Aug 2019 16:37:58 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id p17so91618363wrf.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=uflhRZhb4bi06pLLLGqIdKQZBzk3cYoN6yMBxVifxdRj1b4CoCjS+PL1x6AReKmz8g 2I5AMFhYkGeaDCIP5vkjdTUKho5DClGhYJjyJM70I5PE9N1/SAiuh2DBK+UT+yMvTg87 S8bK9w6FWNo5o1aYndllvfLLbwHvnJOXcN9V8a74dwMB4Uc9d54328JPkzwWhsilaBww G4HypVPoJ2khExiaFWeNw7tlYbx2RuUcJh8gqIPh8LnNxv1W8eRADxjnDId+7mamz84H 3WCjh7anMOlMTEalnz3UocMaGRafAe/rM6KdHr1diidPrMCj2eRYbM4YG/Xjj1cS7ueJ GrlQ== X-Gm-Message-State: APjAAAUSZxgTbq9BlUpBtV8U6ElT3t3PxKVhZck8ifeEynD32qANrVpT fE4Ar79yN+fLn66iYdkvP4oJFO8Vlg== 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-dev] [PATCH 19.11 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 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