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 90BEEA04F6; Tue, 7 Jan 2020 06:55:10 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 08A2E1D923; Tue, 7 Jan 2020 06:55:10 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2068.outbound.protection.outlook.com [40.107.20.68]) by dpdk.org (Postfix) with ESMTP id F32991D921 for ; Tue, 7 Jan 2020 06:55:08 +0100 (CET) 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=qtbp/9wPk7BXmCc5J7ezfmWYdes+Sjp4TCuhmx1ciRA=; b=sTaOnXnaIhAR84lVUF0ymqSZM4EqkdfC3UXdFEwj6lhz6FOqjBGCFTZUHT7eIZ6ekfusruxK9rLQH8dGUAyy6HsWwMsqeAFXdmlGztYYbMP4hgMHJYYZ7fMU3NWbJvc50jC4sYo/GvQBMA6SKiviOvrGyLrCvX5Ojt8yTrevAMM= Received: from AM4PR08CA0043.eurprd08.prod.outlook.com (2603:10a6:205:2::14) by VE1PR08MB4733.eurprd08.prod.outlook.com (2603:10a6:802:aa::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.10; Tue, 7 Jan 2020 05:55:06 +0000 Received: from DB5EUR03FT050.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::209) by AM4PR08CA0043.outlook.office365.com (2603:10a6:205:2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.13 via Frontend Transport; Tue, 7 Jan 2020 05:55:06 +0000 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 DB5EUR03FT050.mail.protection.outlook.com (10.152.21.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11 via Frontend Transport; Tue, 7 Jan 2020 05:55:06 +0000 Received: ("Tessian outbound 1da651c29646:v40"); Tue, 07 Jan 2020 05:55:05 +0000 X-CR-MTA-TID: 64aa7808 Received: from ab47413b6aff.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 08C04EC2-E419-479F-B21B-8AC2F54C8186.1; Tue, 07 Jan 2020 05:55:00 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ab47413b6aff.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 07 Jan 2020 05:55:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OCODz7v3Zh+O2Ia8Ww8iC38xSbCL+SdkI5qhIpS106z1XLKITwooq8JfgoIo8J8R9YqMFuFXD18pXZaR14VkJd/SzU+/zJ8cDZu9K99YR63vqNd+qygMmWJmJ4mTF3cTY0eST//jT8FoLcV0K9zmch4uzW2PFs9+a+0cJHL0aAHPdVioaBb+qVni2q+Hl1CGY4PbO19oJjNS9A4GEfYuu6qCIMZxghJESOpHBIjAZCWeLvnSgdFPawmUySzaJE5xOSvcJ7ztrbwGp8f2dwx3A7sPAOB5g0fbeAJ2sBuLnPS63ia7/UqtyS1lcm7pRXFvpJ3QN5ZmXOg5hXfSUhVEsA== 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=qtbp/9wPk7BXmCc5J7ezfmWYdes+Sjp4TCuhmx1ciRA=; b=PpZn0YKPcOd6K3ffjNKDNjj5Svf73NGEVEi0l96afraAP7Yz9P7xh4qsE/iFflnD9gFRahwmea8UWRuHfPE722z79cK15z4zRiPkk0/yXQ0DM/EU24/4HsaXeonQZy+uZfmXvIPxuvgU8Ard2ShSwp1IhEVO+9AxWIddbv7mrV2BIA1G3cx0blrM4wWWf9e9sQeT+kyx3Mx8DPD/ihLLZEP3PIjulKUHUo2WJXGORi7Fl7f+rkHfKHebwlVDRbukb9NbZmLPp5klAGRusIEl/CZ+krYFkI7/x9l1WqDSmnZtJGjPw1CxB2UoIZAdGLEUxOqpCPnPGtScVSDnPGtYlw== 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=qtbp/9wPk7BXmCc5J7ezfmWYdes+Sjp4TCuhmx1ciRA=; b=sTaOnXnaIhAR84lVUF0ymqSZM4EqkdfC3UXdFEwj6lhz6FOqjBGCFTZUHT7eIZ6ekfusruxK9rLQH8dGUAyy6HsWwMsqeAFXdmlGztYYbMP4hgMHJYYZ7fMU3NWbJvc50jC4sYo/GvQBMA6SKiviOvrGyLrCvX5Ojt8yTrevAMM= Received: from VE1PR08MB5149.eurprd08.prod.outlook.com (20.179.30.27) by VE1PR08MB4991.eurprd08.prod.outlook.com (10.255.158.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.15; Tue, 7 Jan 2020 05:54:58 +0000 Received: from VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::29eb:a1be:8f8f:fae2]) by VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::29eb:a1be:8f8f:fae2%7]) with mapi id 15.20.2602.015; Tue, 7 Jan 2020 05:54:58 +0000 From: Honnappa Nagarahalli To: "Ananyev, Konstantin" , "olivier.matz@6wind.com" , "sthemmin@microsoft.com" , "jerinj@marvell.com" , "Richardson, Bruce" , "david.marchand@redhat.com" , "pbhagavatula@marvell.com" CC: "dev@dpdk.org" , Dharmik Thakkar , Ruifeng Wang , Gavin Hu , nd , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v7 10/17] test/ring: modify single element enq/deq perf test cases Thread-Index: AQHVwY6gdv0w5OR0gku9yZ1wpVockKfeukkw Date: Tue, 7 Jan 2020 05:54:57 +0000 Message-ID: References: <20190906190510.11146-1-honnappa.nagarahalli@arm.com> <20191220044524.32910-1-honnappa.nagarahalli@arm.com> <20191220044524.32910-11-honnappa.nagarahalli@arm.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: a65a97ff-cb33-40a0-9497-0088270e5de8.0 x-checkrecipientchecked: true Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@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: 0737ee15-5b41-43ce-1ab2-08d793362574 X-MS-TrafficTypeDiagnostic: VE1PR08MB4991:|VE1PR08MB4991:|VE1PR08MB4733: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:3631;OLM:3631; x-forefront-prvs: 027578BB13 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(346002)(366004)(376002)(136003)(39860400002)(396003)(51234002)(189003)(199004)(4326008)(52536014)(33656002)(5660300002)(54906003)(76116006)(110136005)(26005)(7696005)(71200400001)(6506007)(316002)(186003)(55016002)(81156014)(9686003)(81166006)(478600001)(66946007)(86362001)(8936002)(8676002)(66476007)(66556008)(64756008)(66446008)(2906002)(21314003); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4991; H:VE1PR08MB5149.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: bAOKi6XgBcLWPCCcBDDcmHJEAHO1deBcxTZKG9OVjhpy0kZkJChX7wV8inwETfT+AQ6DLqFl69BVvOyeMyCmrQO8UXSEp6KAtkaHZLO9Andm2OKkhVOH71g8C+UqEMxzv1pQDhylYp/gUbgkfkQbVw3fQ/uYU358Fd+Cu7MP91FK8CqZPXROC5lo8QJwRq0YVQty+0LFQgOxdoUHQOVCMuAhcSLCb9eK/V+CT8ko/OF7FoAoSxDsBPLDaUJs+0oNopIcqRsaUZrucWoYF5BLCnwheml9cf0wgFvJgDFz1gG2NAhY7R4zQ6hjswlmz96usqN2b2vEmCfUEWF3f/pVKrar4YfrMwFugRqpP6f1DLM20THd/6Hv6LK/G/Me8i9FjOR2rg3X/zgayB0YvFchkfMzIO+boquK3GIah1PEp9pfxj3frXcLJRg4PFSHnrcN3WuK8Icoso2UiHoiPsCVpHiJkgWGvnB32fEsaw0h1jpEuAo5tmGV4wMYKJ0ECJgAhUTtCgYFlWukESdJxHOojw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4991 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT050.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(396003)(39860400002)(376002)(346002)(51234002)(189003)(199004)(7696005)(2906002)(8936002)(26826003)(9686003)(33656002)(55016002)(81156014)(81166006)(8676002)(86362001)(4326008)(478600001)(5660300002)(6506007)(70586007)(356004)(110136005)(54906003)(26005)(186003)(52536014)(316002)(336012)(70206006)(21314003); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4733; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Pass; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; MX:1; A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 135c6a9a-64e1-4533-6a4f-08d7933620c7 NoDisclaimer: True X-Forefront-PRVS: 027578BB13 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AzjzEPp8JYJ+uCxMuIiBLOXOk/mrZRcc/oygNjSCx0z2UvdVotzukdwRqWhzuSu2ngScq58HbwIIm9pOZsX0fYWxTYuSZ/V6d1ETfod/g3vLCfkFJCO08EoPZlhbSxfJlkXczVr5/OhT7Xslkop1dH1oNaT258tPwTT3Lz80OvDPWbFY1j6Nto7WZEAy8C+59f63gedQ3885/R2HuPDNN7VhI3O97RH1xEgMd7NI7l48MoIHDGq/MBBLEFUy6s7lm2p6tFJFxZiTYWkk/NoviqFr4RxFwSEYQy57NVefHSwUWU7AyvyqjEEaDb2TVz1grkRUunI/LF++0X38Cmb8RtjdOAvM6+g55vv/T2gBUJmdOmwz6kcggyVsJEk5Pwnlu/gE2o2Rr6zA0rxAZYJp7aJ7av+byRQgWkSoO3SLIpGDs7lT5jl2UDCpJ/ZqSnklM6Kbwi+YOE6tJxGkimixL53j1bLkgmAMWmquJlnnrjh3xQu3/Yv75pnY4mjdH08YZ4rsMrdA0NxO+tbOP2kRiA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2020 05:55:06.1607 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0737ee15-5b41-43ce-1ab2-08d793362574 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: VE1PR08MB4733 Subject: Re: [dpdk-dev] [PATCH v7 10/17] test/ring: modify single element enq/deq perf test cases 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" >=20 > > > > Add test cases to test rte_ring_xxx_elem APIs for single element > > enqueue/dequeue test cases. > > > > Signed-off-by: Honnappa Nagarahalli > > Reviewed-by: Gavin Hu > > --- > > app/test/test_ring_perf.c | 100 > > ++++++++++++++++++++++++++++++-------- > > 1 file changed, 80 insertions(+), 20 deletions(-) > > > > diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c > > index 6c2aca483..5829718c1 100644 > > --- a/app/test/test_ring_perf.c > > +++ b/app/test/test_ring_perf.c > > @@ -13,6 +13,7 @@ > > #include > > > > #include "test.h" > > +#include "test_ring.h" > > > > /* > > * Ring > > @@ -41,6 +42,35 @@ struct lcore_pair { > > > > static volatile unsigned lcore_count =3D 0; > > > > +static void > > +test_ring_print_test_string(unsigned int api_type, int esize, > > + unsigned int bsz, double value) > > +{ > > + if (esize =3D=3D -1) > > + printf("legacy APIs"); > > + else > > + printf("elem APIs: element size %dB", esize); > > + > > + if (api_type =3D=3D TEST_RING_IGNORE_API_TYPE) > > + return; > > + > > + if ((api_type & TEST_RING_N) =3D=3D TEST_RING_N) > > + printf(": default enqueue/dequeue: "); > > + else if ((api_type & TEST_RING_S) =3D=3D TEST_RING_S) > > + printf(": SP/SC: "); > > + else if ((api_type & TEST_RING_M) =3D=3D TEST_RING_M) > > + printf(": MP/MC: "); > > + > > + if ((api_type & TEST_RING_SL) =3D=3D TEST_RING_SL) > > + printf("single: "); > > + else if ((api_type & TEST_RING_BL) =3D=3D TEST_RING_BL) > > + printf("bulk (size: %u): ", bsz); > > + else if ((api_type & TEST_RING_BR) =3D=3D TEST_RING_BR) > > + printf("burst (size: %u): ", bsz); > > + > > + printf("%.2F\n", value); > > +} > > + > > /**** Functions to analyse our core mask to get cores for different > > tests ***/ > > > > static int > > @@ -335,32 +365,35 @@ run_on_all_cores(struct rte_ring *r) > > * Test function that determines how long an enqueue + dequeue of a > single item > > * takes on a single lcore. Result is for comparison with the bulk enq= +deq. > > */ > > -static void > > -test_single_enqueue_dequeue(struct rte_ring *r) > > +static int > > +test_single_enqueue_dequeue(struct rte_ring *r, const int esize, > > + const unsigned int api_type) > > { > > - const unsigned iter_shift =3D 24; > > - const unsigned iterations =3D 1< > - unsigned i =3D 0; > > + int ret; > > + const unsigned int iter_shift =3D 24; > > + const unsigned int iterations =3D 1 << iter_shift; > > + unsigned int i =3D 0; > > void *burst =3D NULL; > > > > - const uint64_t sc_start =3D rte_rdtsc(); > > - for (i =3D 0; i < iterations; i++) { > > - rte_ring_sp_enqueue(r, burst); > > - rte_ring_sc_dequeue(r, &burst); > > - } > > - const uint64_t sc_end =3D rte_rdtsc(); > > + (void)ret; >=20 > Here, and in few other places, looks redundant. The compiler throws an error since 'ret' is assigned a value, but it is not= used. >=20 > > + /* alloc dummy object pointers */ > > + burst =3D test_ring_calloc(1, esize); > > + if (burst =3D=3D NULL) > > + return -1; > > > > - const uint64_t mc_start =3D rte_rdtsc(); > > + const uint64_t start =3D rte_rdtsc(); > > for (i =3D 0; i < iterations; i++) { > > - rte_ring_mp_enqueue(r, burst); > > - rte_ring_mc_dequeue(r, &burst); > > + TEST_RING_ENQUEUE(r, burst, esize, 1, ret, api_type); > > + TEST_RING_DEQUEUE(r, burst, esize, 1, ret, api_type); > > } > > - const uint64_t mc_end =3D rte_rdtsc(); > > + const uint64_t end =3D rte_rdtsc(); > > + > > + test_ring_print_test_string(api_type, esize, 1, > > + ((double)(end - start)) / iterations); > > + > > + rte_free(burst); > > > > - printf("SP/SC single enq/dequeue: %.2F\n", > > - ((double)(sc_end-sc_start)) / iterations); > > - printf("MP/MC single enq/dequeue: %.2F\n", > > - ((double)(mc_end-mc_start)) / iterations); > > + return 0; > > } > > > > /*