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 1F1E6A00C5; Mon, 6 Jul 2020 22:38:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AE3DE1DD5C; Mon, 6 Jul 2020 22:38:11 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 2E8391DD58 for ; Mon, 6 Jul 2020 22:38:10 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203809euoutp02882c6360ad5a199e37eb276a88e53f1c~fREzZmGZS2313123131euoutp02n; Mon, 6 Jul 2020 20:38:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200706203809euoutp02882c6360ad5a199e37eb276a88e53f1c~fREzZmGZS2313123131euoutp02n DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067890; bh=zbg2xoSaiDgck4H57R7Z3rwqX+vJJlCAoA2nccHDMek=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=as9JyEYZ6wwk5bTXT+9BWYcc90u5m8SjwvUcldbqF30G13uR/t97hnwquBMrnZdGj XnO8kqT1v6zHtk3EoPRfHKKszmPxGU5XgVObHJIis7jc5/QwV4q/c+I5tr1aB1nyAv SfQY3jQmit4gfMEkAcXHLs0aizsQAXZepBxr/Jro= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706203809eucas1p21e0ffc3cf33b6835355e0c383b926cc6~fREylpNeZ2126821268eucas1p23; Mon, 6 Jul 2020 20:38:09 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 62.C6.06318.0BB830F5; Mon, 6 Jul 2020 21:38:09 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706203808eucas1p149298d8c1de1cea35fe9dd22e5a81ea4~fRExp1q6b0771507715eucas1p1l; Mon, 6 Jul 2020 20:38:08 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200706203808eusmtrp1d8614b6a92369aa205ac8661b8b53297~fRExoyO8s2965829658eusmtrp1o; Mon, 6 Jul 2020 20:38:08 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-1b-5f038bb0af59 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id D1.DF.06314.FAB830F5; Mon, 6 Jul 2020 21:38:07 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203806eusmtip19134c09a620660a39f46d64534b7eed6~fREv12HYW1560515605eusmtip1_; Mon, 6 Jul 2020 20:38:06 +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:37:20 +0300 Message-Id: <20200706203743.29416-7-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706203743.29416-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSbUxTdxTGc+69vffSUHapJpygkdhlyVyGbMEPZ8s2nVmym/nFZUtMlih2 8wYNr2mt4vwAcYpNizAK04zxJt1EwYVVSstYJVIHyAoUSEjFIRIlccBErFbR1XWWW7Nvz//3 POclJ3+R1Vfz6eKBwoOKqdCYb+C1nGfgaTDTZWdz3qrLoY7hRqDbM06WZmtv8mRfPs7Q9bat 5PPWa8hxq4yhSscDhrznbTz9PXuMo6Wwl6HpywGB6iaOCRT23xXoVPAHoLvRBZa+b34IFGzs 0tDTvh6e7kdbOKp8NglU5b4GNFjxgKPaX7uBym0SLV9oFcg5vYHCs9c4Ckx1CnQxMs5S1/Bz oOrBDqCR8phm20b5WfNPGtnpm2fkmrPjrDwwdVqQK4YaGdm11M3I93snebnS3QbyH7ftrNw+ t8Lv1H6hfW+fkn/gkGLK+mCvdr91/IZQPJZS4ulpZsqgIdkGSSJKW7BqbJG1gVbUS+cB51sq NOrjEWDDUL0mntJLDwFXTpteVnhc45waagWMnWhPlEcAnef6IJ7ipdcxYG1k4sZaycWjNxpi 4sYaaTu6u3pX23LSa1g9UiXYQBR10ju41FeqTsjA9l+usHGcJL2LDf3p6hIbMNT0aLUlSsMi +u4NCWr+I/RYVxJ6DS4MuhN6PQZqKjhVH8Unl0KCWmwFnGk5kQhtRffi6OoOrLQJO3qyVPwh fvOdg4tjlFLw+r3UOGZfSIfnDKtiHVrL9WragFeGJhIY8fk/iePKGPk5wqvXuQzoOWuDbyGj 7v9ZzQBtkKZYzAW5ijm7UDm82WwsMFsKczd/VVRwCV581MC/g5Fu6I1+6QdJBEOyblZkc/Qa 4yHzkQI/oMga1uq2jwT26HX7jEe+VkxF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gkvWGMTDopgp6v/fEaynfx4qrHpuYRlLUBKVGF158dRQq9PH eOT2It+NiknHqmo1mzBxwRq+9lhgRFlOjTnX4r1ja1Xc+e2e+6drTUfWbHkW7OTOmcdsM/bV rVaHaklVmkfbBnunIb6qLCRxJ/9jcK7Ed0VrmumJFJ/z4PWkNmgZISQYguRlgw77Nk3ungBe SUkpGn4NqZc0/wAQ8yy+BQMAAA== X-CMS-MailID: 20200706203808eucas1p149298d8c1de1cea35fe9dd22e5a81ea4 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203808eucas1p149298d8c1de1cea35fe9dd22e5a81ea4 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203808eucas1p149298d8c1de1cea35fe9dd22e5a81ea4 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 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