From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4830C42B1F; Tue, 16 May 2023 08:19:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20B5841151; Tue, 16 May 2023 08:19:24 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2084.outbound.protection.outlook.com [40.107.22.84]) by mails.dpdk.org (Postfix) with ESMTP id 1CBF840C35 for ; Tue, 16 May 2023 08:19:23 +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=WOJnwl4stHx6stQMpTrXYe9Mby5Ka6LvVrU6Lqh3I1g=; b=WyKSuF1pkzg3zaDk8/7IZwz6JV1a3xEXzgR3kz16yXQm/z3A7eYNvFchBtNikeTWMNdW1rXljMRBvfltuAXT390dLPWAVWhqhS58zFGoHHr1Wq1c5bNv47vQphvrYbZyAPwvK/BCUlecmWsNjBUDbXhFEHJ3v0z/8pi9s158K+U= Received: from DUZPR01CA0187.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b6::17) by PAXPR08MB6416.eurprd08.prod.outlook.com (2603:10a6:102:152::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.33; Tue, 16 May 2023 06:19:19 +0000 Received: from DBAEUR03FT057.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b6:cafe::36) by DUZPR01CA0187.outlook.office365.com (2603:10a6:10:4b6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.33 via Frontend Transport; Tue, 16 May 2023 06:19:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass 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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT057.mail.protection.outlook.com (100.127.142.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.15 via Frontend Transport; Tue, 16 May 2023 06:19:18 +0000 Received: ("Tessian outbound 3570909035da:v136"); Tue, 16 May 2023 06:19:18 +0000 X-CR-MTA-TID: 64aa7808 Received: from ded80dd7ff78.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3B829BC8-6FA4-4A6E-A2DC-B137EB5DD7F9.1; Tue, 16 May 2023 06:19:09 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ded80dd7ff78.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 16 May 2023 06:19:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XhoA9UGpd4Xmbs7rHJQawZCSjxtXQlNuMzvmADRCWlVvO9cpMMnyboQIne5bg2mi+ioIkhqzU23f0PVD0a/lK+uH+V02E4Bdn1Eo80QKx9Z43Pr0TQRUvSWBRvK20WyWQHLNHm4DpedW2jiePOhwFwReA+BlS7GQ6ezoB7Y6Z8m7F+3DI3rVr7p6jUaTUO+eyCpvttYeWoro90j+KCKWKEjvXaTSd/onFmmx9iCOFusEo9DT4ZhP6WYVf0qHlgQYhoSgDvwiwItZUcZiKIK+i40KdmJLsAtB3RwGmHw23uiz+g7f2XqM5zCsVq3bPnoO3SIAkX0mAUr4ZPqoM6JrRA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WOJnwl4stHx6stQMpTrXYe9Mby5Ka6LvVrU6Lqh3I1g=; b=TZCyqbpuIo040VJ2JM3j6ypmKmWQ4TVyHIyaktEa/9tO/4pmczz2M9Ctprabb9ktEh9w6atm4jrf1QkE1NVHcvroptYAOgQTWtEaMO+dFo4OhzrQyGp3yqhiB+IRKlv8LgYV6rwlbfVOAcLBD557beLCI1thPldn4ITIWs1+FRSdoqnng3YNvEhD5vlRTPbKTKstnB5FHc9Jj+HTUHb7RPV9q+OKQamoHcyfqkFSNXMQFfPWeP6IgmoyzJzioBZAdXKX+MUtXQCPSSITCDMeV6thWRxCj0WjkmJg987NqxGO/e2ubml7QiJTetxNjgzJQkGYB//M8VwIyn4nn6DWvQ== 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=WOJnwl4stHx6stQMpTrXYe9Mby5Ka6LvVrU6Lqh3I1g=; b=WyKSuF1pkzg3zaDk8/7IZwz6JV1a3xEXzgR3kz16yXQm/z3A7eYNvFchBtNikeTWMNdW1rXljMRBvfltuAXT390dLPWAVWhqhS58zFGoHHr1Wq1c5bNv47vQphvrYbZyAPwvK/BCUlecmWsNjBUDbXhFEHJ3v0z/8pi9s158K+U= Received: from AS8PR08MB7718.eurprd08.prod.outlook.com (2603:10a6:20b:50a::22) by AS8PR08MB9670.eurprd08.prod.outlook.com (2603:10a6:20b:616::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Tue, 16 May 2023 06:19:06 +0000 Received: from AS8PR08MB7718.eurprd08.prod.outlook.com ([fe80::7878:ff5f:b10:d4a6]) by AS8PR08MB7718.eurprd08.prod.outlook.com ([fe80::7878:ff5f:b10:d4a6%7]) with mapi id 15.20.6387.033; Tue, 16 May 2023 06:19:06 +0000 From: Feifei Wang To: Stephen Hemminger CC: "dev@dpdk.org" , nd , Lijian Zhang , Ruifeng Wang , Honnappa Nagarahalli , nd Subject: RE: [PATCH] examples/l3fwd: add hard code to collect empty poll and NIC counters Thread-Topic: [PATCH] examples/l3fwd: add hard code to collect empty poll and NIC counters Thread-Index: AQHZg+Iv6SQeHrYwPkOO6Q/0wSR4Kq9VN0KAgAEaupA= Date: Tue, 16 May 2023 06:19:06 +0000 Message-ID: References: <20230511082519.4168523-1-feifei.wang2@arm.com> <20230511084447.0a93c411@hermes.local> In-Reply-To: <20230511084447.0a93c411@hermes.local> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 89E32D5985BA45408452D02C3BC92081.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: AS8PR08MB7718:EE_|AS8PR08MB9670:EE_|DBAEUR03FT057:EE_|PAXPR08MB6416:EE_ X-MS-Office365-Filtering-Correlation-Id: 8edf182e-5dce-4451-4006-08db55d57b6a x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: tkLj7yLEiDa9+5164HXtv71ZLCIF4jY7oJ6rCtGfUeQOs7eF98zpP/rQ9GlkFUZIShuuPvD2RhrA+HjkCWZKEeV+2sgvzXcMh0Ylm28oqswVRMJvSf36iiGxxWCfZJfr8g3EQbkgLdorQtcQd50H3Kwy9ge/v7lL4FOQa5wH3UBzugXey3y5fbEGpfkEaDsunxOd2jVuKtUrxGp5Usu9P46eXmwwrJSzS8ziPZ3jW5EiFxAgdljJfpPqAiPyDDUCPWT7bVoK3F16t1x/ONK3Bkg52TsgrmRl1we+zM6ICFGUdBwesYciKNGQEqpSbeGj7M0AqmdxE/oKb7hBiBCamhXMJsr3diwlyeosTJ1l4Dzz+aGPbYMIiRVp8Li152aabKJAcvSTp+GyvLvIhYuIIesy7oH7MarKIn6CJ0XtfaOSiEHFp7Tm9LlFCmAxHpvt8NsGoDh+KLv5ov3e/KiNc/gUHkPt2MHN97teo+bg26KvRIXkdp5NuidYQ9SUXRONBcRdBx8115JrKzt6FU7ea7VRRd9mJM1bsvnWfm/1Icw3Eq5Jg4gGWPUVEOwteLZGMpjDtS0Q2bTpm/ZLkRbD6ASsO/RUPH7BPFhKiOJvZn/ndZDp3pRHUEGpRphcR8IN X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB7718.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(366004)(39860400002)(376002)(396003)(136003)(346002)(451199021)(83380400001)(6506007)(26005)(2906002)(33656002)(186003)(38100700002)(53546011)(38070700005)(9686003)(52536014)(86362001)(7696005)(5660300002)(8936002)(71200400001)(8676002)(66556008)(66476007)(66446008)(64756008)(6916009)(4326008)(66946007)(478600001)(41300700001)(55016003)(54906003)(122000001)(76116006)(316002); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9670 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: af9d4f28-8594-48a9-7b64-08db55d573df X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8mBaILIEm3YufefglVnrblhNJbfc3rMUde7PTdWRCKPUi7Fr6Q9T31GBo+lhNI3mxxtvA5yuLaV8Sqx9pDWuEDPhvs6jiWAxAQezLXkVvmI0U+cmL2txgRedaitxG70Mes2QGdS37SgIR1OEwelK73FHomgm0zcIj6RYK3e86prQQuwH1nrwdufgMVcD6g7eZfjtp20Siop5l5xqeucfWVdZni4sxD3WlfhuFBvuC++uA5osVxKcK6w6ky0S98guzu1afCEBu9DsX52otnQDYvPOIpDbLa5mz4N3um2OVk8WWHn+iWAohvThcSU2MpfFjqZudl/+OGVpyVb+fI5uZnW2XDj0Q1DQNmD0bH4qgFFRYrJMJgJTgkPDCwURcYVxr2vUdEBwijgz4GD/ZBG7sH7FUiKKj9bsUk1Z9c5AStqoGhVITSZ+9VuWdX34q1+dQqA/k+fWt0rEgp6oKoFlwQxTtIYr3TMipwTghs6/4yIdha9BKGLNvMYPa/gXu4Vrf3hdPWj85PgTs6t728Ny9HqN00b6QUeNaugJhoxQa8e49euoUoXXlxLHT6O6biAeMZ75UWt8Ae1rdFKtzaQ0dpZS1WnGG6ASoWUxRet/WL401RjNhWacGHgLQHy+vccwACGx74w44Bo7GD6zDXo8sghNlEvYgF6YxQ3WyeZIACcqJ0zu2AcNL+H6yMQlmnCNMfmYwXYPWjdReJttmxJ4q6Y6MYrJwd8rSaQDF4Ms+EYxbcS+Tnncj2CiPDu2Wdrw 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; SFS:(13230028)(4636009)(39860400002)(396003)(376002)(346002)(136003)(451199021)(36840700001)(46966006)(40470700004)(33656002)(86362001)(54906003)(7696005)(316002)(70586007)(70206006)(4326008)(478600001)(55016003)(40480700001)(82310400005)(8936002)(8676002)(6862004)(5660300002)(52536014)(2906002)(41300700001)(81166007)(82740400003)(356005)(336012)(186003)(6506007)(53546011)(9686003)(36860700001)(83380400001)(47076005)(26005)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 06:19:18.9856 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8edf182e-5dce-4451-4006-08db55d57b6a 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-AuthSource: DBAEUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6416 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Thanks for the comment. > -----Original Message----- > From: Stephen Hemminger > Sent: Thursday, May 11, 2023 11:45 PM > To: Feifei Wang > Cc: dev@dpdk.org; nd ; Lijian Zhang > ; Ruifeng Wang ; > Honnappa Nagarahalli > Subject: Re: [PATCH] examples/l3fwd: add hard code to collect empty poll = and > NIC counters >=20 > On Thu, 11 May 2023 16:25:19 +0800 > Feifei Wang wrote: >=20 > > This patch is to collect empty poll of 'rte_eth_rx_burst' functions in > > dpdk l3fwd application. Empty poll means Rx burst function receives no > > pkts in one loop. > > > > Furthermore, we also add 'nic_xstats_display' API to show NIC counters. > > > > Usage: > > With this patch, no special settings, just run l3fwd, and when you > > stoping l3fwd, thread will print the info above. > > > > Note: > > This patch has just a slight impact on performance and can be ignored. >=20 > There was a set of other patches around telemetry. > Shouldn't this example use some of that rather than "roll your own"? But for 'empty poll', it seems have no API to collect this. By the way, would you please share the API or patch which can do like this? Thanks very much. =20 >=20 > > > > dpdk version:23.03 > > > > Suggested-by: Lijian Zhang > > Signed-off-by: Feifei Wang > > Reviewed-by: Ruifeng Wang > > Reviewed-by: Honnappa Nagarahalli > > --- > > examples/l3fwd/l3fwd.h | 68 > ++++++++++++++++++++++++++++++++++++++ > > examples/l3fwd/l3fwd_lpm.c | 26 +++++++++++++-- > > examples/l3fwd/main.c | 22 ++++++++++++ > > 3 files changed, 114 insertions(+), 2 deletions(-) > > > > diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index > > b55855c932..2b3fca62f3 100644 > > --- a/examples/l3fwd/l3fwd.h > > +++ b/examples/l3fwd/l3fwd.h > > @@ -56,6 +56,17 @@ > > #define L3FWD_HASH_ENTRIES (1024*1024*1) > > #endif > > > > +struct lcore_stats { > > + uint32_t nb_rx_pkts[16]; > > + uint32_t num_loop[16]; > > + uint32_t none_loop[16]; > > + uint32_t no_full_loop[16]; > > + float none_loop_per[16]; > > + float no_full_loop_per[16]; > > +} __rte_cache_aligned; >=20 > What is the 16 magic value? I think here should be use MAX_RX_QUEUE_PER_LCORE to replace 16. >=20 > Use double instead of float to keep more accuracy? Agree. >=20 > There maybe holes in this structure? >=20 > You may want to allocate it at runtime based on number of actual cores an= d > get it on the right NUMA node. Ok. So maybe each lcore is responsible to define this struct for itself? >=20 > > + > > +extern struct lcore_stats stats[RTE_MAX_LCORE]; > > + > > struct parm_cfg { > > const char *rule_ipv4_name; > > const char *rule_ipv6_name; > > @@ -115,6 +126,63 @@ extern struct acl_algorithms acl_alg[]; > > > > extern uint32_t max_pkt_len; > > > > +static inline void > > +nic_xstats_display(uint32_t port_id) > > +{ > > + struct rte_eth_xstat *xstats; > > + int cnt_xstats, idx_xstat; > > + struct rte_eth_xstat_name *xstats_names; > > + > > + printf("###### NIC extended statistics for port %-2d\n", port_= id); > > + if (!rte_eth_dev_is_valid_port(port_id)) { > > + fprintf(stderr, "Error: Invalid port number %i\n", por= t_id); > > + return; > > + } > > + > > + /* Get count */ > > + cnt_xstats =3D rte_eth_xstats_get_names(port_id, NULL, 0); > > + if (cnt_xstats < 0) { > > + fprintf(stderr, "Error: Cannot get count of xstats\n")= ; > > + return; > > + } > > + > > + /* Get id-name lookup table */ > > + xstats_names =3D malloc(sizeof(struct rte_eth_xstat_name) * cn= t_xstats); > > + if (xstats_names =3D=3D NULL) { > > + fprintf(stderr, "Cannot allocate memory for xstats loo= kup\n"); > > + return; > > + } > > + if (cnt_xstats !=3D rte_eth_xstats_get_names( > > + port_id, xstats_names, cnt_xstats)) { > > + fprintf(stderr, "Error: Cannot get xstats lookup\n"); > > + free(xstats_names); > > + return; > > + } > > + > > + /* Get stats themselves */ > > + xstats =3D malloc(sizeof(struct rte_eth_xstat) * cnt_xstats); > > + if (xstats =3D=3D NULL) { > > + fprintf(stderr, "Cannot allocate memory for xstats\n")= ; > > + free(xstats_names); > > + return; > > + } > > + if (cnt_xstats !=3D rte_eth_xstats_get(port_id, xstats, cnt_xs= tats)) { > > + fprintf(stderr, "Error: Unable to get xstats\n"); > > + free(xstats_names); > > + free(xstats); > > + return; > > + } > > + > > + /* Display xstats */ > > + for (idx_xstat =3D 0; idx_xstat < cnt_xstats; idx_xstat++) { > > + printf("%s: %"PRIu64"\n", > > + xstats_names[idx_xstat].name, > > + xstats[idx_xstat].value); > > + } > > + free(xstats_names); > > + free(xstats); > > +} > > + > > /* Send burst of packets on an output interface */ static inline int > > send_burst(struct lcore_conf *qconf, uint16_t n, uint16_t port) diff > > --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index > > 4ac1925c84..9e27e954b9 100644 > > --- a/examples/l3fwd/l3fwd_lpm.c > > +++ b/examples/l3fwd/l3fwd_lpm.c > > @@ -41,6 +41,8 @@ > > static struct rte_lpm *ipv4_l3fwd_lpm_lookup_struct[NB_SOCKETS]; > > static struct rte_lpm6 *ipv6_l3fwd_lpm_lookup_struct[NB_SOCKETS]; > > > > +extern struct lcore_stats stats[RTE_MAX_LCORE]; > > + > > /* Performing LPM-based lookups. 8< */ static inline uint16_t > > lpm_get_ipv4_dst_port(const struct rte_ipv4_hdr *ipv4_hdr, @@ -153,6 > > +155,7 @@ lpm_main_loop(__rte_unused void *dummy) > > struct lcore_conf *qconf; > > const uint64_t drain_tsc =3D (rte_get_tsc_hz() + US_PER_S - 1) / > > US_PER_S * BURST_TX_DRAIN_US; > > + bool start_count =3D 0; > > > > lcore_id =3D rte_lcore_id(); > > qconf =3D &lcore_conf[lcore_id]; > > @@ -207,8 +210,22 @@ lpm_main_loop(__rte_unused void *dummy) > > queueid =3D qconf->rx_queue_list[i].queue_id; > > nb_rx =3D rte_eth_rx_burst(portid, queueid, pkts_burst, > > MAX_PKT_BURST); > > - if (nb_rx =3D=3D 0) > > - continue; > > + if (start_count =3D=3D 0) { > > + if (nb_rx !=3D 0) > > + start_count =3D 1; > > + } > > + > > + if (start_count =3D=3D 1) { > > + stats[lcore_id].nb_rx_pkts[i] +=3D nb_rx; > > + stats[lcore_id].num_loop[i]++; > > + if (nb_rx < MAX_PKT_BURST && nb_rx > 0) > > + stats[lcore_id].no_full_loop[i]++; > > + > > + if (nb_rx =3D=3D 0) { > > + stats[lcore_id].none_loop[i]++; > > + continue; > > + } > > + } >=20 > On Arm you are going to need to use a barrier or atomic variable for thes= e > otherwise, there is no guarantee that other thread will read the right va= lue. For the change in l3fwd, 'Counters++' is in data path, and each lcore only changes itself counters. After all thread exits, the main thread will load all counters in control p= ath. If add barrier in data path, performance will drop and the counters will lo= st their authenticity. >=20 > > > > #if defined RTE_ARCH_X86 || defined __ARM_NEON \ > > || defined RTE_ARCH_PPC_64 > > @@ -223,6 +240,11 @@ lpm_main_loop(__rte_unused void *dummy) > > cur_tsc =3D rte_rdtsc(); > > } > > > > + for (i =3D 0; i < n_rx_q; ++i) { > > + stats[lcore_id].none_loop_per[i] =3D > (float)stats[lcore_id].none_loop[i]/stats[lcore_id].num_loop[i]*100; > > + stats[lcore_id].no_full_loop_per[i] =3D > (float)stats[lcore_id].no_full_loop[i]/stats[lcore_id].num_loop[i]*100; > > + } > > + > > return 0; > > } > > > > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index > > a4f061537e..4727215eae 100644 > > --- a/examples/l3fwd/main.c > > +++ b/examples/l3fwd/main.c > > @@ -53,6 +53,8 @@ > > > > #define MAX_LCORE_PARAMS 1024 > > > > +struct lcore_stats stats[RTE_MAX_LCORE]; > > + > > uint16_t nb_rxd =3D RX_DESC_DEFAULT; > > uint16_t nb_txd =3D TX_DESC_DEFAULT; > > > > @@ -1592,6 +1594,26 @@ main(int argc, char **argv) > > } else { > > rte_eal_mp_wait_lcore(); > > > > + for (lcore_id =3D 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { > > + if (rte_lcore_is_enabled(lcore_id) =3D=3D 0) > > + continue; > > + qconf =3D &lcore_conf[lcore_id]; > > + for (queue =3D 0; queue < qconf->n_rx_queue; ++queue) > { > > + printf("\nlcore id:%d\n", lcore_id); > > + printf("queue_id:%d\n",queue); > > + printf("Rx pkt %d\n", > stats[lcore_id].nb_rx_pkts[queue]); > > + printf("loop number: %d, 0 pkts loop:%d, <32 > pkts loop:%d\n", > > + stats[lcore_id].num_loop[queue], > stats[lcore_id].none_loop[queue], stats[lcore_id].no_full_loop[queue]); > > + printf("0 pkts loop percentage:%.2f%%, <32 > pkts loop percentage:%.2f%%\n", > > + > stats[lcore_id].none_loop_per[queue], > stats[lcore_id].no_full_loop_per[queue]); > > + printf("------------------------------------\n\n"); > > + > > + } > > + } > > + > > + nic_xstats_display(0); > > + nic_xstats_display(1); > > + > > RTE_ETH_FOREACH_DEV(portid) { > > if ((enabled_port_mask & (1 << portid)) =3D=3D 0) > > continue;