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 262C9A04A4; Tue, 26 May 2020 21:10:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EDD6B1D6E9; Tue, 26 May 2020 21:10:51 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 93C3C1D6E5 for ; Tue, 26 May 2020 21:10:50 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200526191049euoutp02f510e8618b57b18ab28edffb2b6bec9a~Sqb14rzv71970319703euoutp02I for ; Tue, 26 May 2020 19:10:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200526191049euoutp02f510e8618b57b18ab28edffb2b6bec9a~Sqb14rzv71970319703euoutp02I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1590520249; bh=qh9JCtxcjKOea/2bzK40RVNX0VCSjD1DsMJBarBtp44=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=Dl6a519Da1K4WQXDdFKht7aQV0U/ewrG8UGsJbfgGI0HMpZdU0poZbwr9gm+Z43xz y+9Z/oKEIRRPEhiE6Ip3JhAU80vbhP3xMYF5ptZ2bRUyj+6gn+X8jDevelb2k+Gbqo SAQW58aJo1j9+2k7yRNFeUnTCVkH40e6yxh0GKWE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200526191049eucas1p1c6a61c19590c7a9bca668ad734f014d9~Sqb1SI-yh2444924449eucas1p1I; Tue, 26 May 2020 19:10:49 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 0D.A7.60698.8B96DCE5; Tue, 26 May 2020 20:10:48 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200526191048eucas1p2970aa70da22d080be6cc2554d5a7083b~Sqb0zXTVz2632026320eucas1p2e; Tue, 26 May 2020 19:10:48 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200526191048eusmtrp2a30fdbae2d2b5e40bc8def80afa4a578~Sqb0yuh-70921709217eusmtrp21; Tue, 26 May 2020 19:10:48 +0000 (GMT) X-AuditID: cbfec7f5-a0fff7000001ed1a-da-5ecd69b846db Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 20.F4.08375.8B96DCE5; Tue, 26 May 2020 20:10:48 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200526191047eusmtip1dca52d93d7c30d2a544caa37490d77f7~Sqb0BhsKK1925319253eusmtip1s; Tue, 26 May 2020 19:10:47 +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 Date: Tue, 26 May 2020 22:10:04 +0300 Message-Id: <20200526191033.16459-2-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200526191033.16459-1-i.dyukov@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA01SfSyUcRzf73nu7nnYnT2OzRct61atskhqPVojzR+Pzao/9I8teeKJy2t3 Tl20RJlYZjflrUVeRh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bae+cvo wOPxa8FSVo/Fe14yeRy7OY3d4/2+q2wefVtWMXqsfvKDLYAtSs+mKL+0JFUhI7+4xFYp2tDC SM/Q0kLPyMRSz9DYPNbKyFRJ384mJTUnsyy1SN8uQS/j1P0DrAXPJCqeb77L2sD4VbiLkZ1D QsBEYlJiFyMXh5DAUkaJSdfWsHQxcgCFJSReP2HuYuQEMoUl/lzrYoOo+cwosa3lLxNIgk1A Q+J0xzwmkISIwBImib2rzjGCJIQFLCQW/1vKCmKzCKhKfF17B2wor4ClxPdJtRBD5SVWbzgA toBTwErizZflLCC2kECmxPo789kgbDmJ6/O/gO3iFRCUODnzCdgYZgF1ifXzhEDCzEBjmrfO Zp7AKDgLSdUshKpZSKoWMDKvYhRJLS3OTc8tNtQrTswtLs1L10vOz93ECIy8bcd+bt7BeGlj 8CFGAQ5GJR7ehN9n4oRYE8uKK3MPMUpwMCuJ8DqdPR0nxJuSWFmVWpQfX1Sak1p8iNEU6MuJ zFKiyfnApJBXEm9oamhuYWlobmxubGahJM7bIXAwRkggPbEkNTs1tSC1CKaPiYNTqoExhG1t 2AkpseafmoGhtSF/d6n71xQunm0cMOGWju3K3VVzF3NHrJ/bdaQiVlTcMeVDWeQvj84rCfuW ZNQ0VGodcp0w8+6RDY0TXS6wtXqtWn5EySSoSfOwmmR28duG//J9zdVx9Tqvr4Qt1NkpEKQ+ O1gu5+9nB+Gjx45oWkrMfcQury5Xu1qJpTgj0VCLuag4EQDDvjWT0gIAAA== X-CMS-MailID: 20200526191048eucas1p2970aa70da22d080be6cc2554d5a7083b X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200526191048eucas1p2970aa70da22d080be6cc2554d5a7083b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200526191048eucas1p2970aa70da22d080be6cc2554d5a7083b References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200526191033.16459-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v2 1/7] 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 --- 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