From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 6504F1B307 for ; Tue, 30 Jan 2018 10:14:06 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B5EC020D31; Tue, 30 Jan 2018 04:14:04 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 30 Jan 2018 04:14:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=tWfWLJBnF2IJxY9tOJdZbvNpMS +qDsW5HuBo2IL48S0=; b=fg0pYE4LmcHgfBOcWJ8PVhqexDntdShPg8D1AcmY7s gcNXid78xFL8VKiNHd3v1eVd/Yn1M+wOv8m/COQIujiDB57vHXulHBfEHlrraLl5 7DhTRfO2jZEvCd5dLXCMEqyGFw9RBeUd1sDwbtZgmFCsSmVzeI+LHbah+Z1Km/Ty A= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=tWfWLJ BnF2IJxY9tOJdZbvNpMS+qDsW5HuBo2IL48S0=; b=ArW27V4r2wXcBBYbD73Asg jrhDlpTTFiISwVk0943I9N+zg6JB/wUy0W7C0Yk+7IURyClzsKg66qIEi6CVCfjl ImDfTJK1m9AbCWtiBEx1tBAUtdZimQsPP/s2kXQDJ2gTkicL0xd2DgezvZFMxMBG dg0KpACGN94eLqhEV34hMxfk0PhqqxaNG3HxcYkk5pgSps3LD8a7uQh3T9YWxLKw sr1AavthzUJxo6jqZCqT61uxZpg5pGK/cIHazuiGuTCadb7ysoGwCulXetzBX+b3 c3XoIvM6pCXeDqu+fosNcEjHaugt9EVgjkNPSOEQ8O9aS44AlFrG4rIqC2zts0iw == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 5CC717E689; Tue, 30 Jan 2018 04:14:04 -0500 (EST) From: Thomas Monjalon To: gowrishankar muthukrishnan Cc: Jerin Jacob , dev@dpdk.org, Olivier Matz Date: Tue, 30 Jan 2018 10:13:16 +0100 Message-ID: <1695593.b6GUU2UBLd@xps> In-Reply-To: <39703dba-4199-79eb-6624-00496f20865c@linux.vnet.ibm.com> References: <0d242c92a3734252f6baa5592c56afeba254941b.1517301739.git.gowrishankar.m@linux.vnet.ibm.com> <20180130085607.GA29747@jerin> <39703dba-4199-79eb-6624-00496f20865c@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] ring: fix compilation error with a broken else clause 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: Tue, 30 Jan 2018 09:14:06 -0000 30/01/2018 10:09, gowrishankar muthukrishnan: > On Tuesday 30 January 2018 02:26 PM, Jerin Jacob wrote: > > -----Original Message----- > >> Date: Tue, 30 Jan 2018 14:18:46 +0530 > >> From: Gowrishankar > >> To: dev@dpdk.org > >> CC: Olivier Matz , thomas@monjalon.net, > >> Gowrishankar Muthukrishnan > >> Subject: [dpdk-dev] [PATCH] ring: fix compilation error with a broken = else > >> clause > >> X-Mailer: git-send-email 1.9.1 > >> > >> From: Gowrishankar Muthukrishnan > >> > >> Calling rte_smp_wmb macro expands into a compound block, which > >> would break compiling a else clause following it, if that calling > >> place has been terminated already with ";", as in below code. > >> This patch adds { } around this macro to allow compiling else too. > >> > >> Fixes: git show c9fb3c6289 ("ring: move code in a new header file") > >> > >> Signed-off-by: Gowrishankar Muthukrishnan > >> --- > >> > >> Error in compiling source: > >> > >> In file included from /tmp/dpdk/lib/librte_ring/rte_ring.h:372:0, > >> from /tmp/dpdk/lib/librte_ring/rte_ring.c:90: > >> /tmp/dpdk/lib/librte_ring/rte_ring_generic.h: In function =E2=80=98upd= ate_tail=E2=80=99: > >> /tmp/dpdk/lib/librte_ring/rte_ring_generic.h:75:2: error: =E2=80=98els= e=E2=80=99 without a previous =E2=80=98if=E2=80=99 > >> else > >> ^~~~ > >> /tmp/dpdk/mk/internal/rte.compile-pre.mk:114: recipe for target 'rte_r= ing.o' failed > >> > >> lib/librte_ring/rte_ring_generic.h | 3 ++- > >> 1 file changed, 2 insertions(+), 1 deletion(-) > >> > >> diff --git a/lib/librte_ring/rte_ring_generic.h b/lib/librte_ring/rte_= ring_generic.h > >> index 8c3e65b..a668489 100644 > >> --- a/lib/librte_ring/rte_ring_generic.h > >> +++ b/lib/librte_ring/rte_ring_generic.h > >> @@ -70,8 +70,9 @@ > >> update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t= new_val, > >> uint32_t single, uint32_t enqueue) > >> { > >> - if (enqueue) > >> + if (enqueue) { > > Just wondering, Is it because of rte_smp_wmb() implementation of ppc64 = is > > not just correct? > > > > We had a similar fix for arm64. > > http://dpdk.org/browse/dpdk/commit/?id=3D59a3cae5305816b3739b4197d277f9= 455af53b9f > Thanks Jerin. Yes. Similar fix also works. I did not want to touch=20 > include/ at this time, as it is called at various places in source. > As same problem is seen in arm64, I think it is ok to go with your=20 > change. If so, I can send version 2 patch with similar change as you show= ed. Please send a patch for the fix in atomics.