From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nqtONYEEPGHcyTrgj43RP/dRL4ZZR7IwxIr4dIMC+aA=; b=X1UfAHvL+5Jm6/hD7/IC3SZ8oGaB+pZ3Iu9x3cYIGsmFKbjuYydWH7ZrYGwbt6eQVYbDBWtLjnt+y5ON8LZaw9LW0UCzFKK/CO989AXENDVdi215i81ld6eiJwlaoG/YE1wXa57bS1dzfvH52amb5+L1MeqeEM57p7gLHXUtxOE= Received: from MW2PR2101MB1017.namprd21.prod.outlook.com (52.132.146.30) by MW2PR2101MB1131.namprd21.prod.outlook.com (52.132.146.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.797.3; Mon, 14 May 2018 21:12:15 +0000 Received: from MW2PR2101MB1017.namprd21.prod.outlook.com ([fe80::3d0b:204b:4c9:82ee]) by MW2PR2101MB1017.namprd21.prod.outlook.com ([fe80::3d0b:204b:4c9:82ee%5]) with mapi id 15.20.0797.003; Mon, 14 May 2018 21:12:15 +0000 From: Daniel Shelepov To: "wenzhuo.lu@intel.com" , "jingjing.wu@intel.com" , "bernard.iremonger@intel.com" CC: "dev@dpdk.org" , Daniel Shelepov Thread-Topic: [PATCH v2] app/testpmd: fix burst stat reporting Thread-Index: AQHT68g7X/vRojGmwUq+yfX3qJbu3g== Date: Mon, 14 May 2018 21:12:15 +0000 Message-ID: <20180514211147.19784-1-dashel@microsoft.com> References: <20180504201209.2964-1-dashel@microsoft.com> In-Reply-To: <20180504201209.2964-1-dashel@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CY4PR18CA0047.namprd18.prod.outlook.com (2603:10b6:903:9a::33) To MW2PR2101MB1017.namprd21.prod.outlook.com (2603:10b6:302:4::30) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2001:4898:80e8:c::485] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MW2PR2101MB1131; 7:YYe5CaDq2tlLMPY4Y98Xc/wLaylraciZwa17t6EXGU8LkLwzNcrHwsOYOvNU0APO5LTYVqhTuZ5zaCL7qQwal6TOuO8Sv1OGUWN1FH89yKKdiImZpBrLpUQJC6qylxQ48Kl0zU0qzw1w6fVDAeC+BixYaVev/qkeuBOzcULsXnh2jrrBEsDz/0TZvuv9iGpVPIe7Oo/jq8vXhUpfQdoHDtYM3DtGOMnnK8miqE+j6J2QJ02Agr8kpWewG2ppAmVf; 20:JgS8JOCbxB1gKuc4/eoeZfm8keC5iIEgUQxJQ2RcXzp6Uj3VmasQlAeJNQnkoMY+SfAJzyVLWTBhLCgyy4QD0ea7nKpBk6JdEnYTTRXYw8suVLwS0bUauecd9iNsH5FD3mujCfYCIpUHsjCxcad/emjIz9gAUfCYKrIMbpeunAg= x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7193020); SRVR:MW2PR2101MB1131; x-ms-traffictypediagnostic: MW2PR2101MB1131: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dashel@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(211171220733660); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(2018427008)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:MW2PR2101MB1131; BCL:0; PCL:0; RULEID:; SRVR:MW2PR2101MB1131; x-forefront-prvs: 067270ECAF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(39380400002)(396003)(39860400002)(376002)(346002)(189003)(199004)(1076002)(6116002)(2501003)(5250100002)(14454004)(2900100001)(6436002)(6486002)(68736007)(86362001)(2201001)(86612001)(97736004)(7736002)(10090500001)(8936002)(81166006)(81156014)(8676002)(4326008)(5660300001)(486006)(2906002)(36756003)(10290500003)(316002)(186003)(102836004)(22452003)(99286004)(76176011)(52116002)(3660700001)(59450400001)(6506007)(386003)(305945005)(3280700002)(53936002)(478600001)(46003)(105586002)(106356001)(11346002)(446003)(476003)(2616005)(107886003)(25786009)(54906003)(110136005)(6512007)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:MW2PR2101MB1131; H:MW2PR2101MB1017.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: zIFdAQmTzGu+c9Q9F4VcqTtpnIUko1euuk83dcJolc0EqhiaVZDLRJ5lzIOXfdiMb5PQj/efNi0knp+ONJCOSgIY64zBecvmeuuHuOOWSns1WrO99OWhndqBG8KXm2sPPs62P/4JbLzPpIsHgx/UGyLk8xLjTG/zUFW3mIKxzmUPaeem6nqp84ByLTiVQuVr spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 7348c33d-f056-4e70-33b3-08d5b9df5e3a X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7348c33d-f056-4e70-33b3-08d5b9df5e3a X-MS-Exchange-CrossTenant-originalarrivaltime: 14 May 2018 21:12:15.6634 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB1131 Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix burst stat reporting X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2018 21:12:19 -0000 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