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 5D1AEA0528; Sat, 11 Jul 2020 12:44:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B0C321D99B; Sat, 11 Jul 2020 12:44:29 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 0D4B21D988 for ; Sat, 11 Jul 2020 12:44:28 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200711104427euoutp023bdef547a06723245883ec5aa09db6f2~grM2oYSMm1781617816euoutp02X; Sat, 11 Jul 2020 10:44:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200711104427euoutp023bdef547a06723245883ec5aa09db6f2~grM2oYSMm1781617816euoutp02X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594464267; bh=BG13JEDguLywByJwOXQTWe6Zorck+0Dg5OriYR0Hx5A=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=qmW3mdtXLMEGKX5cQXrdFk2A/rOprW64yxJIz79gs1AdBVTlX6gTJh/JVFexxQEhe 9+Q9XbzBRHfauO740ghWryDJaFk+uG10hSP1b/uyuNavG0y12VnlVubBLBX1CWBOlq IYH3AKmDRozdnK3t67Fh6WXIbvqaVcz430B0e9Cg= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200711104426eucas1p22dc79772974f722005779d39edc9ed3f~grM16-IIN2331023310eucas1p2C; Sat, 11 Jul 2020 10:44:26 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 23.1F.05997.A08990F5; Sat, 11 Jul 2020 11:44:26 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200711104426eucas1p2309f60cc71b94d6cae864d5a2a1dabb1~grM1ekQ9b2343723437eucas1p2P; Sat, 11 Jul 2020 10:44:26 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200711104426eusmtrp22af3b51731de05f12701dd91dbe5d602~grM1di_9q1628816288eusmtrp2N; Sat, 11 Jul 2020 10:44:26 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-2d-5f09980a1be4 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 3D.76.06017.A08990F5; Sat, 11 Jul 2020 11:44:26 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200711104424eusmtip1aa622d32d104a03695b946e3d1bb3e54~grMztcUgi1304313043eusmtip1f; Sat, 11 Jul 2020 10:44:24 +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: Sat, 11 Jul 2020 13:43:48 +0300 Message-Id: <20200711104414.15422-2-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200711104414.15422-1-i.dyukov@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA01SbUxTZxjNe+/tvZfOmmsh4RlzLnYu2ZaJA415ZjZ1iz+u//jlEqN2VW/A CJX0il/bD4ITSZGChTgtCuVDUOpCUb4kamqdQlfLlxJEi+2IjsCmCNQMsIAtFzP/nfec8zzn OcnL09pmNoHfZzwomYyGdB2rZprvTXetVp+N0X9dENBh/f0ygkNPq2gMlgyymP/qVwof1W3C Gy3nVWgNZFNosY5T2HLJzOK/wRwGX060UOi/6eXQ1pvD4YR7mMOCrlKCw+FRGs/ZJwl2lTWp cPp2G4tj4UoGLTN9BAsbOwi2nxpnsOR6K8Fcs4CvLtdyWOVfgRPBDga9A9c4vPK6h8am+7ME T7fXE/Tlzqs2rxRn7BdVYtWNEUosruihxXsDZzjxlKeMEhtetlLi2K0+VrQ01hHxz6F8WnQ8 m2JT1NvV3+6V0vcdkkxrNv6kTvs9aOUybR8eCVh8XDapjjOTGB6EdeC/UE2ZiZrXCpcIFLp6 VVFBK4QIhEL7FWGSwFTFC+7dREVRN6sItQSczwOM8nhNYPZhJRN1scLn4M0rW9gbJzSw0BLu p6JCrLABHHfekChmhM/g7mgHHcUa4Rs42x9ilIhPwOF0LfAxEf/sWDet3LQC+stDlOJfBp5z zxb8dMR/vKmUjoaBMM/D/PFxlbJoCzjz7bSCY2G0vXGxw3KYv15OKfhn+O9qP6cM5xF4Wnli 0bQJGv/pjGA+kvAF1LetUejvYXi6YIEGYSk8erFMuWEpWJt/oxVaA3m5WsWtA5end5EGmH2z RIEiXH4eV0RW2t7rYnuvi+3/VDuh60i8lCVnpEpyslE6nCgbMuQsY2ringMZV0nkN3vn2kOt pC28200EnuiWaOwGXq9V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v0NKNNQiwmGl r3x5s2OTQr5Nn5gkmow6U0KsKNWiENeZGdhvwlaj6w3jzDp1iFoDWrUmWBMcCspJ8kP8vUgF H6U3i9tFMV40/fVRnJdfMor80Lgireb26bJd2uw1rzNo1mG1TlGsDv8sC/m1vs05MYK/oyXh /m11w1NvZOz2X9cflp//Ulg5t7OzI6eoIieivaB7iyHg9PT4A1OSBwZu1ZfpwD+mOF3ul168 J1HzdpUQljt30pjQE4G4f2ySUDqvI7EgaWZd1t7eN6Gtsz6+ZpW0FK1XB2KTpP8NIQkKZU4D AAA= X-CMS-MailID: 20200711104426eucas1p2309f60cc71b94d6cae864d5a2a1dabb1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200711104426eucas1p2309f60cc71b94d6cae864d5a2a1dabb1 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200711104426eucas1p2309f60cc71b94d6cae864d5a2a1dabb1 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200711104414.15422-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v8 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