]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_vhost/vhost_user.c
net/hns3: log selected datapath
[dpdk.git] / lib / librte_vhost / vhost_user.c
index 2f4f89aeac6d28f253ccacb245029677cb512df7..cdd46a0116ca266ef27cafb495435e04aa42d8e9 100644 (file)
@@ -469,6 +469,10 @@ vhost_user_set_vring_num(struct virtio_net **pdev,
                return RTE_VHOST_MSG_RESULT_ERR;
        }
 
+       if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)) {
+               if (vhost_user_iotlb_init(dev, msg->payload.state.index))
+                       return RTE_VHOST_MSG_RESULT_ERR;
+       }
        return RTE_VHOST_MSG_RESULT_OK;
 }
 
@@ -574,7 +578,7 @@ out:
        dev->virtqueue[index] = vq;
        vhost_devices[dev->vid] = dev;
 
-       if (old_vq != vq)
+       if (old_vq != vq && (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)))
                vhost_user_iotlb_init(dev, index);
 
        return dev;