DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v2] app/test-pmd : Add 2.5Gbps and 5Gbps support to test-pmd
@ 2023-05-18  0:00 julien_dpdk
  2023-06-01 10:17 ` [PATCH v3] " Julien Aube
  0 siblings, 1 reply; 3+ messages in thread
From: julien_dpdk @ 2023-05-18  0:00 UTC (permalink / raw)
  To: dev; +Cc: Julien Aube

From: Julien Aube <julien_dpdk@jaube.fr>

This extends the support for 2.5iG and 5G NIC commonly found today

Signed-off-by: Julien Aube <julien_dpdk@jaube.fr>
---
 app/test-pmd/cmdline.c                      | 14 +++++++++-----
 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, 18 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 7b20bef4e9..727890ef38 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,6 +1344,10 @@ 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, "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")) {
@@ -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 <port_id> 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..e38f3dfacd 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
-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v3] app/test-pmd : Add 2.5Gbps and 5Gbps support to test-pmd
  2023-05-18  0:00 [PATCH v2] app/test-pmd : Add 2.5Gbps and 5Gbps support to test-pmd julien_dpdk
@ 2023-06-01 10:17 ` Julien Aube
  2023-06-01 22:52   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Aube @ 2023-06-01 10:17 UTC (permalink / raw)
  To: dev; +Cc: Julien Aube

This extends the support for 2.5iG and 5G NIC commonly found today

Signed-off-by: Julien Aube <julien_dpdk@jaube.fr>
---
 app/test-pmd/cmdline.c                      | 14 +++++++++-----
 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, 18 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 7b20bef4e9..727890ef38 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,6 +1344,10 @@ 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, "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")) {
@@ -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 <port_id> 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..e38f3dfacd 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
-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] app/test-pmd : Add 2.5Gbps and 5Gbps support to test-pmd
  2023-06-01 10:17 ` [PATCH v3] " Julien Aube
@ 2023-06-01 22:52   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2023-06-01 22:52 UTC (permalink / raw)
  To: Julien Aube, dev

On 6/1/2023 11:17 AM, Julien Aube wrote:
> This extends the support for 2.5iG and 5G NIC commonly found today
> 
> Signed-off-by: Julien Aube <julien_dpdk@jaube.fr>
>

Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>

Applied to dpdk-next-net/main, thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-01 22:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-18  0:00 [PATCH v2] app/test-pmd : Add 2.5Gbps and 5Gbps support to test-pmd julien_dpdk
2023-06-01 10:17 ` [PATCH v3] " Julien Aube
2023-06-01 22:52   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).