From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0102.outbound.protection.outlook.com [104.47.38.102]) by dpdk.org (Postfix) with ESMTP id 935B52952 for ; Fri, 4 May 2018 22:12:21 +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; bh=4MgilUM1+xvP3laGeWCAtgd6DY59BTUD8AnL1RCmzPQ=; b=Uwg00p+yKtqDNiKyEGknq+a+vAvB1T5Cwx5UmPP/BbN16OJpJpYJ0Ov+e5hnKupq0WtD4JBFH5Ex2YsAmk00nlZvChJZ7jPySYw02EfEngiL9IYF52j0cP8uKLc+MSMN9VDvQMsRALeO2nnuPMcYr/cZ0i2sR6yL5blahr9aZDU= Received: from MW2PR2101MB1017.namprd21.prod.outlook.com (52.132.146.30) by MW2PR2101MB1098.namprd21.prod.outlook.com (52.132.149.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.755.0; Fri, 4 May 2018 20:12:19 +0000 Received: from MW2PR2101MB1017.namprd21.prod.outlook.com ([fe80::3d0b:204b:4c9:82ee]) by MW2PR2101MB1017.namprd21.prod.outlook.com ([fe80::3d0b:204b:4c9:82ee%4]) with mapi id 15.20.0755.014; Fri, 4 May 2018 20:12:19 +0000 From: Daniel Shelepov To: "wenzhuo.lu@intel.com" , "jingjing.wu@intel.com" CC: "dev@dpdk.org" , Daniel Shelepov Thread-Topic: [PATCH] app/testpmd: fix burst stat reporting Thread-Index: AQHT4+Q0gG+VksHpkUmIkIqcG/aK5A== Date: Fri, 4 May 2018 20:12:19 +0000 Message-ID: <20180504201209.2964-1-dashel@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CY4PR19CA0027.namprd19.prod.outlook.com (2603:10b6:903:103::13) To MW2PR2101MB1017.namprd21.prod.outlook.com (2603:10b6:302:4::30) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2001:4898:80e8:f::416] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MW2PR2101MB1098; 7:ZH+23LQlTLtnccVep3g3NgXNvIOqybN4svJRexYN/NU9rjinwFz/LQ0eb4QQni/UDHKmsY49UTvGAyiZZq9Rg+1kA96XSkbI/qZ8E9cLOYi3b+UXPzIWk94ceBi9hN2TjjugmKhQo5vBaywnAxvyk+/ppVfFXklgiP16eRz0TEfazACaKz/ImUJoKAoEb4NNcpK9VuGk9ZRfFYB5YYH8/g076Y149nvFJoP8vguDSeg9Io7xXAL2mju7Inzx7Z2c; 20:HW6qHGIm3DjY8Fyl4SCOOEAoQ+jHMOsuPUjNso/0S7Vh3pglYysX15Bi91aqn70/Dt99d+O7Dwi4t6RyfqpEMrUHEdB91JOm9TcDzMWD+LcafRnAC2oaoxZUnc9O2YgbcJZTV8CnufZ7qiylAb1mfF7rSUW6hZSVT5dp8qyf504= x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(48565401081)(2017052603328)(7193020); SRVR:MW2PR2101MB1098; x-ms-traffictypediagnostic: MW2PR2101MB1098: 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)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231254)(2018427008)(944501410)(52105095)(10201501046)(6055026)(149012)(150012)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:MW2PR2101MB1098; BCL:0; PCL:0; RULEID:; SRVR:MW2PR2101MB1098; x-forefront-prvs: 06628F7CA4 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39380400002)(396003)(39860400002)(366004)(376002)(199004)(189003)(305945005)(7736002)(53936002)(105586002)(22452003)(14454004)(10090500001)(186003)(386003)(59450400001)(6346003)(316002)(102836004)(6512007)(54906003)(6506007)(110136005)(5660300001)(2501003)(3280700002)(81166006)(6486002)(86362001)(81156014)(2906002)(1857600001)(5250100002)(8936002)(6116002)(476003)(86612001)(1076002)(46003)(486006)(68736007)(2616005)(8676002)(2900100001)(6436002)(52116002)(3660700001)(97736004)(10290500003)(478600001)(106356001)(25786009)(107886003)(99286004)(4326008)(36756003)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:MW2PR2101MB1098; H:MW2PR2101MB1017.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=dashel@microsoft.com; x-microsoft-antispam-message-info: JygqKVYcG1iQCRatgiP7a8YLVjVYpvURTet4qe8XZt+gg2ztpb0nnYpQwk3CG1asrjsbI0uCOWYbxAaC1pYD+Wzip6hEwwumfEXJhKgPKyU7bE4ZlB88VDX9vaFYEoLwQ2WSEvkIVIfHytNqfGiBVSdhjSnELdqGkmKrA04k4JBZjLou9jnLulKzaIqpH3Zq 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: 81a0ca54-664c-4713-0b4f-08d5b1fb5690 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81a0ca54-664c-4713-0b4f-08d5b1fb5690 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 May 2018 20:12:19.2794 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB1098 Subject: [dpdk-dev] [PATCH] 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: Fri, 04 May 2018 20:12:22 -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. 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