Thanks a lot for fixing this! Acked-by: Alin Serdean <aserd...@ovn.org>
> -----Original Message----- > From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev- > boun...@openvswitch.org] On Behalf Of Ben Pfaff > Sent: Wednesday, September 6, 2017 6:58 PM > To: d...@openvswitch.org > Cc: Ben Pfaff <b...@ovn.org>; Alin Serdean <aserd...@ovn.org> > Subject: [ovs-dev] [PATCH] dpif-netdev: Avoid side-effect in argument of > atomic_store_relaxed(). > > Some of the implementations of atomic_store_relaxed() evaluate their first > argument more than once, so arguments with side effects cause strange > behavior. This fixes a problem observed on 64-bit Windows. > > Reported-by: Alin Serdean <aserd...@ovn.org> > Signed-off-by: Ben Pfaff <b...@ovn.org> > --- > lib/dpif-netdev.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index > 071ec141f1d1..0ceef9d82914 100644 > --- a/lib/dpif-netdev.c > +++ b/lib/dpif-netdev.c > @@ -3201,8 +3201,8 @@ static void > dp_netdev_rxq_set_intrvl_cycles(struct dp_netdev_rxq *rx, > unsigned long long cycles) { > - atomic_store_relaxed(&rx->cycles_intrvl[rx->intrvl_idx++ > - % PMD_RXQ_INTERVAL_MAX], cycles); > + unsigned int idx = rx->intrvl_idx++ % PMD_RXQ_INTERVAL_MAX; > + atomic_store_relaxed(&rx->cycles_intrvl[idx], cycles); > } > > static uint64_t > -- > 2.10.2 > > _______________________________________________ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev