Skip to contentSkip to conversation

app/testpmd: add engine for UDP echo server support

PATCH In review Thadeu Lima de Souza Cascardo 3 participants 4 messages Sep 4, 2015 – Oct 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: add engine for UDP echo server support

Adapt the ICMP echo code to reply to UDP echo requests on port 7. The testpmd forward engine udpecho is used for that.

---
 app/test-pmd/config.c                       |  7 ++-
 app/test-pmd/icmpecho.c                     | 90 ++++++++++++++++++++++-------
 app/test-pmd/testpmd.c                      |  1 +
 app/test-pmd/testpmd.h                      |  1 +
 doc/guides/testpmd_app_ug/run_app.rst       |  2 +-
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  6 +-
 6 files changed, 79 insertions(+), 28 deletions(-)
app/test-pmd/config.c +4 -3
index cf2aa6e..0b5c4e6 100644
@@ -1239,7 +1239,7 @@ dcb_fwd_config_setup(void)
 }
 
 static void
-icmp_echo_config_setup(void)
+echo_config_setup(void)
 {
 	portid_t  rxp;
 	queueid_t rxq;
@@ -1297,8 +1297,9 @@ void
 fwd_config_setup(void)
 {
 	cur_fwd_config.fwd_eng = cur_fwd_eng;
-	if (strcmp(cur_fwd_eng->fwd_mode_name, "icmpecho") == 0) {
-		icmp_echo_config_setup();
+	if (strcmp(cur_fwd_eng->fwd_mode_name, "icmpecho") == 0 ||
+	    strcmp(cur_fwd_eng->fwd_mode_name, "udpecho") == 0) {
+		echo_config_setup();
 		return;
 	}
 	if ((nb_rxq > 1) && (nb_txq > 1)){
app/test-pmd/icmpecho.c +68 -22

145 lines not on this page · raw message

app/test-pmd/testpmd.c +1 -0
index 386bf84..b9a0ddb 100644
@@ -151,6 +151,7 @@ struct fwd_engine * fwd_engines[] = {
 	&tx_only_engine,
 	&csum_fwd_engine,
 	&icmp_echo_engine,
+	&udp_echo_engine,
 #ifdef RTE_LIBRTE_IEEE1588
 	&ieee1588_fwd_engine,
 #endif
app/test-pmd/testpmd.h +1 -0
index d287274..612a4f4 100644
@@ -229,6 +229,7 @@ extern struct fwd_engine rx_only_engine;
 extern struct fwd_engine tx_only_engine;
 extern struct fwd_engine csum_fwd_engine;
 extern struct fwd_engine icmp_echo_engine;
+extern struct fwd_engine udp_echo_engine;
 #ifdef RTE_LIBRTE_IEEE1588
 extern struct fwd_engine ieee1588_fwd_engine;
 #endif
doc/guides/testpmd_app_ug/run_app.rst +1 -1
index 54ae2b2..6ad168a 100644
@@ -315,7 +315,7 @@ They must be separated from the EAL options, shown in the previous section, with
 
 *   --forward-mode=N
 
-    Set forwarding mode. (N: io|mac|mac_retry|mac_swap|flowgen|rxonly|txonly|csum|icmpecho|ieee1588)
+    Set forwarding mode. (N: io|mac|mac_retry|mac_swap|flowgen|rxonly|txonly|csum|icmpecho|udpecho|ieee1588)
 
 *   --rss-ip
 
doc/guides/testpmd_app_ug/testpmd_funcs.rst +4 -2
index 3f076c8..1be0ae8 100644
@@ -609,7 +609,7 @@ set fwd
 
 Set the packet forwarding mode:
 
-set fwd (io|mac|mac_retry|macswap|flowgen|rxonly|txonly|csum|icmpecho)
+set fwd (io|mac|mac_retry|macswap|flowgen|rxonly|txonly|csum|icmpecho|udpecho)
 
 The available information categories are:
 
@@ -633,7 +633,9 @@ The available information categories are:
 
 *   csum: changes the checksum field with HW or SW methods depending on the offload flags on the packet.
 
-*   icmpecho: receives a burst of packets, lookup for IMCP echo requests and, if any, send back ICMP echo replies.
+*   icmpecho: receives a burst of packets, lookup for ICMP echo requests and, if any, send back ICMP echo replies.
+
+*   udpecho: receives a burst of packets, lookup for UDP echo requests and, if any, send back UDP echo replies.
 
 *   ieee1588: demonstrate L2 IEEE1588 V2 PTP timestamping for RX and TX. Requires ``CONFIG_RTE_LIBRTE_IEEE1588=y``.
     Note: TX timestamping is only available in the "Full Featured" TX path. To force ``testpmd`` into this mode set ``--txqflags=0``.
Signature · 1 line
2.4.3
#2 lore raw

Hi,

Quoted 8 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Saturday, October 24, 2015 10:24 PM
To: De Lara Guarch, Pablo
Cc: [email protected]; Thadeu Lima de Souza Cascardo
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add engine for UDP echo server support

Quoted 9 lines

Pablo, opinion?
Is the UDP echo eligible in testpmd to ease some tests?

2015-09-04 14:17, Thadeu Lima de Souza Cascardo:

Quoted 1 line

Adapt the ICMP echo code to reply to UDP echo requests on port 7. The

testpmd

Quoted 3 lines

forward engine udpecho is used for that.

Sorry I missed this patch. Patch looks fine, but in my opinion, it would be better to rename icmpecho to just echo,
and integrate UDP and TCP, with ICMP, as I think there is no need to increase the number of forwarding modes for something so similar.

Pablo

#3 lore raw
Quoted 27 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of De Lara Guarch, Pablo
Sent: Monday, October 26, 2015 8:37 PM
To: Thomas Monjalon
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add engine for UDP echo server support

Hi,

Quoted 14 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Saturday, October 24, 2015 10:24 PM
To: De Lara Guarch, Pablo
Cc: [email protected]; Thadeu Lima de Souza Cascardo
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add engine for UDP echo server support

Pablo, opinion?
Is the UDP echo eligible in testpmd to ease some tests?

2015-09-04 14:17, Thadeu Lima de Souza Cascardo:

Quoted 1 line

Adapt the ICMP echo code to reply to UDP echo requests on port 7. The

testpmd

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines

forward engine udpecho is used for that.

Sorry I missed this patch. Patch looks fine, but in my opinion, it would be better to rename icmpecho to just echo,
and integrate UDP and TCP, with ICMP, as I think there is no need to increase the number of forwarding modes for something so similar.

Actually, I forgot to say that patch does not compile at least with gcc 5.1. Variables icmp_h and udp_h in reply_to_echo_rqsts() have to be initialized.

Quoted 1 line

Pablo