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 C05F8A0522; Thu, 2 Jul 2020 15:23:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B3241DA0F; Thu, 2 Jul 2020 15:22:19 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 2CD2B1DA0C for ; Thu, 2 Jul 2020 15:22:18 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200702132217euoutp02cc78f626328dd2f7b11c17bbc420aef2~d8jGXjmC_1773417734euoutp02O for ; Thu, 2 Jul 2020 13:22:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200702132217euoutp02cc78f626328dd2f7b11c17bbc420aef2~d8jGXjmC_1773417734euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1593696138; bh=RnlYD+Sn70PZMzCtJxYR4w9oEJDvYzwy6GYddb6sZF8=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=Idaxb5KODN2zxQuXWxgj+rmVtRIocC9Al7ZWfA4Ck4lvziWpT2OBMDEAqy65CQr7n I9S6iTctII0jbw2DQJzYtP+n4AngZl4pa82YV/mFIkzwSJK692mejFk9qs4l5zC9cj HfRt28PH68RCEbp9ilrPiZ6eAkzR3wfjStl6ecSs= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200702132217eucas1p1d89a270c98b74ab80b5919b8f20dc4c3~d8jGAcV6E1005510055eucas1p1o; Thu, 2 Jul 2020 13:22:17 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id EB.00.06456.98FDDFE5; Thu, 2 Jul 2020 14:22:17 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200702132217eucas1p1ff03745544095adbdc9f35edb6e9ec6b~d8jFlDb8t2044920449eucas1p1H; Thu, 2 Jul 2020 13:22:17 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200702132217eusmtrp187592bb9617bdf27fdaba6aea52394c2~d8jFjXCTT1219712197eusmtrp1S; Thu, 2 Jul 2020 13:22:17 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-19-5efddf899fee Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 7C.11.06017.88FDDFE5; Thu, 2 Jul 2020 14:22:17 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200702132216eusmtip2ff5f8188bd1e4deb71228ff65f524cb4~d8jEtOyKL0936109361eusmtip22; Thu, 2 Jul 2020 13:22:16 +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 Date: Thu, 2 Jul 2020 16:21:33 +0300 Message-Id: <20200702132139.28078-7-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702132139.28078-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSa0hTYRjHeXe2neNl9joNnywVBkFFaabUSSItAk/2oT4ERuTlqCcveWvz kiUkpqXT1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6Zub2S3W fL3IbLH1zF9GBz6PXwuWsnos3vOSyePYzWnsHj0n5zF5vN93lc2jb8sqRo9Tj7qZPVY/+cEW wBGlZ1OUX1qSqpCRX1xiqxRtaGGkZ2hpoWdkYqlnaGwea2VkqqRvZ5OSmpNZllqkb5egl/Fo sVHBCr6Ku186mRsYf3F3MXJySAiYSNy6PJeli5GLQ0hgKaPEztuP2boYOYASEhKvnzBD1AhL /LnWxQZR85lR4ubkyewgCTYBDYnTHfOYQGwRgXtMEltWqoLYwgIOEhcmX2YEsVkEVCX6u6+A DeIVsJRYcWY6C8RQeYnVGw4wg+ziFLCS2HKCDyQsJJApcfn1FTYIW07i+vwvTBMY+RYwMqxi FEktLc5Nzy020itOzC0uzUvXS87P3cQIjIltx35u2cHY9S74EKMAB6MSD++E43/jhFgTy4or cw8xSnAwK4nwOp09HSfEm5JYWZValB9fVJqTWnyI0RTovonMUqLJ+cB4zSuJNzQ1NLewNDQ3 Njc2s1AS5+0QOBgjJJCeWJKanZpakFoE08fEwSnVwMhT+Fj6dNuVjRfOuLLPXOP/wnGSeFaN hlNg9n/psOwDU19bcD55ESoe/K8lL3b5BqmIln0fooOjl5tVnY6M/XXcd+OHzXFJdSGvZiuf 5ZysYc/Zqnti5Sr/RaF8t8N2n/zZUt79fYZH+4dJixk3Kx1YL3b9gaJgZYP8NcFY15CZc2a0 WBtKWSixFGckGmoxFxUnAgAk4CwqnwIAAA== X-CMS-MailID: 20200702132217eucas1p1ff03745544095adbdc9f35edb6e9ec6b X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200702132217eucas1p1ff03745544095adbdc9f35edb6e9ec6b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200702132217eucas1p1ff03745544095adbdc9f35edb6e9ec6b References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200702132139.28078-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v4 6/7] 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 --- 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 749d85f54..d09b77674 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2889,7 +2889,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 bb5d28a44..1da185485 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -2165,15 +2165,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