DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: Gowrishankar <gowrishankar.m@linux.vnet.ibm.com>
Cc: dev@dpdk.org, Olivier Matz <olivier.matz@6wind.com>, thomas@monjalon.net
Subject: Re: [dpdk-dev] [PATCH] ring: fix compilation error with a broken else clause
Date: Tue, 30 Jan 2018 14:26:08 +0530	[thread overview]
Message-ID: <20180130085607.GA29747@jerin> (raw)
In-Reply-To: <0d242c92a3734252f6baa5592c56afeba254941b.1517301739.git.gowrishankar.m@linux.vnet.ibm.com>

-----Original Message-----
> Date: Tue, 30 Jan 2018 14:18:46 +0530
> From: Gowrishankar <gowrishankar.m@linux.vnet.ibm.com>
> To: dev@dpdk.org
> CC: Olivier Matz <olivier.matz@6wind.com>, thomas@monjalon.net,
>  Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> Subject: [dpdk-dev] [PATCH] ring: fix compilation error with a broken else
>  clause
> X-Mailer: git-send-email 1.9.1
> 
> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> 
> 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 <gowrishankar.m@linux.vnet.ibm.com>
> ---
> 
> 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


>  		rte_smp_wmb();
> +	}
>  	else
>  		rte_smp_rmb();
>  	/*
> -- 
> 1.9.1
> 

  reply	other threads:[~2018-01-30  8:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30  8:48 Gowrishankar
2018-01-30  8:56 ` Jerin Jacob [this message]
2018-01-30  9:09   ` gowrishankar muthukrishnan
2018-01-30  9:13     ` Thomas Monjalon
2018-01-30 10:53 ` [dpdk-dev] [PATCH v2] eal/ppc: " Gowrishankar
2018-01-30 13:46   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180130085607.GA29747@jerin \
    --to=jerin.jacob@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=gowrishankar.m@linux.vnet.ibm.com \
    --cc=olivier.matz@6wind.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).