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 07231A04B5; Thu, 10 Sep 2020 21:34:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CFF421C0B9; Thu, 10 Sep 2020 21:34:17 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 33FC31BFC3 for ; Thu, 10 Sep 2020 21:34:16 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200910193415euoutp02b02b4863a8fb0cde566f1b530a5f09c9~zgx2Q09xa0500705007euoutp02S; Thu, 10 Sep 2020 19:34:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200910193415euoutp02b02b4863a8fb0cde566f1b530a5f09c9~zgx2Q09xa0500705007euoutp02S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1599766455; bh=BG13JEDguLywByJwOXQTWe6Zorck+0Dg5OriYR0Hx5A=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=Bz/k5gy1I3m6J3Oj//9P2wvVH5pnpuGtmaMo7MlGTKOcdYG9uld0DymOiJaFk+7/p NOK6X8YFPn8MstfxI9x1eHP8vlFnXDtFKzXIX3dDs5SjqQbSJJOQF0DwEv8Hmk9Qbr udTeIVOO1JyHYf5CzpOecRuPsROTT3ol8Fk2cbLY= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200910193414eucas1p10358368e5370bf22ea15df579c52ad1d~zgx1mwy872936129361eucas1p1Q; Thu, 10 Sep 2020 19:34:14 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id CE.32.06318.6BF7A5F5; Thu, 10 Sep 2020 20:34:14 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200910193414eucas1p1e8a7fcd9e119b1d68f1dec32338f4f12~zgx09Bj_q2935729357eucas1p1w; Thu, 10 Sep 2020 19:34:14 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200910193414eusmtrp1588eabde5f55183e81393d11ca3965dd~zgx08J-5H3165331653eusmtrp1s; Thu, 10 Sep 2020 19:34:14 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-16-5f5a7fb64074 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D1.8A.06017.6BF7A5F5; Thu, 10 Sep 2020 20:34:14 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200910193412eusmtip25df87e32c16a103c97b3767aa4630f23~zgxzOuwJ71532615326eusmtip2L; Thu, 10 Sep 2020 19:34:12 +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:34 +0300 Message-Id: <20200910193400.15326-2-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200910193400.15326-1-i.dyukov@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0wUZxTtNzM7M2xcHVeMF0okbmKsNaLGR29pU60hZn7YRP1hCCmlo45g hQV3QYpJU2CbrS4PEcTHoriyNcpDEWEXfBFE64LrSsCgGLGsFoPQqoDQIA+pw9DUf/eec+49 5375eFrvYoP5XcZk2WSU4g2slnHfftuy1P1zVMzy649XYOXdYoLP/nDS6D/8hMWs/l8o7Chb i9dqT2gwvyudwtz8AQprz9lY/NufyeCrwVoKO697ObS3ZXI42NjDYU5LEcGe8T4ajzveEGwp dmnw7Y0rLL4eL2Ewd7Sd4MGaJoKe7AEGD1+uI2i1CdhfepZDZ+d8HPQ3Meh9VM1hxXArja67 EwQPeSoJ+qyTmnULxFHHGY3ovNZLiQWnW2nx9qMjnJjdXEyJVa/qKPF1fTsr5taUEfHOsyxa LO8eYTdpo7Rf7pDjd+2VTcu++l4bd96fzyXZg37syvVx6eS3QBsJ4EFYBU33M4iNaHm9cI5A 4Xk/pzZDBLyZhYzavCHgLH2hsRF+amTCE6lM64WzBDy+JFUzTODU2ElKIVjhE/DuL6YUIlCo YqF2/OEUMUf4AjwDGRqlZoSFcGCkgFWW6oTP4UL7XDVSKJRfbKAVOEAIh6ed0arXfHh4amhq i06YDc3Huxmlpt/LLa4iWrECYZKHE1X9nLonAhwlv7NqPQf6PDXTeAh4C7IZdeBXAofc1Zza 5BGwFL2cVq2Fmr/ucUoKWlgMlVeWqfDXcDGncPohZkLHy9lqiJmQ7z5Kq7AO9lv1qtoADc1t 0zDAxNgMFRbhzmgWl0cW2D+4xv7BNfb/bR2ELiPz5BRzQqxsXmmUU8P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KMaUZJp5EEo5RlStNsNhtvIP9sbj34VteIbAOJLsQqERekuheflKpWCDukbKMLYSXJ haqWtXk3qlVbhOxdosWcasnKFCUXivM/eYIMm7TZ7B+hyZqqjdPqwaDVx+hj5gM3RXWIvZ+i ZtMEq7hNFLeLlr93hDIgLAd5wum1g6sb1688HPKxVwgKCOyiij7U9PU3o/CJgjC6Z3fkMdKT nZ9erxlYt3wCW1Nqm5Pb3jl5TelBkws3c9UzIvK2pUU8WrvJ7ct/kljefrOipqnl4jx1xtnO rYbi/pUnFw2djvq58+S5nlmS7uXI0ei4lNq7l2O5Sn3CCv3S5IkcJaUL2ijSIgm/AWeF0YdM AwAA X-CMS-MailID: 20200910193414eucas1p1e8a7fcd9e119b1d68f1dec32338f4f12 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200910193414eucas1p1e8a7fcd9e119b1d68f1dec32338f4f12 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200910193414eucas1p1e8a7fcd9e119b1d68f1dec32338f4f12 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200910193400.15326-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v10 01/24] ethdev: allow unknown link speed 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" From: Thomas Monjalon When querying the link information, the link status is a mandatory major information. Other boolean values are supposed to be accurate: - duplex mode (half/full) - negotiation (auto/fixed) This API update is making explicit that the link speed information is optional. The value ETH_SPEED_NUM_NONE (0) was already part of the API. The value ETH_SPEED_NUM_UNKNOWN (infinite) is added to cover two different cases: - speed is not known by the driver - device is virtual Suggested-by: Morten Brørup Suggested-by: Benoit Ganne Signed-off-by: Thomas Monjalon Reviewed-by: Ferruh Yigit --- lib/librte_ethdev/rte_ethdev.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index a49242bcd..2090af501 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -303,6 +303,7 @@ struct rte_eth_stats { #define ETH_SPEED_NUM_56G 56000 /**< 56 Gbps */ #define ETH_SPEED_NUM_100G 100000 /**< 100 Gbps */ #define ETH_SPEED_NUM_200G 200000 /**< 200 Gbps */ +#define ETH_SPEED_NUM_UNKNOWN UINT32_MAX /**< Unknown */ /** * A structure used to retrieve link-level information of an Ethernet port. @@ -2262,15 +2263,16 @@ int rte_eth_allmulticast_disable(uint16_t port_id); int rte_eth_allmulticast_get(uint16_t port_id); /** - * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX - * or FULL-DUPLEX) of the physical link of an Ethernet device. It might need - * to wait up to 9 seconds in it. + * Retrieve the link status (up/down), the duplex mode (half/full), + * the negotiation (auto/fixed), and if available, the speed (Mbps). + * + * It might need to wait up to 9 seconds. + * @see rte_eth_link_get_nowait. * * @param port_id * The port identifier of the Ethernet device. * @param link - * A pointer to an *rte_eth_link* structure to be filled with - * the status, the speed and the mode of the Ethernet device link. + * Link information written back. * @return * - (0) if successful. * - (-ENOTSUP) if the function is not supported in PMD driver. @@ -2279,15 +2281,13 @@ int rte_eth_allmulticast_get(uint16_t port_id); int rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link); /** - * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX - * or FULL-DUPLEX) of the physical link of an Ethernet device. It is a no-wait - * version of rte_eth_link_get(). + * Retrieve the link status (up/down), the duplex mode (half/full), + * the negotiation (auto/fixed), and if available, the speed (Mbps). * * @param port_id * The port identifier of the Ethernet device. * @param link - * A pointer to an *rte_eth_link* structure to be filled with - * the status, the speed and the mode of the Ethernet device link. + * Link information written back. * @return * - (0) if successful. * - (-ENOTSUP) if the function is not supported in PMD driver. -- 2.17.1