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 728E9A00C5; Mon, 6 Jul 2020 22:38:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B43E01DD01; Mon, 6 Jul 2020 22:37:59 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 6F3791DCE2 for ; Mon, 6 Jul 2020 22:37:57 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203756euoutp0184c314b6c30ed20aea4014ae3eab52a0~fREnIQ5tC3113131131euoutp01U; Mon, 6 Jul 2020 20:37:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706203756euoutp0184c314b6c30ed20aea4014ae3eab52a0~fREnIQ5tC3113131131euoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067876; bh=BG13JEDguLywByJwOXQTWe6Zorck+0Dg5OriYR0Hx5A=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=omwI+i/B7ZShQSv0JxkxTNO5CPYGsBsqdhhBNtDvngBoA4PSifno2Cs4JiWQMLqWD Gc+uLkqeqb9A+iyWmb1Mxv44+JnT3XT1TIXHikNxEO+AoKhZrviSj5tPpxj/yCdhBT 13ytMQtO6VORLlQAbtgwHWuPWYGPAP487/GI5MQo= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706203755eucas1p2358a7b4cadb3c50611f2e5ddf08ece8d~fREmGpIiM1729817298eucas1p2y; Mon, 6 Jul 2020 20:37:55 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 41.C9.05997.3AB830F5; Mon, 6 Jul 2020 21:37:55 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200706203754eucas1p2d933772e36fe6ae9d4ad29d6d1684294~fRElAk_XG2126321263eucas1p2l; Mon, 6 Jul 2020 20:37:54 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706203754eusmtrp2552b748b2dbe2d9926fe3ae8132c516f~fREk-kKFt0640206402eusmtrp2o; Mon, 6 Jul 2020 20:37:54 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-a0-5f038ba388ea Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 4F.6E.06017.2AB830F5; Mon, 6 Jul 2020 21:37:54 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203752eusmtip106a4a5fc007ea709d82a6809adbeb77e~fREjNFNDI1500415004eusmtip1v; Mon, 6 Jul 2020 20:37:52 +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:15 +0300 Message-Id: <20200706203743.29416-2-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706203743.29416-1-i.dyukov@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA02SbUxTZxTH89zn9t5LZ/FSu3lkYmenE5cMp/PD2VzGfEvusi/7pjFR7PQO zWh1rTAdXwgqq7xU5WULRXmrG1BceLG86wJdFLqCBl0DLg6wMTGKCgKNqGWOu1uj3875/X8n zznJI1B9Cxcv7Lcekm1Wc5qJ07KtV55e/cCdR1M+/HtgFTb0lxMMjbgpjhX/w2He5DEGhz3J eLHtjAYLR7MYdBY+ZrCtNpfDB2PZLD6aamPw1qUAj67r2TxO+e7yWHCtjODdyH2KpZXTBK+V t2jwaU8nhxORahadz4IET3r7CPbmP2axuKOdYE6uiJN1NTy6by3DqbE+FgM3L/B4PjxIsaV/ juDp3gaCAzkvNJ8vl55V/qKR3BfvMVJR1SCVrtz8iZfy/eWM1PSonZEmfg9yktPrIdKfoTwq 1d+Z5b7S7tB+uldO258h29Z8tlu777exQv6ga8nhUecAn0XOGXJJjADieigq+ZHmEq2gF2sJ +IPHWLWZIVBV0hNtpgk0d7XyL0fmAh0aNaghcKb+eHQ+TKC9v4QoFicmQsBRziiBQWzioC0y xCjBIvET8Fzwz0uCwIorwTe5S8E68WMYzA6z6gtGqG/spooSM6+fvRyvYL24DIYqZhhVjwN/ 6Z3/dTqvH20po+rorAB1tyW13gLdfaNErRfB/V5v9ICl8KKjglHrTHjSPMQra4LoIDBSfTwq JYN3/Cqv7EDF1dDQuUbFG2HWUcUqGMRYGH4Yp64QC4WtP1MV68CRo1dtE3T7r0cxwNzzBSqW 4Hb1HDlFlrteu8X12i2uV89WEuohi+V0uyVVtq+zyt8n2c0We7o1NWnPAUszmf/MgX97Z9pJ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h7QTVVkMjlErjCnSTpMLEQ5rNarV LZ5otSrOuDNNtFpirMlJouRCYf4/HsOBU2It/iM022L0YfoIMOgjQiJCwkE7VZXF129W8/FG m7hdFHeI1r97FKcMTEcL7xVlP/AUZ9yfQL3ybtVYc1vc8yNLO69lblbZo+dSZV3vBrnpPWvN X3sX7WdDdluUI2lRPsXQydS08LzKOeccQZX923Te+trqxhPuhKxd698MKQueCbGP2N6B4Q0v SgeoPYdxUWfo7KaXaVFtV7/lrcHhd9va41tHZzzymQ0XvFpaSjDqF2CrZPwNFNTjbUwDAAA= X-CMS-MailID: 20200706203754eucas1p2d933772e36fe6ae9d4ad29d6d1684294 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203754eucas1p2d933772e36fe6ae9d4ad29d6d1684294 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203754eucas1p2d933772e36fe6ae9d4ad29d6d1684294 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 01/25] 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