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 DBA60A0526; Fri, 10 Jul 2020 09:02:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 635311DB43; Fri, 10 Jul 2020 09:02:41 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id C93551DB40 for ; Fri, 10 Jul 2020 09:02:40 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200710070240euoutp015b750e5dc5f610efad9d09054bb2d0cd~gUh6909CN1892318923euoutp01c; Fri, 10 Jul 2020 07:02:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200710070240euoutp015b750e5dc5f610efad9d09054bb2d0cd~gUh6909CN1892318923euoutp01c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594364560; bh=BG13JEDguLywByJwOXQTWe6Zorck+0Dg5OriYR0Hx5A=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=j3qNYAuaB0Ve9+eEXdw2TsViqLT1dTBy0fzuVltrBPV2BgP9T2Ix8UpWwGm+vw6Vv 5lCKacfhUEYEdrW9/mTli8ycQOAmmp9ii3B0HaqTBjEnHagZ9U5pkXEYxJT/xmYgXT QpDd2HKiBLQPuCkbSLKe3DoPd4j/eI7S+l4CsRQw= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200710070239eucas1p2fb1aebdd20479514cd1d143b133ac65f~gUh6tGuhi1868318683eucas1p2K; Fri, 10 Jul 2020 07:02:39 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id CA.21.06318.F82180F5; Fri, 10 Jul 2020 08:02:39 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200710070239eucas1p1585ae0ea8e64d3f00e58870d9e133fa1~gUh6XGn890906809068eucas1p1y; Fri, 10 Jul 2020 07:02:39 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200710070239eusmtrp185a60019d86e28bb410e21cee714deb2~gUh6V8qpd1113611136eusmtrp1j; Fri, 10 Jul 2020 07:02:39 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-6a-5f08128f856e Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id C3.F3.06017.F82180F5; Fri, 10 Jul 2020 08:02:39 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710070237eusmtip1b943ed57f774aa2fc1e272479b65c068~gUh4mXe3P1592215922eusmtip1H; Fri, 10 Jul 2020 07:02:37 +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: Fri, 10 Jul 2020 10:01:59 +0300 Message-Id: <20200710070226.6045-2-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710070226.6045-1-i.dyukov@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0wUZxT1m5mdGTYuGUcSbrWxsolW2/po8cf1VatpzCTVSDUxYoK4ygS0 gGQHtNI2WR8QstBF11dc7BZZDCtqAQUW0VpdjYgDEkkIEB+7otYKBeQloovWcTD137nnnHvP vV8+nhar2Un8ltR02ZpqSTazRqb6+kjTrHyRj58bCH2BZQ1ugh33PTQGD95jMffZXgrbSpfg Rd8xAzoDNgodzj4KfV47i/8GdzPY0++j8O6fKoeu5t0c9vufcPhrUwHBJ6FOGo8WDhBsclcZ cORKLYu9oSIGHS9bCOZX3iBYl9fH4MHzNQSz7QI+O1nCoefuFOwP3mBQbT/H4emh2zRWNYwS 3F9XRrAx+43hmyjpZeEJg+S5+JSSDhy/TUvX2w9zUl69m5IqemooqfdSCys5KkuJdLMjl5ZO PXrBxhjXGxclyMlbtsvWOV9vNCadCTq5NNdHPwYcjZyNFEfYCc+DMA+Gd023EyMvCl4C3UN+ Ri8GCVytsLF6MUDAt/8CsZOwdx0lD+rHXCUE/rrlNujFEIFcb8s7FyvMADXHTWlChFDBgi/U SmnCRGEBNN/ppbVwRpgG/7inarRJQCivyTHoCZ/AqfLLtIbDhPmQZS/iNCwKU6D190FK90+A +qOPGA3Tb/17qgpoLQuENzwEA69YfdC3UNz+YmzoROisq+R0/DGoB/IYHf8Ew2dbOb05h8D9 oqwx0xKo7LrFaYvSwkwoq52j00vhTL7K6Y8XDm3dE/QdwsFZfYTWaRPkZIu62wyX65vHaIDR V+N1WoLWxpOGfSTK9cExrg+Ocf0fW0joUhIpZygpibISnSrvmK1YUpSM1MTZm7elnCVvf7P6 um6ohlwKbfITgSfm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q5RJsinNJZEZaSCm9Z RIftiFx2THvqNG/QawzJCbxgRUHOX14hfRZF651XmGjUqIJUIaBWhQSGBAaDYoksk22OkrMx WiMfz/NJvOHvHCH18ElFUSb/cP/26oIbM6XN6Zry5/FRVMy+2dCx/WEnM0qCw3f5iWljKZ2j m7dV7a64x+jH52ybIrgzkV7PvnTL63RTKxcN7/KZ3uvreSKJ7u+rcWwPK3ml6e4fWnauqlfP XT4cseTDFiT7JqFao037MiZys7Ya1RXHl85cP2DP2/lqWdQzBSXEalVrSYOg/QN8IOpJTQMA AA== X-CMS-MailID: 20200710070239eucas1p1585ae0ea8e64d3f00e58870d9e133fa1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200710070239eucas1p1585ae0ea8e64d3f00e58870d9e133fa1 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710070239eucas1p1585ae0ea8e64d3f00e58870d9e133fa1 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200710070226.6045-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v7 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