vhost: add flag to enable IOMMU support
[dpdk.git] / lib / librte_vhost / socket.c
index 7018150..422da00 100644 (file)
@@ -68,6 +68,7 @@ struct vhost_user_socket {
        bool is_server;
        bool reconnect;
        bool dequeue_zero_copy;
+       bool iommu_support;
 
        /*
         * The "supported_features" indicates the feature bits the
@@ -669,6 +670,11 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
        vsocket->supported_features = VIRTIO_NET_SUPPORTED_FEATURES;
        vsocket->features           = VIRTIO_NET_SUPPORTED_FEATURES;
 
+       if (!(flags & RTE_VHOST_USER_IOMMU_SUPPORT)) {
+               vsocket->supported_features &= ~(1ULL << VIRTIO_F_IOMMU_PLATFORM);
+               vsocket->features &= ~(1ULL << VIRTIO_F_IOMMU_PLATFORM);
+       }
+
        if ((flags & RTE_VHOST_USER_CLIENT) != 0) {
                vsocket->reconnect = !(flags & RTE_VHOST_USER_NO_RECONNECT);
                if (vsocket->reconnect && reconn_tid == 0) {