From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 52DD1A0613 for ; Tue, 30 Jul 2019 13:41:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CD96F1C0CD; Tue, 30 Jul 2019 13:41:11 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10088.outbound.protection.outlook.com [40.107.1.88]) by dpdk.org (Postfix) with ESMTP id 573791C0C9 for ; Tue, 30 Jul 2019 13:41:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hSEAscLeVTiWD6POKi6cQGf6FVU4lsSoRzWQIedi0relYcanVcRljJqo3UFfFjEWENAp42ycfWmQB5IxX+MPwpgYluxlG8T7pqmBwlATNuoL9bZLmjiZ9AKTAWdxnUm76iJkw+Y3Qp8kHllWLRtKDv2LPleOiWOrmKAn4RqaXcHti3ydM8dvBqrZqr2BRqV38WnuZ8zcp8/g/xtxkL7IDi5/450g4WdcDDADseKEGp/AkN0apzQwg7YkbEUS0HByswX2oMYMeSH3MPnBfelv2eUvCwj4Ay9V84HHGP5suzBQZbTMeVJpMg0CYQp6E2jfnGOjXdpIAdCsgrCcWXtCyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CZdra6+sHoFHhEbF9E/2Oylb527/TC9caoIR6cMto/4=; b=S5MbqSqwy1ihyBNb5zIPnRN/rAARdBB4T596PCWopKm576M9uDMu9osiplSRVN1320taNommurMnPqS/haaw74TY1yLBBlWAR8WOEJHln8HaJCjXJGBHnabCc14rR1wm8QQasM8l4jCz5IJSC3fwd/Xf9YBZbqgOojoe9a3a8C3kHqgFHDnymahDZqnesz2LQPQFD5fO7LlRr4n6qdjh+S6IJ3W9SoC9us6BLqUSxp+24/VaFN+P+ilZxOh1NtslRody6uhr8M1k70bnJ24YHvl/FgC39Zq2ZZfnuzFKQKmiKAQy37zJIsiGueyOqjjF8X/FsnzUB4XOg68pksy9mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=mellanox.com;dmarc=pass action=none header.from=mellanox.com;dkim=pass header.d=mellanox.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CZdra6+sHoFHhEbF9E/2Oylb527/TC9caoIR6cMto/4=; b=DHu0uv+QJpMq6YQuAy9XlCRXFd4ChpXdF8FHvnskLKeGAGBs3nWGc111j6cjq8aVZkBjvtY9yRxViV5MFvOzWXEPlGV/sEo23BGW+Kc4Ha/xdCcC+Sovc+gPjd7WCnOFVHrLYixlkC9b2oPUX/HOq8GXoTIGQkOC7oYRaePOhrY= Received: from AM0PR05MB4435.eurprd05.prod.outlook.com (52.134.95.151) by AM0PR05MB4516.eurprd05.prod.outlook.com (52.133.57.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2115.15; Tue, 30 Jul 2019 11:41:08 +0000 Received: from AM0PR05MB4435.eurprd05.prod.outlook.com ([fe80::d4a1:f970:c1ae:a0e]) by AM0PR05MB4435.eurprd05.prod.outlook.com ([fe80::d4a1:f970:c1ae:a0e%7]) with mapi id 15.20.2115.005; Tue, 30 Jul 2019 11:41:08 +0000 From: Moti Haimovsky To: Matan Azrad , Wenzhuo Lu , Jingjing Wu CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 2/2] app/testpmd: add bits per second to statistics Thread-Index: AQHVRgpfbM3UhDj9oEueQeR1P4yAuqbjCvFw Date: Tue, 30 Jul 2019 11:41:07 +0000 Message-ID: References: <1564403817-13438-1-git-send-email-matan@mellanox.com> <1564403817-13438-2-git-send-email-matan@mellanox.com> In-Reply-To: <1564403817-13438-2-git-send-email-matan@mellanox.com> Accept-Language: he-IL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 415d77bd-a688-4da6-1795-08d714e2cffc x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM0PR05MB4516; x-ms-traffictypediagnostic: AM0PR05MB4516: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:148; x-forefront-prvs: 0114FF88F6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(376002)(346002)(366004)(39860400002)(396003)(13464003)(189003)(199004)(53546011)(71190400001)(6506007)(9686003)(71200400001)(81156014)(81166006)(14454004)(25786009)(110136005)(6436002)(102836004)(55016002)(8936002)(7736002)(76176011)(33656002)(478600001)(186003)(26005)(99286004)(229853002)(256004)(52536014)(6246003)(66446008)(66066001)(66556008)(66476007)(64756008)(5660300002)(7696005)(316002)(486006)(53936002)(305945005)(74316002)(86362001)(66946007)(446003)(11346002)(68736007)(3846002)(6116002)(76116006)(476003)(2906002)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB4516; H:AM0PR05MB4435.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 1YEynS2Y6kswHtAtrAPPmkFPB/Ek+FUR2HOGIc4XDX4O2oPwazCNBzKB9yalXzEBXc+SHXHR5eBKNRaDFwRHs4AKxfOwYkIy6wotm149RVDuyaGqvxk7/hCND8mwUNRm7j8g+JEkna+NRK2KUrKZLMpcouiEXhyi+7BPkYrKOINauACaRLUaT8OEpIkXmXM/CbUWYNvii3C0epsB3pGI55UhFAWw2XmfIw3+1t/eDhViOcUPe6Sz4w+YHhL1HuDH7G0+m6YIirjU+djAL2Sfjtt6jmyBrdg5ZI9EtoO3V8/Gk8/SQqLBL0a+GcrDgSsW2iZ78aHMwM9ue0ZeVim4RyiqNPaKob6qtnoEhkwBzx91dMhCp5c6YAaQJ1+q26gigYW1kh+/B3/qEpRAX4Sjy+m5qOw/RJpTj3CpzkD2Bf0= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 415d77bd-a688-4da6-1795-08d714e2cffc X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jul 2019 11:41:07.9954 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: motih@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4516 Subject: Re: [dpdk-dev] [PATCH 2/2] app/testpmd: add bits per second to statistics 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: dev On Behalf Of Matan Azrad > Sent: Monday, July 29, 2019 3:37 PM > To: Wenzhuo Lu ; Jingjing Wu > > Cc: dev@dpdk.org > Subject: [dpdk-dev] [PATCH 2/2] app/testpmd: add bits per second to > statistics >=20 > Traffic bps statistics is very useful for performance testing. >=20 > Add bits per second statistics for Rx and Tx. >=20 > Signed-off-by: Matan Azrad Acked-by: Moti Haimovsky > --- > app/test-pmd/config.c | 24 ++++++++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) >=20 > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index > 1a5a5c1..88bc716 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -119,9 +119,12 @@ > { > static uint64_t prev_pkts_rx[RTE_MAX_ETHPORTS]; > static uint64_t prev_pkts_tx[RTE_MAX_ETHPORTS]; > + static uint64_t prev_bytes_rx[RTE_MAX_ETHPORTS]; > + static uint64_t prev_bytes_tx[RTE_MAX_ETHPORTS]; > static uint64_t prev_cycles[RTE_MAX_ETHPORTS]; > - uint64_t diff_pkts_rx, diff_pkts_tx, diff_cycles; > - uint64_t mpps_rx, mpps_tx; > + uint64_t diff_pkts_rx, diff_pkts_tx, diff_bytes_rx, diff_bytes_tx, > + diff_cycles; > + uint64_t mpps_rx, mpps_tx, mbps_rx, mbps_tx; > struct rte_eth_stats stats; > struct rte_port *port =3D &ports[port_id]; > uint8_t i; > @@ -192,9 +195,22 @@ > diff_pkts_rx * rte_get_tsc_hz() / diff_cycles : 0; > mpps_tx =3D diff_cycles > 0 ? > diff_pkts_tx * rte_get_tsc_hz() / diff_cycles : 0; > + > + diff_bytes_rx =3D (stats.ibytes > prev_bytes_rx[port_id]) ? > + (stats.ibytes - prev_bytes_rx[port_id]) : 0; > + diff_bytes_tx =3D (stats.obytes > prev_bytes_tx[port_id]) ? > + (stats.obytes - prev_bytes_tx[port_id]) : 0; > + prev_bytes_rx[port_id] =3D stats.ibytes; > + prev_bytes_tx[port_id] =3D stats.obytes; > + mbps_rx =3D diff_cycles > 0 ? > + diff_bytes_rx * rte_get_tsc_hz() / diff_cycles : 0; > + mbps_tx =3D diff_cycles > 0 ? > + diff_bytes_tx * rte_get_tsc_hz() / diff_cycles : 0; > + > printf("\n Throughput (since last show)\n"); > - printf(" Rx-pps: %12"PRIu64"\n Tx-pps: %12"PRIu64"\n", > - mpps_rx, mpps_tx); > + printf(" Rx-pps: %12"PRIu64" Rx-bps: %12"PRIu64"\n Tx- > pps: %12" > + PRIu64" Tx-bps: %12"PRIu64"\n", mpps_rx, mbps_rx * 8, > + mpps_tx, mbps_tx * 8); >=20 > printf(" %s############################%s\n", > nic_stats_border, nic_stats_border); > -- > 1.8.3.1