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 3FBBFA04F1; Thu, 18 Jun 2020 21:29:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C0AB31BFFC; Thu, 18 Jun 2020 21:29:03 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60066.outbound.protection.outlook.com [40.107.6.66]) by dpdk.org (Postfix) with ESMTP id 1E2BB1BFF3; Thu, 18 Jun 2020 21:29:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zSa8dmBCxnFIcGXuqaZ0gvWbT2ERoLmbKJMrW5MkSEU=; b=EG3HH1C1eOzvT0hzFdURoy3CLT+rZyYqrtUC5n47431ulJVRBAFaqermh/aWvG5LAP7q1qr4PrtYriqW+bjpDAoxHvVu3I2bT8ix+Qn2C+QLS1vcX4oNJs7l7CTLzswnmA/Ro1MFsy14FuUTwVQIpMAGEAH59ebDiNaCnCJnSq4= Received: from AM7PR04CA0008.eurprd04.prod.outlook.com (2603:10a6:20b:110::18) by DB6PR08MB2936.eurprd08.prod.outlook.com (2603:10a6:6:25::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.19; Thu, 18 Jun 2020 19:29:00 +0000 Received: from VE1EUR03FT033.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::87) by AM7PR04CA0008.outlook.office365.com (2603:10a6:20b:110::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Thu, 18 Jun 2020 19:29:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT033.mail.protection.outlook.com (10.152.18.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Thu, 18 Jun 2020 19:28:59 +0000 Received: ("Tessian outbound b2c4593baa67:v59"); Thu, 18 Jun 2020 19:28:59 +0000 X-CR-MTA-TID: 64aa7808 Received: from 773661dd7b1c.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2BA68AB8-065A-4F3F-8880-B246AAB1A89A.1; Thu, 18 Jun 2020 19:28:54 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 773661dd7b1c.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 18 Jun 2020 19:28:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cLjJNXhE5ol4pkAdvhE7iAcXVNnmUwCf71Ji+2DxvKvSr9bwlbj9BKvg/DePk7rWEvXC4LyeWFu9gPrWXYHDJ6bf3RhLox038UaJwj7DJDB8+Uq/JQSuKTIdISrO6S4UcrmBhlc/AhZHqwkpYWrq8BMXUsAM0JmnREpFJT+1uFJh9VrJDegR1nZRowNKN5PjpbNdQeUNZ+s+YD3Ce8Gw21x0Cj1tewtBsuUBt8SKs/ccXcS+QZfazwcFMH0PEID/00lSOvm90HE2pVLJXBex9eOAzrbuc29ycbW8Koxv7KnZl10n7yO+UEQe5afIWDvo1tGIcMaD7lxg6ids3xikxA== 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=zSa8dmBCxnFIcGXuqaZ0gvWbT2ERoLmbKJMrW5MkSEU=; b=oFT9p+v6Dy3DQMjGSAJtCEBhhXPtrLZnbYXkQqapyvvMVtQ1S/0tNE0wvhVCLWHZGMU0KkfSpl8Cji+/RYQyglrh+vv4Fn1cqBZRjNV2dPzzeljiy46K/sU/wcz+nyuHoKL9ZY9ELkn/jxueDQVfN3Vuh1hUAE/gYkIV3yuVUWNI67MQAbjbs0IRWplGU4C0Oy644fLAoPinfh2p28Jx9QJH1CFUyyYSCtbH2NO4TKsQnTrK6s5Qe1WB2Vy7BQ6rGMZKjDDR1AR9hyuU4witRH9Ddfa0HGDpGvQFGCXlWF0h8eaPcdE8DdKDZwjFcfQ3TYQC6ilCQ0+/VYQeF0L2kA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zSa8dmBCxnFIcGXuqaZ0gvWbT2ERoLmbKJMrW5MkSEU=; b=EG3HH1C1eOzvT0hzFdURoy3CLT+rZyYqrtUC5n47431ulJVRBAFaqermh/aWvG5LAP7q1qr4PrtYriqW+bjpDAoxHvVu3I2bT8ix+Qn2C+QLS1vcX4oNJs7l7CTLzswnmA/Ro1MFsy14FuUTwVQIpMAGEAH59ebDiNaCnCJnSq4= Received: from DB6PR0802MB2216.eurprd08.prod.outlook.com (2603:10a6:4:85::9) by DB6PR0802MB2517.eurprd08.prod.outlook.com (2603:10a6:4:a1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Thu, 18 Jun 2020 19:28:52 +0000 Received: from DB6PR0802MB2216.eurprd08.prod.outlook.com ([fe80::1128:b7e7:e832:310f]) by DB6PR0802MB2216.eurprd08.prod.outlook.com ([fe80::1128:b7e7:e832:310f%9]) with mapi id 15.20.3109.021; Thu, 18 Jun 2020 19:28:52 +0000 From: Honnappa Nagarahalli To: Phil Yang , "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , "maxime.coquelin@redhat.com" , Ruifeng Wang , nd , "stable@dpdk.org" , "david.marchand@redhat.com" , Honnappa Nagarahalli , nd Thread-Topic: [PATCH] app/testpmd: fix CPU cycles per pkt stats on transmit modes Thread-Index: AQHWRX/NQcYGqBWAw0yuPJuxbzMff6jewcBA Date: Thu, 18 Jun 2020 19:28:52 +0000 Message-ID: References: <1592491803-21173-1-git-send-email-phil.yang@arm.com> In-Reply-To: <1592491803-21173-1-git-send-email-phil.yang@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 1dd7c7de-0db0-48ae-be16-68911a03598a.0 x-checkrecipientchecked: true Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [70.113.25.165] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ca7fec2a-f6e5-418a-d25b-08d813bdd9ed x-ms-traffictypediagnostic: DB6PR0802MB2517:|DB6PR08MB2936: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:569;OLM:569; x-forefront-prvs: 0438F90F17 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: GJcriZml0QWWVMIwIms/nQlUkf6XxUaodfB2DaGJ1RISQfA7+07iYZXkr51uGisXKUAnf/YxnZJ2yKb11LaNoSoxotzAlIMrlic7IpqHCnOZ/x+zTqjYZ8ks+b/+MvHjRPyQmMLfWJw4L3OhxBgxPxGCRD4Vvdr4cdxjnoh5OFK5NARmV5+PsTGa14C6LQWFerUpaylJea7S/kiloU3Sz35XOKySm52H00Q+cWOZEOmdXv4MMSTdLimzZwjoBSlplRvASeL9wN0O0fX50LaO/CZu4rXqESEGlHIkYkhF2rr5Asj1V9KEEuAnkeGpEgtx X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0802MB2216.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(346002)(366004)(376002)(39860400002)(396003)(186003)(26005)(8676002)(316002)(6506007)(2906002)(54906003)(478600001)(71200400001)(52536014)(33656002)(5660300002)(7696005)(66446008)(4326008)(110136005)(66946007)(76116006)(83380400001)(66476007)(66556008)(64756008)(9686003)(55016002)(8936002)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 59hln4Xyq+/3qJ9qK8usR3H+tXatj8wT0lPKJbII9y+51TrdOOgKAlm/PAQvcXw9jbbighx9WuukuvGMNwZv2W09pNSY6Q9nNYdhAk+4G6zg3rbSD92dwxe//aaNYmbCHkz1nlzunBKgpShJnZebSt/n8UbGmsDd5IO5WAqfa1a4KFUdVMO4zQOIcARAVeQDjzMp/MrH3AeZ6ZLVN0eSD7L6bmkMFP8m+YKXKE4zs0wsfjglp0e1y/TZ+PPv5iAMSKuZwKy399ieHshiUYNCSt5C+/b/l41D1ttYXnLV5L6+c8i/1uYO85ME5lY4++Ztimznz56Bm8HN1l31IZdZDkkxZKM0F3ijicgji2WZ+NnSnqPV43lcVvMykbBbn/UwZmv4gK2AI6ulpwYzraFoFOxqNe1yW3Eq6D6t0GhC9hbUAUd2auJ42l3CjfDtry3+sSGjPSqyUwWnjU6rxrPJ+kQUXGt2wT/8VoRUfLJM0a2nC4KhmhgsQcXIxeITbQ/a Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2517 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT033.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:; SFS:(4636009)(376002)(136003)(346002)(396003)(39860400002)(46966005)(55016002)(9686003)(83380400001)(82740400003)(70586007)(47076004)(81166007)(70206006)(52536014)(33656002)(2906002)(82310400002)(356005)(54906003)(450100002)(5660300002)(7696005)(86362001)(316002)(36906005)(6506007)(478600001)(8936002)(26005)(110136005)(186003)(4326008)(8676002)(336012); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 18cb49d6-4670-4b21-e132-08d813bdd586 X-Forefront-PRVS: 0438F90F17 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DgD2JgQ/hi1EebwpODv7Q2ZX2Go+9ua4kLUZv5L0djisrCnX0QKoKrTxqgGQAjarrgxAOZzgHK6cLUE8QzYgZFMgB4p5F83KVKZJp7jh99Tq0CaA5b0EEl9fk0CFcuWhm/Zogmm9rHQMY/6BtyCXGbjZ7kqqxL36zZGGVzitzyISyak6s4DPWukr3ihTZemaAcrc2xp0gRWLYlNJIsjD8DuVSks/Q3TSbhh2xdG3EWpClSNDrDP4rvHlBO9McH/1I6aXw5qSHm+g/5vsg2+gWlHPMrpDeEem5zEy+ynfamHMq9vFT1FRmZW+V4AaAvvpMCUnr1t4S5anzMd9trSakPHIaQxBSP45KsyltLIvZ3VXrYHGUbTwAzjzYoa2bTiiIKlj1a3cfpTpVSzwlxNIOw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2020 19:28:59.7354 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca7fec2a-f6e5-418a-d25b-08d813bdd9ed X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2936 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix CPU cycles per pkt stats on transmit modes 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" > Subject: [PATCH] app/testpmd: fix CPU cycles per pkt stats on transmit mo= des >=20 > In txonly and flowgen forwarding mode, calculating CPU per packets with t= otal > received packets is not accurate. Use total transmitted packets for these= cases. >=20 > The error output under txonly mode: > testpmd> show fwd stats all >=20 > ---------------------- Forward statistics for port 0 ------------------- > RX-packets: 0 RX-dropped: 0 RX-total: 0 > TX-packets: 3582891927 TX-dropped: 401965824 TX-total: 3984857751 > TX-bursts : 86381636 [0% of 0 pkts + 85% of 64 pkts + 15% of 32 pkts] > ------------------------------------------------------------------------- >=20 > ---------------------- Forward statistics for port 1 ------------------- > RX-packets: 1 RX-dropped: 394351696 RX-total: 394351697 > TX-packets: 3582890632 TX-dropped: 401965568 TX-total: 3984856200 > TX-bursts : 86381679 [0% of 0 pkts + 85% of 64 pkts + 15% of 32 pkts] > ------------------------------------------------------------------------- >=20 > +++++++++++++++ Accumulated forward statistics for all > +++++++++++++++ ports+++++++++++++ > RX-packets: 1 RX-dropped: 394351696 RX-total: 394351697 > TX-packets: 7165782559 TX-dropped: 803931392 TX-total: 7969713951 > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++ >=20 > CPU cycles/packet=3D54984156291.00 \ > (total cycles=3D54984156291 / total RX packets=3D1) at 200 MHz Clock >=20 > Signed-off-by: Phil Yang > Reviewed-by: Ruifeng Wang > Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on > demand") > Cc: stable@dpdk.org > Cc: david.marchand@redhat.com > --- > app/test-pmd/testpmd.c | 24 +++++++++++++++++------- > 1 file changed, 17 insertions(+), 7 deletions(-) >=20 > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > 4989d22..798b8e0 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -1961,13 +1961,23 @@ fwd_stats_display(void) > acc_stats_border, acc_stats_border); #ifdef > RTE_TEST_PMD_RECORD_CORE_CYCLES #define CYC_PER_MHZ 1E6 > - if (total_recv > 0) > - printf("\n CPU cycles/packet=3D%.2F (total cycles=3D" > - "%"PRIu64" / total RX packets=3D%"PRIu64") at %"PRIu64 > - " MHz Clock\n", > - (double) fwd_cycles / total_recv, > - fwd_cycles, total_recv, > - (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ)); > + if (total_recv > 0 || total_xmit > 0) { > + if (strcmp(cur_fwd_eng->fwd_mode_name, "txonly") =3D=3D 0 || > + strcmp(cur_fwd_eng->fwd_mode_name, "flowgen") =3D=3D 0) > + printf("\n CPU cycles/packet=3D%.2F (total cycles=3D" > + "%"PRIu64" / total %s packets=3D%"PRIu64") at %" > + PRIu64" MHz Clock\n", > + (double) fwd_cycles / total_xmit, > + fwd_cycles, cur_fwd_eng->fwd_mode_name, > total_xmit, > + (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ)); > + else > + printf("\n CPU cycles/packet=3D%.2F (total cycles=3D" > + "%"PRIu64" / total %s packets=3D%"PRIu64") at %" > + PRIu64" MHz Clock\n", > + (double) fwd_cycles / total_recv, > + fwd_cycles, cur_fwd_eng->fwd_mode_name, > total_recv, > + (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ)); > + } nit. Only difference between the two 'printf' calls are total_recv vs total= _xmit. Can be consolidated into a single printf. > #endif > } >=20 > -- > 2.7.4