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;
}
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;