On 9/6/17, 8:57 AM, "[email protected] on behalf of Ben Pfaff"
<[email protected] on behalf of [email protected]> wrote:
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.
Acked-by: Darrell Ball <[email protected]>
Reported-by: Alin Serdean <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
---
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
[email protected]
https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=dbPiJUxk4mmv_rFKdPUGAFvYi0T-dlJbVYyuRzb0gtQ&s=pwkvuvnWKzBBebzMnL_KG-Hkl2YICM8ZeyhU_f984Sg&e=
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev