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 C94B4A0C47; Thu, 7 Oct 2021 13:55:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B218A411AD; Thu, 7 Oct 2021 13:55:06 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 02BA241137 for ; Thu, 7 Oct 2021 13:55:04 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10129"; a="213178128" X-IronPort-AV: E=Sophos;i="5.85,354,1624345200"; d="scan'208";a="213178128" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 04:55:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,354,1624345200"; d="scan'208";a="522575257" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga001.jf.intel.com with ESMTP; 07 Oct 2021 04:55:04 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 7 Oct 2021 04:55:03 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 7 Oct 2021 04:55:03 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 7 Oct 2021 04:55:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pkk25OyxXf692HEQQRKvst3kNkrjf+nw8PbUsQIfg7UR74Rntav4NDcNTa1z70vEWFKTEigk7WyGuQ3BQP+Zo6lHwVRL1QmPlF3HNDl0wIoPlsnbV7AKKX7+zRu9ywKpukitXkoEjgXtlu9wj6QrYf1/dHJz49ZZgAB7fbdzS6n8/Gsi5oGWNNylBk2TneQzl8/qfskE25LB7QDDuU4FeZN/1Ho86fSd3IJJC4Ccd9+bvSzEfB8uLjsyoVMB5evhswx784PxSSG/VCj1+DWa0X/fmVgaVI5FuSn8lY9d8rpI9EZCGFr4ATrJ3VrrX1viYcMokqueEGvI0N/WG57tFQ== 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=eQbE6dVPacOuLvO0whJ38KY+mSyoWOs9wIh4KlaxxsU=; b=cXmDkD1JavRv9eM0AyKDa7A2+e0amhdrVGOd4B7bySWIAl8ytO0Ikf1hfXa9BN69QpkZEhDDR6YLKoReeu1A0sm5MgOCYBFEbTa5bDMq93vaAkG96Hx3Xhg4I5XZVFTVwdArxzMaPlzflTUE2/BLlnDtA6B4ATDOV76t8Lu4+DGNlrmisDVo9j7dhoKGGpV59kOuf7JD/rYHZmyuewdHTAc+NJwulkjESAPIlIlgLfXztdnynME0d5cAHTf9dQ7rXJFYlCjXvJMjhRodScoziKNdfAGFzgWyajfJpYahrLgVjLaJZJ6/YGGi62HUsKGLupAbEIXHALtKBjKne6Ipww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eQbE6dVPacOuLvO0whJ38KY+mSyoWOs9wIh4KlaxxsU=; b=H3tKOZbU3eVHwpHDAiHUsm33r2ZoHYF/2BT9zGWUXhQ247D1SFhF7aS1KrQfc9kLGyaRFi65MjQT10El+NzTWBWEOsfjLugA/XOz0ejd7gGmq5rSj27HOLNwg7sdhrj8R14ZRe/Ym6Vurr6xLd+Dfn3sd4FKR/16j6a09ZsggqI= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB2764.namprd11.prod.outlook.com (2603:10b6:5:bf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.19; Thu, 7 Oct 2021 11:55:02 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd%4]) with mapi id 15.20.4587.019; Thu, 7 Oct 2021 11:55:02 +0000 From: "Ananyev, Konstantin" To: Honnappa Nagarahalli , "dev@dpdk.org" , "david.marchand@redhat.com" , "feifei.wang2@arm.com" CC: "ruifeng.wang@arm.com" , "nd@arm.com" , Ola Liljedahl , Feifei Wang Thread-Topic: [PATCH v2 6/6] test/ring: use relaxed barriers for ring stress test Thread-Index: AQHXpdBaZmLu04FmxUCUzlRrFr7MTavHmBqA Date: Thu, 7 Oct 2021 11:55:02 +0000 Message-ID: References: <20210224212018.17576-1-honnappa.nagarahalli@arm.com> <20210909231312.2572006-1-honnappa.nagarahalli@arm.com> <20210909231312.2572006-7-honnappa.nagarahalli@arm.com> In-Reply-To: <20210909231312.2572006-7-honnappa.nagarahalli@arm.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f24bfeb0-aac8-4753-1a4b-08d989894baa x-ms-traffictypediagnostic: DM6PR11MB2764: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GYMgoohz0E3Vr8gvWyf/6pDnVfIuJIVTYKkkGUpuimNafyBqi549506ZJue9yknJ1yGU96UKLEuVPrTlPU3dsfua6YHzkDBip5gnoOq3ADq48GGCqMjPlf2gyQuRCWQrC/w3zqc4bCVOElLwV59w1qnA662LTFgsZTKNyCwMm4EAQXL41p7SVbqvOwhC0WQmCql6fQdGHqmLzJHpMVGKYpolmCz6yZtda4K9Tr4NrmJZCLip1Mczv+Ce2x+bQ4Dx8re2NbOx+D9q1e/sboYmVsz7JvTYBOWbllKCISQq1K74I3r9fTZ5p9ie1kP/Tqnv75lXHTIoFnHG1qkZr9grnW/mgVSgUz/ldu8Show58rJplEdva2M5lD2bymvNqa6GfZJ4MrQmFpeoZwhYEUTHJRNfjTJIyqMc3OeDL/ImVLwgym8Ik8RRa/HF3mBlUWDer9PybsM2GoHQhwsRO8qfp6/52zwM6tqHjEBqU/F2C6tbgD6s0xv796EJQ5S0T0xkFIqDqG1/7D831UmlGQEgIDr0K1Fz3xq3azqrdVPW5AkgdnYifnr6QW5rldAhvxG4bIVmQk9D9xNV1vOCsJPr4sbl/3IS5qkG6vg2aebh/QuKjOpNcFE+ag5E/f9sCa9DH/397LCzHYT3Xfo1V9q8ZbL58wo99sanV0NU576uFnmCAL0uwqRvzTYeLq56aXfTORuilBaSi0LcZVLcXHqt6A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(86362001)(76116006)(64756008)(66556008)(316002)(38070700005)(55016002)(66446008)(4326008)(66946007)(66476007)(26005)(186003)(83380400001)(508600001)(110136005)(2906002)(8936002)(122000001)(54906003)(6506007)(55236004)(7696005)(5660300002)(71200400001)(9686003)(38100700002)(8676002)(33656002)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BsrdJqo6tcSfCKzU/wBUQ3oxkoK0Vl1j+EqxLf0ibuCtx+31HbiQuV83NANT?= =?us-ascii?Q?Rw0jTcERrMmDsxoJ0rYwrLUvlz3Ysmx+qD1dq00SQBzTbDsLTSwfYOspGU6G?= =?us-ascii?Q?6y80k6mPu7og5pXhByQ+SDtKKDE+tTa92miIBhKsnf/vW5oi4+LYswiEggMy?= =?us-ascii?Q?tndahD1MpxVc2MRuj3kRnkxkUKrQ9CF8hLaWGPvR4D3NUvaCP5VGOUKUDI9a?= =?us-ascii?Q?Q71LJAcFNRxPjkicXCXKosUut4uhmPOLvwmhCLrQVfD6ef/POyRs6ci4ISHo?= =?us-ascii?Q?nBG0tbkaacUcngY1XMp3Zknq0Lna53FaiAzitQz6g5aWSnLAiEa3nkX/2unS?= =?us-ascii?Q?GYassjdtwlMG89+NK7EEDlu/T1ibo+pYpE+8X0PVeKa26Omp7f2jBBWjqXh2?= =?us-ascii?Q?xvbFQL6aOEUdxnxcTnGsPThUluZiCdWMMbMtdfWlklgF6lciWb2wFAq28hPk?= =?us-ascii?Q?DvpqyIoJESv8wocWhMwQI4QuavwAKROISHHz6S2kCDsy6P5l8KxefckMjnmr?= =?us-ascii?Q?yDV43cFdDzWfQIStfXfz0z5CGmMo7M2sbFHro7MfHT9jz+BzejqT/CG9x7+y?= =?us-ascii?Q?yuG+UuWixdzsryvxLbLi+7l0A2vVC/rY0IMKUvTEEIihZ6+OHKWKRleySFO2?= =?us-ascii?Q?1m8thjQ4pEsedQgG7TkugYlH4VAqU0uXXf36vYUNpMNehAS3BaUbMQYeBpvx?= =?us-ascii?Q?c83DAd0C+h3Nza9Pj1rVu/WbeXb8Hu0AtRerT/cnDGNOFVO0gmbp+ETz2ChG?= =?us-ascii?Q?JZ4Dx4eaptz+n36JZtZn6cWO3FmnmP4+TiD/2S0DJezi7+3PWbedKBS2ka+R?= =?us-ascii?Q?b+K5ru4+jsydLrDHAWybpesdOM68zvc1+ICLy8cN/S/s5x6wXriy0dsE2J0L?= =?us-ascii?Q?pFloZ3Upn9ThPxfqZykew+scpcxgCI+EkgUrvkJOl6w2yUeD2ezsU4WqEJ/Z?= =?us-ascii?Q?RYjCQvaAbri7pYo0tyFB55Nr7KTq2tEE0uu4/PNOaDDiHAH9RIuw5FmkOtiZ?= =?us-ascii?Q?81woHvzgWY5Be5B+hFRLzIRyUhvDUhEZyAFDBHbLhIZyWBBPBm9DGkL7HNLg?= =?us-ascii?Q?E/i8hXsm0OxonZHMSBB4dwJ9zljYNzsK+cNFG41/i1dx+YBf7L6M5kgYgDqE?= =?us-ascii?Q?l0SotMo5LAbp6PliqHzPCseiZ6wYvgb2bANy/VP6UW/HSdDNbblcdcP8kcCB?= =?us-ascii?Q?A/TIRIlA/u1+nShFyQY8rf+sEwQPPGZ4V/83DKLqcoEhR+IBfdOgbxi/D0OK?= =?us-ascii?Q?4sXzguAsdbIcJFBA3SrW4vJ8ggQZfX6dbcyuJKB3Jsq7r2vvtH2KMK53rqXw?= =?us-ascii?Q?ewWde+nYelzyyZdMugd82Ezv?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f24bfeb0-aac8-4753-1a4b-08d989894baa X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2021 11:55:02.1620 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +ZzfUXuy8v+r3JDU3eDgSec1BovVIrT66ebbQ9eselbZWcyWkTmcKFh3c1yUtOZOoOPRosqD1IjCqHGS7Q6Gqc4NClilE8ax4SxngLpOK88= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2764 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 6/6] test/ring: use relaxed barriers for ring stress test 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 Sender: "dev" =20 > wrk_cmd variable is used to signal the worker thread to start > or stop the stress test loop. Relaxed barriers are used > to achieve the same. >=20 > Signed-off-by: Honnappa Nagarahalli > Reviewed-by: Ola Liljedahl > Reviewed-by: Feifei Wang > --- > app/test/test_ring_stress_impl.h | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) >=20 > diff --git a/app/test/test_ring_stress_impl.h b/app/test/test_ring_stress= _impl.h > index f9ca63b908..ee8293bb04 100644 > --- a/app/test/test_ring_stress_impl.h > +++ b/app/test/test_ring_stress_impl.h > @@ -22,7 +22,7 @@ enum { > WRK_CMD_RUN, > }; >=20 > -static volatile uint32_t wrk_cmd __rte_cache_aligned; > +static volatile uint32_t wrk_cmd __rte_cache_aligned =3D WRK_CMD_STOP; If we switch to using atomic load/store for 'wrk_cmd', then we can get remove 'volatile' classifier in the 'wrk_cmd' definition ab= ove? =20 >=20 > /* test run-time in seconds */ > static const uint32_t run_time =3D 60; > @@ -197,10 +197,12 @@ test_worker(void *arg, const char *fname, int32_t p= rcs) > fill_ring_elm(&def_elm, UINT32_MAX); > fill_ring_elm(&loc_elm, lc); >=20 > - while (wrk_cmd !=3D WRK_CMD_RUN) { > - rte_smp_rmb(); > + /* Acquire ordering is not required as the main is not > + * really releasing any data through 'wrk_cmd' to > + * the worker. > + */ > + while (__atomic_load_n(&wrk_cmd, __ATOMIC_RELAXED) !=3D WRK_CMD_RUN) > rte_pause(); > - } >=20 > cl =3D rte_rdtsc_precise(); >=20 > @@ -242,7 +244,7 @@ test_worker(void *arg, const char *fname, int32_t prc= s) >=20 > lcore_stat_update(&la->stats, 1, num, tm0 + tm1, prcs); >=20 > - } while (wrk_cmd =3D=3D WRK_CMD_RUN); > + } while (__atomic_load_n(&wrk_cmd, __ATOMIC_RELAXED) =3D=3D WRK_CMD_RUN= ); >=20 > cl =3D rte_rdtsc_precise() - cl; > if (prcs =3D=3D 0) > @@ -356,14 +358,12 @@ test_mt1(int (*test)(void *)) > } >=20 > /* signal worker to start test */ > - wrk_cmd =3D WRK_CMD_RUN; > - rte_smp_wmb(); > + __atomic_store_n(&wrk_cmd, WRK_CMD_RUN, __ATOMIC_RELEASE); >=20 > usleep(run_time * US_PER_S); >=20 > /* signal worker to start test */ > - wrk_cmd =3D WRK_CMD_STOP; > - rte_smp_wmb(); > + __atomic_store_n(&wrk_cmd, WRK_CMD_STOP, __ATOMIC_RELEASE); >=20 > /* wait for workers and collect stats. */ > mc =3D rte_lcore_id(); > -- > 2.25.1