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 93BD3A0528; Sat, 11 Jul 2020 12:45:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4A5BC1D9C3; Sat, 11 Jul 2020 12:44:43 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id AE1741D9C3 for ; Sat, 11 Jul 2020 12:44:41 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200711104441euoutp026a31ae7e1fd7b29f7122f33cd6fc37a6~grNDgK73d1781817818euoutp02a; Sat, 11 Jul 2020 10:44:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200711104441euoutp026a31ae7e1fd7b29f7122f33cd6fc37a6~grNDgK73d1781817818euoutp02a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594464281; bh=zbg2xoSaiDgck4H57R7Z3rwqX+vJJlCAoA2nccHDMek=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=d7VViYkvOjVk8VMGj21zC3drCF3I7LPncS42/LcMecOHVLll2jZ0GKxxYJ7YS8YFo X1t2KAhhfxJGbSx8unE6wo+y5aKUecn7ZDEk/3c1q2y3rQHcz0olX0Qkrand2hBAbi PIKPyZSxccpgdR+lTkBnqLD7MWyvpmfPTU5Nil8U= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200711104440eucas1p27a5ab9cf38cf226797c5ed8f5cf23dd2~grNDCdINC1984019840eucas1p2x; Sat, 11 Jul 2020 10:44:40 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id FF.77.06318.818990F5; Sat, 11 Jul 2020 11:44:40 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200711104439eucas1p278753181e040c94f95e9b47deccccbbb~grNB3mcsX1983519835eucas1p2t; Sat, 11 Jul 2020 10:44:39 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200711104439eusmtrp27877abd35fb4c5febf61e84053d995be~grNB2hlBX1628816288eusmtrp2P; Sat, 11 Jul 2020 10:44:39 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-45-5f099818667d Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 91.86.06017.718990F5; Sat, 11 Jul 2020 11:44:39 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200711104437eusmtip1eb265644b639efa474eea8bda6dddc32~grNAD_8Nm0882108821eusmtip1k; Sat, 11 Jul 2020 10:44:37 +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, mb@smartsharesystems.com, stephen@networkplumber.org, nicolas.chautru@intel.com, bruce.richardson@intel.com, konstantin.ananyev@intel.com, cristian.dumitrescu@intel.com, radu.nicolau@intel.com, akhil.goyal@nxp.com, declan.doherty@intel.com, skori@marvell.com, pbhagavatula@marvell.com, jerinj@marvell.com, kirankumark@marvell.com, david.hunt@intel.com, anatoly.burakov@intel.com, xiaoyun.li@intel.com, jingjing.wu@intel.com, john.mcnamara@intel.com, jasvinder.singh@intel.com, byron.marohn@intel.com, yipeng1.wang@intel.com Date: Sat, 11 Jul 2020 13:43:52 +0300 Message-Id: <20200711104414.15422-6-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200711104414.15422-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSbUwTaRDH8+xud7cNJWslYQJGQhONLxHP4MucEUHvNJtojDHxi6hQcQPk oJKWl/PuC0ElTcFygqKiYoWgiEZQKi0EOawXKhaFapSXQ64hGgPciaL1jYLSbs19+8385z8z z+ThaU0FG8Vn6nMlg16XpWVVTEvX594VcEaZ8kNZ5RJs7KkmODpSS6P35HMWS94cpXCgIRHb 7ecVWP5PIYWW8rcU2uvNLP7rLWLw9ZSdwuE7bg6rHhdxOOV8xeHx3nMEX/nHaTxrfUewt/q2 Aj/fbWNx0l/DoOXLU4JltvsEXaVvGTzZ6iBYbBbwzdUrHNYOL8Qp730G3YPNHF73eWi83TND 8ISrkeDD4q+KpFjxi7VOIda2j1FixSUPLXYNVnJiaXc1Jd587aDEyY6nrGixNRDxwWgJLV57 8Yndqdqj2nBQysrMlwwrN6aqMkyeIS6nL/zXljYrVUguhJkJz4OwGkauxpiJitcI9QTu2itY OXhPYLq1WSEH7wiMfKzhzEQZdBzprCSycIVA2acyWg58BFy1z4NVrLAE3KZqKiBECDdZsPv7 qYAwX9gMjZYHigAzwiKwe8pJgNXCj/Bk/AUtj4iBa02dQVYK62Fmsi/IGmEh9F98H2wKQg8P JeZTIcPP4BjzMTLPh3GXLbTrAvjaepGS+Xf4eKufk82muQfVHAsVJYJt4hEXOActLIXGtpXy ZTbBdPNyGcNh4L95gWJ6DstbTtNyWg2mYo3cQwud3Y9DaYCZ6TA5LcKzEyWhi94h4PT52T9I TNX/o6yENJBIKc+YnS4Z4/VSQZxRl23M06fHpR3KvkXmvqp71uVzkA7/AScReKINU1t1fIpG ocs3Hs52EuBpbYR680P3fo36oO7wb5LhUIohL0syOkk0z2gj1fE1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kXgloIPVK6rq+/d5kQUehX6f2Y4p+57H ya+SGiYngsLUtv1R90KXntzu6pMZvtZ5fGhsZ0LbpgM7wpftdgZ31XkIN83BuZe2DS258PTr uZwsVXeKCM30+XhXZ0/uqMtV2jvqNSHq6gqjxJDbuSssk/AdOVOqffllue2NsyYto0a9U9Pu J6eESJ1yDWkUdP8AaswoBgkDAAA= X-CMS-MailID: 20200711104439eucas1p278753181e040c94f95e9b47deccccbbb X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200711104439eucas1p278753181e040c94f95e9b47deccccbbb X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200711104439eucas1p278753181e040c94f95e9b47deccccbbb References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200711104414.15422-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v8 05/24] 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 Acked-by: Jeff Guo --- 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 472ce2a9e..f718356b5 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2891,7 +2891,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 eca716a6a..cf931bf9c 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -2163,15 +2163,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