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 4E410A0350; Mon, 22 Jun 2020 05:40:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F11202C27; Mon, 22 Jun 2020 05:40:05 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70057.outbound.protection.outlook.com [40.107.7.57]) by dpdk.org (Postfix) with ESMTP id A0FDE2BEA; Mon, 22 Jun 2020 05:40:03 +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=U0rW79dgDweAgSr63RMPgaJBbfKN44EStQIeJLkn/ck=; b=dnUKJsmiJKqJ9HdBbaKLj+pCJtgxLRDvFYwIBLJam4j+qkqUxTJ3BhaJh3N22jS2gj8EjlHkOCJU62OHKh0MBPPj2VWVzKO5E7ytRChZh9hM5gwz4zUhtfbKar00tcK3efGD5wDCmJ+QJDtYwAboEPi+mepm/FiIPtw6e+puuvk= Received: from AM6PR04CA0062.eurprd04.prod.outlook.com (2603:10a6:20b:f0::39) by AM6PR08MB4389.eurprd08.prod.outlook.com (2603:10a6:20b:bc::16) 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 03:40:01 +0000 Received: from AM5EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:f0:cafe::6d) by AM6PR04CA0062.outlook.office365.com (2603:10a6:20b:f0::39) 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 03:40:01 +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 AM5EUR03FT006.mail.protection.outlook.com (10.152.16.122) 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 03:40:01 +0000 Received: ("Tessian outbound 839770a6d413:v59"); Mon, 22 Jun 2020 03:40:01 +0000 X-CR-MTA-TID: 64aa7808 Received: from 436f2e292817.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 685CA4B7-D49C-4199-8845-A9ED7F6B52A8.1; Mon, 22 Jun 2020 03:39:56 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 436f2e292817.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 22 Jun 2020 03:39:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cVmHBDJ3mN6sl5bJdVdd5INmv4E0rp6SmPvdSiMDPGq2SkF08K8UNud8Re6jrmxCg0Jnkcp4bosiydhXKV1Pe4wKObwXKwaPRFh7cZjwh2XkQ4g70IBupCjNzSfKR6r8gPxs3hmQMNvl+m5bHn75CiEcAYmqGWrozq0uanMsMYnaagtDmQul/YOyleTreuSuS53WjQzq8arr179EOZzlJf0JKD0BNie3UQzERkOj5Wa0hQaso6sV3aPvbFqekNiWm3eY23QSsL3/tMnJdbp/glOUasaEwbbpnSZW1v2mVGb5gyq3nW+DBtioN6+IWw8mypXhVbZB0J143YG2Th/HEw== 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=U0rW79dgDweAgSr63RMPgaJBbfKN44EStQIeJLkn/ck=; b=GInExmRRDcJKsGCbOU+0WSE/zfymvBpU+osaB4M0u0WkXfaKbImfQRl+5HI+IIVW3bFGnQjQpaz5+ZybDuBi1v8AmV8KC3r+5ENpz7EQMfOu0mhY2R468E3clzMPeIuyN4swXhlJ0Tm9W0q+Jb+oEvZ0bXKVfY5RiJmeIoZGwNMQbt6d3FtQT/MEtCMpMHPHe4Ntknf4vz9JWtax9mjGxzQZXu0e3dMm97qNy9FqarJ38+5FktPXLqccArjQe1ina16HEh9mqqsL2DeFgWlBXYP0gP1LqLXKpOnv6mx73JvaI27BEOA24/r120XyBKiYn+QSHIPlVv4U4uqp9pY3QQ== 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=U0rW79dgDweAgSr63RMPgaJBbfKN44EStQIeJLkn/ck=; b=dnUKJsmiJKqJ9HdBbaKLj+pCJtgxLRDvFYwIBLJam4j+qkqUxTJ3BhaJh3N22jS2gj8EjlHkOCJU62OHKh0MBPPj2VWVzKO5E7ytRChZh9hM5gwz4zUhtfbKar00tcK3efGD5wDCmJ+QJDtYwAboEPi+mepm/FiIPtw6e+puuvk= Received: from DB6PR0802MB2216.eurprd08.prod.outlook.com (2603:10a6:4:85::9) by DB6PR0802MB2518.eurprd08.prod.outlook.com (2603:10a6:4:94::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.24; Mon, 22 Jun 2020 03:39:53 +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.027; Mon, 22 Jun 2020 03:39:53 +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 v2] app/testpmd: fix CPU cycles per pkt stats on transmit modes Thread-Index: AQHWRe9kvYI80bQEek2jMN4R5VMIW6jj/bDg Date: Mon, 22 Jun 2020 03:39:53 +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: <1592539681-3855-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: f9c851cb-60ef-4601-ba4d-2ed67f35ebcb.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: [217.140.111.135] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d2df41b2-64b2-4be8-508f-08d8165df1a9 x-ms-traffictypediagnostic: DB6PR0802MB2518:|AM6PR08MB4389: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:6430;OLM:6430; x-forefront-prvs: 0442E569BC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: BCS4Bw61nRB8fllvUvICyhokrQEtxprjZ9BEy/C7ufo20aYaEqs2pzFVxXX5BWQ6XNQfNzDsa4iuMlTEj5wiCkEdzoCpiq2GcjN9uXtmEDdMVqoh49E3ekW3w4LnxgPOx4z+M2mG3K49E9O1ZWDra6jRPRUHSk5B6yxwkDAfmfwuVsL5Qy1s3Vpg15HxFFKyV956Twd8diyPGyfoTaNRQ7X7e7F20NyNNq3vGB3glUpY98mEt4jbd+dEoNA9syKGiK8Hbgv14FHMtjOSwatLFnLYFquV0SXWS3JmYr+UK0um13wLM2q6aVPUk0PF0MEs 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)(366004)(376002)(346002)(136003)(396003)(39850400004)(110136005)(54906003)(55016002)(76116006)(7696005)(6506007)(66476007)(66556008)(64756008)(66446008)(66946007)(86362001)(71200400001)(52536014)(8936002)(83380400001)(5660300002)(8676002)(186003)(26005)(478600001)(2906002)(4326008)(9686003)(316002)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: unihFQXIBBBfmleyGyrtk1VjuilDN5BXziHa0pXxrwOcRn0skAiJIqDSBdXrOPbynFQqS4J4FkWR3KA5KRXDQ1s7+cjdCDCC5Du2B3JtpOo6/ZQGpPER0E4WX0+YYFzOUQ0INOhvDJVsVGDP3twT47WF/NRilc1Ar7N4hS7EATgfmTo6lPoH0hUNtPnnCDEIFYaWZF5Gb8PYxI3/2VHExNoUtEEWgbhrCpIVzHJLR/g9m9VjfPZfAutislXXca09t964UgkK9oepzLJGjo1KQkgWB9AfUyhDlVKQ9JlRw83egFU5Kr1rvARhXJ8OzQujLfr86xjzpZtk6DxjDyMYNa0UibDlR+YVaPgLTlkJsrQDsxEh3Ps93HHo8MWFA3DXNYbVWyjzuMMmhuNQ4YrKG3zdIrGDmgpvAYb/rB8jBhpuNJfKQO3BGlAjfcQkET4TlmzcR/oWQ0SR0H7o67ScXEIct0mMExi2Lzf5qq+JC4Stc9jEYx/D0N4nBTcdCwVw Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2518 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: AM5EUR03FT006.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)(346002)(39850400004)(396003)(136003)(46966005)(316002)(82310400002)(5660300002)(8936002)(478600001)(356005)(52536014)(450100002)(110136005)(55016002)(81166007)(36906005)(336012)(4326008)(83380400001)(54906003)(9686003)(82740400003)(8676002)(26005)(70206006)(70586007)(33656002)(7696005)(186003)(2906002)(6506007)(47076004)(86362001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: fd662d42-68aa-45ae-3cc7-08d8165ded17 X-Forefront-PRVS: 0442E569BC X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e2+xqRrio8foHYMAP7KouBPt6rmjVFd80Z2FNoWl8SgFL6pWvmh3bir1YdB9T3U01QfkO8oZh+XNaW+/BCx0hy2domMJGkChU6bPxc2jdtfF55Vq0kgUuo6ezFwL7J43Beq3FdVVZZAg8DpU0wlwiJCHQv3m6NtMqU8WEnEFPTOd8LXpA1EOxbESV2yYHTAFWuvJn4X++TpeBqxuSnhNbUrqbI3yWdzi5rmzsystsbq3m8aARIghCWl6flf/wGS9h4u8Mk1QbW4PMs+ncedW+ms/238nryTiIBwLNC/bWcrD084Lad4lgnP45xllHJE1d+eIn/++ibQdHPb71nydC3oQmbdfIpreHmHZ+DJLaT3XbLQ3qQiHbap1sUObo1y0WOw4CBbX0T50pLNKYv8Sgg== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2020 03:40:01.4310 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d2df41b2-64b2-4be8-508f-08d8165df1a9 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: AM6PR08MB4389 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" > Subject: [PATCH v2] app/testpmd: fix CPU cycles per pkt stats on transmit > modes >=20 > In txonly and flowgen forwarding mode, calculating CPU per packets with > total 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 > --- > v2: > Consolidate the output into a single printf. (Honnappa Nagarahalli) >=20 > app/test-pmd/testpmd.c | 21 +++++++++++++++------ > 1 file changed, 15 insertions(+), 6 deletions(-) >=20 > 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' > + else > + ingress =3D 1; This can be 'total_pkts =3D total_xmit' > + > 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'. > + fwd_cycles, cur_fwd_eng->fwd_mode_name, > + (ingress ? total_recv : total_xmit), Can be just 'total_pkts'. > + (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ)); > + } > #endif > } Otherwise, Reviewed-by: Honnappa Nagarahalli >=20 > -- > 2.7.4