bus/vmbus: add missing barrier
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 30 Apr 2020 19:08:49 +0000 (12:08 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 May 2020 20:27:39 +0000 (22:27 +0200)
The check for event ring being empty needs a barrier
to avoid any over aggressive optimization.
This is same barrier as Linux kernel.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
drivers/bus/vmbus/vmbus_channel.c

index 46b3ba3..ff2985c 100644 (file)
@@ -199,6 +199,7 @@ bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel)
 {
        const struct vmbus_br *br = &channel->rxbr;
 
+       rte_smp_rmb();
        return br->vbr->rindex == br->vbr->windex;
 }