app/testpmd: add noisy neighbour forwarding mode
PATCH v9 1/1 app/testpmd: add noisy neighbour forwarding mode
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 --noisy-tx-sw-buffer-flushtime commandline parameter.
A second commandline parameter is used to set a timeout in milliseconds after which the fifo is flushed.
--noisy-tx-sw-buffer-size [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).
--noisy-tx-sw-buffer-flushtime [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:
--noisy-lkup-memory [size]
Size of the VNF internal memory (MB), in which the random read/write will be done, allocated by rte_malloc (hugepages).
--noisy-lkup-num-writes [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.
--noisy-lkup-num-reads [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.
--noisy-lkup-num-reads-writes [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.
---
v8-v9:
* re-add blank line in testpmd documentation (Bernard)
* add new parameters to usage function (Bernard)
* change error messages to match code in parameters.c (Kevin)
v7-v8:
* fix checkpatches.sh warnings/errors
v6->v7:
* fix return value of mem allocation in noisy_begin
* remove blank line
* allow 0 as parameter value
v5->v6:
* fix patch description
* fix comment for pkt_burst_noisy_vnf
* check if flush needed when no packets were received
* free dropped packets
* remove redundant else-if
* do memory access simulation in all cases
* change order of free'd data structures in noisy_fwd_end
* only allocate one noisy_config struct per port
* check for return of rte_ring_create()
* change checking of input parameters in noisy_fwd_begin(). Decided to allow to set paramters to 0 (which is the default)
* did not change use of "=N" in documentation as suggested by Kevin because it is how it's done for most other parameters
* make error message match code in checking of flush time parameter
* don't add whitespace in testpmd.h
v4->v5:
* try to minimize impact in common code. Instead implement fwd_begin andfwd_end
* simplify actual fwd function
* remove unnecessary casts (Kevin)
* use more meaningful names for parameters and global variables (Kevin)
* free ring and vnf_mem as well (Kevin)
* squash documentation and code into single patch (Bernard)
* fix patch subject to "app/testpmd" (Bernard)
--- app/test-pmd/Makefile | 1 + app/test-pmd/meson.build | 1 + app/test-pmd/noisy_vnf.c | 279 ++++++++++++++++++++ app/test-pmd/parameters.c | 66 +++++ app/test-pmd/testpmd.c | 35 +++ app/test-pmd/testpmd.h | 8 + doc/guides/testpmd_app_ug/run_app.rst | 33 +++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 6 +- 8 files changed, 428 insertions(+), 1 deletion(-) create mode 100644 app/test-pmd/noisy_vnf.c
app/test-pmd/Makefile +1 -0
@@ -33,6 +33,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 SRCS-$(CONFIG_RTE_LIBRTE_BPF) += bpf_cmd.c
app/test-pmd/meson.build +1 -0
@@ -17,6 +17,7 @@ sources = files('cmdline.c', 'iofwd.c', 'macfwd.c', 'macswap.c', + 'noisy_vnf.c', 'parameters.c', 'rxonly.c', 'testpmd.c',
app/test-pmd/noisy_vnf.c new file +279 -0
279 lines not on this page · raw message
app/test-pmd/parameters.c +66 -0
84 lines not on this page · raw message
app/test-pmd/testpmd.c +35 -0
@@ -157,6 +157,7 @@ struct fwd_engine * fwd_engines[] = { &tx_only_engine, &csum_fwd_engine, &icmp_echo_engine, + &noisy_vnf_engine, #if defined RTE_LIBRTE_PMD_SOFTNIC &softnic_fwd_engine, #endif
@@ -252,6 +253,40 @@ int16_t tx_free_thresh = RTE_PMD_PARAM_UNSET;*/ int16_t tx_rs_thresh =RTE_PMD_PARAM_UNSET ; +/* +* Configurable value of buffered packets before sending. +*/ +uint16_t noisy_tx_sw_bufsz; + +/* +* Configurable value of packet buffer timeout. +*/ +uint16_t noisy_tx_sw_buf_flush_time; + +/* +* Configurable value for size of VNF internal memory area +* used for simulating noisy neighbour behaviour +*/ +uint64_t noisy_lkup_mem_sz; + +/* +* Configurable value of number of random writes done in +* VNF simulation memory area. +*/ +uint64_t noisy_lkup_num_writes; + +/* +* Configurable value of number of random reads done in +* VNF simulation memory area. +*/ +uint64_t noisy_lkup_num_reads; + +/* +* Configurable value of number of random reads/writes done in +* VNF simulation memory area. +*/ +uint64_t noisy_lkup_num_reads_writes; +/* * Receive Side Scaling (RSS) configuration. */
app/test-pmd/testpmd.h +8 -0
@@ -243,6 +243,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 SOFTNIC extern struct fwd_engine softnic_fwd_engine;#endif
@@ -375,6 +376,13 @@ extern int8_t rx_drop_en;extern int16_t tx_free_thresh;extern int16_t tx_rs_thresh; +extern uint16_t noisy_tx_sw_bufsz; +extern uint16_t noisy_tx_sw_buf_flush_time; +extern uint64_t noisy_lkup_mem_sz; +extern uint64_t noisy_lkup_num_writes; +extern uint64_t noisy_lkup_num_reads; +extern uint64_t noisy_lkup_num_reads_writes; +extern uint8_t dcb_config;extern uint8_t dcb_test;
doc/guides/testpmd_app_ug/run_app.rst +33 -0
@@ -340,6 +340,7 @@ The commandline options are: icmpecho ieee1588 tm + noisy * ``--rss-ip``
@@ -498,3 +499,35 @@ The commandline options are: * ``--no-mlockall`` Disable locking all memory. + +* ``--noisy-tx-sw-buffer-size`` + + 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. + +* ``--noisy-tx-sw-buffer-flushtime=N`` + + Set the time before packets in the FIFO queue is flushed. + Only available with the noisy forwarding mode. The default value is 0. + +* ``--noisy-lkup-memory=N`` + + Set the size of the noisy neighbour simulation memory buffer in MB to N. + Only available with the noisy forwarding mode. The default value is 0. + + +* ``--noisy-lkup-num-reads=N`` + + Set the number of reads to be done in noisy neighbour simulation memory buffer to N. + Only available with the noisy forwarding mode. The default value is 0. + +* ``--noisy-lkup-num-writes=N`` + + Set the number of writes to be done in noisy neighbour simulation memory buffer to N. + Only available with the noisy forwarding mode. The default value is 0. + +* ``--noisy-lkup-num-reads-writes=N`` + + Set the number of r/w accesses to be done in noisy neighbour simulation memory buffer to N. + Only available with the noisy forwarding mode. The default value is 0.
doc/guides/testpmd_app_ug/testpmd_funcs.rst +5 -1
@@ -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``.
@@ -323,6 +323,10 @@ The available information categories are: * ``softnic``: Demonstrates the softnic forwarding operation. In this mode, packet forwarding is similar to I/O mode except for the fact that packets are loopback to the softnic ports only. Therefore, portmask parameter should be set to softnic port only. The various software based custom NIC pipelines specified through the softnic firmware (DPDK packet framework script) can be tested in this mode. Furthermore, it allows to build 5-level hierarchical QoS scheduler as a default option that can be enabled through CLI once testpmd application is initialised. The user can modify the default scheduler hierarchy or can specify the new QoS Scheduler hierarchy through CLI. Requires ``CONFIG_RTE_LIBRTE_PMD_SOFTNIC=y``. +* ``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
Signature · 1 line
2.17.1
Quoted 50 lines · Jens Freimann
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 --noisy-tx-sw-buffer-flushtime commandline parameter.
A second commandline parameter is used to set a timeout in milliseconds after which the fifo is flushed.
--noisy-tx-sw-buffer-size [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).--noisy-tx-sw-buffer-flushtime [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:
--noisy-lkup-memory [size]
Size of the VNF internal memory (MB), in which the random read/write will be done, allocated byrte_malloc(hugepages).--noisy-lkup-num-writes [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.--noisy-lkup-num-reads [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
--noisy-lkup-num-reads-writes [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.Signed-off-by Jens Freimann <[email protected]>
Iremonger, Bernard
Acked-byQuoted 69 lines
-----Original Message-----
From: Kevin Traynor [mailto:[email protected]]
Sent: Friday, October 5, 2018 10:55 AM
To: Jens Freimann <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Ananyev, Konstantin <[email protected]>; Yigit, Ferruh <[email protected]>; Iremonger, Bernard <[email protected]>
Subject: Re: [PATCH v9] app/testpmd: add noisy neighbour forwarding modeQuoted 55 lines · Jens Freimann
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 --noisy-tx-sw-buffer-flushtime commandline parameter.
A second commandline parameter is used to set a timeout in milliseconds after which the fifo is flushed.
--noisy-tx-sw-buffer-size [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).
--noisy-tx-sw-buffer-flushtime [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:
--noisy-lkup-memory [size]
Size of the VNF internal memory (MB), in which the random read/write will be done, allocated byrte_malloc(hugepages).--noisy-lkup-num-writes [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.--noisy-lkup-num-reads [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.--noisy-lkup-num-reads-writes [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.
Quoted 4 lines
Quoted 2 lines
Signed-off-by Jens Freimann <[email protected]>Acked-by Kevin Traynor <[email protected]>
Ferruh Yigit
AppliedQuoted 69 lines · Bernard
Quoted 69 lines
-----Original Message-----
From: Kevin Traynor [mailto:[email protected]]
Sent: Friday, October 5, 2018 10:55 AM
To: Jens Freimann <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Ananyev, Konstantin <[email protected]>; Yigit, Ferruh <[email protected]>; Iremonger, Bernard <[email protected]>
Subject: Re: [PATCH v9] app/testpmd: add noisy neighbour forwarding modeQuoted 55 lines · Jens Freimann
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 --noisy-tx-sw-buffer-flushtime commandline parameter.
A second commandline parameter is used to set a timeout in milliseconds after which the fifo is flushed.
--noisy-tx-sw-buffer-size [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).
--noisy-tx-sw-buffer-flushtime [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:
--noisy-lkup-memory [size]
Size of the VNF internal memory (MB), in which the random read/write will be done, allocated byrte_malloc(hugepages).--noisy-lkup-num-writes [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.--noisy-lkup-num-reads [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.--noisy-lkup-num-reads-writes [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.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Signed-off-by Jens Freimann <[email protected]>Acked-by Kevin Traynor <[email protected]>
Applied to dpdk-next-net/master, thanks.