[ovs-dev] [PATCH v3] Improved Packet Drop Statistics in OVS

Keshav Gupta keshav.gupta at ericsson.com
Tue Sep 11 12:45:24 UTC 2018


Thanks Ben for prompt reply.  I have incorporated the comment & warning and sent out a v4 patch.

Thanks
keshav

-----Original Message-----
From: Ben Pfaff [mailto:blp at ovn.org] 
Sent: Tuesday, September 11, 2018 1:21 AM
To: Keshav Gupta <keshav.gupta at ericsson.com>
Cc: dev at openvswitch.org; Anju Thomas <anju.thomas at ericsson.com>; Rohith Basavaraja <rohith.basavaraja at gmail.com>
Subject: Re: [ovs-dev] [PATCH v3] Improved Packet Drop Statistics in OVS

On Mon, Sep 10, 2018 at 11:07:08AM +0000, Keshav Gupta wrote:
> Hi Ben
>            I am not quite getting the below error. I believe this may be coming because of existing macro atomic_read_explicit  definition.   
>   #define atomic_read_explicit(SRC, DST, ORDER)   \
>     (*(DST) = atomic_load_explicit(SRC, ORDER), \
>      (void) 0)
> Where I believe it is cribbing for (void)0 which gcc is cribbing that it may not have any effect.  I have corrected the other errors. 
> 
> I see some discussion of this sort in this URL. 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61081
> From the discussion if I understood correctly it is a false alarm present from gcc 4.9.
> 
> 
> >>    In file included from ../lib/ovs-atomic.h:331,
> >>                     from ../lib/dpif-netdev-perf.h:32,
> >>                     from ../lib/dpif-netdev-perf.c:20:
>  >>   ../lib/dpif-netdev-perf.c: In function 'pmd_perf_drop_stats_clear':
> >>    ../lib/ovs-atomic-c11.h:31:47: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
> >>         (*(DST) = atomic_load_explicit(SRC, ORDER), \
> >>                                                   ^
> >>   ../lib/ovs-atomic.h:401:5: note: in expansion of macro 'atomic_read_explicit'
> >>         atomic_read_explicit(VAR, DST, memory_order_relaxed)
>  >>        ^~~~~~~~~~~~~~~~~~~~
>  >>   ../lib/dpif-netdev-perf.c:474:9: note: in expansion of macro 'atomic_read_relaxed'
>  >>            atomic_read_relaxed(&s->drop_counters.n.rx_drops[i],
>  >>            ^~~~~~~~~~~~~~~~~~~
>  >>    ../lib/ovs-atomic-c11.h:31:47: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
>          (*(DST) = atomic_load_explicit(SRC, ORDER), \

One problem I see is that you're trying to use atomic_read_relaxed() to store into an atomic variable.  It's only for reading one, not writing to one.  Try fixing that.


More information about the dev mailing list