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 1500FA04B5; Thu, 10 Sep 2020 21:34:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 278481C113; Thu, 10 Sep 2020 21:34:30 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 827021C10F for ; Thu, 10 Sep 2020 21:34:28 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200910193428euoutp014513a1f3951feac11234e75ab8a10fdc~zgyCBqE4C3152731527euoutp01o; Thu, 10 Sep 2020 19:34:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200910193428euoutp014513a1f3951feac11234e75ab8a10fdc~zgyCBqE4C3152731527euoutp01o DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1599766468; bh=zbg2xoSaiDgck4H57R7Z3rwqX+vJJlCAoA2nccHDMek=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=MpVBW6vlCKCaBIS3OpFZA4pbWPHWSR5NmYmxcCu7YbCIUgZHs6hHduFOon7Szyrps uiNyLweIPK0HMn5uUNK/0hzKExRxyGOfRFshcrFYqdJ6bVFkrt0+3H5Iy8grpTWYiG NGo27bPUFLKBgNeQOqBw4IReH/QzBAy6fFX8/cMg= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200910193428eucas1p12b79e8a411f54ac114ddc0a2cd7ffd30~zgyB0IpbF0307203072eucas1p1v; Thu, 10 Sep 2020 19:34:28 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 91.42.06318.3CF7A5F5; Thu, 10 Sep 2020 20:34:27 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200910193426eucas1p2b48cdd5bb0a0956bd88d18991bc0f647~zgyAyWjGW2392123921eucas1p2p; Thu, 10 Sep 2020 19:34:26 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200910193426eusmtrp15f0c128640f742019c48972cdc218682~zgyAxgm1W3165331653eusmtrp1w; Thu, 10 Sep 2020 19:34:26 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-24-5f5a7fc33ff9 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 5A.8A.06017.2CF7A5F5; Thu, 10 Sep 2020 20:34:26 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200910193425eusmtip2235cb6fb445c676776c23c55b11ac4a2~zgx__tMYY1532615326eusmtip2O; Thu, 10 Sep 2020 19:34:24 +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: Thu, 10 Sep 2020 22:33:38 +0300 Message-Id: <20200910193400.15326-6-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200910193400.15326-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0xTdxTHd+69vffSUHKtZp6wxUfRZS9g6rYcDc7Hlnj/wESz6ZYGZd28 wQegacFXTNaAA1Y7htQ4fAAdRGE4xhilBaYG6wZCiwiOABs6qGZMHII8sqGwjXpr9t/3+z2f c84vJz+R1Tv4SHFXappiTjUlG3gt526auh599RNj4mt3M1dTlb8IKHC7lKX+E7d4OjZ6lKGe ijV00XNWQ/m/WRnKzX/IkKfcxtOf/RkcPRjzMNR3ySfQ6c4Mgca8gwJ93n4GaHB6iKVTznGg 9qJaDU1daeBpZLqEo9xHXUBfuK4BNdsfcnSivg4oyybR6NdlApX2LaCx/msc+XprBPpmsoOl Wv8M0PHmKqC2rH81axfLj5znNHLpxXuM7Piqg5Wbek8Ksr2liJGrH9Qx8sjlLl7OdVWA3Bo4 xsoX7v7Nb9IatXE7lORd+xVz7FsfanfmdPwi7LsRcdDd4GSsUBhugzARpdfRPnGHtYFW1Evl gN0/+DWqmQD8tscPqhkHLHbls09bCjOuhFrKAAesthA1CdhWkwlBipdeRF9OERMszJOqefRM d88aUZwrvY3ZM08YTlqK56cqNUGtk1Zi14/1jLphIV74rpEN4mHSKhzo2xaM9dIC7C6eeDIS pZ9FbL8zwQUZlN7B8Z9Cj5uLQ80uQdXPo89h51Q+G/C4u0ZQTR5g5pnhELUGXfevC8FBrPQS VjXEqvE6vHVuUFDnR2DP8JxgzM7KfPeXrBrrMCdLr9IGbGzpDMWIM49D15XxL4+VV69zCbDM 6WfzYOHp/3c5ASpgvpJuSUlSLCtSlQMxFlOKJT01KebjvSnfw+xX9f3TPFkHl6c/8oIkgiFc 17jKmKjXmPZbDqV4AUXWME+3vs23Xa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FGEgkoRGhwavBJkcyVZbNMuKRuvMfL7eH4/b/ifIxgPnzTkUb51x+HjOV4x49a1hwIq I+XMBuuDKd2WzZZNqtoALT2ZNqOsatyvLX+jX0V468aX0SkZi9cX2N/EBH185vBdcqp0tW/U 52+FnXcnzt3NvnXjSvW8qIuBThzhpz7buyOztmeqLZMplrQmHf4T5/hjyntcd5BrHEi11CeQ aPtO58KZMkpI0CgWkQZB8w+OM0SlBgMAAA== X-CMS-MailID: 20200910193426eucas1p2b48cdd5bb0a0956bd88d18991bc0f647 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200910193426eucas1p2b48cdd5bb0a0956bd88d18991bc0f647 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200910193426eucas1p2b48cdd5bb0a0956bd88d18991bc0f647 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200910193400.15326-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v10 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