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 BA8C5A0519; Fri, 3 Jul 2020 10:14:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B9CDC1DA40; Fri, 3 Jul 2020 10:14:02 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 4ABD51DA3D for ; Fri, 3 Jul 2020 10:14:00 +0200 (CEST) IronPort-SDR: vtT/Zl2pQhYKt1ooOdP5hkxBFV+2047azGDxQ0goDiBYb4rkSV/NDFUE+GCk/qqO90Ycd18evv Bl3iAPikEx1w== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="135392096" X-IronPort-AV: E=Sophos;i="5.75,307,1589266800"; d="scan'208,217";a="135392096" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2020 01:13:58 -0700 IronPort-SDR: wobqkcqTvUO/1Pmp542XrNYX1gJrS0vyuaFUIuxUkp/Zo1WgrwB+BuS9tEnZdf5p7OgOT1MY/V JPyPdPJadcwg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,307,1589266800"; d="scan'208,217";a="278367758" Received: from jguo15x-mobl.ccr.corp.intel.com (HELO [10.67.68.176]) ([10.67.68.176]) by orsmga003.jf.intel.com with ESMTP; 03 Jul 2020 01:13:55 -0700 To: i.dyukov@samsung.com, dev@dpdk.org, v.kuramshin@samsung.com, thomas@monjalon.net, david.marchand@redhat.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, wei.zhao1@intel.com, beilei.xing@intel.com, qiming.yang@intel.com, wenzhuo.lu@intel.com, mb@smartsharesystems.com, stephen@networkplumber.org References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200702132139.28078-1-i.dyukov@samsung.com> <20200702132139.28078-7-i.dyukov@samsung.com> From: Jeff Guo Message-ID: Date: Fri, 3 Jul 2020 16:13:54 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200702132139.28078-7-i.dyukov@samsung.com> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v4 6/7] net/i40e: return unknown speed in status 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" On 7/2/2020 9:21 PM, Ivan Dyukov wrote: > rte_ethdev has declared new NUM_UNKNOWN speed which > could be used in case when no speed information is available and > link is up. NUM_NONE should be returned, if link is down. > > Signed-off-by: Ivan Dyukov > --- > drivers/net/i40e/i40e_ethdev.c | 5 ++++- > drivers/net/i40e/i40e_ethdev_vf.c | 10 +++++----- > 2 files changed, 9 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c > index 749d85f54..d09b77674 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -2889,7 +2889,10 @@ 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_NONE; > + if (link->link_status) > + link->link_speed = ETH_SPEED_NUM_UNKNOWN; > + else > + 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 bb5d28a44..1da185485 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -2165,15 +2165,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_NONE; > + if (vf->link_up) > + new_link.link_speed = ETH_SPEED_NUM_UNKNOWN; > + else > + 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 && > - new_link.link_speed != ETH_SPEED_NUM_NONE > - ? ETH_LINK_UP > - : ETH_LINK_DOWN; > + new_link.link_status = vf->link_up ? ETH_LINK_UP : ETH_LINK_DOWN; > new_link.link_autoneg = > !(dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED); > Acked-by: Jeff Guo >