Skip to contentSkip to conversation

testpmd: allow configure of Tx IP parameters

PATCH In review Stephen Hemminger 2 participants 8 messages Jun 11, 2018 – Jun 18, 2018

lore
Share & tools
lore
#0 lore raw

v2 cover testpmd: allow configure of Tx IP parameters

The testpmd application had hardcoded 192.168.0.1 port 1024 which is a problem when used in environments where IP address of network is different. For example, running testpmd on Azure where virtual networks are assigned by host infrastructure.

Stephen Hemminger (2):
testpmd: use RFC values for Tx address and port
testpmd: add ability to set tx IP and UDP parameters

 app/test-pmd/parameters.c             | 49 +++++++++++++++++++++++++++
 app/test-pmd/testpmd.h                |  6 ++++
 app/test-pmd/txonly.c                 | 18 +++++-----
 doc/guides/testpmd_app_ug/run_app.rst |  9 +++++
 4 files changed, 74 insertions(+), 8 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/2 testpmd: use RFC values for Tx address and port

Change the IP address and UDP port used for testpmd Tx only test. The old values overlap common NAT local networks; instead use reserved addresses in IETF RFC 2544.

---
 app/test-pmd/txonly.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
app/test-pmd/txonly.c +6 -4
index 1f08b6ed37a2..a24000e3af44 100644
@@ -40,11 +40,13 @@
 
 #include "testpmd.h"
 
-#define UDP_SRC_PORT 1024
-#define UDP_DST_PORT 1024
+/* RFC863 discard port */
+#define UDP_SRC_PORT 9
+#define UDP_DST_PORT 9
 
-#define IP_SRC_ADDR ((192U << 24) | (168 << 16) | (0 << 8) | 1)
-#define IP_DST_ADDR ((192U << 24) | (168 << 16) | (0 << 8) | 2)
+/* RFC2544 reserved test subnet 192.18.0.0 */
+#define IP_SRC_ADDR ((192U << 24) | (18 << 16) | (0 << 8) | 1)
+#define IP_DST_ADDR ((192U << 24) | (18 << 16) | (0 << 8) | 2)
 
 #define IP_DEFTTL  64   /* from RFC 1340. */
 #define IP_VERSION 0x40
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH v2 1/2] testpmd: use RFC values for Tx address and port

Hi Stephen,

Quoted 10 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Stephen Hemminger
Sent: Monday, June 11, 2018 7:25 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH v2 1/2] testpmd: use RFC values for Tx address and port

Quoted 3 lines

Change the IP address and UDP port used for testpmd Tx only test. The old values overlap common NAT local networks; instead use reserved addresses in IETF RFC 2544.

The commit message should probably refer to RFC 863 too.

Quoted 29 lines
---
 app/test-pmd/txonly.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
app/test-pmd/txonly.c index renamed from app/test-pmd/txonly.c +0 -0

1f08b6ed37a2..a24000e3af44 100644

app/test-pmd/txonly.c +6 -4
@@ -40,11 +40,13 @@
 
 #include "testpmd.h"
 
-#define UDP_SRC_PORT 1024
-#define UDP_DST_PORT 1024
+/* RFC863 discard port */
+#define UDP_SRC_PORT 9
+#define UDP_DST_PORT 9
 
-#define IP_SRC_ADDR ((192U << 24) | (168 << 16) | (0 << 8) | 1) -#define
 IP_DST_ADDR ((192U << 24) | (168 << 16) | (0 << 8) | 2)
+/* RFC2544 reserved test subnet 192.18.0.0 */ #define IP_SRC_ADDR
+((192U << 24) | (18 << 16) | (0 << 8) | 1) #define IP_DST_ADDR ((192U
+<< 24) | (18 << 16) | (0 << 8) | 2)
 
 #define IP_DEFTTL  64   /* from RFC 1340. */
 #define IP_VERSION 0x40
--
Quoted 1 line

2.17.1

dpdk/devtools/check-git-log.sh is showing the following error Wrong headline label:
testpmd: use RFC values for Tx address and port

It should be app/testpmd

Regards,

Bernard.

#3 lore raw

Re: [PATCH v2 1/2] testpmd: use RFC values for Tx address and port

Quoted 12 lines · Bernard

Hi Stephen,

Quoted 10 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Stephen Hemminger
Sent: Monday, June 11, 2018 7:25 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH v2 1/2] testpmd: use RFC values for Tx address and port

Quoted 6 lines
Quoted 3 lines

Change the IP address and UDP port used for testpmd Tx only test. The old values overlap common NAT local networks; instead use reserved addresses in IETF RFC 2544.

The commit message should probably refer to RFC 863 too.

Ok. I forgot about RFC863. It is 1 page!

#4 lore raw

PATCH v2 2/2 testpmd: add ability to set tx IP and UDP parameters

In reply to Stephen Hemminger

Allow user to override the hard coded IP address and UDP port values in Tx only test.

---
 app/test-pmd/parameters.c             | 49 +++++++++++++++++++++++++++
 app/test-pmd/testpmd.h                |  6 ++++
 app/test-pmd/txonly.c                 | 16 ++++-----
 doc/guides/testpmd_app_ug/run_app.rst |  9 +++++
 4 files changed, 72 insertions(+), 8 deletions(-)
app/test-pmd/parameters.c +49 -0
index 75807623c719..6d666e088fd9 100644
@@ -19,6 +19,7 @@
 #include <stdint.h>
 #include <unistd.h>
 #include <inttypes.h>
+#include <arpa/inet.h>
 
 #include <rte_common.h>
 #include <rte_byteorder.h>
@@ -65,6 +66,7 @@ usage(char* progname)
 #ifdef RTE_LIBRTE_CMDLINE
 	       "--eth-peers-configfile= | "
 	       "--eth-peer=X,M:M:M:M:M:M | "
+	       "--tx-ip=SRC,DST | --tx-udp=PORT | "
 #endif
 	       "--pkt-filter-mode= |"
 	       "--rss-ip | --rss-udp | "
@@ -625,6 +627,8 @@ launch_args_parse(int argc, char** argv)
 		{ "vxlan-gpe-port",		1, 0, 0 },
 		{ "mlockall",			0, 0, 0 },
 		{ "no-mlockall",		0, 0, 0 },
+		{ "tx-ip",			1, 0, 0 },
+		{ "tx-udp",			1, 0, 0 },
 		{ 0, 0, 0, 0 },
 	};
 
@@ -717,6 +721,51 @@ launch_args_parse(int argc, char** argv)
 				nb_peer_eth_addrs++;
 			}
 #endif
+			if (!strcmp(lgopts[opt_idx].name, "tx-ip")) {
+				struct in_addr in;
+				char *end;
+
+				end = strchr(optarg, ',');
+				if (end == optarg || !end)
+					rte_exit(EXIT_FAILURE,
+						 "Invalid tx-ip: %s", optarg);
+
+				*end++ = 0;
+				if (inet_aton(optarg, &in) == 0)
+					rte_exit(EXIT_FAILURE,
+						 "Invalid source IP address: %s\n", optarg);
+				tx_ip_src_addr = rte_be_to_cpu_32(in.s_addr);
+
+				if (inet_aton(end, &in) == 0)
+					rte_exit(EXIT_FAILURE,
+						 "Invalid destination IP address: %s\n", optarg);
+				tx_ip_dst_addr = rte_be_to_cpu_32(in.s_addr);
+			}
+			if (!strcmp(lgopts[opt_idx].name, "tx-udp")) {
+				char *end = NULL;
+
+				errno = 0;
+				n = strtoul(optarg, &end, 10);
+				if (errno != 0 || end == optarg || n > UINT16_MAX ||
+				    !(*end == '\0' || *end == ','))
+					rte_exit(EXIT_FAILURE,
+						 "Invalid UDP port: %s\n", optarg);
+				tx_udp_src_port = n;
+				if (*end == ',') {
+					char *dst = end + 1;
+
+					n = strtoul(dst, &end, 10);
+					if (errno != 0 || end == dst ||
+					    n > UINT16_MAX || *end)
+						rte_exit(EXIT_FAILURE,
+							 "Invalid destination UDP port: %s\n",
+							 dst);
+					tx_udp_dst_port = n;
+				} else {
+					tx_udp_dst_port = n;
+				}
+
+			}
 			if (!strcmp(lgopts[opt_idx].name, "nb-ports")) {
 				n = atoi(optarg);
 				if (n > 0 && n <= nb_ports)
app/test-pmd/testpmd.h +6 -0
index f51cd9dd9bbd..48f7b364e9b3 100644
@@ -444,6 +444,12 @@ extern int8_t tx_pthresh;
 extern int8_t tx_hthresh;
 extern int8_t tx_wthresh;
 
+extern uint16_t tx_udp_src_port;
+extern uint16_t tx_udp_dst_port;
+
+extern uint32_t tx_ip_src_addr;
+extern uint32_t tx_ip_dst_addr;
+
 extern struct fwd_config cur_fwd_config;
 extern struct fwd_engine *cur_fwd_eng;
 extern uint32_t retry_enabled;
app/test-pmd/txonly.c +8 -8
index a24000e3af44..6d7ddf99d639 100644
@@ -41,12 +41,12 @@
 #include "testpmd.h"
 
 /* RFC863 discard port */
-#define UDP_SRC_PORT 9
-#define UDP_DST_PORT 9
+uint16_t tx_udp_src_port = 9;
+uint16_t tx_udp_dst_port = 9;
 
 /* RFC2544 reserved test subnet 192.18.0.0 */
-#define IP_SRC_ADDR ((192U << 24) | (18 << 16) | (0 << 8) | 1)
-#define IP_DST_ADDR ((192U << 24) | (18 << 16) | (0 << 8) | 2)
+uint32_t tx_ip_src_addr = (192U << 24) | (18 << 16) | (0 << 8) | 1;
+uint32_t tx_ip_dst_addr = (192U << 24) | (18 << 16) | (0 << 8) | 2;
 
 #define IP_DEFTTL  64   /* from RFC 1340. */
 #define IP_VERSION 0x40
@@ -106,8 +106,8 @@ setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr,
 	 * Initialize UDP header.
 	 */
 	pkt_len = (uint16_t) (pkt_data_len + sizeof(struct udp_hdr));
-	udp_hdr->src_port = rte_cpu_to_be_16(UDP_SRC_PORT);
-	udp_hdr->dst_port = rte_cpu_to_be_16(UDP_DST_PORT);
+	udp_hdr->src_port = rte_cpu_to_be_16(tx_udp_src_port);
+	udp_hdr->dst_port = rte_cpu_to_be_16(tx_udp_dst_port);
 	udp_hdr->dgram_len      = RTE_CPU_TO_BE_16(pkt_len);
 	udp_hdr->dgram_cksum    = 0; /* No UDP checksum. */
 
@@ -122,8 +122,8 @@ setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr,
 	ip_hdr->next_proto_id = IPPROTO_UDP;
 	ip_hdr->packet_id = 0;
 	ip_hdr->total_length   = RTE_CPU_TO_BE_16(pkt_len);
-	ip_hdr->src_addr = rte_cpu_to_be_32(IP_SRC_ADDR);
-	ip_hdr->dst_addr = rte_cpu_to_be_32(IP_DST_ADDR);
+	ip_hdr->src_addr = rte_cpu_to_be_32(tx_ip_src_addr);
+	ip_hdr->dst_addr = rte_cpu_to_be_32(tx_ip_dst_addr);
 
 	/*
 	 * Compute IP header checksum.
doc/guides/testpmd_app_ug/run_app.rst +9 -0
index f301c2b6f709..ae9eb712e209 100644
@@ -249,6 +249,15 @@ The commandline options are:
     Set the MAC address ``XX:XX:XX:XX:XX:XX`` of the peer port N,
     where 0 <= N < ``CONFIG_RTE_MAX_ETHPORTS`` from the configuration file.
 
+
+*   ``--tx-ip=SRC,DST``
+    Set the source and destination IP address used when doing transmit only test.
+    The defaults are source 192.18.0.1 and destination 192.18.0.2.
+
+*   ``--tx-udp=SRC[,DST]``
+    Set the source and destination UDP port number for transmit test only test.
+    The default port is the 9 (discard).
+
 *   ``--pkt-filter-mode=mode``
 
     Set Flow Director mode where mode is either ``none`` (the default), ``signature`` or ``perfect``.
Signature · 1 line
2.17.1
#5 lore raw

Re: [PATCH v2 2/2] testpmd: add ability to set tx IP and UDP parameters

Hi Stephen,

Quoted 57 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Stephen Hemminger
Sent: Monday, June 11, 2018 7:25 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH v2 2/2] testpmd: add ability to set tx IP and UDP parameters

Allow user to override the hard coded IP address and UDP port values in Tx only test.

---
 app/test-pmd/parameters.c             | 49 +++++++++++++++++++++++++++
 app/test-pmd/testpmd.h                |  6 ++++
 app/test-pmd/txonly.c                 | 16 ++++-----
 doc/guides/testpmd_app_ug/run_app.rst |  9 +++++
 4 files changed, 72 insertions(+), 8 deletions(-)
app/test-pmd/parameters.c index renamed from app/test-pmd/parameters.c +0 -0

75807623c719..6d666e088fd9 100644

app/test-pmd/parameters.c +8 -0
@@ -19,6 +19,7 @@
 #include <stdint.h>
 #include <unistd.h>
 #include <inttypes.h>
+#include <arpa/inet.h>
 
 #include <rte_common.h>
 #include <rte_byteorder.h>
@@ -65,6 +66,7 @@ usage(char* progname)
 #ifdef RTE_LIBRTE_CMDLINE
 	       "--eth-peers-configfile= | "
 	       "--eth-peer=X,M:M:M:M:M:M | "
+	       "--tx-ip=SRC,DST | --tx-udp=PORT | "
 #endif
 	       "--pkt-filter-mode= |"
 	       "--rss-ip | --rss-udp | "
@@ -625,6 +627,8 @@ launch_args_parse(int argc, char** argv)
 		{ "vxlan-gpe-port",		1, 0, 0 },
 		{ "mlockall",			0, 0, 0 },
 		{ "no-mlockall",		0, 0, 0 },
+		{ "tx-ip",			1, 0, 0 },
+		{ "tx-udp",			1, 0, 0 },
 		{ 0, 0, 0, 0 },
 	};
 
@@ -717,6 +721,51 @@ launch_args_parse(int argc, char** argv)
 				nb_peer_eth_addrs++;
 			}
 #endif
+			if (!strcmp(lgopts[opt_idx].name, "tx-ip")) {
+				struct in_addr in;
+				char *end;
+

app/test-pmd/parameters.c launch_args_parse(int argc, char** argv) · line 737

Quoted 10 lines
app/test-pmd/parameters.c +9 -0
+				end = strchr(optarg, ',');
+				if (end == optarg || !end)
+					rte_exit(EXIT_FAILURE,
+						 "Invalid tx-ip: %s", optarg);
+
+				*end++ = 0;
+				if (inet_aton(optarg, &in) == 0)
+					rte_exit(EXIT_FAILURE,
+						 "Invalid source IP address:
 %s\n", optarg);

Line over 80 characters should be fixed.

app/test-pmd/parameters.c launch_args_parse(int argc, char** argv) · line 744

Quoted 7 lines
app/test-pmd/parameters.c +5 -0
+				tx_ip_src_addr =
 rte_be_to_cpu_32(in.s_addr);
+
+				if (inet_aton(end, &in) == 0)
+					rte_exit(EXIT_FAILURE,
+						 "Invalid destination IP
 address: %s\n", optarg);

Line over 80 characters should be fixed.

Quoted 10 lines
app/test-pmd/parameters.c +1 -0
+				tx_ip_dst_addr =

rte_be_to_cpu_32(in.s_addr);

app/test-pmd/parameters.c +7 -0
+			}
+			if (!strcmp(lgopts[opt_idx].name, "tx-udp")) {
+				char *end = NULL;
+
+				errno = 0;
+				n = strtoul(optarg, &end, 10);
+				if (errno != 0 || end == optarg || n >

UINT16_MAX ||

Line over 80 characters should be fixed.

Quoted 4 lines
app/test-pmd/parameters.c +3 -0
+				    !(*end == '\0' || *end == ','))
+					rte_exit(EXIT_FAILURE,
+						 "Invalid UDP port: %s\n",

optarg);

Line over 80 characters should be fixed.

Quoted 88 lines
app/test-pmd/parameters.c +9 -0
+				tx_udp_src_port = n;
+				if (*end == ',') {
+					char *dst = end + 1;
+
+					n = strtoul(dst, &end, 10);
+					if (errno != 0 || end == dst ||
+					    n > UINT16_MAX || *end)
+						rte_exit(EXIT_FAILURE,
+							 "Invalid destination

UDP port: %s\n",

app/test-pmd/parameters.c +7 -0
+							 dst);
+					tx_udp_dst_port = n;
+				} else {
+					tx_udp_dst_port = n;
+				}
+
+			}
 			if (!strcmp(lgopts[opt_idx].name, "nb-ports")) {
 				n = atoi(optarg);
 				if (n > 0 && n <= nb_ports)
app/test-pmd/testpmd.h index renamed from app/test-pmd/testpmd.h +0 -0

f51cd9dd9bbd..48f7b364e9b3 100644

app/test-pmd/testpmd.h +6 -0
@@ -444,6 +444,12 @@ extern int8_t tx_pthresh;  extern int8_t tx_hthresh;
 extern int8_t tx_wthresh;
 
+extern uint16_t tx_udp_src_port;
+extern uint16_t tx_udp_dst_port;
+
+extern uint32_t tx_ip_src_addr;
+extern uint32_t tx_ip_dst_addr;
+
 extern struct fwd_config cur_fwd_config;  extern struct fwd_engine
 *cur_fwd_eng;  extern uint32_t retry_enabled; diff --git a/app/test-

pmd/txonly.c b/app/test-pmd/txonly.c index a24000e3af44..6d7ddf99d639 100644

app/test-pmd/txonly.c +8 -6
@@ -41,12 +41,12 @@
 #include "testpmd.h"
 
 /* RFC863 discard port */
-#define UDP_SRC_PORT 9
-#define UDP_DST_PORT 9
+uint16_t tx_udp_src_port = 9;
+uint16_t tx_udp_dst_port = 9;
 
 /* RFC2544 reserved test subnet 192.18.0.0 */ -#define IP_SRC_ADDR
 ((192U << 24) | (18 << 16) | (0 << 8) | 1) -#define IP_DST_ADDR ((192U << 24)
 | (18 << 16) | (0 << 8) | 2)
+uint32_t tx_ip_src_addr = (192U << 24) | (18 << 16) | (0 << 8) | 1;
+uint32_t tx_ip_dst_addr = (192U << 24) | (18 << 16) | (0 << 8) | 2;
 
 #define IP_DEFTTL  64   /* from RFC 1340. */
 #define IP_VERSION 0x40
@@ -106,8 +106,8 @@ setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr,
 	 * Initialize UDP header.
 	 */
 	pkt_len = (uint16_t) (pkt_data_len + sizeof(struct udp_hdr));
-	udp_hdr->src_port = rte_cpu_to_be_16(UDP_SRC_PORT);
-	udp_hdr->dst_port = rte_cpu_to_be_16(UDP_DST_PORT);
+	udp_hdr->src_port = rte_cpu_to_be_16(tx_udp_src_port);
+	udp_hdr->dst_port = rte_cpu_to_be_16(tx_udp_dst_port);
 	udp_hdr->dgram_len      = RTE_CPU_TO_BE_16(pkt_len);
 	udp_hdr->dgram_cksum    = 0; /* No UDP checksum. */
 
@@ -122,8 +122,8 @@ setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr,
 	ip_hdr->next_proto_id = IPPROTO_UDP;
 	ip_hdr->packet_id = 0;
 	ip_hdr->total_length   = RTE_CPU_TO_BE_16(pkt_len);
-	ip_hdr->src_addr = rte_cpu_to_be_32(IP_SRC_ADDR);
-	ip_hdr->dst_addr = rte_cpu_to_be_32(IP_DST_ADDR);
+	ip_hdr->src_addr = rte_cpu_to_be_32(tx_ip_src_addr);
+	ip_hdr->dst_addr = rte_cpu_to_be_32(tx_ip_dst_addr);
 
 	/*
 	 * Compute IP header checksum.
doc/guides/testpmd_app_ug/run_app.rst +0 -0
index f301c2b6f709..ae9eb712e209 100644
@@ -249,6 +249,15 @@ The commandline options are:
     Set the MAC address ``XX:XX:XX:XX:XX:XX`` of the peer port N,
     where 0 <= N < ``CONFIG_RTE_MAX_ETHPORTS`` from the configuration

file.

doc/guides/testpmd_app_ug/run_app.rst The commandline options are: · line 253

Quoted 2 lines
doc/guides/testpmd_app_ug/run_app.rst +2 -0
+
+*   ``--tx-ip=SRC,DST``

Newline should be added to give correct formatting in output.

doc/guides/testpmd_app_ug/run_app.rst The commandline options are: · line 257

Quoted 5 lines

+ Set the source and destination IP address used when doing transmit only
test.

doc/guides/testpmd_app_ug/run_app.rst +3 -0
+    The defaults are source 192.18.0.1 and destination 192.18.0.2.
+
+*   ``--tx-udp=SRC[,DST]``

Newline should be added to give correct formatting in output.

Quoted 10 lines

+ Set the source and destination UDP port number for transmit test only
test.

doc/guides/testpmd_app_ug/run_app.rst +2 -0
+    The default port is the 9 (discard).
+
 *   ``--pkt-filter-mode=mode``
 
     Set Flow Director mode where mode is either ``none`` (the default),

``signature`` or ``perfect``.
--
2.17.1

dpdk/devtools/check-git-log.sh is showing the following errors Wrong headline label:
testpmd: add ability to set tx IP and UDP parameters
Wrong headline lowercase:
testpmd: add ability to set tx IP and UDP parameters

label should be app/testpmd
tx should be Tx

Regards,

Bernard.

#6 lore raw

Re: [PATCH v2 2/2] testpmd: add ability to set tx IP and UDP parameters

Quoted 82 lines · Bernard

Hi Stephen,

Quoted 57 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Stephen Hemminger
Sent: Monday, June 11, 2018 7:25 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH v2 2/2] testpmd: add ability to set tx IP and UDP parameters

Allow user to override the hard coded IP address and UDP port values in Tx only test.

---
 app/test-pmd/parameters.c             | 49 +++++++++++++++++++++++++++
 app/test-pmd/testpmd.h                |  6 ++++
 app/test-pmd/txonly.c                 | 16 ++++-----
 doc/guides/testpmd_app_ug/run_app.rst |  9 +++++
 4 files changed, 72 insertions(+), 8 deletions(-)
app/test-pmd/parameters.c index renamed from app/test-pmd/parameters.c +0 -0

75807623c719..6d666e088fd9 100644

app/test-pmd/parameters.c +8 -0
@@ -19,6 +19,7 @@
 #include <stdint.h>
 #include <unistd.h>
 #include <inttypes.h>
+#include <arpa/inet.h>
 
 #include <rte_common.h>
 #include <rte_byteorder.h>
@@ -65,6 +66,7 @@ usage(char* progname)
 #ifdef RTE_LIBRTE_CMDLINE
 	       "--eth-peers-configfile= | "
 	       "--eth-peer=X,M:M:M:M:M:M | "
+	       "--tx-ip=SRC,DST | --tx-udp=PORT | "
 #endif
 	       "--pkt-filter-mode= |"
 	       "--rss-ip | --rss-udp | "
@@ -625,6 +627,8 @@ launch_args_parse(int argc, char** argv)
 		{ "vxlan-gpe-port",		1, 0, 0 },
 		{ "mlockall",			0, 0, 0 },
 		{ "no-mlockall",		0, 0, 0 },
+		{ "tx-ip",			1, 0, 0 },
+		{ "tx-udp",			1, 0, 0 },
 		{ 0, 0, 0, 0 },
 	};
 
@@ -717,6 +721,51 @@ launch_args_parse(int argc, char** argv)
 				nb_peer_eth_addrs++;
 			}
 #endif
+			if (!strcmp(lgopts[opt_idx].name, "tx-ip")) {
+				struct in_addr in;
+				char *end;
+

app/test-pmd/parameters.c launch_args_parse(int argc, char** argv) · line 737

Quoted 10 lines
app/test-pmd/parameters.c +9 -0
+				end = strchr(optarg, ',');
+				if (end == optarg || !end)
+					rte_exit(EXIT_FAILURE,
+						 "Invalid tx-ip: %s", optarg);
+
+				*end++ = 0;
+				if (inet_aton(optarg, &in) == 0)
+					rte_exit(EXIT_FAILURE,
+						 "Invalid source IP address:
 %s\n", optarg);  

Line over 80 characters should be fixed.

app/test-pmd/parameters.c launch_args_parse(int argc, char** argv) · line 744

Quoted 7 lines
app/test-pmd/parameters.c +5 -0
+				tx_ip_src_addr =
 rte_be_to_cpu_32(in.s_addr);
+
+				if (inet_aton(end, &in) == 0)
+					rte_exit(EXIT_FAILURE,
+						 "Invalid destination IP
 address: %s\n", optarg);  

Line over 80 characters should be fixed.

Quoted 12 lines
Quoted 10 lines
app/test-pmd/parameters.c +1 -0
+				tx_ip_dst_addr =

rte_be_to_cpu_32(in.s_addr);

app/test-pmd/parameters.c +7 -0
+			}
+			if (!strcmp(lgopts[opt_idx].name, "tx-udp")) {
+				char *end = NULL;
+
+				errno = 0;
+				n = strtoul(optarg, &end, 10);
+				if (errno != 0 || end == optarg || n >

UINT16_MAX ||

Line over 80 characters should be fixed.

I don't want to get into major code restructuring, just to deal with existing parsing. The 80 limit is really too small.