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 10F7EA04A4; Tue, 26 May 2020 21:11:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 03F011D95F; Tue, 26 May 2020 21:11:02 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id E1E1B1D71A for ; Tue, 26 May 2020 21:10:58 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200526191058euoutp0234f4dad1b7a92c4f2d1e78e849df3207~Sqb_VJ20q1195811958euoutp02h for ; Tue, 26 May 2020 19:10:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200526191058euoutp0234f4dad1b7a92c4f2d1e78e849df3207~Sqb_VJ20q1195811958euoutp02h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1590520258; bh=RnlYD+Sn70PZMzCtJxYR4w9oEJDvYzwy6GYddb6sZF8=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=iZjgtMsBjZ43px85u0pckL8PZzbPLTiE4K7zZbsfFBkZW1Y54I6s3xNfdvBa1mOTv 96YxJorktW89fNVaG11vYH3J+fakiYd1yQElbu+0bLSLzubsa5u/cp1P41OxDmcdDy gSTmWfQRI7eHZWIl7lk1bhz5ig4YVKqUd0dWwsEI= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200526191058eucas1p190d3452905bb37299eb5ac47062515a6~Sqb_IRwm22594725947eucas1p1J; Tue, 26 May 2020 19:10:58 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id BF.A7.60698.2C96DCE5; Tue, 26 May 2020 20:10:58 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200526191058eucas1p11a8a5007144ba3b0e66ab1286a85c84b~Sqb9sk4Wt2444924449eucas1p1O; Tue, 26 May 2020 19:10:58 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200526191058eusmtrp19af5a763df3af7a1d5f8e6cfaeef140d~Sqb9sBai70430304303eusmtrp1R; Tue, 26 May 2020 19:10:58 +0000 (GMT) X-AuditID: cbfec7f5-a29ff7000001ed1a-e7-5ecd69c263b5 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 24.F0.07950.1C96DCE5; Tue, 26 May 2020 20:10:57 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200526191057eusmtip15ec74b91514ab368071150da909f68e5~Sqb85E2tD1119611196eusmtip1A; Tue, 26 May 2020 19:10:57 +0000 (GMT) From: Ivan Dyukov To: dev@dpdk.org, i.dyukov@samsung.com, v.kuramshin@samsung.com, thomas@monjalon.net, david.marchand@redhat.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, wei.zhao1@intel.com, jia.guo@intel.com, beilei.xing@intel.com, qiming.yang@intel.com, wenzhuo.lu@intel.com Date: Tue, 26 May 2020 22:10:09 +0300 Message-Id: <20200526191033.16459-7-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200526191033.16459-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBKsWRmVeSWpSXmKPExsWy7djP87qHMs/GGSyfL2LxYMpdNovuDy1M FttXdLFZvPu0ncnizt7T7BazLjWxWzz/84rZYsrOHYwWnx6cYLE4fX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FYp2tDC SM/Q0kLPyMRSz9DYPNbKyFRJ384mJTUnsyy1SN8uQS/j0WKjghV8FXe/dDI3MP7i7mLk5JAQ MJH4PeMIYxcjF4eQwFJGid4b+4AcDqCEhMTrJ8wQNcISf651sUHUfGaUWPSymR0kwSagIXG6 Yx4TSEJEYAmTxN5V5xhBEsICDhInHl1iBxnEIqAq0bNHEiTMK2Ap8eBDGyPEUHmJ1RsOgC3g FLCSePNlOQuILSSQKbH+znw2CFtO4vr8L0wTGPkWMDKsYhRJLS3OTc8tNtIrTswtLs1L10vO z93ECAz3bcd+btnB2PUu+BCjAAejEg9vwu8zcUKsiWXFlbmHGCU4mJVEeJ3Ono4T4k1JrKxK LcqPLyrNSS0+xGgKdN9EZinR5HxgLOaVxBuaGppbWBqaG5sbm1koifN2CByMERJITyxJzU5N LUgtgulj4uCUamBUc4j0i05U9tuiafFrpckjEa+almua/x8bHvENkuj9HJoxYdZz36LnM0Ir jpyyVEmZW/npt6XKhf3TLupqnJrxaUaddGPc3eQW/g1MX1JKKla/SnjJ/WKzG+OTaW5Sr4s9 bwUZnKsqeOqV1favtJAl2azwFf+jWRtO6tr4KLZtX/i3rT/yVZsSS3FGoqEWc1FxIgDaXSgC jQIAAA== X-CMS-MailID: 20200526191058eucas1p11a8a5007144ba3b0e66ab1286a85c84b X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200526191058eucas1p11a8a5007144ba3b0e66ab1286a85c84b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200526191058eucas1p11a8a5007144ba3b0e66ab1286a85c84b References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200526191033.16459-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v2 6/7] net/i40e: return unknown speed in status X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: i.dyukov@samsung.com List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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); -- 2.17.1