From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A416C41CB0; Thu, 16 Feb 2023 11:44:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E91340EE3; Thu, 16 Feb 2023 11:44:09 +0100 (CET) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by mails.dpdk.org (Postfix) with ESMTP id F224A40E0F for ; Thu, 16 Feb 2023 11:44:07 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id ACADC3200986; Thu, 16 Feb 2023 05:44:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 16 Feb 2023 05:44:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t=1676544244; x=1676630644; bh=stGmepxqt1Xp+MBgv31sUZRr8 SZ8HPcbAWUdiUt7eEo=; b=eSG/n7hpoeWXrgVsz6/i/YkP+ZTotH9ylynVms0LE vWWxfLqHC1cvkhio68Cyy79g01NIRNlG3HP9tOQvzTxw2zUIHRBSKkSYahntRyVG XMkyAa6VoakElJL5EW9IvfDMO95CX6WRO8Zeff/LbLgxEEyCVDgN1COWe6ANXxB8 whn8Gd+G8CjqkkywTm3E/nVtL4tlnIk7HTDETZVA/KhVO7mwkL6YCEIwvNnB6pxv 9MipePbUVFqnHs8iP+hiGYRqdqCShC72JLJLOPE4gSXaP1mbuj+mUmzRt0BOPMao As8bm1kfj9dP8vsXTrw5xb4KAnKwIHiKVTmqCn0VyipZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1676544244; x=1676630644; bh=stGmepxqt1Xp+MBgv31sUZRr8SZ8HPcbAWU diUt7eEo=; b=eHPrWBR/avFQ7yrTxZTySLEcFuHGX9kCQN41CUaVUFI44noiULS z/ZRs89YFWjHGHF2cQgIYPV5SEvGZjj+DYKVCSZiJFpaEkmFtvdcULrKkVjNkkRN NKVf9WCQ+PJ4YVl7kjO043xesHY10F3hrDeZgVqGGCrH7FKYR1DZiRePHhETSt5u yiZCOkBidO+pSispvPySCx0gadbbZuXe16QKOIUp14bbaodOMc48ybZy0SmsgCwr RFGNUP8J4zL1dyiUFXDxqRHEa4P8S3h58Jh+1S/GYCWbH8qe+jlNWooxXiLbxpjv OFBCkHfBO0c1K7+ZmtxoiV/YmOQN9N7LvwA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeijedgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpeevveefveeiiefhtedukeegkeelieegffeukeevudetueffieduveet iedukeefleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Feb 2023 05:44:02 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: Bruce Richardson , Jerin Jacob , Ajit Khaparde , Raslan Darawsheh , David Marchand , Aman Singh , Yuying Zhang , Ferruh Yigit , Andrew Rybchenko , Maxime Coquelin , Chenbo Xia Subject: [PATCH] ethdev: add link speed 400G Date: Thu, 16 Feb 2023 11:43:50 +0100 Message-Id: <20230216104350.1639394-1-thomas@monjalon.net> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org There are some devices supporting 400G speed, and it is well standardized in IEEE. Signed-off-by: Thomas Monjalon --- app/test-pmd/cmdline.c | 2 ++ app/test-pmd/config.c | 2 ++ app/test-pmd/parameters.c | 3 +++ app/test/test_ethdev_link.c | 3 ++- drivers/net/virtio/virtio_ethdev.c | 2 ++ lib/ethdev/rte_ethdev.c | 6 ++++++ lib/ethdev/rte_ethdev.h | 2 ++ 7 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index bb7ff2b449..e312aa93d6 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1352,6 +1352,8 @@ parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed) *speed = RTE_ETH_LINK_SPEED_100G; } else if (!strcmp(speedstr, "200000")) { *speed = RTE_ETH_LINK_SPEED_200G; + } else if (!strcmp(speedstr, "400000")) { + *speed = RTE_ETH_LINK_SPEED_400G; } else if (!strcmp(speedstr, "auto")) { *speed = RTE_ETH_LINK_SPEED_AUTONEG; } else { diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 41484c3dde..8f162645ec 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -612,6 +612,8 @@ device_infos_display_speeds(uint32_t speed_capa) printf(" 100 Gbps "); if (speed_capa & RTE_ETH_LINK_SPEED_200G) printf(" 200 Gbps "); + if (speed_capa & RTE_ETH_LINK_SPEED_400G) + printf(" 400 Gbps "); } void diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index e734ad9a02..3b37809baf 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -568,6 +568,9 @@ parse_link_speed(int n) case 200000: speed |= RTE_ETH_LINK_SPEED_200G; break; + case 400000: + speed |= RTE_ETH_LINK_SPEED_400G; + break; case 100: case 10: default: diff --git a/app/test/test_ethdev_link.c b/app/test/test_ethdev_link.c index 6248aea49a..ab52385a12 100644 --- a/app/test/test_ethdev_link.c +++ b/app/test/test_ethdev_link.c @@ -54,7 +54,7 @@ test_link_status_up_default(void) "string with HDX"); /* test max str len */ - link_status.link_speed = RTE_ETH_SPEED_NUM_200G; + link_status.link_speed = RTE_ETH_SPEED_NUM_400G; link_status.link_duplex = RTE_ETH_LINK_HALF_DUPLEX; link_status.link_autoneg = RTE_ETH_LINK_AUTONEG; ret = rte_eth_link_to_str(text, sizeof(text), &link_status); @@ -130,6 +130,7 @@ test_link_speed_all_values(void) { "56 Gbps", RTE_ETH_SPEED_NUM_56G }, { "100 Gbps", RTE_ETH_SPEED_NUM_100G }, { "200 Gbps", RTE_ETH_SPEED_NUM_200G }, + { "400 Gbps", RTE_ETH_SPEED_NUM_400G }, { "Unknown", RTE_ETH_SPEED_NUM_UNKNOWN }, { "Invalid", 50505 } }; diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 0103d95920..dc6856d749 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -2046,6 +2046,8 @@ virtio_dev_speed_capa_get(uint32_t speed) return RTE_ETH_LINK_SPEED_100G; case RTE_ETH_SPEED_NUM_200G: return RTE_ETH_LINK_SPEED_200G; + case RTE_ETH_SPEED_NUM_400G: + return RTE_ETH_LINK_SPEED_400G; default: return 0; } diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 055c46082b..27c0ecbf7d 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -978,6 +978,9 @@ rte_eth_speed_bitflag(uint32_t speed, int duplex) case RTE_ETH_SPEED_NUM_200G: ret = RTE_ETH_LINK_SPEED_200G; break; + case RTE_ETH_SPEED_NUM_400G: + ret = RTE_ETH_LINK_SPEED_400G; + break; default: ret = 0; } @@ -2882,6 +2885,9 @@ rte_eth_link_speed_to_str(uint32_t link_speed) case RTE_ETH_SPEED_NUM_200G: ret = "200 Gbps"; break; + case RTE_ETH_SPEED_NUM_400G: + ret = "400 Gbps"; + break; case RTE_ETH_SPEED_NUM_UNKNOWN: ret = "Unknown"; break; diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index c129ca1eaf..89b25c9a0f 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -304,6 +304,7 @@ struct rte_eth_stats { #define RTE_ETH_LINK_SPEED_56G RTE_BIT32(13) /**< 56 Gbps */ #define RTE_ETH_LINK_SPEED_100G RTE_BIT32(14) /**< 100 Gbps */ #define RTE_ETH_LINK_SPEED_200G RTE_BIT32(15) /**< 200 Gbps */ +#define RTE_ETH_LINK_SPEED_400G RTE_BIT32(16) /**< 400 Gbps */ /**@}*/ /**@{@name Link speed @@ -323,6 +324,7 @@ struct rte_eth_stats { #define RTE_ETH_SPEED_NUM_56G 56000 /**< 56 Gbps */ #define RTE_ETH_SPEED_NUM_100G 100000 /**< 100 Gbps */ #define RTE_ETH_SPEED_NUM_200G 200000 /**< 200 Gbps */ +#define RTE_ETH_SPEED_NUM_400G 400000 /**< 400 Gbps */ #define RTE_ETH_SPEED_NUM_UNKNOWN UINT32_MAX /**< Unknown */ /**@}*/ -- 2.39.1