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 A50D9A00C5; Mon, 6 Jul 2020 22:27:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 48EA81DC9A; Mon, 6 Jul 2020 22:26:58 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 1175F1DC93 for ; Mon, 6 Jul 2020 22:26:57 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706202656euoutp01e2058873127fb57414f42dacbfcbe06d~fQ7AeTyB_2799827998euoutp01A; Mon, 6 Jul 2020 20:26:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706202656euoutp01e2058873127fb57414f42dacbfcbe06d~fQ7AeTyB_2799827998euoutp01A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067216; bh=zbg2xoSaiDgck4H57R7Z3rwqX+vJJlCAoA2nccHDMek=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=qn/OBAF9nRQFQanDlNrHaLDpyQwxJySMTtDGeELp9mFNvqQ5/FZZZbBmRiDb7RgTo 5fntfiidAeRYqZ+o14N+nBdz++Wwalg89IZQn9P6cwBlrSrtp6XzxdokRyIAki2y1N 9jpdCKv9p9RzZEOEy+J/f3tD4KgBOdtYDfHrBMDQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706202656eucas1p2cdf64e943a0a1d96b897755e0e29c77a~fQ7ASPvrf3131931319eucas1p21; Mon, 6 Jul 2020 20:26:56 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id E0.99.05997.019830F5; Mon, 6 Jul 2020 21:26:56 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706202656eucas1p1acaa7bcd4a93fadfb28164e348986e7a~fQ6-63pz51287412874eucas1p1n; Mon, 6 Jul 2020 20:26:56 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706202656eusmtrp29d0f31afa8db0d4c8e4d5cd43100094f~fQ6-6Fyhr3205132051eusmtrp2q; Mon, 6 Jul 2020 20:26:56 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-9e-5f038910379b Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 21.4E.06017.019830F5; Mon, 6 Jul 2020 21:26:56 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706202654eusmtip1e40b3bc3c210a35a9e8e29d970575308~fQ6_J7en-1560515605eusmtip1U; Mon, 6 Jul 2020 20:26:54 +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: Mon, 6 Jul 2020 23:25:56 +0300 Message-Id: <20200706202626.28628-7-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706202626.28628-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0hTYRjG+c45O+c4nJxml5cMrUFQUWo3eI3Iii4H+ieK/kgoW3UyyVub 2o3EomTNW1oUdrHpSksLM3WzsUWNSG2mWciy0oYE4rp4W/eVeTpF//2+532e53v5+Hhae5qd zienZUqGNH2KjlUztkffOhYIp+jE2N7umVjXXk6wv89Ko+9sL4v5wycofFETj077JRWWvsml sKh0hEL7dTOL733HGfw4aqfwtcvD4YVnxzkcdQ9wWNh5keBA0E9jmWWMYGd5kwq/PXCwOBSs ZLDoezfB4sZWgi0FIwyevdtMMM8s4PCNag6tryNx1NfKoKengcObn7pobGr/SbCkpY7gk7xx 1cpZ4nfLNZVodQ5S4pmKLlp81HOOEwvayimx/mMzJQ7d62bFosYaIj7uz6fF2rdf2Y3qBPXy 3VJKcrZkiFmxQ73X1PWSy3gadtDmsFC55HKomYTwICwBv+0YJ7NWuE7A1LbWTNQTHCBg73Zx ymGMQMDlZcyE/5Ooc+YoejWBwoEBRjl8IvDePczIVawwBzymckoeTBbqWbAHvZScDhdWQ4GL lz2MMBt6250qmTVCHPgu+RhlpSiovX2fljlEWAYPhxpYZb1I8F4J/OkEoZ2Hpr4rlLLRGvD7 I5RsOPhbGjmFZ8D4Xdki8xH4csfLKVkTgb7Kk39N8dD4roOTe2hhLtQ5YhR5Fby7WqNS6sPg xYdJskxPYKntPK3IGjDlaRW3Du63PfsrA/z8EaqgCBc7JOVxXASe28a40yTqwv+rLITUkGlS ljE1STIuSpMORBv1qcastKToXempd8jEP/X8agk0E0dwp5sIPNGFakwsnahV6bONh1LdBHha N1mz+olnu1azW3/osGRITzRkpUhGN4ngGd00zeLKwW1aIUmfKe2Tp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N9+GprobbD543y183Gu+Yl 9DK6w9M3a7zuN7Zc34LR0D439q8NTczelFa0L2fd/qQGx7KDq6K5EwOoMLL3e88eWHMzPtdh n1Ia6o7i84evJPwqXnem+fwuods3uM/ZEv02RrFBXeq8G5bhrz20MXGuUDRSu/nLa755a/+9 qFgFJaboVfNJQdT/BbVrNGIHAwAA X-CMS-MailID: 20200706202656eucas1p1acaa7bcd4a93fadfb28164e348986e7a X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706202656eucas1p1acaa7bcd4a93fadfb28164e348986e7a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706202656eucas1p1acaa7bcd4a93fadfb28164e348986e7a References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706202626.28628-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v5 06/25] 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