From: Daniel Shelepov Date: Mon, 14 May 2018 21:12:15 +0000 (+0000) Subject: app/testpmd: fix burst stats reporting X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fe613657ce486083a3ed96890c95de4f35c8593b;p=dpdk.git app/testpmd: fix burst stats reporting When RTE_TEST_PMD_RECORD_BURST_STATS is enabled, testpmd collects burst statistics and includes them in the port stats report. The summary should include top 2 most frequent burst sizes, but there is a bug in finding the top-2. During the scan of burst size counts, the top-2 can change only if top-1 also changes. Added logic to update the top-2 if current burst size is larger than existing top-2, but smaller than existing top-1. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Daniel Shelepov Acked-by: Bernard Iremonger --- diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 1344016032..017cc618fa 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -951,6 +951,9 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs) pktnb_stats[1] = pktnb_stats[0]; burst_stats[0] = nb_burst; pktnb_stats[0] = nb_pkt; + } else if (nb_burst > burst_stats[1]) { + burst_stats[1] = nb_burst; + pktnb_stats[1] = nb_pkt; } } if (total_burst == 0)