app/testpmd: fix burst stat reporting
PATCH 1/1 app/testpmd: fix burst stat 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.
--- app/test-pmd/testpmd.c | 3 +++ 1 file changed, 3 insertions(+)
app/test-pmd/testpmd.c +3 -0
@@ -927,6 +927,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 )
Signature · 1 line
2.15.1.gvfs.2.39.g03d366a
Hi Daniel,
Quoted 8 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Daniel Shelepov
Sent: Friday, May 4, 2018 9:12 PM
To: Lu, Wenzhuo <[email protected]>; Wu, Jingjing <[email protected]>
Cc: [email protected]; Daniel Shelepov <[email protected]>
Subject: [dpdk-dev] [PATCH] app/testpmd: fix burst stat reporting
Quoted 8 lines
When
RTE_TEST_PMD_RECORD_BURST_STATSis 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.
Could you add a fixes line.
Quoted 20 lines
Signed-off-by Daniel Shelepov <[email protected]>--- app/test-pmd/testpmd.c | 3 +++ 1 file changed, 3 insertions(+)app/test-pmd/testpmd.c index renamed from app/test-pmd/testpmd.c +0
-0
db23f23e5..cc38e51fc100644app/test-pmd/testpmd.c +3
-0@@ -927,6 +927,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; } }
Quoted 3 lines
if (
total_burst== 0)
--
2.15.1.gvfs.2.39.g03d366a
Regards,
Bernard
PATCH v2 1/1 app/testpmd: fix burst stat reporting
In reply to Daniel ShelepovWhen 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.
--- app/test-pmd/testpmd.c | 3 +++ 1 file changed, 3 insertions(+)
app/test-pmd/testpmd.c +3 -0
@@ -927,6 +927,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 )
Signature · 1 line
2.15.1.gvfs.2.39.g03d366a
Quoted 15 lines
-----Original Message-----
From: Daniel Shelepov [mailto:[email protected]]
Sent: Monday, May 14, 2018 10:12 PM
To: Lu, Wenzhuo <[email protected]>; Wu, Jingjing <[email protected]>; Iremonger, Bernard <[email protected]>
Cc: [email protected]; Daniel Shelepov <[email protected]>
Subject: [PATCH v2] app/testpmd: fix burst stat reportingWhen
RTE_TEST_PMD_RECORD_BURST_STATSis 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.
Quoted 6 lines
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")Signed-off-by Daniel Shelepov <[email protected]>
Thomas Monjalon
AppliedQuoted 6 lines
Quoted 6 lines
When
RTE_TEST_PMD_RECORD_BURST_STATSis 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.
Quoted 8 lines
Quoted 6 lines
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")Signed-off-by Daniel Shelepov <[email protected]>
Applied, thanks