[PATCH v3 4/9] app/testpmd: fix packet transmission in noisy VNF engine

David Marchand david.marchand at redhat.com
Mon Feb 20 19:34:57 CET 2023


nb_rx relates to the number of packets received from the driver.
nb_tx is the total number of packets transmitted by this forward engine.

Fix the retry stage, for dequeued packets, as it was incorrectly
passing nb_rx / nb_tx as bounds of the tmp_pkts[] array, and fix tx stats
accordingly.

Fixes: 3c156061b938 ("app/testpmd: add noisy neighbour forwarding mode")
Cc: stable at dpdk.org

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
 app/test-pmd/noisy_vnf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/noisy_vnf.c b/app/test-pmd/noisy_vnf.c
index ce5a3e5e69..0e72dc034f 100644
--- a/app/test-pmd/noisy_vnf.c
+++ b/app/test-pmd/noisy_vnf.c
@@ -217,9 +217,10 @@ pkt_burst_noisy_vnf(struct fwd_stream *fs)
 		sent = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 					 tmp_pkts, nb_deqd);
 		if (unlikely(sent < nb_deqd) && fs->retry_enabled)
-			nb_tx += do_retry(nb_rx, nb_tx, tmp_pkts, fs);
-		inc_tx_burst_stats(fs, nb_tx);
+			sent += do_retry(nb_deqd, sent, tmp_pkts, fs);
+		inc_tx_burst_stats(fs, sent);
 		fs->fwd_dropped += drop_pkts(tmp_pkts, nb_deqd, sent);
+		nb_tx += sent;
 		ncf->prev_time = rte_get_timer_cycles();
 	}
 end:
-- 
2.39.2



More information about the dev mailing list