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 96F9BA04F5; Fri, 19 Jun 2020 05:54:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D914DE07; Fri, 19 Jun 2020 05:54:18 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2088.outbound.protection.outlook.com [40.107.20.88]) by dpdk.org (Postfix) with ESMTP id 82B433B5; Fri, 19 Jun 2020 05:54:17 +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=DaOH1rfj+M/ViRozeOyZq+WQJ3xhljeSRnEWmzIyXf4=; b=xwZvQMmOcrs6QfRylVSF7i37zqQF8EME7t6ntpiAb7/flBT3eZyJyGzYO/phouh3yl+zqTbQdNNmhCHhLv1leDSaFv7dWfV1oO5cbZhzYLDqPQsu+S9RK7Hdlc2ZMHGhQTmtUsUmYpHfxA6MjoFj0Sou6IlxH94epyXFBCEkLpk= Received: from MR2P264CA0114.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:33::30) by VI1PR08MB3456.eurprd08.prod.outlook.com (2603:10a6:803:7e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Fri, 19 Jun 2020 03:54:15 +0000 Received: from VE1EUR03FT016.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:33:cafe::cf) by MR2P264CA0114.outlook.office365.com (2603:10a6:500:33::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Fri, 19 Jun 2020 03:54:15 +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 VE1EUR03FT016.mail.protection.outlook.com (10.152.18.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Fri, 19 Jun 2020 03:54:14 +0000 Received: ("Tessian outbound cdcc6148d2f4:v59"); Fri, 19 Jun 2020 03:54:14 +0000 X-CR-MTA-TID: 64aa7808 Received: from b51b6d78469e.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7A99A854-5DE7-41C9-8A43-BCD8A771044A.1; Fri, 19 Jun 2020 03:54:09 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b51b6d78469e.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 Jun 2020 03:54:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lSXJgovw/4FDsDE19HmXFmyPvoxTXYtnvMXn92Gfh9zB6SjPcxYqoyJowFAv/l/Y181JmRGKl9QgWn5x7/RTISAwH+DIc6aVrUSSFg+LJgOeVX7lzS8BB4SnzUhzY2FqzVn1FVE119jyQzIt2StK46s0Pa0NanCejwoxw5i5GLmO2zMaM5oG0Pn4QSV2tshNyychUWRbS2lCO3n5Gvbf6xQkP6MUD8K4E2mWmehzfcBjRshxS82hlEbrgkAsMKUf20ZL0GMK50Nv+1TA/CpvyAj/ri0pSYqjCiO90R4hHTJakEIOiclIlak4+Lu2XA0P/XK1cabCV3QOzWS6jmHVVg== 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=DaOH1rfj+M/ViRozeOyZq+WQJ3xhljeSRnEWmzIyXf4=; b=dvbmSr/8PSg0ZRSfO+CrnP88SuRH1BfgPePEseHc4ZxX+85dwUIu3CAq49L4i5gDyFqsbOyfOUegNjWGcemknWlnmxl3ht1H8A2vTVdCHfMy/Knx0L4A5B6s9DwVygPN/OXX7WTMpnR/oZ0m268cKotluwvbDoc8B1TQA/2TU8wKtTMBrx4LQSHiIPFA53k8ot0JPzYEbYxae9/CTYu25cILuh64TqjuEngvklAdJ7kiJ6cF7K9iEAs5yBg9Br/hYja18xzc6boU0EyjqJGJcq0v9fYb78GrSBztYZLJGXb2lLKKb7AQ+5Pww8RsEry4pMD0XquXTTWZH1wpbDmleA== 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=DaOH1rfj+M/ViRozeOyZq+WQJ3xhljeSRnEWmzIyXf4=; b=xwZvQMmOcrs6QfRylVSF7i37zqQF8EME7t6ntpiAb7/flBT3eZyJyGzYO/phouh3yl+zqTbQdNNmhCHhLv1leDSaFv7dWfV1oO5cbZhzYLDqPQsu+S9RK7Hdlc2ZMHGhQTmtUsUmYpHfxA6MjoFj0Sou6IlxH94epyXFBCEkLpk= Received: from VE1PR08MB4640.eurprd08.prod.outlook.com (2603:10a6:802:b2::11) by VE1PR08MB4976.eurprd08.prod.outlook.com (2603:10a6:803:105::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Fri, 19 Jun 2020 03:54:08 +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.023; Fri, 19 Jun 2020 03:54:08 +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 , nd Thread-Topic: [PATCH] app/testpmd: fix CPU cycles per pkt stats on transmit modes Thread-Index: AQHWRaa4a62yBxYZnE+8SQC7f6UWy6jfR5Pg Date: Fri, 19 Jun 2020 03:54:08 +0000 Message-ID: References: <1592491803-21173-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: d30ad05e-ee3a-4a2f-9688-15fc62e96e5a.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: 34482ba1-75ba-4975-662d-08d814046f37 x-ms-traffictypediagnostic: VE1PR08MB4976:|VI1PR08MB3456: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:741;OLM:741; x-forefront-prvs: 0439571D1D X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: xs0S7FmwKCVekSUby2rm1UXdbE4YWXV4eIbfmkSE1J1Pt6u6XX1+KbWDK774xXHVx6DYgqUd/FnXUPWJ0ypDZdf+7LJ2vE5xp6Bq0iIjuroQodo/rcv+3aRQRc8kiWfePU+5M7AtTaCgNko2tKW4QaY/q8r73Ium+4XcIJik7KKZcmqTmNxDvBvEcPjZVxBtFs8Ko3IxeidpY67v6l11bQbDWTqvyJjO44UHIWnMKi/ZZZ+PnEgHbxF392H4jeDXQVQmf/uIKV99AP9C/G8P5UHWIdM4kL9I1bL3ha73X1D/jUz1I48SaMQ4lI1Sd6N7 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)(376002)(39860400002)(136003)(366004)(346002)(396003)(7696005)(186003)(66946007)(4326008)(55016002)(9686003)(71200400001)(54906003)(66476007)(110136005)(66446008)(64756008)(8676002)(66556008)(76116006)(5660300002)(26005)(52536014)(316002)(33656002)(83380400001)(8936002)(478600001)(53546011)(6506007)(86362001)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: CFTs3iDj2NuzNJRrY0wARFd2NRAKtdfmh7LT42ZgdBsQzOvq0SQUcjdoZemwOvrJT+uu15OzRL52pq4Qj3tWsAcBOSrFDp721ch88M6BaDIa0R8ExC5cO+Ut4QH042JVieTv32edUyxjICGvgdwSwczzBZRo+qUia9KUg8rWxY3x7kG2UN0hXHEcd+7906zNQaDwPfk1Qy9Xc1hSsNYmo9fc2YJyhpi8nENoxJIY21oW7VtN2SI5gW7f0c379Psi4ec+Ry3N7usqqCa1F5nu9YfgMZxgFL/5u2DeZnppmf7WoBSrrhLiLJ9YL0uc1K9KrAusT6Lkk8J652S5FJUnGZU6NA585LLn/GfPrDk7BDnhgpUQGT4z40rAI1uSxdx5iWdmUA4/fHheJu4f51KVIIrpNaMhJgN4oty9ssqFz2fIvpMEE90rE/yVGFN1bIMPwz+xOdHwaXzVW7TwcWh2UtkIyYWfQLepC8ApzDTh4yI= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4976 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: VE1EUR03FT016.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)(136003)(346002)(39860400002)(396003)(376002)(46966005)(186003)(26005)(8676002)(316002)(53546011)(6506007)(33656002)(47076004)(2906002)(52536014)(82740400003)(54906003)(478600001)(36906005)(5660300002)(7696005)(4326008)(83380400001)(70206006)(70586007)(110136005)(356005)(450100002)(336012)(8936002)(55016002)(82310400002)(86362001)(81166007)(9686003); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 33402acf-4b73-4ab7-fc65-08d814046b32 X-Forefront-PRVS: 0439571D1D X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mgs5O2k2ion7BnjiYrITCP654DoUbhdTT/EnwPM0t+APtk93zNCfLa4fay6y8iXFdku1+gU94DwOKsXcg6Gir8TrrLnqE024WBlCJWUOdLk9fNF+Nj4fHrFK9U0/37NdXsFH5mwtD3BOd9SteEb8Z+L1a5/h3j3xVDk95H7bBC1G6SodYreKhTvnIAgueyblfL9SpbRDFzDu0LUVE1YEFF92YSYk7BSK4YM2QcwQFDslFrzLYoLT2KLPYTSc118RC4jITGr2UcWHNcqmeznMF5PmcW94UWrrq94vHGyt9r+mY0rOR0f/c8VjvO6h80RzNacyy29e5Lq0UKNyJ9beNIEjhAnSML8tzA+EidUrythZ9yQRKq16PJeG9/n3e7sdCnqC2NSrB5KYBFK93X4xTQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2020 03:54:14.9772 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34482ba1-75ba-4975-662d-08d814046f37 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: VI1PR08MB3456 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" > -----Original Message----- > From: Honnappa Nagarahalli > Sent: Friday, June 19, 2020 3:29 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] app/testpmd: fix CPU cycles per pkt stats on transmi= t > modes >=20 > >=20 > > Subject: [PATCH] app/testpmd: fix CPU cycles per pkt stats on transmit > modes > > > > In txonly and flowgen forwarding mode, calculating CPU per packets with > total > > received packets is not accurate. Use total transmitted packets for the= se > 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 > > --- > > app/test-pmd/testpmd.c | 24 +++++++++++++++++------- > > 1 file changed, 17 insertions(+), 7 deletions(-) > > > > 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 tot= al_xmit. > Can be consolidated into a single printf. OK. I can use a local flag and a ternary operator to print the ingress and = the egress packets respectively. I will update it in V2. Thanks, Phil >=20 > > #endif > > } > > > > -- > > 2.7.4