From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150079.outbound.protection.outlook.com [40.107.15.79]) by dpdk.org (Postfix) with ESMTP id 2B4241BDB0 for ; Thu, 20 Dec 2018 22:03:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ePBs9JIhur4MfGO88dtdPoheCkEkeNo1YkL7BgvNLW0=; b=nzro/WEibVf0DOosDe/vrSCcnDZDLE+Esd5k2VWi+GnE9hhajg4xvUzhqXLsgRuQ/AJqlmRMWL+dFxF2pLFL1a53JuJL5UDv+1cwEiNm2giuzNibZ6tdkCRJ0b8cXsOgujJH+zKKBxcaK18GuBkXlFOMGdwaRHD7cJwF/wHU4dk= Received: from AM6PR08MB3672.eurprd08.prod.outlook.com (20.177.115.29) by AM6PR08MB4456.eurprd08.prod.outlook.com (20.179.7.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.21; Thu, 20 Dec 2018 21:03:54 +0000 Received: from AM6PR08MB3672.eurprd08.prod.outlook.com ([fe80::78ab:2bf4:5476:6c3e]) by AM6PR08MB3672.eurprd08.prod.outlook.com ([fe80::78ab:2bf4:5476:6c3e%2]) with mapi id 15.20.1446.018; Thu, 20 Dec 2018 21:03:54 +0000 From: Honnappa Nagarahalli To: Thomas Monjalon , "Gavin Hu (Arm Technology China)" CC: "dev@dpdk.org" , "jerinj@marvell.com" , "hemant.agrawal@nxp.com" , "bruce.richardson@intel.com" , "anatoly.burakov@intel.com" , nd , "Joyce Kong (Arm Technology China)" , "olivier.matz@6wind.com" , nd Thread-Topic: [PATCH v1] test/ring: ring perf test case enhancement Thread-Index: AQHUmFfsS2NUg+mBEk+Q4cNbfiaCo6WHgOkAgACaRMA= Date: Thu, 20 Dec 2018 21:03:54 +0000 Message-ID: References: <1545305634-81288-1-git-send-email-gavin.hu@arm.com> <1600613.K5MK70CiJL@xps> In-Reply-To: <1600613.K5MK70CiJL@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR08MB4456; 6:Fkesw4lB3i4gxnGy+NYyGDztsakypamyLrm/C4tHvCGIHpPEFGqvw0GY7Ud+fPzfrnIh8kaPimt2+lKLa3udWrTXke6K3RoriI9UvyshwX2/fI4cy9g7qfZS+VYddoMtcsddA8YazmQpXTg95u7bMshw8tYwzTjb4deHJ9VZw9cB60alh/T6evEdzjAbXIL/AJmd3z7Qt95g7ZXIY/tdwqSHNT3BMC0t3S0YDhii/Xo9FzV+nPvO2gjQtmIEetS7XuhfID263c0Dfoy7HybknEREw+19WW3GFjhm/0BER0Wdojj9z/aMK1p8B8lw1ndn2gGYOW4u3Jg9hdoWooKyn1DgM2kyfurjnaNffuDd8j6k7YfTzCY5NV8kWf4gNGXmSSFKEVULinKaCzpGce5VKr6LKXfqcO8dn+uiifF4UMw9zqs+2SKwkI7SesvbwwwFmw+AXsPwNWucsa75ImHXcQ==; 5:Pnrl7+8b8gQjo7coXabvwmRlMqJPowKmAp8yY7zi9zYSYbhsOQ8oIB8nJrOI0wto6S7J0Ri4UgkCRm8ZSNIs5wE2osX9Wd2jfDA6uH1OsGbjX/n2CdGG03Sa7B0mJVW6uvoS4iz7hC30ufFZu96EJGm/LUV4DV0cabIrzgg2MMY=; 7:ixh0iMtPx5PHxjrmyi968kFa689xXer2NDmH/XxarzEWfdtW2tjqZ43ZoCQLABEmDAJlGkeAfYYEU2DqGR41cOfITnqlnFQaYMya1W6I+pmIjfkNnV4BuksZ6zC72XkPJfV1anqn4QOeZfpY6g7k2w== x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-correlation-id: f31cb92f-73e4-4f9f-bcbd-08d666bea6a3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR08MB4456; x-ms-traffictypediagnostic: AM6PR08MB4456: nodisclaimer: True x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(999002)(5005026)(6040522)(2401047)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:AM6PR08MB4456; BCL:0; PCL:0; RULEID:; SRVR:AM6PR08MB4456; x-forefront-prvs: 0892FA9A88 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(136003)(346002)(366004)(396003)(39860400002)(199004)(189003)(71200400001)(71190400001)(186003)(8676002)(5660300001)(14454004)(486006)(7736002)(105586002)(86362001)(54906003)(110136005)(72206003)(316002)(6116002)(81166006)(81156014)(6636002)(3846002)(478600001)(25786009)(305945005)(106356001)(26005)(102836004)(8936002)(9686003)(55016002)(6246003)(53936002)(256004)(4326008)(14444005)(99286004)(74316002)(68736007)(66066001)(97736004)(7696005)(6506007)(229853002)(476003)(2906002)(6436002)(11346002)(76176011)(33656002)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB4456; H:AM6PR08MB3672.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: cuBnGRzhF8zES24VLDXb/F7/JlM8HhWiqOsrjYZQvKH/FaA2bSp7iARFq2tuV6SCXcTebDnJsRkHaEA6KAo4S+Lo4NDRFB0k+Z0yHPeJqAOisZ9wzlnwJqYQSW5/qmXOVJJPdcrz1YFx5DtwcBhNkngrlCxlcSPY4hpMhJGYIsgIdcrraB64tJnQkrZMOQVVHDUjplQNnFOazrvOJZUhjr+59Ne4tgPUX00kJaKbn3heYDJKRzWJlDi0/av55gOhE1ZiKJvgQ2U4iFCV4I1Ff3eyzp7pXWD3eW4ybrSEVumImlZS9ZSeUZm6qmL80dev spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: f31cb92f-73e4-4f9f-bcbd-08d666bea6a3 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Dec 2018 21:03:54.3971 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4456 Subject: Re: [dpdk-dev] [PATCH v1] test/ring: ring perf test case enhancement 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: , X-List-Received-Date: Thu, 20 Dec 2018 21:03:56 -0000 >=20 > +Cc Olivier, maintainer of the ring library. >=20 > 20/12/2018 12:33, Gavin Hu: > > From: Joyce Kong > > > > Run ring perf test on all available cores to really verify MPMC operati= ons. > > The old way of running on a pair of cores is not enough for MPMC > > rings. We used this test case for ring optimization and it was really > > helpful for measuring the ring performance in multi-core environment. IMO, the last sentence does not convey quantifiable information. I suggest = taking that out or replacing it with something that explains how it is usef= ul. > > > > Suggested-by: Gavin Hu > > Signed-off-by: Joyce Kong > > Reviewed-by: Ruifeng Wang > > Reviewed-by: Honnappa Nagarahalli > > Reviewed-by: Dharmik Thakkar > > Reviewed-by: Ola Liljedahl > > Reviewed-by: Gavin Hu > > --- > > test/test/test_ring_perf.c | 82 > > ++++++++++++++++++++++++++++++++++++++++++++-- > > 1 file changed, 80 insertions(+), 2 deletions(-) > > > > diff --git a/test/test/test_ring_perf.c b/test/test/test_ring_perf.c > > index ebb3939..819d119 100644 > > --- a/test/test/test_ring_perf.c > > +++ b/test/test/test_ring_perf.c > > @@ -20,12 +20,17 @@ > > * * Empty ring dequeue > > * * Enqueue/dequeue of bursts in 1 threads > > * * Enqueue/dequeue of bursts in 2 threads > > + * * Enqueue/dequeue of bursts in all available threads > > */ > > > > #define RING_NAME "RING_PERF" > > #define RING_SIZE 4096 > > #define MAX_BURST 32 > > > > +#ifndef ARRAY_SIZE > > +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #endif > > + > > /* > > * the sizes to enqueue and dequeue in testing > > * (marked volatile so they won't be seen as compile-time constants) > > @@ -248,9 +253,78 @@ run_on_core_pair(struct lcore_pair *cores, struct > rte_ring *r, > > } > > } > > > > +static rte_atomic32_t synchro; > > +static uint64_t queue_count[RTE_MAX_LCORE] =3D {0}; > > + > > +#define TIME_MS 100 > > + > > +static int > > +load_loop_fn(void *p) > > +{ > > + uint64_t time_diff =3D 0; > > + uint64_t begin =3D 0; > > + uint64_t hz =3D rte_get_timer_hz(); > > + uint64_t lcount =3D 0; > > + const unsigned int lcore =3D rte_lcore_id(); > > + struct thread_params *params =3D p; > > + void *burst[MAX_BURST] =3D {0}; > > + > > + /* wait synchro for slaves */ > > + if (lcore !=3D rte_get_master_lcore()) > > + while (rte_atomic32_read(&synchro) =3D=3D 0) > > + rte_pause(); > > + > > + begin =3D rte_get_timer_cycles(); > > + while (time_diff < hz * TIME_MS / 1000) { > > + rte_ring_mp_enqueue_bulk(params->r, burst, params->size, > NULL); > > + rte_ring_mc_dequeue_bulk(params->r, burst, params->size, > NULL); > > + lcount++; > > + time_diff =3D rte_get_timer_cycles() - begin; > > + } IMO, the method of measurement should be changed to reduce the over head of= reading the cycles. > > + queue_count[lcore] =3D lcount; > > + return 0; > > +} > > + > > +static int > > +run_on_all_cores(struct rte_ring *r) > > +{ > > + uint64_t total =3D 0; > > + struct thread_params param =3D {0}; > > + unsigned int i, c; > > + for (i =3D 0; i < ARRAY_SIZE(bulk_sizes); i++) { > > + printf("\nBulk enq/dequeue count on size %u\n", > bulk_sizes[i]); > > + param.size =3D bulk_sizes[i]; > > + param.r =3D r; > > + > > + /* clear synchro and start slaves */ > > + rte_atomic32_set(&synchro, 0); > > + if (rte_eal_mp_remote_launch(load_loop_fn, > > + ¶m, SKIP_MASTER) < 0) > > + return -1; > > + > > + /* start synchro and launch test on master */ > > + rte_atomic32_set(&synchro, 1); > > + load_loop_fn(¶m); > > + > > + rte_eal_mp_wait_lcore(); > > + > > + RTE_LCORE_FOREACH(c) { > > + printf("Core [%u] count =3D %"PRIu64"\n", > > + c, queue_count[c]); > > + total +=3D queue_count[c]; > > + } > > + > > + printf("Total count (size: %u): %"PRIu64"\n", bulk_sizes[i], > > + total); > > + } > > + > > + return 0; > > +} > > + > > /* > > - * 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. > > + * 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) @@ -394,6 +468,10 @@ > > test_ring_perf(void) > > printf("\n### Testing using two NUMA nodes ###\n"); > > run_on_core_pair(&cores, r, enqueue_bulk, dequeue_bulk); > > } > > + > > + printf("\n### Testing using all slave nodes ###\n"); > > + run_on_all_cores(r); > > + > > rte_ring_free(r); > > return 0; > > } > > >=20 >=20 >=20 >=20