From patchwork Wed May 17 23:16:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Aube X-Patchwork-Id: 126960 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7888642B2F; Thu, 18 May 2023 01:16:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55BC640E25; Thu, 18 May 2023 01:16:18 +0200 (CEST) Received: from obconseil.eu (obconseil.eu [91.224.149.111]) by mails.dpdk.org (Postfix) with ESMTP id 147E940698 for ; Thu, 18 May 2023 01:16:17 +0200 (CEST) Received: by obconseil.eu (OpenSMTPD) with ESMTP id 0f294df7; Thu, 18 May 2023 01:16:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=jaube.fr; h=from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=default; bh=yHxDjUVVa/IHS+PlIMpB1u 7XKL0=; b=nb4d1WitIOtGtuO13tWWoJE5sAwI9p8l0z4EvY8QeF7ntIJxymUnAE RsfO0QCcU503E3Y29vVt6DboMVGQw+jf6b/NgLRXkpoINqllx0zLUdurjrh1Xb+K pVbX8KtALWr4ZSCRrQAkfO5O7onfG1oTvtS/e4d12WjE3/P/DRAgI= Received: from router.ob (i19-lef02-th2-212-194-241-67.ft.lns.abo.bbox.fr [212.194.241.67]) by obconseil.eu (OpenSMTPD) with ESMTPSA id 75ce02c1 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 18 May 2023 01:16:16 +0200 (CEST) From: julien_dpdk@jaube.fr To: dev@dpdk.org Cc: Julien Aube Subject: [PATCH] app/test-pmd : Add 2.5Gbps and 5Gbps support to test-pmd Date: Thu, 18 May 2023 01:16:14 +0200 Message-Id: <20230517231614.69440-1-julien_dpdk@jaube.fr> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 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 From: Julien Aube Signed-off-by: Julien Aube Acked-by: Stephen Hemminger --- app/test-pmd/cmdline.c | 16 ++++++++++------ app/test-pmd/parameters.c | 6 ++++++ doc/guides/testpmd_app_ug/run_app.rst | 2 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 7b20bef4e9..23309ee6e7 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -653,7 +653,7 @@ static void cmd_help_long_parsed(void *parsed_result, " Detach physical or virtual dev by port_id\n\n" "port config (port_id|all)" - " speed (10|100|1000|10000|25000|40000|50000|100000|200000|400000|auto)" + " speed (10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto)" " duplex (half|full|auto)\n" " Set speed and duplex for all ports or port_id\n\n" @@ -1344,7 +1344,11 @@ parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed) } if (!strcmp(speedstr, "1000")) { *speed = RTE_ETH_LINK_SPEED_1G; - } else if (!strcmp(speedstr, "10000")) { + } else if (!strcmp(speedstr, "2500")) { + *speed = RTE_ETH_LINK_SPEED_2_5G; + } else if (!strcmp(speedstr, "5000")) { + *speed = RTE_ETH_LINK_SPEED_5G; + } else if (!strcmp(speedstr, "10000")) { *speed = RTE_ETH_LINK_SPEED_10G; } else if (!strcmp(speedstr, "25000")) { *speed = RTE_ETH_LINK_SPEED_25G; @@ -1408,7 +1412,7 @@ static cmdline_parse_token_string_t cmd_config_speed_all_item1 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item1, "speed"); static cmdline_parse_token_string_t cmd_config_speed_all_value1 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, value1, - "10#100#1000#10000#25000#40000#50000#100000#200000#400000#auto"); + "10#100#1000#2500#5000#10000#25000#40000#50000#100000#200000#400000#auto"); static cmdline_parse_token_string_t cmd_config_speed_all_item2 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item2, "duplex"); static cmdline_parse_token_string_t cmd_config_speed_all_value2 = @@ -1419,7 +1423,7 @@ static cmdline_parse_inst_t cmd_config_speed_all = { .f = cmd_config_speed_all_parsed, .data = NULL, .help_str = "port config all speed " - "10|100|1000|10000|25000|40000|50000|100000|200000|400000|auto duplex " + "10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto duplex " "half|full|auto", .tokens = { (void *)&cmd_config_speed_all_port, @@ -1483,7 +1487,7 @@ static cmdline_parse_token_string_t cmd_config_speed_specific_item1 = "speed"); static cmdline_parse_token_string_t cmd_config_speed_specific_value1 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, value1, - "10#100#1000#10000#25000#40000#50000#100000#200000#400000#auto"); + "10#100#1000#2500#5000#10000#25000#40000#50000#100000#200000#400000#auto"); static cmdline_parse_token_string_t cmd_config_speed_specific_item2 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, item2, "duplex"); @@ -1495,7 +1499,7 @@ static cmdline_parse_inst_t cmd_config_speed_specific = { .f = cmd_config_speed_specific_parsed, .data = NULL, .help_str = "port config speed " - "10|100|1000|10000|25000|40000|50000|100000|200000|400000|auto duplex " + "10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto duplex " "half|full|auto", .tokens = { (void *)&cmd_config_speed_specific_port, diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 3b37809baf..13155b2723 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -550,6 +550,12 @@ parse_link_speed(int n) case 1000: speed |= RTE_ETH_LINK_SPEED_1G; break; + case 2500: + speed |= RTE_ETH_LINK_SPEED_2_5G; + break; + case 5000: + speed |= RTE_ETH_LINK_SPEED_5G; + break; case 10000: speed |= RTE_ETH_LINK_SPEED_10G; break; diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst index 57b23241cf..e60ba4d345 100644 --- a/doc/guides/testpmd_app_ug/run_app.rst +++ b/doc/guides/testpmd_app_ug/run_app.rst @@ -388,6 +388,8 @@ The command line options are: 10 - 10Mbps (not supported) 100 - 100Mbps (not supported) 1000 - 1Gbps + 2500 - 2.5Gbps + 5000 - 5Gbps 10000 - 10Gbps 25000 - 25Gbps 40000 - 40Gbps diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 8f23847859..b727b689c1 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -2048,7 +2048,7 @@ port config - speed Set the speed and duplex mode for all ports or a specific port:: - testpmd> port config (port_id|all) speed (10|100|1000|10000|25000|40000|50000|100000|200000|400000|auto) \ + testpmd> port config (port_id|all) speed (10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto) \ duplex (half|full|auto) port config - queues/descriptors