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 010A1A00C5; Mon, 6 Jul 2020 22:26:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D87F1DB88; Mon, 6 Jul 2020 22:26:46 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 486BB1DB88 for ; Mon, 6 Jul 2020 22:26:45 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200706202644euoutp0277cf9b9de9fec27f4fdb3ebdaaf33b69~fQ61NH7qP1760117601euoutp02y; Mon, 6 Jul 2020 20:26:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200706202644euoutp0277cf9b9de9fec27f4fdb3ebdaaf33b69~fQ61NH7qP1760117601euoutp02y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067204; bh=BG13JEDguLywByJwOXQTWe6Zorck+0Dg5OriYR0Hx5A=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=BYEbtouI22mQ4t4ofjrCeEW2iB90Oyb5/7YllnOqeiLDvaVP9lOY58sbhP+cc8XnS szZqtaYAgCgo4e6XQf/Nw1Tai4sbqvSSAjK+XYb2Ak1A6xtVlXLQ8KFCIwQxCIJy56 9rEVeQVhmOe0UGylXwMYx4qYDkiQP7cmGlFKPrO8= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200706202643eucas1p1da6ede74521ffcc522cef1b84835ec5e~fQ60LJfH40814308143eucas1p1h; Mon, 6 Jul 2020 20:26:43 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 8A.89.05997.309830F5; Mon, 6 Jul 2020 21:26:43 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200706202642eucas1p2929ffa3795a06b1e99d19a6b0e90da76~fQ6y_TrCp3131931319eucas1p2x; Mon, 6 Jul 2020 20:26:42 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706202642eusmtrp24b228b7630808619732568ae52970af5~fQ6y9TmVv3205132051eusmtrp2k; Mon, 6 Jul 2020 20:26:42 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-8e-5f03890372dc Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 5A.3E.06017.209830F5; Mon, 6 Jul 2020 21:26:42 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706202640eusmtip106d5317c52445d6d46e8af9206317659~fQ6xNNmdk1560515605eusmtip1S; Mon, 6 Jul 2020 20:26: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: Mon, 6 Jul 2020 23:25:51 +0300 Message-Id: <20200706202626.28628-2-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706202626.28628-1-i.dyukov@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0xTdxjG8z/n9JxDZ92x4ny9Eposc2aDOfzwbnHTTaNnUxP9sriZgVWP wMbFtIK3LwQVasEqtXGjzIqAA7kqAkWCN2QgVqwlEMoEaQjzgs4CQgQFteXU6Lff/3meN8/7 Jn+eVtewc/nYhF2SLkEbp2GVTE3TuPNz+jAd9UVWZghW3LIR7LuXT6PH0sNixuBBCt3Fy7He /pcCzb0pFJrMQxTai4wsPvGkMvh02E5h9yUHh9a2VA6HGx5weMSZQ/DBxACN2bnPCDpt1Qoc v1bHoncij0HTiw6CR6tuEGzOHGLQcrGWYJpRwMGzhRzmdy/EYc8NBh1dFzgsHXXRWH1rkmBW cwXB1rTXihWh4ovcMwoxv/4RJR4/7aLFpq4TnJjZYqPE809rKdF7uYMVTVXFRLzZl0GLJf1j 7AblL8pl26W42GRJF/7tFmVMmcfM7bTO2dNrauVSSEGwkQTxICyF7PQxxkiUvFooIjBQ9B+R HyMEyrwZAecZgfLGSu7tSHnxn1OsFgoJjNXvkEOjBNIbe6YMVlgEDoON8hvBwnkW7BOdlN+Y KXwNnqGcKWaEj6H78d0pVglfgX3SpZAbQqDk3FXaz0G+fKP3Aiu3LYTOUyOB/Axoye5n/Ez7 8geqc2h5doyH7nJR5lXwxHCEkXkmDDRXBS6YD68vnqJk3g/PKzs5/6IgGAjcyzsUCC2Hqse3 fcz7Cj6FirpwWf4OroweoP0yCNPB/f8MeYXpYK75IyCrwJCmltMauNrSFpABJl9Ok2URjlq8 1DESan3vFut7t1jf1eYSupjMlpL08dGS/ssEaXeYXhuvT0qIDtuWGF9JfL/Z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nF53H3mS86B+rMqOTENbHYgVI/ksSTZNxkpF6lThsM6BsJiUB0jW tzh3SyXx6sNHeIM+1pCSyAsOFOF5M4+UzYnTe3KYZIxVRihVEKlUhanCVoJ8riSbfbZTyiao jfx+nk/mDX/7CLGPLA2V5jBHr2s+muNczleaCeX2kgOfZRus81eFuNzZ90869ms+b86rzOoP GwoxBcVbdnBNqdbC14Exe3sGtS/aG9LG0w8GBsv23e3oupiVoXhcFfPh7KwtxvqouW77xqCy wCOLEhi/qPjGuhWq2i9NpdvKNzltx/q2TGlLEt/4jxY8CpknpwSNWrmUNAjq3/Prpz9PAwAA X-CMS-MailID: 20200706202642eucas1p2929ffa3795a06b1e99d19a6b0e90da76 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706202642eucas1p2929ffa3795a06b1e99d19a6b0e90da76 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706202642eucas1p2929ffa3795a06b1e99d19a6b0e90da76 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706202626.28628-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v5 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