From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id D8F1F1B306 for ; Tue, 30 Jan 2018 10:09:20 +0100 (CET) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0U98H9E017623 for ; Tue, 30 Jan 2018 04:09:20 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ftkcyp9mt-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 30 Jan 2018 04:09:19 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Jan 2018 09:09:17 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 30 Jan 2018 09:09:13 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0U99DhA66125872; Tue, 30 Jan 2018 09:09:13 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E304A11C066; Tue, 30 Jan 2018 09:02:43 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2C72011C05B; Tue, 30 Jan 2018 09:02:43 +0000 (GMT) Received: from [9.124.35.17] (unknown [9.124.35.17]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 30 Jan 2018 09:02:42 +0000 (GMT) To: Jerin Jacob Cc: dev@dpdk.org, Olivier Matz , thomas@monjalon.net References: <0d242c92a3734252f6baa5592c56afeba254941b.1517301739.git.gowrishankar.m@linux.vnet.ibm.com> <20180130085607.GA29747@jerin> From: gowrishankar muthukrishnan Date: Tue, 30 Jan 2018 14:39:11 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180130085607.GA29747@jerin> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-TM-AS-GCONF: 00 x-cbid: 18013009-0020-0000-0000-000003F03D7D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18013009-0021-0000-0000-000042829D6E Message-Id: <39703dba-4199-79eb-6624-00496f20865c@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-30_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801300116 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:09:21 -0000 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 ‘update_tail’: >> /tmp/dpdk/lib/librte_ring/rte_ring_generic.h:75:2: error: ‘else’ without a previous ‘if’ >> else >> ^~~~ >> /tmp/dpdk/mk/internal/rte.compile-pre.mk:114: recipe for target 'rte_ring.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=59a3cae5305816b3739b4197d277f9455af53b9f Thanks Jerin. Yes. Similar fix also works. I did not want to touch 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 change. If so, I can send version 2 patch with similar change as you showed. Thanks, Gowrishankar > >> rte_smp_wmb(); >> + } >> else >> rte_smp_rmb(); >> /* >> -- >> 1.9.1 >>