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 C2138A04C7; Tue, 15 Sep 2020 21:07:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E7411C0D9; Tue, 15 Sep 2020 21:07:45 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 319C11C0CF for ; Tue, 15 Sep 2020 21:07:43 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200915190742euoutp02f38549436b642f3f23224b43089b17ba~1CpGFaLNm1701117011euoutp02O; Tue, 15 Sep 2020 19:07:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200915190742euoutp02f38549436b642f3f23224b43089b17ba~1CpGFaLNm1701117011euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1600196862; bh=BG13JEDguLywByJwOXQTWe6Zorck+0Dg5OriYR0Hx5A=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=HX0lRs8YxNRi7gfkG9gWnF+rtsuAThLHFy2GGCy/3KMulyRwsK4w1f4NTvwCEYO/P B0RYAuCPuHBz/nod+tMcq4RyIknzC3KFPKusjqp01GTJgNNj/xj/vS4P0Mp0Qzbkna YOReiSg7WkjbIMoiBcPeLsj/NLbqXhKZuxR5yeQY= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200915190742eucas1p1b9eb8cbe7533a52d38f9590dc51491a9~1CpF38i9E3106731067eucas1p1M; Tue, 15 Sep 2020 19:07:42 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 1B.CF.05997.EF0116F5; Tue, 15 Sep 2020 20:07:42 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200915190742eucas1p2a19ad1f8ee0a19b400652262fd036e67~1CpFhzPAw2574925749eucas1p2e; Tue, 15 Sep 2020 19:07:42 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200915190742eusmtrp19fb23f967264dfeb76ad13cc3686e0c7~1CpFhC-W12872428724eusmtrp1A; Tue, 15 Sep 2020 19:07:42 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-29-5f6110feeede Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id C5.DB.06314.EF0116F5; Tue, 15 Sep 2020 20:07:42 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200915190740eusmtip22e3a06ec606c533a89f9c13c05b94566~1CpDxn2qW0503405034eusmtip2e; Tue, 15 Sep 2020 19:07:40 +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: Tue, 15 Sep 2020 22:06:56 +0300 Message-Id: <20200915190728.18143-2-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200915190728.18143-1-i.dyukov@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0yTZxjN+91prPksOB6VYWgyb5mXgT8eh9GBZvt+aESzZMuCw6pf0IxW 0w9wLibWS5gpULmpoWhXYQas2xApbcHLtE6xq5VIYEh0UkkTb0MFauIFcJRPo//Oc855znmf 5BVonYebLmw15ctmkyFPz2kYz9WXHfPHREPOIv+Zadh43UGw/24djeGqfzksfrafwluu5XjO e5TFij4LhbaKQQq9DVYO/wvvZfDJkJfCO+eDPNo79/I45L/PY2lHDcH7I49orHYOE+xwtLD4 8lIbh09Hahm0veomeNB9jWB7ySCDVa0+gkVWEZ+drOex7k4yDoWvMRjsbebxt+c3aWy5Pkqw vL2RYKjoDftFivTKeYKV6s49pKTK4zdp6WrvYV4qCTgoqemJj5KeXujmJJvbRaS/+4tp6VTk BZel+U6zdLOct7VQNi9ctkGz5fdwBb/dPu3HPluIt5BfE6wkTgBxMdQPP2CtRCPoxAYCo64T bEzQiVECt3uJKgwTeNFxmX63ceVsF6MK9QR8UTenbjwnEPBmxzAnzoHgAQcVMyWITRx4R3qo mBAvpsM9TyuJYUb8BB5HLBNYKy6BoqYoozbMhFOnL060xYmfQ2drN68WJEPPL1FK9U+BQHVk wk+P+/e11NCxMhDfCLCnJzQeKowPK6HBslvNjIdH7W5exUkQrCxhVP/PBMo9zbw6lBHYVzPw 1rUc3I9v8LEgWpwLjW0LVToDIgOXWTV/MtwamKK+YTJUeI7QKq2FA0U61a2Hi4HOtzTA6OtJ Ki2Bv+EPpoyk2D84xv7BMfb3tU5Cu0iiXKAYc2Ul1STvWKAYjEqBKXfBpm3GM2T8NwfH2qM+ 0jay0U9EgegnaZ23N+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QqkXacKu/VZoNaIaTLO4y1CCtJ rUa1vMmxSa1KEHbsFCWTQUpLEeVaFO4+8zgZOD7e5H7DVLOBC+f0EMHpQ/Wh80E7QXWAfbBR zSYKZnGrKG4Tpb9zhNInMBNNLdbY1068HzNa018jTVraNCN6cPn6GNXRail2XZ/NvqZzjn7F p6zmkelt0b/8YqNWBa2uztC/FVxciXizYXRGdHBMkH5lpM/A1oszXTtfR25Jz/7ulLqYoZrS qCLLqV3LXGcyXI8C4uOqNh20dDw9gZLjyipCtjsN87t3r9qdsCZXS8lJAjeHlGThD1fDtXZO AwAA X-CMS-MailID: 20200915190742eucas1p2a19ad1f8ee0a19b400652262fd036e67 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200915190742eucas1p2a19ad1f8ee0a19b400652262fd036e67 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200915190742eucas1p2a19ad1f8ee0a19b400652262fd036e67 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200915190728.18143-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v11 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