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 0A75EA0471 for ; Fri, 19 Jul 2019 07:15:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 80CD52BA8; Fri, 19 Jul 2019 07:15:14 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10055.outbound.protection.outlook.com [40.107.1.55]) by dpdk.org (Postfix) with ESMTP id 76E86231E for ; Fri, 19 Jul 2019 07:15:13 +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=BNSdlY3AHi+ognDIxO9Lhc65a4fmUeSMZRHUyoQ5WKY=; b=jaolAhr2et+01GY0ClU7K2PfzDXBF7dCy1tJoRcWVk9b5KXegnoxcyhXmwglbx07Zch2GTJs69eypfY7QS4BvWmd+N/7FT84tstUhVqY8/w3bF5kpb1Xmo82+CL/DVTXuXj833h1LfHKxO7C86kovzHTWWSpXwHTDpFFRAy9aDY= Received: from VE1PR08MB4640.eurprd08.prod.outlook.com (10.255.27.75) by VE1PR08MB5055.eurprd08.prod.outlook.com (10.255.159.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.19; Fri, 19 Jul 2019 05:15:12 +0000 Received: from VE1PR08MB4640.eurprd08.prod.outlook.com ([fe80::f4e4:378b:49d3:d876]) by VE1PR08MB4640.eurprd08.prod.outlook.com ([fe80::f4e4:378b:49d3:d876%5]) with mapi id 15.20.2094.013; Fri, 19 Jul 2019 05:15:12 +0000 From: "Phil Yang (Arm Technology China)" To: "jerinj@marvell.com" , "Eads, Gage" , "dev@dpdk.org" CC: "thomas@monjalon.net" , "hemant.agrawal@nxp.com" , Honnappa Nagarahalli , "Gavin Hu (Arm Technology China)" , nd , nd Thread-Topic: [EXT] [PATCH v3 3/3] eal/stack: enable lock-free stack for aarch64 Thread-Index: AQHVPekETn3p0d1g+Ea/3eXmx1KzjabRXNOAgAAFyYCAAAA80A== Date: Fri, 19 Jul 2019 05:15:11 +0000 Message-ID: References: <1561257671-10316-1-git-send-email-phil.yang@arm.com> <1561709503-11665-1-git-send-email-phil.yang@arm.com> <1561709503-11665-3-git-send-email-phil.yang@arm.com> <9184057F7FC11744A2107296B6B8EB1E68D23943@FMSMSX108.amr.corp.intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: bbdc6b0a-fb45-49ad-9b98-44a68c7df461.0 x-checkrecipientchecked: true authentication-results: spf=none (sender IP is ) smtp.mailfrom=Phil.Yang@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9d57a521-51fd-4303-3cac-08d70c081368 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:VE1PR08MB5055; x-ms-traffictypediagnostic: VE1PR08MB5055: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-microsoft-antispam-prvs: nodisclaimer: True x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 01039C93E4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(346002)(366004)(396003)(376002)(39860400002)(199004)(189003)(13464003)(8936002)(5660300002)(186003)(478600001)(52536014)(14444005)(102836004)(55016002)(55236004)(53546011)(305945005)(7696005)(2501003)(6506007)(8676002)(86362001)(7736002)(99286004)(81166006)(6246003)(2906002)(81156014)(76176011)(66066001)(229853002)(66476007)(4326008)(25786009)(66446008)(53936002)(6436002)(71190400001)(9686003)(14454004)(3846002)(66946007)(76116006)(68736007)(33656002)(561944003)(446003)(74316002)(476003)(11346002)(66556008)(71200400001)(64756008)(110136005)(256004)(54906003)(486006)(316002)(6116002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5055; H:VE1PR08MB4640.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: 00/NUFI4W/n2rTO8xmCt0Sc2anNO76IojnXrde66Li4/mwdO6/78PnCNm9HxMuSUS7EaI9bceD+MN75y9wPhhQzWOV6GhAn9urToLo4IlpwVrpMvO9aTyoBuy/lgi7W7jl5tYdcPTMFmYAAw8/D1lIKxlXRjfo8wkk2UI47TQeEDVIAM0ngz8M38eZpEJAEeTTXyBIKZGDyYkDiLndnZdALr0KNDWC8Rbol5hyZV0DP4ojwq/T4wlpRj12EevEf5E4n09AFjC3VPTGQThOCiI9DrN2/EEzpbQKId+YqCxGZV7W9hJTUV4Imn/CMvKKIu3aGjEsEpsAIKQ3xjaa3BfKbIHf//as6Y5/2ypLxR1pjmb95wpw0yd4ELuh0aVWcNgMs32wvTGDBhJ/5qEleyeclgshWd8i0TZ++WLW4Q+BI= 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: 9d57a521-51fd-4303-3cac-08d70c081368 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2019 05:15:11.9035 (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-CrossTenant-userprincipalname: Phil.Yang@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5055 Subject: Re: [dpdk-dev] [EXT] [PATCH v3 3/3] eal/stack: enable lock-free stack for aarch64 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" > -----Original Message----- > From: Jerin Jacob Kollanukkaran > Sent: Friday, July 19, 2019 1:03 PM > To: Eads, Gage ; Phil Yang (Arm Technology China) > ; dev@dpdk.org > Cc: thomas@monjalon.net; hemant.agrawal@nxp.com; Honnappa > Nagarahalli ; Gavin Hu (Arm Technology > China) ; nd > Subject: RE: [EXT] [PATCH v3 3/3] eal/stack: enable lock-free stack for > aarch64 >=20 > > > Can we remove this all #ifdef clutter by adding the following > > > > > > $ git diff > > > diff --git a/lib/librte_stack/rte_stack_lf.h > > > b/lib/librte_stack/rte_stack_lf.h index f5581f0c2..46af08b83 100644 > > > --- a/lib/librte_stack/rte_stack_lf.h > > > +++ b/lib/librte_stack/rte_stack_lf.h > > > @@ -5,7 +5,7 @@ > > > #ifndef _RTE_STACK_LF_H_ > > > #define _RTE_STACK_LF_H_ > > > > > > -#ifdef RTE_USE_C11_MEM_MODEL > > > +#if defined (RTE_USE_C11_MEM_MODEL) && > > defined(RTE_ARCH_X86_64) > > > && > > > +defined(RTE_ARCH_ARM64) > > > > I assume you meant (defined(RTE_ARCH_X86_64) || > > defined(RTE_ARCH_ARM64))? >=20 > Yup. >=20 > > > > > #include "rte_stack_lf_c11.h" > > > #else > > > #include "rte_stack_lf_generic.h" > > > > > > > > > > The ifdefs in those two headers prevent DPDK from trying to build > > rte_atomic128_cmp_exchange() on architectures that don't implement it. > So > > the proposal wouldn't quite work, since rte_stack_lf_generic.h calls > > rte_atomic128_cmp_exchange(). > > > > Something like this could work: > > > > #if !(defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_ARM64)) #include > > rte_stack_lf_stubs.h #else #ifdef RTE_USE_C11_MEM_MODEL #include > > "rte_stack_lf_c11.h" > > #else > > #include "rte_stack_lf_generic.h" > > #endif > > #endif > > > > Where rte_stack_lf_stubs.h is a new header containing stub > > implementations of __rte_stack_lf_count, __rte_stack_lf_push_elems, > and > > __rte_stack_lf_pop_elems. It still has some ifdef clutter, but less ove= rall. >=20 > Agree. I prefer to take this route to reduce the ifdef clutter across gen= eric > and c11 files. Got it. I will update it in the next version. Thanks, Phil Yang