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 5D186A04AF; Tue, 11 Aug 2020 10:54:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B27321C0D1; Tue, 11 Aug 2020 10:53:14 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id EE1301C0C0 for ; Tue, 11 Aug 2020 10:53:11 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085311euoutp01baa57c377e4fc6730dc06e21ce9c63b3~qKrjzubKY0892608926euoutp01J; Tue, 11 Aug 2020 08:53:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200811085311euoutp01baa57c377e4fc6730dc06e21ce9c63b3~qKrjzubKY0892608926euoutp01J DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597135991; bh=zbg2xoSaiDgck4H57R7Z3rwqX+vJJlCAoA2nccHDMek=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=vcIcjklECh6yaypIPksw5jbiaQpRJtlJi/UE1XmnJjDa67rzdvbFeVj/RHZiLXP9m WoDL7PBUe16zgJKXGq8od20eesEiiC7czu5ryZueU0CpWvUa/PUh/JKEQuOA3NmZyD SsF+evBpEoYhWwos9IkSA2DeSBJd6KbSrdgeolYI= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200811085311eucas1p2eb91c7c0040883fc6a0a7f0b8b0b71ff~qKrjbBM0J0327403274eucas1p26; Tue, 11 Aug 2020 08:53:11 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id B4.1C.05997.77C523F5; Tue, 11 Aug 2020 09:53:11 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200811085310eucas1p148e7b8704bc9eff714520b96b24d9df0~qKri0qdTP1584215842eucas1p11; Tue, 11 Aug 2020 08:53:10 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200811085310eusmtrp21912fb25aac700ff1340bd5fd9b3327f~qKriylKJh2198021980eusmtrp2Q; Tue, 11 Aug 2020 08:53:10 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-9a-5f325c77fec7 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 11.0B.06314.67C523F5; Tue, 11 Aug 2020 09:53:10 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085308eusmtip15fac9f39704bad870124f1ee7587b45f~qKrg-qpO01666316663eusmtip1E; Tue, 11 Aug 2020 08:53:08 +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: Tue, 11 Aug 2020 11:52:24 +0300 Message-Id: <20200811085246.28735-6-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200811085246.28735-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSb0xTZxTGc+69vffSUHMtEt84Ilo18U+GwDQ5m0YcIeYmm9FolMToWJ03 gFIgLX/m9mGVEWSFoTCYQRQZzIBUx9QKpUGD/QDSFhkEAhqUgjiUzSIVAroyRntr9u33POc8 7/uek5en1RXsKj41PUvSp2vTNKySae54+/DD3KOxSdG+P1XY5KoGHHtaR6O7/AmLRa/zKRxq jMO2lksKLBsxUlhSNk1hS4OJxb/deQx6vC0UDt91cnixL49Dr32Cwx97qgAnfJM0Vta8Aeyp vqPAt/dtLE75ahkseTcAeM7yALCzeJrB8lYrYIFJwNfX6jmsG16NXvcDBp2PbnN4fbaXxjuu BcDSzibA7oJFxe614ruaqwqxru0lJf70Sy8tdjz6mROLu6op8abHSolT9wZYscTSCKJjrIgW zePz7H7lEeXOE1Jaao6k37rrS2VKYe9jLvOPZV8322ooI1wONUEIT4RtpMz9A2sCJa8WGoB0 /HZZIYsZIEVWDyWLN0C6+02cCfhAxDSRKPv1QPoqz4AsZoF0OeZY/7mssJE4C6sD6RXCTZa0 +AYpfyFMiCe3at2cnxlhAymuMDN+Vgkfk97GNkZ+VCQx/95O+zlE+ISYq0YCrBZWk8ErM4FD ieDiSWmlF+RAAnHcm6dlDiOTnRZO5giy2HolGDgLpLT5NieL80C+r3oV7Iojlr8eBoajhU2k ybZVtj8lPc8dtDzzMjL0arnfppewrPlC0FaRwgK13K0h7V19QZuQhX+C+xWXxnq/xbtAjIvj 9HmIvPj/XTUAjbBSyjbokiVDbLqUG2XQ6gzZ6clRX2XobsHSZ3X+2zljBZvvuB0EHjShqswd MUlqhTbHcFpnB8LTmhWq+G7nF2rVCe3pbyR9RpI+O00y2OEDntGs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FU+JYpJo+d9HMH7BaUiv+3v9V1hNpHagN3CE//Q2 VPLWFIwJ2rD9fQ3eAc634lRLhimx795IvzP7bitmgudDzOTm/pMh/l9s9W2bur0PneURzSUb h7p9qw9AraP4kO5s7b7LhvHvsz2r/rAlE3N7K2ibPXqq2hPwa6p4usDIfTu45/zjfNcTzbnM PE5FSfEGPoy0SIZ/wCFY+ggDAAA= X-CMS-MailID: 20200811085310eucas1p148e7b8704bc9eff714520b96b24d9df0 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085310eucas1p148e7b8704bc9eff714520b96b24d9df0 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085310eucas1p148e7b8704bc9eff714520b96b24d9df0 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 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