From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0072.outbound.protection.outlook.com [104.47.2.72]) by dpdk.org (Postfix) with ESMTP id 795851B5E6 for ; Thu, 9 Nov 2017 10:59:31 +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=TOMlOTxCmpSB8a5gWSjvsu2BKvZMUXfkeEoi3aGpSpI=; b=liJdu8CvrtYXGKzckX0XeO6ExOVXFK47SFv6crKKqIeAGqa7tiN0pPHf90K8w8H9jlwUDzgsL8XZI08Rm2rS1ETguyWka2NI7nCIzCYdGgkHUrsl5N6Nw1djV0Q0G/rPk2sE4YB0e+M89ZfN8TVfbIGn1driKOqoQ9oNP5Uoecc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jianbo.Liu@arm.com; Received: from arm.com (113.29.88.7) by DB6PR0801MB1352.eurprd08.prod.outlook.com (2603:10a6:4:b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Thu, 9 Nov 2017 09:59:27 +0000 Date: Thu, 9 Nov 2017 17:58:14 +0800 From: Jianbo Liu To: "Ananyev, Konstantin" Cc: Jia He , "Richardson, Bruce" , "jerin.jacob@caviumnetworks.com" , "dev@dpdk.org" , "olivier.matz@6wind.com" , "hemant.agrawal@nxp.com" , "jia.he@hxt-semitech.com" Message-ID: <20171109095813.GB27104@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> <20171109032145.GA26939@arm.com> <20171109045601.GA27104@arm.com> <2601191342CEEE43887BDE71AB9772585FABB311@irsmsx105.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2601191342CEEE43887BDE71AB9772585FABB311@irsmsx105.ger.corp.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [113.29.88.7] X-ClientProxiedBy: SG2PR04CA0127.apcprd04.prod.outlook.com (2603:1096:3:16::11) To DB6PR0801MB1352.eurprd08.prod.outlook.com (2603:10a6:4:b::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0fcb42de-efbe-4d10-25a5-08d5275891e9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:DB6PR0801MB1352; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1352; 3:7QrE+oXIXgD4ftJfZ6tQZ0BPtSFV4g8RVw1Skl7gZxStaoWF1nPS/6XrUzXvhQIdN84umiLCFqvyRtnPbDOGb3VsC+9Lqar4+ScD04lzhT0mE0buGo0kgFnq451GGiVKuvZguD6gonCIXL74A4PCWi4cBaGBEYEUL5CGtBGvWXrUQ+Xv9Uh5JB0KUG+puLMUwrbNfURh9Z2JTdajI4/o86WhjvcrRWTFP38D4fSoes2unLscGM2EdM7ZFsOkS+9W; 25:VrMT+xmQDdXE2DwAcVYJcaZ5gjRt5eqwKFI7gd2xM/nfbc3RxqbGUCjzTQBAnYmg4mV0lv0J2PruYXCAMi27J9zDIXBUxhAiAnZLxucDe7VqYazeTCvJmUkKBqzeGq91HeZEdxB8WkFCJ97jozkhIKJ/rjPxOw+M++ch8+3c9Ze3sxxJ+33vAN+KZHY9At0UgB2wW6uVcc5Nj33TeLvRxQG3RG1wFq/IxfZCDIZZAt/ALUXprHarpHzkYH5pmCZDXrp8M4YoPiVH9+DexkwE5Cme6G063maAVKq4MNidryWC5X9pWYtLarV5Nb4QFS7Un1WT4Sje4rMkC14DpQMJjQ==; 31:9wXnUgQ8UUXXpKTtfKCTTHr1HD8XkDiviAVykcttE5OafRzWjZBCMikCP1zrP+mog96uMq2PDVwG5FfMaUKeNu7KHgESEsNp7DKk5Arg7CxlYkTpVxNLBTlM3x1JdvCcs5kQdHC6hCc5fQTMjjsJC93bhpze3IbfosCvdGU8Hvp9p4HHp/u3mdUAhVyI85ze0RCFRQEWD+N4Qvv/7y+H8CGKvcYfeUIy6ZUoFe13YI8= X-MS-TrafficTypeDiagnostic: DB6PR0801MB1352: Content-Transfer-Encoding: quoted-printable X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1352; 20:Q3PvCSnF2nyjNN6SNqCaE/6QvK99f9eCiR9DsfPBs4KhiBadzc7crzz5Y7jAsnVB8ybym8YibOp1KYGem0e7npOJrAYRJdx3mF5Gmo8pUEIeIQYRUSHqlivtkspII3aThHYmXlkyNSAsoWMAcQ8EWIWWdnHIB0aQKRUCNH5hudZuwCbUyWN+q5iQjX3wE2CZDq6NSz45o50I+pYt0sWuWw2XQZ3uG2/UVJPbTIbSpGb0TdmFXkHaR4dvI+FREm8e9ybXzyXFs5aZA7wWV3kIGqePdruo3jKwNyZ8ZysUgsgLDXmMnOUOKCskpZf7Go0BH5BU9qhJRpaCSU6c7rKrW+kPqd4WHJA2Otg2C8RPay0uts8Nr2oQrlKAspwwQFtxVdur4b1hNhvlajz6tf9jAwFolPV3oaw8Lv0i/dYivAoay7XG5ahQkHLRpX32I6cZAvA2xSkplPmMBnoUUKS+7sUaCWdxUuzE+20U3KtgZCtJQ7DzvhEB551HbIcRO/Pc; 4:AAcxeQ/YpCWGPsLZDe/yo0xYduKdrTO4C3VUi5Krx/EQL+oZTMcYat10KwV0PRrjJu8DqGsEQkTGmu5z3ynkpHCvJIeaZK03syWJ/PnjhG/hAChooXWFXbBMazi8U4UYamtXen1PWtQHeiJq+5yCoWjSm+9cC7ox12s55a/9sk4ZoW2rboFhawPnDcLcEleflclLXKyoiezdCf793pNmJblnKLQPJeautYVjtftkG6sb9FJ6gLPf4HgtmAzaFPUizkncHE1ufnus2i3Rf5XttloACryw6F/hnEMX0isxexvp7Df9QSjoaSrZzezd2rwhakbpm0QoLz6bQE8erQq43CT1hxm+/Pjl7x3pUg6qhvdf2JXsjkiyHbLzmPjoz+ow X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(185117386973197)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(3231021)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123564025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0801MB1352; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0801MB1352; X-Forefront-PRVS: 0486A0CB86 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(24454002)(13464003)(40434004)(199003)(189002)(6666003)(53546010)(25786009)(6916009)(478600001)(33656002)(47776003)(93886005)(6246003)(21086003)(66066001)(5660300001)(2950100002)(81156014)(8676002)(101416001)(81166006)(54356999)(7736002)(305945005)(1076002)(3846002)(6116002)(50986999)(2906002)(76176999)(68736007)(72206003)(8936002)(53936002)(106356001)(105586002)(36756003)(189998001)(86362001)(23676003)(16526018)(55016002)(39060400002)(4326008)(8656006)(97736004)(229853002)(8746002)(5890100001)(58126008)(83506002)(316002)(50466002)(54906003)(18370500001)(125773002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0801MB1352; H:arm.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjZQUjA4MDFNQjEzNTI7MjM6YTNmejNEY1ptaHhIaFdnaVlUeXdFSTZU?= =?utf-8?B?dUxQMUxENkVaMC9ueHRIRGV0MVA4bDVzbjBjbzNwMmEycjVDWUhjYVpWYkRR?= =?utf-8?B?UUhsWDNObmhaeEtQZ2tuMG0xaTBtYmtnR1lxY3ptbnNqZlVJTE94K3NITk9k?= =?utf-8?B?aXYyM2x3YmE2bE5SclorV2V6SVdOTVBUcGdnV2IyR1RySFY0QityUUtBeXY2?= =?utf-8?B?TTVMQUp1c1BwRk5vT0V5T3NXd09QR1FNUW1WbE5zQjZrLzQwb0pyTHQvVWdr?= =?utf-8?B?ZVQ1S2I3d1oxcmxWMGRUQXVUZmMvQ05QRTBOejZLZGw4Q0pUT0RjWGZRci9K?= =?utf-8?B?UVUxTXNyaW5lQWpLSDh6cGRLU21lMzdwaXpHRlR1T2dmTlE4QVBybmJqUllU?= =?utf-8?B?SExlbjRVYkc0MWNoOUJSQnJ4QnVIdUJFNkpjVGkxeFVScTN0SHQyTUsrK3Fz?= =?utf-8?B?aFpPZVJLSW9RTzNQRHZic01hSWptVTIyZ0Z5NEJIMXJNb3FvYnlia0hvY0Rr?= =?utf-8?B?bTJPSmhuWmwySzl5Z1FFZnlkSkdhQnluL1k3SklrTE9YbGR5SjFNODhhcDVS?= =?utf-8?B?eUpNN1JYZXNNRXA3NDJ2RnVjUnNnVlJLT0E4ZUZ0Ymhob3lKRjA3TmtmaU5x?= =?utf-8?B?ZHVNeXJYeC9Dalo4MXQvdW1NdCtJV1FHTnMwYllmcWxzL0U2eEhkZHB4RFlo?= =?utf-8?B?TEpVNVc5YlpZQU5WVURIQnQ1WlE5VmtDbFNzQ0xmRTRyYkd2VkRaNWJMTnJa?= =?utf-8?B?NjlZL3M0Y1BMSUs5SVNLaGg1bENnRVk0SU54WE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yQb15uaHFJLGGHe7S3lbzucJE7LHk7p0rHo1NmjaUIFPQOTnXKA1wOcpH78+Ijm//GWt1f09B02RBIXlxdnJyAlnKrDA5P5oDTz0OxG7MXunOqkpKWGvB6YC9W2T2+raAIn8HH6OgCbn3iPxDYcnyYxzu7k29DNPPFJmqwCvuZnh SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2017 09:59:27.3716 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0fcb42de-efbe-4d10-25a5-08d5275891e9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1352 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 09:59:31 -0000 The 11/09/2017 09:38, Ananyev, Konstantin wrote: > > > > -----Original Message----- > > From: Jianbo Liu [mailto:jianbo.liu@arm.com] > > Sent: Thursday, November 9, 2017 4:56 AM > > To: Jia He > > Cc: Richardson, Bruce ; jerin.jacob@caviumn= etworks.com; dev@dpdk.org; olivier.matz@6wind.com; > > Ananyev, Konstantin ; hemant.agrawal@nxp.= com; jia.he@hxt-semitech.com > > Subject: Re: [PATCH 1/3] eal/arm64: remove the braces {} for dmb(),dsb(= ) > > > > The 11/09/2017 12:43, Jia He wrote: > > > Hi Jianbo > > > > > > > > > On 11/9/2017 11:21 AM, Jianbo Liu Wrote: > > > >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) > > > >>>>> rte_smp_rmb(); > > > >>>>>else > > > >>>>> rte_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 > > > >>>>>--- > > > >>>>> lib/librte_eal/common/include/arch/arm/rte_atomic_64.h | 4 ++= -- > > > >>>>> 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" { > > > >>>>> #include "generic/rte_atomic.h" > > > >>>>> -#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 us= e > > > >>>>do { ... } while(0) > > > >>>If trailing ";" is not removed > > > >>>the code: > > > >>>if (condition) > > > >>> rte_smp_rmb(); > > > >>>else > > > >>> anything(); > > > >>> > > > >Sorry, why not use two different functions as your conditions passed= in > > > >are fixed in the calling functions. > > > Do you mean to split update_tail() into update_tail_enqueue() and > > > update_tail_dequeue()? > > > > Yes. So it's not need to change dsb/dmb. > > That's a good idea - but you still might hit the same problem in > Some different place in future... I think there is no any issue if we add {} for if/else sections. - if (enqueue) + if (enqueue) { rte_smp_wmb(); - else + } else { rte_smp_rmb(); + } It's not a good way to ommit {}. Jianbo > Why not to convert these macros into 'always_inline' functions then? > Konstantin > > > > > Jianbo > > IMPORTANT NOTICE: The contents of this email and any attachments are co= nfidential and may also be privileged. If you are not the > > intended recipient, please notify the sender immediately and do not dis= close the contents to any other person, use it for any purpose, or > > store or copy the information in any medium. Thank you. -- 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.