summaryrefslogtreecommitdiff
path: root/drivers/net/virtio
diff options
context:
space:
mode:
authorTiwei Bie <tiwei.bie@intel.com>2019-03-19 14:43:05 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-03-20 18:15:42 +0100
commit8f66bc4ac3c0d4a11252d860f495abd806aa871f (patch)
treef03756ae99fa0a4c559b44d54bfb16c636a3bfb7 /drivers/net/virtio
parentc68fee95880820138a16cd2637b6de0300081dfb (diff)
downloaddpdk-next-eventdev-8f66bc4ac3c0d4a11252d860f495abd806aa871f.zip
dpdk-next-eventdev-8f66bc4ac3c0d4a11252d860f495abd806aa871f.tar.gz
dpdk-next-eventdev-8f66bc4ac3c0d4a11252d860f495abd806aa871f.tar.xz
net/virtio: add barrier in interrupt enable
Typically, after enabling Rx interrupt, a check should be done to make sure that there is no new incoming packets before going to sleep. So a barrier is needed to make sure that any following check won't happen before the interrupt is actually enabled. Fixes: c056be239db5 ("net/virtio: add Rx interrupt enable/disable functions") Cc: stable@dpdk.org Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Diffstat (limited to 'drivers/net/virtio')
-rw-r--r--drivers/net/virtio/virtio_ethdev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 78ba7bd..ff16fb6 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -850,10 +850,12 @@ virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
static int
virtio_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
{
+ struct virtio_hw *hw = dev->data->dev_private;
struct virtnet_rx *rxvq = dev->data->rx_queues[queue_id];
struct virtqueue *vq = rxvq->vq;
virtqueue_enable_intr(vq);
+ virtio_mb(hw->weak_barriers);
return 0;
}