Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vhost/vdpa: Remove the restriction that only supports virtio-net devices

Since the config checks are done by the vDPA drivers, we can remove the
virtio-net restriction and we should be able to support all kinds of
virtio devices.

<linux/virtio_net.h> is not needed anymore, but we need to include
<linux/slab.h> to avoid compilation failures.

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20210315163450.254396-11-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>

authored by

Xie Yongji and committed by
Michael S. Tsirkin
9d6d97bf d6d8bb92

+1 -5
+1 -5
drivers/vhost/vdpa.c
··· 16 16 #include <linux/cdev.h> 17 17 #include <linux/device.h> 18 18 #include <linux/mm.h> 19 + #include <linux/slab.h> 19 20 #include <linux/iommu.h> 20 21 #include <linux/uuid.h> 21 22 #include <linux/vdpa.h> 22 23 #include <linux/nospec.h> 23 24 #include <linux/vhost.h> 24 - #include <linux/virtio_net.h> 25 25 26 26 #include "vhost.h" 27 27 ··· 1022 1022 struct vhost_vdpa *v; 1023 1023 int minor; 1024 1024 int r; 1025 - 1026 - /* Currently, we only accept the network devices. */ 1027 - if (ops->get_device_id(vdpa) != VIRTIO_ID_NET) 1028 - return -ENOTSUPP; 1029 1025 1030 1026 v = kzalloc(sizeof(*v), GFP_KERNEL | __GFP_RETRY_MAYFAIL); 1031 1027 if (!v)