From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130085.outbound.protection.outlook.com [40.107.13.85]) by dpdk.org (Postfix) with ESMTP id 408605323 for ; Mon, 1 Apr 2019 18:24:26 +0200 (CEST) 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=Xb5zp0Vg6va9PJ8P6nug/23yVFvqmNC8Mr304UmoZTs=; b=WdxcqTnJTIzBskfUd2yv5+SC50kdpfzDt5YUA74XpeNNRrlf7TiVlwheXyyKnqdbCWrVi0DcYfHnwhf77bS3r6+pk9vADt/LLWO9x0s0OPBcpeon9qzLc+NDMtn3wvYQ8PxBISQh6w91LEsqoxLNh8zf3NqzZWg23hsOvH7BixQ= Received: from VE1PR08MB5149.eurprd08.prod.outlook.com (20.179.30.152) by VE1PR08MB4768.eurprd08.prod.outlook.com (10.255.113.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.15; Mon, 1 Apr 2019 16:24:25 +0000 Received: from VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::e0ae:ecad:ec5:8177]) by VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::e0ae:ecad:ec5:8177%2]) with mapi id 15.20.1750.017; Mon, 1 Apr 2019 16:24:25 +0000 From: Honnappa Nagarahalli To: "Phil Yang (Arm Technology China)" , "dev@dpdk.org" , "thomas@monjalon.net" CC: "david.hunt@intel.com" , "reshma.pattan@intel.com" , "Gavin Hu (Arm Technology China)" , "Phil Yang (Arm Technology China)" , nd , Honnappa Nagarahalli , "olivier.matz@6wind.com" , nd Thread-Topic: [PATCH v2 3/3] test/ring_perf: replace sync builtins with atomic builtins Thread-Index: AQHU5h4ilZ/xG+q7+EaxbWHpBB+abaYnf9Qw Date: Mon, 1 Apr 2019 16:24:24 +0000 Message-ID: References: <1546508946-12552-1-git-send-email-phil.yang@arm.com> <1553856998-25394-4-git-send-email-phil.yang@arm.com> In-Reply-To: <1553856998-25394-4-git-send-email-phil.yang@arm.com> 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-ms-office365-filtering-correlation-id: 5fddbb36-95c1-4299-e50a-08d6b6be8164 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VE1PR08MB4768; x-ms-traffictypediagnostic: VE1PR08MB4768: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0994F5E0C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(136003)(376002)(346002)(39860400002)(199004)(189003)(7696005)(55016002)(76176011)(446003)(97736004)(72206003)(33656002)(476003)(9686003)(229853002)(81156014)(4326008)(14454004)(26005)(256004)(68736007)(8936002)(71190400001)(6506007)(486006)(4744005)(11346002)(6246003)(66066001)(110136005)(6116002)(99286004)(7736002)(81166006)(86362001)(102836004)(305945005)(186003)(53936002)(71200400001)(3846002)(5660300002)(74316002)(54906003)(478600001)(2906002)(8676002)(6436002)(105586002)(106356001)(316002)(52536014)(2201001)(2501003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4768; H:VE1PR08MB5149.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: EkjE20xc3oitsSebAo7uce7O9p/pzryW+AI9MqhoVzwAa3UXVhi2CAnCXGQAdvry+awQxJi9yzhmgA0cwGiJtYLAGsSi+hp0MMrkl7z0BER5McbLqSR7y1oAr4jn+pV/J095uWsUx7JOlNRrnX1eZ3YrRJmMWZKyNs3o3ZOd5FRuo/8OLE3nl08fAWpri7kPphqvNT6lL+L+g32r9ZQ7FUnlUoUPHkJsK7x3RBmAlXvvXCR74TWu/a4Ffhou8a8GYXVFKbAIxVyv3YaZzI7Ln2QjOcRNcONUB/Ajq+NUQvH5OM8iYE9Y2UUfUtv784bwSskhDvhjHDcia4toylMJNFYBwqxYikQL5kEGD12K8X1MmOtlc/SNLbqLTX7xp/C9RqfJEUbDMLtCFYsu7KDjXV1QbFceqixjanS6tN1EwCM= 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: 5fddbb36-95c1-4299-e50a-08d6b6be8164 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2019 16:24:24.8917 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4768 Subject: Re: [dpdk-dev] [PATCH v2 3/3] test/ring_perf: replace sync builtins with atomic builtins 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: Mon, 01 Apr 2019 16:24:26 -0000 > diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c index > ebb3939..e851c1a 100644 > --- a/app/test/test_ring_perf.c > +++ b/app/test/test_ring_perf.c > @@ -160,7 +160,11 @@ enqueue_bulk(void *p) > unsigned i; > void *burst[MAX_BURST] =3D {0}; >=20 > - if ( __sync_add_and_fetch(&lcore_count, 1) !=3D 2 ) > +#ifdef RTE_USE_C11_MEM_MODEL > + if (__atomic_add_fetch(&lcore_count, 1, __ATOMIC_RELAXED) !=3D 2) > #else > + if (__sync_add_and_fetch(&lcore_count, 1) !=3D 2) #endif > while(lcore_count !=3D 2) > rte_pause(); Since, rte_ring library has both C11 and non-C11 implementations, condition= al compilation should be fine here. >=20 > @@ -196,7 +200,11 @@ dequeue_bulk(void *p) > unsigned i; > void *burst[MAX_BURST] =3D {0}; >=20 > - if ( __sync_add_and_fetch(&lcore_count, 1) !=3D 2 ) > +#ifdef RTE_USE_C11_MEM_MODEL > + if (__atomic_add_fetch(&lcore_count, 1, __ATOMIC_RELAXED) !=3D 2) > #else > + if (__sync_add_and_fetch(&lcore_count, 1) !=3D 2) #endif > while(lcore_count !=3D 2) > rte_pause(); >=20 > -- > 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 14078A0679 for ; Mon, 1 Apr 2019 18:24:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DF3B2559A; Mon, 1 Apr 2019 18:24:27 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130085.outbound.protection.outlook.com [40.107.13.85]) by dpdk.org (Postfix) with ESMTP id 408605323 for ; Mon, 1 Apr 2019 18:24:26 +0200 (CEST) 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=Xb5zp0Vg6va9PJ8P6nug/23yVFvqmNC8Mr304UmoZTs=; b=WdxcqTnJTIzBskfUd2yv5+SC50kdpfzDt5YUA74XpeNNRrlf7TiVlwheXyyKnqdbCWrVi0DcYfHnwhf77bS3r6+pk9vADt/LLWO9x0s0OPBcpeon9qzLc+NDMtn3wvYQ8PxBISQh6w91LEsqoxLNh8zf3NqzZWg23hsOvH7BixQ= Received: from VE1PR08MB5149.eurprd08.prod.outlook.com (20.179.30.152) by VE1PR08MB4768.eurprd08.prod.outlook.com (10.255.113.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.15; Mon, 1 Apr 2019 16:24:25 +0000 Received: from VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::e0ae:ecad:ec5:8177]) by VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::e0ae:ecad:ec5:8177%2]) with mapi id 15.20.1750.017; Mon, 1 Apr 2019 16:24:25 +0000 From: Honnappa Nagarahalli To: "Phil Yang (Arm Technology China)" , "dev@dpdk.org" , "thomas@monjalon.net" CC: "david.hunt@intel.com" , "reshma.pattan@intel.com" , "Gavin Hu (Arm Technology China)" , "Phil Yang (Arm Technology China)" , nd , Honnappa Nagarahalli , "olivier.matz@6wind.com" , nd Thread-Topic: [PATCH v2 3/3] test/ring_perf: replace sync builtins with atomic builtins Thread-Index: AQHU5h4ilZ/xG+q7+EaxbWHpBB+abaYnf9Qw Date: Mon, 1 Apr 2019 16:24:24 +0000 Message-ID: References: <1546508946-12552-1-git-send-email-phil.yang@arm.com> <1553856998-25394-4-git-send-email-phil.yang@arm.com> In-Reply-To: <1553856998-25394-4-git-send-email-phil.yang@arm.com> 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-ms-office365-filtering-correlation-id: 5fddbb36-95c1-4299-e50a-08d6b6be8164 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VE1PR08MB4768; x-ms-traffictypediagnostic: VE1PR08MB4768: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0994F5E0C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(136003)(376002)(346002)(39860400002)(199004)(189003)(7696005)(55016002)(76176011)(446003)(97736004)(72206003)(33656002)(476003)(9686003)(229853002)(81156014)(4326008)(14454004)(26005)(256004)(68736007)(8936002)(71190400001)(6506007)(486006)(4744005)(11346002)(6246003)(66066001)(110136005)(6116002)(99286004)(7736002)(81166006)(86362001)(102836004)(305945005)(186003)(53936002)(71200400001)(3846002)(5660300002)(74316002)(54906003)(478600001)(2906002)(8676002)(6436002)(105586002)(106356001)(316002)(52536014)(2201001)(2501003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4768; H:VE1PR08MB5149.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: EkjE20xc3oitsSebAo7uce7O9p/pzryW+AI9MqhoVzwAa3UXVhi2CAnCXGQAdvry+awQxJi9yzhmgA0cwGiJtYLAGsSi+hp0MMrkl7z0BER5McbLqSR7y1oAr4jn+pV/J095uWsUx7JOlNRrnX1eZ3YrRJmMWZKyNs3o3ZOd5FRuo/8OLE3nl08fAWpri7kPphqvNT6lL+L+g32r9ZQ7FUnlUoUPHkJsK7x3RBmAlXvvXCR74TWu/a4Ffhou8a8GYXVFKbAIxVyv3YaZzI7Ln2QjOcRNcONUB/Ajq+NUQvH5OM8iYE9Y2UUfUtv784bwSskhDvhjHDcia4toylMJNFYBwqxYikQL5kEGD12K8X1MmOtlc/SNLbqLTX7xp/C9RqfJEUbDMLtCFYsu7KDjXV1QbFceqixjanS6tN1EwCM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5fddbb36-95c1-4299-e50a-08d6b6be8164 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2019 16:24:24.8917 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4768 Subject: Re: [dpdk-dev] [PATCH v2 3/3] test/ring_perf: replace sync builtins with atomic builtins 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" Message-ID: <20190401162424.vX4smxgYEgYJlOKRI64snFJ-8u61qCL4kJzlUHrWGqk@z> > diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c index > ebb3939..e851c1a 100644 > --- a/app/test/test_ring_perf.c > +++ b/app/test/test_ring_perf.c > @@ -160,7 +160,11 @@ enqueue_bulk(void *p) > unsigned i; > void *burst[MAX_BURST] =3D {0}; >=20 > - if ( __sync_add_and_fetch(&lcore_count, 1) !=3D 2 ) > +#ifdef RTE_USE_C11_MEM_MODEL > + if (__atomic_add_fetch(&lcore_count, 1, __ATOMIC_RELAXED) !=3D 2) > #else > + if (__sync_add_and_fetch(&lcore_count, 1) !=3D 2) #endif > while(lcore_count !=3D 2) > rte_pause(); Since, rte_ring library has both C11 and non-C11 implementations, condition= al compilation should be fine here. >=20 > @@ -196,7 +200,11 @@ dequeue_bulk(void *p) > unsigned i; > void *burst[MAX_BURST] =3D {0}; >=20 > - if ( __sync_add_and_fetch(&lcore_count, 1) !=3D 2 ) > +#ifdef RTE_USE_C11_MEM_MODEL > + if (__atomic_add_fetch(&lcore_count, 1, __ATOMIC_RELAXED) !=3D 2) > #else > + if (__sync_add_and_fetch(&lcore_count, 1) !=3D 2) #endif > while(lcore_count !=3D 2) > rte_pause(); >=20 > -- > 2.7.4