Thank you for the reviews. Series applied with an incremental shown below, Jarno
On Jun 2, 2014, at 9:24 PM, YAMAMOTO Takashi <yamam...@valinux.co.jp> wrote: >> ovsrcu_set() and ovsrcu_init() look like functions, so users are >> justified in expecting the arguments to be evalueated before any of > > evaluated > Thanks. >> >> +#define ovsrcu_set__(VAR, VALUE, ORDER) \ >> + ({ \ >> + typeof(VAR) var__ = (VAR); \ >> + typeof(VALUE) value__ = (VALUE); \ >> + memory_order order__ = (ORDER); \ >> + \ >> + atomic_store_explicit(&var__->p, value__, order__); \ > > ovs-atomic-gcc4+ version of atomic_store_explicit also has > a variable named order__. is it safe? > Good catch, applied with the following incremental: diff --git a/lib/ovs-rcu.h b/lib/ovs-rcu.h index e27dfad..87651d8 100644 --- a/lib/ovs-rcu.h +++ b/lib/ovs-rcu.h @@ -136,14 +136,14 @@ * any of the body of the atomic_store_explicit. Since the type of * 'VAR' is not fixed, we cannot use an inline function to get * function semantics for this. */ -#define ovsrcu_set__(VAR, VALUE, ORDER) \ - ({ \ - typeof(VAR) var__ = (VAR); \ - typeof(VALUE) value__ = (VALUE); \ - memory_order order__ = (ORDER); \ - \ - atomic_store_explicit(&var__->p, value__, order__); \ - (void *) 0; \ +#define ovsrcu_set__(VAR, VALUE, ORDER) \ + ({ \ + typeof(VAR) ovsrcu_var = (VAR); \ + typeof(VALUE) ovsrcu_value = (VALUE); \ + memory_order ovsrcu_order = (ORDER); \ + \ + atomic_store_explicit(&ovsrcu_var->p, ovsrcu_value, ovsrcu_order); \ + (void *) 0; \ }) #else /* not GNU C */ struct ovsrcu_pointer { ATOMIC(void *) p; }; > otherwise, > Acked-by: YAMAMOTO Takashi <yamam...@valinux.co.jp> > > YAMAMOTO Takashi
_______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev