Skip to contentSkip to conversation

app/testpmd: txonly multiflow port change support

PATCH Superseded Joshua Washington 2 participants 2 messages Apr 11, 2023

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: txonly multiflow port change support

Google cloud routes traffic using IP addesses without the support of MAC addresses, so changing source IP address for txonly-multi-flow can have negative performance implications for net/gve when using testpmd. This change adds a new flag --txonly-alter-port, which allows the alteration of source port instead of source IP address for txonly multiflow mode.

The new flag can be tested with the following command:
dpdk-testpmd -- --forward-mode=txonly --txonly-multi-flow --txonly-alter-port --txip=<SRC>,<DST>

---
 app/test-pmd/parameters.c             |  4 +++
 app/test-pmd/testpmd.c                |  6 ++++
 app/test-pmd/testpmd.h                |  1 +
 app/test-pmd/txonly.c                 | 51 ++++++++++++++++++---------
 doc/guides/testpmd_app_ug/run_app.rst |  6 ++++
 5 files changed, 52 insertions(+), 16 deletions(-)
app/test-pmd/parameters.c +4 -0
index 3b37809baf..a99f04b4f0 100644
@@ -158,6 +158,7 @@ usage(char* progname)
 		" or total packet length.\n");
 	printf("  --multi-rx-mempool: enable multi-rx-mempool support\n");
 	printf("  --txonly-multi-flow: generate multiple flows in txonly mode\n");
+	printf("  --txonly-alter-port: alter source port when generating multiple flows in txonly mode. Source IP address is changed by default\n");
 	printf("  --tx-ip=src,dst: IP addresses in Tx-only mode\n");
 	printf("  --tx-udp=src[,dst]: UDP ports in Tx-only mode\n");
 	printf("  --eth-link-speed: force link speed.\n");
@@ -678,6 +679,7 @@ launch_args_parse(int argc, char** argv)
 		{ "txpkts",			1, 0, 0 },
 		{ "multi-rx-mempool",           0, 0, 0 },
 		{ "txonly-multi-flow",		0, 0, 0 },
+		{ "txonly-alter-port",		0, 0, 0 },
 		{ "rxq-share",			2, 0, 0 },
 		{ "eth-link-speed",		1, 0, 0 },
 		{ "disable-link-check",		0, 0, 0 },
@@ -1307,6 +1309,8 @@ launch_args_parse(int argc, char** argv)
 				multi_rx_mempool = 1;
 			if (!strcmp(lgopts[opt_idx].name, "txonly-multi-flow"))
 				txonly_multi_flow = 1;
+			if (!strcmp(lgopts[opt_idx].name, "txonly-alter-port"))
+				txonly_alter_port = 1;
 			if (!strcmp(lgopts[opt_idx].name, "rxq-share")) {
 				if (optarg == NULL) {
 					rxq_share = UINT32_MAX;
app/test-pmd/testpmd.c +6 -0
index 5cb6f92523..b78bc4c26d 100644
@@ -267,6 +267,12 @@ enum tx_pkt_split tx_pkt_split = TX_PKT_SPLIT_OFF;
 uint8_t txonly_multi_flow;
 /**< Whether multiple flows are generated in TXONLY mode. */
 
+uint8_t txonly_alter_port;
+/*
+ * Whether source port should be altered instead of IP address when generating
+ * multiple flows in TXONLY mode.
+ */
+
 uint32_t tx_pkt_times_inter;
 /**< Timings for send scheduling in TXONLY mode, time between bursts. */
 
app/test-pmd/testpmd.h +1 -0
index bdfbfd36d3..8926b51595 100644
@@ -619,6 +619,7 @@ enum tx_pkt_split {
 extern enum tx_pkt_split tx_pkt_split;
 
 extern uint8_t txonly_multi_flow;
+extern uint8_t txonly_alter_port;
 
 extern uint32_t rxq_share;
 
app/test-pmd/txonly.c +35 -16

77 lines not on this page · raw message

doc/guides/testpmd_app_ug/run_app.rst +6 -0
index 57b23241cf..aa2ef112a7 100644
@@ -373,6 +373,12 @@ The command line options are:
 
     Generate multiple flows in txonly mode.
 
+*   ``--txonly-alter-port``
+
+    Alter source port when generating multiple flows in txonly mode. The default
+    behavior is to alter source IP address. This flag must be used in conjuction
+    with --txonly-multi-flow.
+
 *   ``--rxq-share=[X]``
 
     Create queues in shared Rx queue mode if device supports.
Signature · 1 line
2.40.0.577.gac1e443424-goog
#1 lore raw
Quoted 6 lines · On Tue, 11 Apr 2023 13:11:07 -0700 Joshua Washington <[email protected]>…

Google cloud routes traffic using IP addesses without the support of MAC addresses, so changing source IP address for txonly-multi-flow can have negative performance implications for net/gve when using testpmd. This change adds a new flag --txonly-alter-port, which allows the alteration of source port instead of source IP address for txonly multiflow mode.

Quoted 6 lines

The new flag can be tested with the following command:
dpdk-testpmd -- --forward-mode=txonly --txonly-multi-flow --txonly-alter-port --txip=<SRC>,<DST>

---

Since the purpose of the tuple variation is to get RSS, why not just make the udp port only mode the default.

Testpmd doesn't need more options :-)