DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test/pmd_perf: change the way to drain the port
@ 2019-01-02 15:55 Julien Meunier
  2019-01-08 17:33 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  2019-02-03 19:42 ` [dpdk-dev] [PATCH v2] test/pmd_perf: fix " Julien Meunier
  0 siblings, 2 replies; 9+ messages in thread
From: Julien Meunier @ 2019-01-02 15:55 UTC (permalink / raw)
  To: dev; +Cc: stable

If the port has received less than ``pkt_per_port`` packets (for
example, the port has missed some packets), the test is in an infinite
loop.

Instead of expecting a number of packet to receive, let the port to be
drained by itself. If no more packets are received, the test can
continue.

Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
---
 test/test/test_pmd_perf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c
index f5095c8..286e09d 100644
--- a/test/test/test_pmd_perf.c
+++ b/test/test/test_pmd_perf.c
@@ -493,15 +493,15 @@ main_loop(__rte_unused void *args)
 
 	for (i = 0; i < conf->nb_ports; i++) {
 		portid = conf->portlist[i];
-		int nb_free = pkt_per_port;
+		int nb_free = 0;
 		do { /* dry out */
 			nb_rx = rte_eth_rx_burst(portid, 0,
 						 pkts_burst, MAX_PKT_BURST);
 			nb_tx = 0;
 			while (nb_tx < nb_rx)
 				rte_pktmbuf_free(pkts_burst[nb_tx++]);
-			nb_free -= nb_rx;
-		} while (nb_free != 0);
+			nb_free += nb_rx;
+		} while (nb_rx != 0);
 		printf("free %d mbuf left in port %u\n", pkt_per_port, portid);
 	}
 
-- 
2.10.2

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-02-21 16:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-02 15:55 [dpdk-dev] [PATCH] test/pmd_perf: change the way to drain the port Julien Meunier
2019-01-08 17:33 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2019-01-08 21:16   ` Meunier, Julien (Nokia - FR/Paris-Saclay)
2019-02-03 19:42 ` [dpdk-dev] [PATCH v2] test/pmd_perf: fix " Julien Meunier
2019-02-07 12:28   ` Ferruh Yigit
2019-02-18 11:25     ` Meunier, Julien (Nokia - FR/Paris-Saclay)
2019-02-18 12:28       ` Ferruh Yigit
2019-02-20 21:06   ` [dpdk-dev] [PATCH v3] " Julien Meunier
2019-02-21 16:46     ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).