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 41E00A0350; Mon, 22 Jun 2020 10:48:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 34FE31D166; Mon, 22 Jun 2020 10:48:39 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10062.outbound.protection.outlook.com [40.107.1.62]) by dpdk.org (Postfix) with ESMTP id 7B59D1C1B7; Mon, 22 Jun 2020 10:48:37 +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=7+AXxIjv63RLBHZKpD9nOSldIlpp/RPnUJ4cFYQ+oo4=; b=3pB2igdw76zHqMI5rsID/ZaelcNOsMtM8OdNjm7WvRmj4BdmrFp1HhHR4dTerprTgn50/CUgwBMk/n7dmeLCnfItOaOdmlRTZjAz638kNdo/ZjZOyP8OuntWY3NGTnWCvQqlS7S4O+gP3/f72ENR+qii9LtNIHkAU7xxYcv2h0U= Received: from DB6PR07CA0017.eurprd07.prod.outlook.com (2603:10a6:6:2d::27) by AM5PR0801MB1761.eurprd08.prod.outlook.com (2603:10a6:203:3a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Mon, 22 Jun 2020 08:48:36 +0000 Received: from DB5EUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2d:cafe::cc) by DB6PR07CA0017.outlook.office365.com (2603:10a6:6:2d::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.12 via Frontend Transport; Mon, 22 Jun 2020 08:48:36 +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 DB5EUR03FT010.mail.protection.outlook.com (10.152.20.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Mon, 22 Jun 2020 08:48:36 +0000 Received: ("Tessian outbound da41658aa5d4:v59"); Mon, 22 Jun 2020 08:48:35 +0000 X-CR-MTA-TID: 64aa7808 Received: from faf0b6026aa1.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8E2D000D-080D-4BFD-9292-9490C6E57C45.1; Mon, 22 Jun 2020 08:48:30 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id faf0b6026aa1.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 22 Jun 2020 08:48:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G3MqxEsGZZ/JUOcqe5l6cEwCBgoJnBgd0O0fCzxMOM1w5Gu7V9ALQ3WxfxfKt9+4SMBsAaJqWeP47K8xjEJ397n3sQYLUIsfvAT2a5UTeAHF9SMY18xWEnMHsgK/m/Tu2xHI5mFXSWaM6a+/4iY3TdYVdXNGl81rCSTdmYX0gCNPu1cYo7ln543VKx06/8bwbpZ3geAOkNnmXeaOEFsAhbMCCuZJHupoKu31GCGhHeilV11QMorzgZqZNLu9B1J/vfJAxnRyAFySoQSoaGTy1ktxiruCkvWoQoXzyRa0oxk0f1x5L81bgQ3VCu6GzWSQ5p1HNPAA7QlnGjQOElTkvw== 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=7+AXxIjv63RLBHZKpD9nOSldIlpp/RPnUJ4cFYQ+oo4=; b=nl5PmruvTjsKQ52vA6srqTDL0GC+uNAnqlaDJ/ecYk+AL/QoK7d+9VXb4VNkhMNr7h1TUtglSGnZpqBz5lI1IKVcM70ymg1t2vsDs3ZlQ/dPjYfqcZ4DVcn2INkgnotv/jBsvCLwjOFh+Y22cbAjPCNOYjUw2oAt0taQyP4YOymvXNJfM4WiWL+ClDDyC+JpsicQ7RgwD20O2VH/2jga4nClZbF2BVfwieaLTYj+AisXJmVv3jFnQTbM5l4SRjHIRV73iUvNr0AiUYuUq3ellaw6CMw5N/k4zvE2O0yl9BxzbeWnOrCXnjyyIMiVRh2VdyTJmrrotX9r7pjyax5iAg== 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=7+AXxIjv63RLBHZKpD9nOSldIlpp/RPnUJ4cFYQ+oo4=; b=3pB2igdw76zHqMI5rsID/ZaelcNOsMtM8OdNjm7WvRmj4BdmrFp1HhHR4dTerprTgn50/CUgwBMk/n7dmeLCnfItOaOdmlRTZjAz638kNdo/ZjZOyP8OuntWY3NGTnWCvQqlS7S4O+gP3/f72ENR+qii9LtNIHkAU7xxYcv2h0U= Received: from VE1PR08MB4640.eurprd08.prod.outlook.com (2603:10a6:802:b2::11) by VE1PR08MB5198.eurprd08.prod.outlook.com (2603:10a6:803:10d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Mon, 22 Jun 2020 08:48:28 +0000 Received: from VE1PR08MB4640.eurprd08.prod.outlook.com ([fe80::c2e:9ccb:a690:6863]) by VE1PR08MB4640.eurprd08.prod.outlook.com ([fe80::c2e:9ccb:a690:6863%6]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 08:48:28 +0000 From: Phil Yang To: Honnappa Nagarahalli , "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , "maxime.coquelin@redhat.com" , Ruifeng Wang , nd , "stable@dpdk.org" , "david.marchand@redhat.com" , nd Thread-Topic: [PATCH v2] app/testpmd: fix CPU cycles per pkt stats on transmit modes Thread-Index: AQHWSEbPf7mYcuDfbEaBBv4PRyGgl6jkUrzA Date: Mon, 22 Jun 2020 08:48:28 +0000 Message-ID: References: <1592491803-21173-1-git-send-email-phil.yang@arm.com> <1592539681-3855-1-git-send-email-phil.yang@arm.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 78c0b52d-01e2-4c37-8229-c8dca2203877.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: [203.126.0.112] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a6f3899b-8f89-4d72-8283-08d816890d2b x-ms-traffictypediagnostic: VE1PR08MB5198:|AM5PR0801MB1761: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:3968;OLM:3968; x-forefront-prvs: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: LN8i95qbgi8zYSs9jSqt8vhs7LNL3bTMVPqeHusxcW/wyh6XLdBXo6ivTrP/up8slkt1888mTMZiy+obF0nb7mRsNw/dNpSA0hHyOwRRawBIKbhMypP9lXP5ppyIfqzpT5kBLQzAh1M3ANXs+BNM4mL+v2xz41CkFAfF4NMHQy9sAqFIN/HQGefVBI2HH9oNG2pwi0KlmDw5HyyboK6qOMGbEKZT7582m3vobvmddbZmNVnGRWvVXX7XGFvzF/oIrHBPuXIm12KuPL1iIdwqAZzh5dHU6b2h3usLozuKag0/d+9MG2XCWVb5FFVnqX/B X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB4640.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(346002)(376002)(396003)(136003)(366004)(4326008)(66946007)(52536014)(7696005)(76116006)(66556008)(64756008)(66476007)(316002)(54906003)(86362001)(110136005)(66446008)(6506007)(8676002)(8936002)(478600001)(5660300002)(55016002)(9686003)(71200400001)(33656002)(186003)(26005)(2906002)(53546011)(83380400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: AJQEcnUkrHHzmTElKwiX9StOt68EoGXwrYEkbm7BJ6ki1FpRQSUg29+F75kFqZ4/Qns5Oo3v41Szs6bQ1zoVtH2QwwtYPBKB/IxKOGhOAZ1ACmS64g0O6i4TJkCByE93E8DtKCOhx1WMEsOyCKNrwlLWVDgZysh71Qhebn8OUQIqjFgkLSxbHm5itrpsKOXzxN+A0vvOQgByIonjKOthHODGNl2eku2IEd4o8pG/rR7yVnUA5L2JhAMWbbQLI+hVBlxy/dbTgfPJziK9EUA8ZQC6VTCc2uxaIt8XfVT56PNYYUIIdKtyKVUr+ye9LQCBlueyvCP/qo1z9jo5S80ClQg6qJxs8+QTvyg6Q+IgStCmhnzt+ERwxmkcjequCEA7Sg2Vf3nciUPs9OKM5ytFH+ov5ELXTJZ/xbJeBppVuQMMNq0Wse+z5dgiFUjj1EG0a/9b//ghe4THE/bsbeg3XjFmvw2jAi2u/WmL8yiAvzk= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5198 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: DB5EUR03FT010.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)(33656002)(356005)(82310400002)(26005)(53546011)(6506007)(8676002)(7696005)(316002)(70586007)(4326008)(336012)(478600001)(82740400003)(70206006)(86362001)(5660300002)(450100002)(47076004)(54906003)(55016002)(110136005)(81166007)(8936002)(186003)(83380400001)(9686003)(2906002)(52536014); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: c1dc07f1-c453-4cc2-8c06-08d8168908ef X-Forefront-PRVS: 0442E569BC X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /BWszOhF5YeTaFp8Er6Lqt+EKYb/LnXZxo4SibHLw0FCnka7nHgzikfo5Hb5oIvenfVDxkziDBllYq+bdyxywcNDa1u2WJ/XKPFpmtvs2v5XH4qephsGqHLqTIUXrhYQrzZ7fXlD7ngEe86HOON8Pj21YlP0qjgCqgh9VfKGE6nzewG4xH71wiub0jZDTvbChkmfcBnhnVsuRg668pO/odMMamS84WeTi+SGW4mwDHRhHs1+GC9a4JhGAyMJDQIbMd9gjgo1GpSBAVtJhNZLMAWBOQSTIshxheZHHXzJKNtKMOwSFSNh4thDIV0NfxtR4ciL05RMRGazFGjQeDaQ4WhF8rQYWh+d838QBHwoCm07eu1rZ25GDM36b9gkWhCXJIWPTpdcMCDjqnxIBfeH/A== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 08:48:36.0041 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6f3899b-8f89-4d72-8283-08d816890d2b 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: AM5PR0801MB1761 Subject: Re: [dpdk-dev] [PATCH v2] 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" > -----Original Message----- > From: Honnappa Nagarahalli > Sent: Monday, June 22, 2020 11:40 AM > 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 > Subject: RE: [PATCH v2] app/testpmd: fix CPU cycles per pkt stats on tran= smit > modes >=20 > >=20 > > Subject: [PATCH v2] app/testpmd: fix CPU cycles per pkt stats on transm= it > > modes > > > > In txonly and flowgen forwarding mode, calculating CPU per packets with > > total received packets is not accurate. Use total transmitted packets f= or > > these cases. > > > > The error output under txonly mode: > > testpmd> show fwd stats all > > > > ---------------------- Forward statistics for port 0 -----------------= -- > > RX-packets: 0 RX-dropped: 0 RX-total: 0 > > TX-packets: 3582891927 TX-dropped: 401965824 TX-total: 39848577= 51 > > TX-bursts : 86381636 [0% of 0 pkts + 85% of 64 pkts + 15% of 32 pkts] > > -----------------------------------------------------------------------= -- > > > > ---------------------- Forward statistics for port 1 -----------------= -- > > RX-packets: 1 RX-dropped: 394351696 RX-total: 39435169= 7 > > TX-packets: 3582890632 TX-dropped: 401965568 TX-total: 39848562= 00 > > TX-bursts : 86381679 [0% of 0 pkts + 85% of 64 pkts + 15% of 32 pkts] > > -----------------------------------------------------------------------= -- > > > > +++++++++++++++ Accumulated forward statistics for all > > +++++++++++++++ ports+++++++++++++ > > RX-packets: 1 RX-dropped: 394351696 RX-total: 39435169= 7 > > TX-packets: 7165782559 TX-dropped: 803931392 TX-total: 79697139= 51 > > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++ > > ++++++++++ > > > > CPU cycles/packet=3D54984156291.00 \ > > (total cycles=3D54984156291 / total RX packets=3D1) at 200 MHz Clock > > > > 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 > > --- > > v2: > > Consolidate the output into a single printf. (Honnappa Nagarahalli) > > > > app/test-pmd/testpmd.c | 21 +++++++++++++++------ > > 1 file changed, 15 insertions(+), 6 deletions(-) > > > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > > 4989d22..826d7dd 100644 > > --- a/app/test-pmd/testpmd.c > > +++ b/app/test-pmd/testpmd.c > > @@ -1961,13 +1961,22 @@ 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) > > + if (total_recv > 0 || total_xmit > 0) { > > + uint8_t ingress; > > + if (strcmp(cur_fwd_eng->fwd_mode_name, "txonly") =3D=3D 0 > || > > + strcmp(cur_fwd_eng->fwd_mode_name, "flowgen") =3D=3D 0) > > + ingress =3D 0; > This can be 'total_pkts =3D total_recv' >=20 > > + else > > + ingress =3D 1; > This can be 'total_pkts =3D total_xmit' Agree. Much better. Updated in V3. Thanks, Phil >=20 > > + > > 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)); > > + "%"PRIu64" / total %s packets=3D%"PRIu64") at %" > > + PRIu64" MHz Clock\n", ((double) fwd_cycles / > > + (ingress ? total_recv : total_xmit)), > Can be just 'total_pkts'. >=20 > > + fwd_cycles, cur_fwd_eng->fwd_mode_name, > > + (ingress ? total_recv : total_xmit), > Can be just 'total_pkts'. >=20 > > + (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ)); > > + } > > #endif > > } > Otherwise, > Reviewed-by: Honnappa Nagarahalli >=20 > > > > -- > > 2.7.4