summaryrefslogtreecommitdiff
path: root/drivers/net/virtio/virtio_ethdev.c
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@samsung.com>2019-01-09 17:50:15 +0300
committerFerruh Yigit <ferruh.yigit@intel.com>2019-01-14 17:44:29 +0100
commit9230ab8d791399179498d42dfd84981c5bba412a (patch)
tree952679c938a483c63641f4ca125e7ff1e8a5556d /drivers/net/virtio/virtio_ethdev.c
parentcc827f83595643da3b716712c2117d63752276f3 (diff)
downloaddpdk-next-eventdev-9230ab8d791399179498d42dfd84981c5bba412a.zip
dpdk-next-eventdev-9230ab8d791399179498d42dfd84981c5bba412a.tar.gz
dpdk-next-eventdev-9230ab8d791399179498d42dfd84981c5bba412a.tar.xz
net/virtio: support platform memory ordering
VIRTIO_F_ORDER_PLATFORM is required to use proper memory barriers in case of HW vhost implementations like vDPA. DMA barriers (rte_cio_*) are sufficent for that purpose. Previously known as VIRTIO_F_IO_BARRIER. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/net/virtio/virtio_ethdev.c')
-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 446c338..6d46118 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1613,6 +1613,8 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
if (virtio_negotiate_features(hw, req_features) < 0)
return -1;
+ hw->weak_barriers = !vtpci_with_feature(hw, VIRTIO_F_ORDER_PLATFORM);
+
if (!hw->virtio_user_dev) {
pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
rte_eth_copy_pci_info(eth_dev, pci_dev);