From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30045.outbound.protection.outlook.com [40.107.3.45]) by dpdk.org (Postfix) with ESMTP id 68EA01B23C for ; Thu, 9 Nov 2017 04:22:59 +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; bh=w7HnSq4zQb1q+CDCpuWIOLknhjpPjAOQ77B8KIERzZk=; b=cUkdzmkT9SAvlSleT3gNHZ5loFqlUwq5BtNTuXHen3NOWHRAzpe/Tb1rZVXT29Pscp5qqKdTTNhS4wXMaUPamwEdA9ITWBniapRYGSAGSELfXP8oqDP8dctQ8cCO1K8XBY6y6PPnTCNZyPwH68PItpTth0K8etJvNYl2HNqlR+w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jianbo.Liu@arm.com; Received: from arm.com (113.29.88.7) by HE1PR0801MB1355.eurprd08.prod.outlook.com (2603:10a6:3:3a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Thu, 9 Nov 2017 03:22:53 +0000 Date: Thu, 9 Nov 2017 11:21:46 +0800 From: Jianbo Liu To: Jia He Cc: Bruce Richardson , jerin.jacob@caviumnetworks.com, dev@dpdk.org, olivier.matz@6wind.com, konstantin.ananyev@intel.com, hemant.agrawal@nxp.com, jia.he@hxt-semitech.com Message-ID: <20171109032145.GA26939@arm.com> References: <1510121832-16439-1-git-send-email-hejianet@gmail.com> <20171108102814.GA7552@bricha3-MOBL3.ger.corp.intel.com> <9086316b-c16b-c42b-2d85-9b01fa2f66e1@gmail.com> <028263d0-44de-bd0c-c495-081588a0ad20@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <028263d0-44de-bd0c-c495-081588a0ad20@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [113.29.88.7] X-ClientProxiedBy: SG2PR0401CA0010.apcprd04.prod.outlook.com (2603:1096:3:1::20) To HE1PR0801MB1355.eurprd08.prod.outlook.com (2603:10a6:3:3a::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2d90aa91-eb01-43e9-9d77-08d527212bd6 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603249); SRVR:HE1PR0801MB1355; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1355; 3:GcZpuL4Km1ifVnpCy/zxAmfQUxmEzYfuiO/z1N4wJK1ibRDOO7mKpxNx7dIMR/HYJAbqUNg+4cu14izzIjL9LfzVv12IDt20QBUq1Mzj8srS0BgxWynF2cLwKFZqIE3prWI3K/pD64EmxbJ47QQ8PkH3G6zxPnZby/cAniAasS+ynuKXm0qLXYYMqANHV1cH+Cp2kmUznzulHjVcyZ8LZJh2ci4V16yS5+kb5irxRvmiSezJWY/PX2VJfAOp7zO1; 25:BjEu++zCLBqmV20xalbdxHYX5PFay9bF+FpQ79iZ+WOod6cJMDwTuIHOSfDrfIPZ6SCB5bWie47iXP3pWun+BeW6zVCSyQd7aBu4uaO01ao5oLFykWFaSA1cvYV72B+3OxDBHvNSLAJq5xmpzT/SMz6pnoIf3f9kq+0Efu2DMt6+wJ8lCb+lavqJtmK+EFX5HPKghv0xP/m+FVfd13WsqBTyct/g3H7NVEJ9R0qaKtuFfzolFA9ZbqWdVO4U3zAHzoWK6FPX3fzRKM96cDiVIC1NyRbhXoo558xiEc2opS3+Y9MYyFScWnWgqXZ2DlbveD/J4NDkOPTz/IPcuRdAQw==; 31:oZDX1qWVugU+KcULHrCGPziCsj7eH0XwDgsfiBJet1EcB9bBZVGQdxT/at2AQICb8fYSMuktkBZh9o6u36fOcjkSFV0PDYZ+k/PR/97zUS1yr5Ukbt4poPXegY/s5ED+HUDKDWjffcBJvSyZ4u38gy1bameg1icGEjt2lUQtBqaqFKZZkk8VwDuJfNsNWpWeos8woRETsUiIe4GNaTYP5P40rORRdT6w2P6cGzNAwy0= X-MS-TrafficTypeDiagnostic: HE1PR0801MB1355: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1355; 20:RofqpZJk8mPx6VKf3knAjRNOq5VnKUM8zy8cLGcfRQpCPrMh+lfBMDwu9aQCa9CemaFPBC/WhRtBkeKFOf32oPAQwfHrXfy26XP5qTn+5cg3YMs6En2ytBLAWoYFgPRC9YILzdYYj+4W6yguMfS5qDkiw28xtXD1XFN37hk4kkhz8O4vo7o+TExYLCZ4wBpSQflZ7+PvHhZcsJXuwzd1pdJvKMWhKTqFfyHfWLTu2hW4dMHkvezD+iQJbObdfTuDnyfM4VbEW9Asn8+YuAVqnN+mtWZRG5b+oM6XY0VMveAYasBXvlrhBe7ZSxktL7sndpNa5NT+PNh4dkAj9KJzLnCic0zqPUJp5AfgJQqnD6Pz7Du+5PhXrvE1aSOPCgvJjUfhfeYC0L5+004grKzNbWMJiVynh64YPci838esLCEVwsbwOqFX+dgqccT0wrFVQgAXeJkBSgvypOJ9TLADrEiNtDMs82e2bb0pxH4vtZaNqzBmnNPHs6PYJ+6EZiRN; 4:X6QnFGji0K0Z7RzpC60GiQ1AQKBXoHYMw7Y49k+gL7x8oD+BE41oFBjLBRfXjhvCvDi889KI1OrRjmbVXYTecFIaC7vatLuTci3YTWYEN60aVxsMKxBZe+pYQD1Qkf8KHz0VsLIz7JxbTqWFVCF/ITtHS2Vo7DeNNQgqVn8H0pr995ajJEg+gsjrI6CQMW3IriB6k1B+b+SMbFWR5IbHEyk8Mp32N435rYp61pnlVgwOJE9uOoCtVZT+xtTjpB2WM+1DenC1DghRFDzKmOfcJA== X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231021)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0801MB1355; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0801MB1355; X-Forefront-PRVS: 0486A0CB86 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(189002)(40434004)(24454002)(199003)(8656006)(16526018)(25786009)(72206003)(33656002)(478600001)(8676002)(81166006)(81156014)(6666003)(106356001)(2950100002)(7736002)(305945005)(53936002)(55016002)(97736004)(23676003)(83506002)(5890100001)(1411001)(4326008)(6246003)(50466002)(316002)(93886005)(105586002)(2906002)(39060400002)(58126008)(1076002)(229853002)(6116002)(3846002)(50986999)(76176999)(68736007)(86362001)(21086003)(101416001)(54356999)(36756003)(8746002)(66066001)(5660300001)(6916009)(8936002)(189998001)(47776003)(18370500001)(125773002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0801MB1355; H:arm.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA4MDFNQjEzNTU7MjM6QTVsWHJENWs0b0Fab3BIUkF1ZHU2QVZk?= =?utf-8?B?SCtaT1ZQWnFHM3QxUXh2UTZCY1ZjWDg0TnNZemhmUStjT3QvVC9rdUZHZ1Q0?= =?utf-8?B?ZmMvUVV4UWszVDAxTV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KgzU6gjU0Zs6Pn6qPAZLf5YAa3ZrCo3xVOk2Qsqe4xKEQZ5FgWIcCS5PGvRsDLsJuywRX+V6ILt9yiCB+VI0p+sG2EraXnWOcCjp0/sL2TZEYoOC+UnO43oebfR2E106Taz7Qflt/dAdfIP71++yYXw8N4uQJv8tl1es8Fsx8k8dJdnh/aGd2K82Rvz8siUiZB2gC4QxYnsxKfu/R1SWjJZeL6dFsSaFLudQR9F6Tt4Tz2F5/6eZJgMu5T3J9jkf1hh2HaYbSyaq6mU7TmsuFEB0hqk3z7bYNHpFjXGk/YyzcZAbe11hBwFIVxf1Ng7ph+dNoSB26QxXtLS7Qw/q2ZIeF/3ffWufYkzmpE=; 5:mz4giU67yhiTSmHnwzbUYMzJqAYATxO0ZMkjIuiVtbJMqfV3lnn9k8vi2BdG0L35Yg5O8ib5UhSXdXCVaJbadOZMUYTyAhDbk92ENRbvprqMzCCrUNKNan5qwZDOkhv49gB1gyv3sU3hszOzpWCFoTLkuYuhWQniIco6XdccN90=; 24:uG2TezeNhIe8pygGZef+JoC5YsTP5GIMV3Siz1yJE1ryz/pAAPN0RXeU49Raarr1Wo99c5UsrFU623Llyjfusd+lRKOJPpTrrh4nJkZVku0=; 7:8Syz7918PRgW5JdVuRO7EeLlPZxCi8xPaJdJFdT/Vb8m5VPsArFA3d7PBmtvU/pZxDT3dNkqB2K58Ap61nvPRN/9oA3zScMMu96JLeOYXhgOdSsyFxL/sTo8B9hrwaqLSAXaDLwiyMVGOqjgdZFiISMcDLkzPpgDhSBemS/vCU+U28ZPtHxF4+dwRBnz6vQvufx/IGOBALCzzzug3WuI6Ll/UbOPrjV1dgre8jSZbTM2tsKEDGe0MPc1Q2zf+Rf/ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2017 03:22:53.7553 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2d90aa91-eb01-43e9-9d77-08d527212bd6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1355 Subject: Re: [dpdk-dev] [PATCH 1/3] eal/arm64: remove the braces {} for dmb(), dsb() 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, 09 Nov 2017 03:22:59 -0000 The 11/09/2017 11:14, Jia He wrote: > > > On 11/9/2017 9:22 AM, Jia He Wrote: > >Hi Bruce > > > > > >On 11/8/2017 6:28 PM, Bruce Richardson Wrote: > >>On Wed, Nov 08, 2017 at 06:17:10AM +0000, Jia He wrote: > >>>for the code as follows: > >>>if (condition) > >>>=C2=A0=C2=A0=C2=A0=C2=A0rte_smp_rmb(); > >>>else > >>>=C2=A0=C2=A0=C2=A0=C2=A0rte_smp_wmb(); > >>>Without this patch, compiler will report this error: > >>>error: 'else' without a previous 'if' > >>> > >>>Signed-off-by: Jia He > >>>Signed-off-by: jia.he@hxt-semitech.com > >>>--- > >>>=C2=A0 lib/librte_eal/common/include/arch/arm/rte_atomic_64.h | 4 ++-- > >>>=C2=A0 1 file changed, 2 insertions(+), 2 deletions(-) > >>> > >>>diff --git > >>>a/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h > >>>b/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h > >>>index 0b70d62..38c3393 100644 > >>>--- a/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h > >>>+++ b/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h > >>>@@ -43,8 +43,8 @@ extern "C" { > >>>=C2=A0 #include "generic/rte_atomic.h" > >>>=C2=A0 -#define dsb(opt) { asm volatile("dsb " #opt : : : "memory"); = } > >>>-#define dmb(opt) { asm volatile("dmb " #opt : : : "memory"); } > >>>+#define dsb(opt) asm volatile("dsb " #opt : : : "memory"); > >>>+#define dmb(opt) asm volatile("dmb " #opt : : : "memory"); > >>Need to remove the trailing ";" I too I think. > >>Alternatively, to keep the braces, the standard practice is to use > >>do { ... } while(0) > >If trailing ";" is not removed > >the code: > >if (condition) > >=C2=A0=C2=A0=C2=A0 rte_smp_rmb(); > >else > >=C2=A0=C2=A0=C2=A0 anything(); > > Sorry, why not use two different functions as your conditions passed in are fixed in the calling functions. > >will be like below after precompiling: > >if (condition) > >=C2=A0=C2=A0=C2=A0 asm volatile("dsb " "ld" : : : "memory");; > >else > >=C2=A0=C2=A0=C2=A0 anything(); > >Then, the same error - error: 'else' without a previous 'if' > > > Ignore my words above=EF=BC=8Cthanks > sorry for the inconvenience. > And I've sent out v4 in this mail thread. The ";" has been removed. > If no more comments, I will send out v5 (2 patch sets for 17 and 18) > > -- > Cheers, > Jia > > > -- > Cheers, > Jia > -- IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.