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 90332A0526; Fri, 10 Jul 2020 09:03:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5DF771DC11; Fri, 10 Jul 2020 09:02:55 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id D66DF1DC11 for ; Fri, 10 Jul 2020 09:02:53 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200710070253euoutp0167d80b133aa2129faa74c1c9886bcf99~gUiHl_9YP1892318923euoutp01k; Fri, 10 Jul 2020 07:02:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200710070253euoutp0167d80b133aa2129faa74c1c9886bcf99~gUiHl_9YP1892318923euoutp01k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594364573; bh=zbg2xoSaiDgck4H57R7Z3rwqX+vJJlCAoA2nccHDMek=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=XO09GYznzkwopdb2zxOXaMqRzxywKIoN/vxkkVuLqgxgoGm/hsUxnInJs3oTViZIn ZrCFqu+OVeF5jt4dwwNmdpnXJsRKHp1rWYUJkS9X0JCIUKqdRn8pzZCS/xe2UGEd19 4i3Hb6QYkTLSmzuHrmGS3kB2fuuidBf6qPzl8f2U= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200710070253eucas1p232cb59feca5410e77fab57bbf7b2b910~gUiHP8pPq1909319093eucas1p2a; Fri, 10 Jul 2020 07:02:53 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 45.31.06318.D92180F5; Fri, 10 Jul 2020 08:02:53 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200710070252eucas1p111c3c4698edfd5a44b376c63e9b62822~gUiGyZjsl0824408244eucas1p1b; Fri, 10 Jul 2020 07:02:52 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200710070252eusmtrp20386bc25eb0d8fb28253b8d30e6ecf3a~gUiGxhOye2959129591eusmtrp26; Fri, 10 Jul 2020 07:02:52 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-8f-5f08129dfd5f Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 0E.74.06314.C92180F5; Fri, 10 Jul 2020 08:02:52 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710070250eusmtip126d76716ff2e644c7091205e365bd942~gUiFCQwNs1602216022eusmtip1H; Fri, 10 Jul 2020 07:02:50 +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: Fri, 10 Jul 2020 10:02:04 +0300 Message-Id: <20200710070226.6045-7-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710070226.6045-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSbUxTZxTHfe69vffSUHK9YjxxRrOqiS7zLZh4Fh1OM5dLfP3iFxOtVW7w BdC1otNlCZLZ1KIoiBuiAlJNgToRWtqKDJHEUmzVQSIviyLDF6bTCmij1qKjvTV++53/Of9z nnPy8LRYzE7mt2fvkQ3Z+kwtq2Zc3ne355wVed38wYdqrA2UERzos9LYX3yfxfyhXynsqVmK Te4zKix6kEthQdEwhe4qC4vP+/MYDI64Kbz3p5/D0s48DkdaBzk8euc0wcHIMxpPVbwieKes QYXvrjey+DJSyWBB+C7BY04fwbYjwwwWX/EQNFkEHKq2cWi9NxVH+n0M+nsdHF4MddDYEBgl WNhWS/CW6aPquy+lcMUFlWRtekpJJ8510JK39zdOOtJeRkl1QQ8lvWy+y0oFzhoi3RzIpyX7 o7fsOvUG9ZJ0OXP7XtkwL3Wzepu5429u919JP7kaK6hccjbRQhJ4EBZClz2fsxA1LwpVBMKe S/HgNYHC8mZKCV4R8NrtYxk+Zgn+sVbRbQROVQ/FHSECnoMuNtqXFWaB31wWcycLdSy4I91U NDFBWA52a1eMGWEmXKvPo6OsERDMgSZaedQ0sF9uiXGC8A0cslRyURaFqdBd/jrWFAQfD55/ HIxi+B7O9d6gFJ4Az9qcnMJT4OOV8rj+M7yp7+YUs5lAX+WheNFScP53O7YbLcyG2sZ5irwM uk42EmXlJOh5MT4q02NY5PqdVmQNmE2iUq2FlvbOuAww+j5+XgkevDkcv08TgVBfL3ucTCv9 PKuCkBoySc4xZmXIxpRsed9coz7LmJOdMXfrrqx6MvZX/R/aQh7SHNnSSgSeaBM1m0dZnajS 7zXuz2olwNPaZM3yW/5NoiZdv/+AbNilM+RkysZW8g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hhRf/65f8v3hsYhMuzLi82GwTDp cIqxb23Eap7R7P15uTLv6Jok1te/UTis39SUVsXyC89+zhGndRHDZ2KFSe7GdZk6ZvMRk2ND njRlv2XXr211RYHlHWVOe0VWwZzCFFtwXcvwesNoxqpP09VxPUXnmqOO7NNHdV9JGykdKM7W UkqMJMwnLYr0B/ZB/mQIAwAA X-CMS-MailID: 20200710070252eucas1p111c3c4698edfd5a44b376c63e9b62822 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200710070252eucas1p111c3c4698edfd5a44b376c63e9b62822 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710070252eucas1p111c3c4698edfd5a44b376c63e9b62822 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200710070226.6045-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v7 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