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 E0C17A0520; Thu, 2 Jul 2020 15:22:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8A67E1D9E9; Thu, 2 Jul 2020 15:22:08 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 4F5EE1D9E8 for ; Thu, 2 Jul 2020 15:22:07 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200702132207euoutp02e14997c7bb517b44379a401eb024fbed~d8i8PBypz1678816788euoutp02t for ; Thu, 2 Jul 2020 13:22:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200702132207euoutp02e14997c7bb517b44379a401eb024fbed~d8i8PBypz1678816788euoutp02t DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1593696127; bh=BG13JEDguLywByJwOXQTWe6Zorck+0Dg5OriYR0Hx5A=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=ZtaKnzSE+XelX10UOQjCE5nkKaxFrnnoQs5wBt0eVXXJwYxhAIpg0pnzvq/CNRWs2 1K1mipqP4NvzhAqzJmb/QcKVNfOR5q2Pqr1DG0iOMQrJVx5P3LYOoU06qIvXAzotAX MYgkHw3Jz3zA/i3wbixRY7NykX/dUSWJfM1U9eeU= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200702132206eucas1p1b2406ef1a61a8c0b2ba0e0cc1abac09a~d8i79Nq_d1005510055eucas1p1e; Thu, 2 Jul 2020 13:22:06 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 81.00.06456.E7FDDFE5; Thu, 2 Jul 2020 14:22:06 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200702132206eucas1p1d13fc23fe4d48b18435f79aa94efbc10~d8i7jEJ6m0983109831eucas1p1l; Thu, 2 Jul 2020 13:22:06 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200702132206eusmtrp284a550efad53719d07f18e1d1f099bd3~d8i7iUppx2389023890eusmtrp2g; Thu, 2 Jul 2020 13:22:06 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-f3-5efddf7e4c85 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 7F.D2.06314.E7FDDFE5; Thu, 2 Jul 2020 14:22:06 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200702132205eusmtip2fb2e42bfb1273c18268892b0eb36fda9~d8i6qHapF1152711527eusmtip2Q; Thu, 2 Jul 2020 13:22:05 +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 Date: Thu, 2 Jul 2020 16:21:28 +0300 Message-Id: <20200702132139.28078-2-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702132139.28078-1-i.dyukov@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA01SWUwTURT1zbSdobEw1CpXFAlNU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YMpdNovuDy1M FttXdLFZvPu0ncnizt7T7BazLjWxWzz/84rZou/XVUaLKTt3MFosviNn8enBCRaL0zc3s1us +XqR2WLrmb+MDnwevxYsZfVYvOclk8exm9PYPXpOzmPyeL/vKptH35ZVjB6nHnUze6x+8oMt gCNKz6Yov7QkVSEjv7jEVina0MJIz9DSQs/IxFLP0Ng81srIVEnfziYlNSezLLVI3y5BL2Pt g0nsBbMkK+73nWVvYFwi0sXIwSEhYCKxf1FmFyMXh5DAUkaJC/vuM0PEJSRePwEyOYFMYYk/ 17rYIGo+M0psbHvBBpJgE9CQON0xjwnEFhG4xySxZaUqiC0sYCHR2XcJrJlFQFWi9VofmM0r YClxqHUPK8RQeYnVGw6A7eIUsJLYcoIPJCwkkClx+fUVNghbTuL6/C9MEK2CEidnPmEBKWcW UJdYP08IJMwMNKV562zmCYyCs5BUzUKomoWkagEj8ypGkdTS4tz03GJDveLE3OLSvHS95Pzc TYzA+Nx27OfmHYyXNgYfYhTgYFTi4Z1w/G+cEGtiWXFl7iFGCQ5mJRFep7On44R4UxIrq1KL 8uOLSnNSiw8xmgJ9OZFZSjQ5H5g68kriDU0NzS0sDc2NzY3NLJTEeTsEDsYICaQnlqRmp6YW pBbB9DFxcEo1MCYLOLDkebKtCzs4QVv/T69bzYkgrvJYz4SLf1/dUJ39/OfueZ++y6p3eN83 4r/wY+3hgpdysS260z5n6PKeM7GuFzt+Q8J/0atf+hWOrTY1VdwaKenq7u5Z66oatqY4xglt UY85bvn2S+uWdQ4TzV+8MKxdYx42a43mMY3WKObUVI2NBWtmKrEUZyQaajEXFScCAOZFzEDl AgAA X-CMS-MailID: 20200702132206eucas1p1d13fc23fe4d48b18435f79aa94efbc10 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200702132206eucas1p1d13fc23fe4d48b18435f79aa94efbc10 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200702132206eucas1p1d13fc23fe4d48b18435f79aa94efbc10 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200702132139.28078-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v4 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 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