From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Shelepov Subject: [PATCH v2] app/testpmd: fix burst stat reporting Date: Mon, 14 May 2018 21:12:15 +0000 Message-ID: <20180514211147.19784-1-dashel@microsoft.com> References: <20180504201209.2964-1-dashel@microsoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , Daniel Shelepov To: "wenzhuo.lu@intel.com" , "jingjing.wu@intel.com" , "bernard.iremonger@intel.com" Return-path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0126.outbound.protection.outlook.com [104.47.42.126]) by dpdk.org (Postfix) with ESMTP id 71CAF1CBF9 for ; Mon, 14 May 2018 23:12:18 +0200 (CEST) In-Reply-To: <20180504201209.2964-1-dashel@microsoft.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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") Signed-off-by: Daniel Shelepov --- app/test-pmd/testpmd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index db23f23e5..cc38e51fc 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -927,6 +927,9 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_b= urst_stats *pbs) pktnb_stats[1] =3D pktnb_stats[0]; burst_stats[0] =3D nb_burst; pktnb_stats[0] =3D nb_pkt; + } else if (nb_burst > burst_stats[1]) { + burst_stats[1] =3D nb_burst; + pktnb_stats[1] =3D nb_pkt; } } if (total_burst =3D=3D 0) --=20 2.15.1.gvfs.2.39.g03d366a