Skip to contentSkip to conversation

testpmd: simulating noisy host environment

PATCH Superseded Jens Freimann 3 participants 6 messages Apr 13, 2018 – Jun 14, 2018

v2 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v2 cover testpmd: simulating noisy host environment

This series adds a new forwarding mode 'noisy'. It proposes enhancements to testpmd to simulate more realistic behavior of a guest machine engaged in receiving and sending packets performing Virtual Network Function (VNF).

The goal is to enable simple of measuring performance impact on cache and memory footprint utilization from various VNF co-located on the same host machine.

This series of patches adds the new command line switches to testpmd:

--buffersize-before-sending [packet numbers]

Keep the mbuf in a FIFO and forward the over flooding packets from the FIFO. This queue is per TX-queue (after all other packet processing).

--flush-timeout [delay]
Flush the packet queue if no packets have been seen during [delay]. As long as packets are seen, the timer is reset.

Options to simulate route lookups:

--memory-footprint [size]
Size of the VNF internal memory (MB), in which the random read/write will be done, allocated by rte_malloc (hugepages).

--random-w-memory-access-per-packet [num]
Number of random writes in memory per packet should be performed, simulating hit-flags update. 64 bits per write, all write in different cache lines.

--random-r-memory-access-per-packet [num]
Number of random reads in memory per packet should be performed, simulating FIB/table lookups. 64 bits per read, all write in different cache lines.

--random-rw-memory-access-per-packet [num]
Number of random reads and writes in memory per packet should be performed, simulating stats update. 64 bits per read-write, all reads and writes in different cache lines.

Comments are appreciated.

regards,
Jens

Jens Freimann (2):
testpmd: add forwarding mode to simulate a noisy neighbour
testpmd: update testpmd documentation to include noisy forwarding mode

 app/test-pmd/Makefile                       |   1 +
 app/test-pmd/noisy_vnf.c                    | 184 ++++++++++++++++++++++++++++
 app/test-pmd/noisy_vnf.h                    |  42 +++++++
 app/test-pmd/parameters.c                   |  55 ++++++++-
 app/test-pmd/testpmd.c                      |  68 ++++++++++
 app/test-pmd/testpmd.h                      |  17 +++
 doc/guides/testpmd_app_ug/run_app.rst       |  27 ++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |   7 +-
 8 files changed, 398 insertions(+), 3 deletions(-)
 create mode 100644 app/test-pmd/noisy_vnf.c
 create mode 100644 app/test-pmd/noisy_vnf.h
Signature · 1 line
2.14.3
#1 lore raw

PATCH v2 1/2 testpmd: add forwarding mode to simulate a noisy neighbour

This adds a new forwarding mode to testpmd to simulate more realistic behavior of a guest machine engaged in receiving and sending packets performing Virtual Network Function (VNF).

The goal is to enable a simple way of measuring performance impact on cache and memory footprint utilization from various VNF co-located on the same host machine. For this it does:

* Buffer packets in a FIFO:

Create a fifo to buffer received packets. Once it flows over put those packets into the actual tx queue. The fifo is created per tx queue and its size can be set with the --buffersize-before-sending commandline parameter.

A second commandline parameter is used to set a timeout in milliseconds after which the fifo is flushed.

--buffersize-before-sending [packet numbers]
Keep the mbuf in a FIFO and forward the over flooding packets from the FIFO. This queue is per TX-queue (after all other packet processing).

--flush-timeout [delay]
Flush the packet queue if no packets have been seen during [delay]. As long as packets are seen, the timer is reset.

Add several options to simulate route lookups (memory reads) in tables that can be quite large, as well as route hit statistics update. These options simulates the while stack traversal and
will trash the cache. Memory access is random.

* simulate route lookups:

Allocate a buffer and perform reads and writes on it as specified by commandline options:

--memory-footprint [size]
Size of the VNF internal memory (MB), in which the random read/write will be done, allocated by rte_malloc (hugepages).

--nb-rnd-write [num]
Number of random writes in memory per packet should be performed, simulating hit-flags update. 64 bits per write, all write in different cache lines.

--nb-rnd-read [num]
Number of random reads in memory per packet should be performed, simulating FIB/table lookups. 64 bits per read, all write in different cache lines.

--nb-rnd-read-write [num]
Number of random reads and writes in memory per packet should be performed, simulating stats update. 64 bits per read-write, all reads and writes in different cache lines.

---
 app/test-pmd/Makefile     |   1 +
 app/test-pmd/noisy_vnf.c  | 184 ++++++++++++++++++++++++++++++++++++++++++++++
 app/test-pmd/noisy_vnf.h  |  42 +++++++++++
 app/test-pmd/parameters.c |  55 +++++++++++++-
 app/test-pmd/testpmd.c    |  68 +++++++++++++++++
 app/test-pmd/testpmd.h    |  17 +++++
 6 files changed, 366 insertions(+), 1 deletion(-)
 create mode 100644 app/test-pmd/noisy_vnf.c
 create mode 100644 app/test-pmd/noisy_vnf.h
app/test-pmd/Makefile +1 -0
index 60ae9b9c1..2dc07ab16 100644
@@ -32,6 +32,7 @@ SRCS-y += rxonly.c
 SRCS-y += txonly.c
 SRCS-y += csumonly.c
 SRCS-y += icmpecho.c
+SRCS-y += noisy_vnf.c
 SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c
 
 ifeq ($(CONFIG_RTE_LIBRTE_PMD_SOFTNIC)$(CONFIG_RTE_LIBRTE_SCHED),yy)
app/test-pmd/noisy_vnf.c new file +184 -0

184 lines not on this page · raw message

app/test-pmd/noisy_vnf.h new file +42 -0

42 lines not on this page · raw message

app/test-pmd/parameters.c +54 -1

67 lines not on this page · raw message

app/test-pmd/testpmd.c +68 -0

110 lines not on this page · raw message

app/test-pmd/testpmd.h +17 -0
index 153abea05..12d601e0d 100644
@@ -9,6 +9,7 @@
 #include <rte_bus_pci.h>
 #include <rte_gro.h>
 #include <rte_gso.h>
+#include "noisy_vnf.h"
 
 #define RTE_PORT_ALL            (~(portid_t)0x0)
 
@@ -109,6 +110,14 @@ struct fwd_stream {
 #endif
 };
 
+struct noisy_config {
+	struct rte_ring *f;
+	uint64_t prev_time;
+	char *vnf_mem;
+};
+struct noisy_config *noisy_cfg;
+
+
 /** Descriptor for a single flow. */
 struct port_flow {
 	size_t size; /**< Allocated space including data[]. */
@@ -251,6 +260,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 noisy_vnf_engine;
 #ifdef TM_MODE
 extern struct fwd_engine softnic_tm_engine;
 extern struct fwd_engine softnic_tm_bypass_engine;
@@ -382,6 +392,13 @@ extern int8_t rx_drop_en;
 extern int16_t tx_free_thresh;
 extern int16_t tx_rs_thresh;
 
+extern uint16_t bsize_before_send;
+extern uint16_t flush_timer;
+extern uint64_t vnf_memory_footprint;
+extern uint64_t nb_rnd_write;
+extern uint64_t nb_rnd_read;
+extern uint64_t nb_rnd_read_write;
+
 extern uint8_t dcb_config;
 extern uint8_t dcb_test;
 
Signature · 1 line
2.14.3
#3 lore raw

PATCH v2 2/2 testpmd: update testpmd documentation to include noisy forwarding mode

In reply to Jens Freimann
---
 doc/guides/testpmd_app_ug/run_app.rst       | 27 +++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++++--
 2 files changed, 32 insertions(+), 2 deletions(-)
doc/guides/testpmd_app_ug/run_app.rst +27 -0
index 1fd53958a..0b7046bb0 100644
@@ -340,6 +340,7 @@ The commandline options are:
        icmpecho
        ieee1588
        tm
+       noisy
 
 *   ``--rss-ip``
 
@@ -479,3 +480,29 @@ The commandline options are:
 
     Set the hexadecimal bitmask of TX queue offloads.
     The default value is 0.
+
+*   ``--buffersize-before-sending=N``
+
+    Set the number of maximum elements  of the FIFO queue to be created 
+    for buffering packets. Only available with the noisy forwarding mode.
+    The default value is 0.
+
+*   ``--flush-timeout=N``
+
+    Set the size of the FIFO queue to be created for buffering packets.
+    Only available with the noisy forwarding mode. The default value is 0.
+
+*   ``--nb-rnd-read=N``
+
+    Set the number of reads to be done in noisy neighbour simulation memory buffer.
+    Only available with the noisy forwarding mode. The default value is 0.
+
+*   ``--nb-rnd-write=N``
+
+    Set the number of writes to be done in noisy neighbour simulation memory buffer.
+    Only available with the noisy forwarding mode. The default value is 0.
+
+*   ``--nb-rnd-write=N``
+
+    Set the number of r/w access to be done in noisy neighbour simulation memory buffer.
+    Only available with the noisy forwarding mode. The default value is 0.
doc/guides/testpmd_app_ug/testpmd_funcs.rst +5 -2
index a766ac795..0c1f49ae3 100644
@@ -289,7 +289,7 @@ set fwd
 Set the packet forwarding mode::
 
    testpmd> set fwd (io|mac|macswap|flowgen| \
-                     rxonly|txonly|csum|icmpecho) (""|retry)
+                     rxonly|txonly|csum|icmpecho|noisy) (""|retry)
 
 ``retry`` can be specified for forwarding engines except ``rx_only``.
 
@@ -327,8 +327,11 @@ The available information categories are:
   also modify the default hierarchy or specify the new hierarchy through CLI for
   implementing QoS scheduler.  Requires ``CONFIG_RTE_LIBRTE_PMD_SOFTNIC=y`` ``CONFIG_RTE_LIBRTE_SCHED=y``.
 
-Example::
+* ``noisy``: Noisy neighbour simulation.
+  Simulate more realistic behavior of a guest machine engaged in receiving
+  and sending packets performing Virtual Network Function (VNF).
 
+Example::
    testpmd> set fwd rxonly
 
    Set rxonly packet forwarding mode
Signature · 1 line
2.14.3
#4 lore raw

Re: [PATCH v2 2/2] testpmd: update testpmd documentation to include noisy forwarding mode

Quoted 23 lines · Jens Freimann
---
 doc/guides/testpmd_app_ug/run_app.rst       | 27 +++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++++--
 2 files changed, 32 insertions(+), 2 deletions(-)
doc/guides/testpmd_app_ug/run_app.rst +2 -0
index 1fd53958a..0b7046bb0 100644
@@ -340,6 +340,7 @@ The commandline options are:
        icmpecho
        ieee1588
        tm
+       noisy
 
 *   ``--rss-ip``
 
@@ -479,3 +480,29 @@ The commandline options are:
 
     Set the hexadecimal bitmask of TX queue offloads.
     The default value is 0.
+

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

Quoted 10 lines
doc/guides/testpmd_app_ug/run_app.rst +10 -0
+*   ``--buffersize-before-sending=N``
+
+    Set the number of maximum elements  of the FIFO queue to be created 
+    for buffering packets. Only available with the noisy forwarding mode.
+    The default value is 0.
+
+*   ``--flush-timeout=N``
+
+    Set the size of the FIFO queue to be created for buffering packets.
+    Only available with the noisy forwarding mode. The default value is 0.

Some of the there parameter names are so generic when you think them in the scope of the whole testpmd it can be confusing and hard to understand what they are for.

What do you think adding a prefix to all noisy neighbor related commands?

Quoted 15 lines
doc/guides/testpmd_app_ug/run_app.rst +15 -0
+
+*   ``--nb-rnd-read=N``
+
+    Set the number of reads to be done in noisy neighbour simulation memory buffer.
+    Only available with the noisy forwarding mode. The default value is 0.
+
+*   ``--nb-rnd-write=N``
+
+    Set the number of writes to be done in noisy neighbour simulation memory buffer.
+    Only available with the noisy forwarding mode. The default value is 0.
+
+*   ``--nb-rnd-write=N``
+
+    Set the number of r/w access to be done in noisy neighbour simulation memory buffer.
+    Only available with the noisy forwarding mode. The default value is 0.

<...>

#5 lore raw

Re: [PATCH v2 2/2] testpmd: update testpmd documentation to include noisy forwarding mode

Quoted 39 lines · Ferruh Yigit
Quoted 23 lines · Jens Freimann
---
 doc/guides/testpmd_app_ug/run_app.rst       | 27 +++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++++--
 2 files changed, 32 insertions(+), 2 deletions(-)
doc/guides/testpmd_app_ug/run_app.rst +2 -0
index 1fd53958a..0b7046bb0 100644
@@ -340,6 +340,7 @@ The commandline options are:
        icmpecho
        ieee1588
        tm
+       noisy
 
 *   ``--rss-ip``
 
@@ -479,3 +480,29 @@ The commandline options are:
 
     Set the hexadecimal bitmask of TX queue offloads.
     The default value is 0.
+

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

Quoted 10 lines
doc/guides/testpmd_app_ug/run_app.rst +10 -0
+*   ``--buffersize-before-sending=N``
+
+    Set the number of maximum elements  of the FIFO queue to be created
+    for buffering packets. Only available with the noisy forwarding mode.
+    The default value is 0.
+
+*   ``--flush-timeout=N``
+
+    Set the size of the FIFO queue to be created for buffering packets.
+    Only available with the noisy forwarding mode. The default value is 0.

Some of the there parameter names are so generic when you think them in the scope of the whole testpmd it can be confusing and hard to understand what they are for.

Quoted 1 line

What do you think adding a prefix to all noisy neighbor related commands?

Yes, I think it is a good point. Thanks for the review!

regards,
Jens

Quoted 18 lines
Quoted 16 lines
doc/guides/testpmd_app_ug/run_app.rst +15 -0
+
+*   ``--nb-rnd-read=N``
+
+    Set the number of reads to be done in noisy neighbour simulation memory buffer.
+    Only available with the noisy forwarding mode. The default value is 0.
+
+*   ``--nb-rnd-write=N``
+
+    Set the number of writes to be done in noisy neighbour simulation memory buffer.
+    Only available with the noisy forwarding mode. The default value is 0.
+
+*   ``--nb-rnd-write=N``
+
+    Set the number of r/w access to be done in noisy neighbour simulation memory buffer.
+    Only available with the noisy forwarding mode. The default value is 0.

<...>

#2 lore raw

Re: [PATCH v2 1/2] testpmd: add forwarding mode to simulate a noisy neighbour

In reply to Jens Freimann

Hi Jens,

Quoted 59 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Jens Freimann
Sent: Friday, April 13, 2018 12:37 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Ananyev, Konstantin <[email protected]>; Yigit, Ferruh <[email protected]>
Subject: [dpdk-dev] [PATCH v2 1/2] testpmd: add forwarding mode to simulate a noisy neighbour

This adds a new forwarding mode to testpmd to simulate more realistic behavior of a guest machine engaged in receiving and sending packets performing Virtual Network Function (VNF).

The goal is to enable a simple way of measuring performance impact on cache and memory footprint utilization from various VNF co-located on the same host machine. For this it does:

* Buffer packets in a FIFO:

Create a fifo to buffer received packets. Once it flows over put those packets into the actual tx queue. The fifo is created per tx queue and its size can be set with the --buffersize-before-sending commandline parameter.

A second commandline parameter is used to set a timeout in milliseconds after which the fifo is flushed.

--buffersize-before-sending [packet numbers] Keep the mbuf in a FIFO and forward the over flooding packets from the FIFO. This queue is per TX-queue (after all other packet processing).

--flush-timeout [delay]
Flush the packet queue if no packets have been seen during [delay]. As long as packets are seen, the timer is reset.

Add several options to simulate route lookups (memory reads) in tables that can be quite large, as well as route hit statistics update. These options simulates the while stack traversal and will trash the cache. Memory access is random.

* simulate route lookups:

Allocate a buffer and perform reads and writes on it as specified by commandline options:

--memory-footprint [size]
Size of the VNF internal memory (MB), in which the random read/write will be done, allocated by rte_malloc (hugepages).

--nb-rnd-write [num]
Number of random writes in memory per packet should be performed, simulating hit-flags update. 64 bits per write, all write in different cache lines.

--nb-rnd-read [num]
Number of random reads in memory per packet should be performed, simulating FIB/table lookups. 64 bits per read, all write in different cache lines.

Quoted 7 lines

--nb-rnd-read-write [num]
Number of random reads and writes in memory per packet should be performed, simulating stats update. 64 bits per read-write, all reads and writes in different cache lines.

---

<snip>

This patch fails to apply to dpdk_18.08.rc0
checkpatch.pl reports 1 error.

Regards,

Bernard.