aboutsummaryrefslogtreecommitdiffstats
path: root/test/test/test_pmd_perf.c
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-07-04 10:40:06 +0200
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-07-04 10:48:05 +0200
commit8d53e9f3c6001dcb2865f6e894da5b54e1418f88 (patch)
tree63907f21c13636a987d43463c675d0727a04e327 /test/test/test_pmd_perf.c
parente2bea7436061ca2e7e14bfcfdc5870f2555c3965 (diff)
New upstream version 18.11.2upstream-18.11-stable
Change-Id: I23eb4f9179abf1f9c659891f8fddb27ee68ad26b Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'test/test/test_pmd_perf.c')
-rw-r--r--test/test/test_pmd_perf.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c
index f5095c87..ed8524a1 100644
--- a/test/test/test_pmd_perf.c
+++ b/test/test/test_pmd_perf.c
@@ -493,16 +493,21 @@ 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;
+ uint64_t timeout = 10000;
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);
- printf("free %d mbuf left in port %u\n", pkt_per_port, portid);
+ nb_free += nb_rx;
+
+ if (unlikely(nb_rx == 0))
+ timeout--;
+ } while (nb_free != pkt_per_port && timeout != 0);
+ printf("free %d (expected %d) mbuf left in port %u\n", nb_free,
+ pkt_per_port, portid);
}
if (count == 0)