Skip to content

Commit 9d6d97b

Browse files
YongjiXiemstsirkin
authored andcommitted
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>
1 parent d6d8bb9 commit 9d6d97b

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

drivers/vhost/vdpa.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
#include <linux/cdev.h>
1717
#include <linux/device.h>
1818
#include <linux/mm.h>
19+
#include <linux/slab.h>
1920
#include <linux/iommu.h>
2021
#include <linux/uuid.h>
2122
#include <linux/vdpa.h>
2223
#include <linux/nospec.h>
2324
#include <linux/vhost.h>
24-
#include <linux/virtio_net.h>
2525

2626
#include "vhost.h"
2727

@@ -1023,10 +1023,6 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)
10231023
int minor;
10241024
int r;
10251025

1026-
/* Currently, we only accept the network devices. */
1027-
if (ops->get_device_id(vdpa) != VIRTIO_ID_NET)
1028-
return -ENOTSUPP;
1029-
10301026
v = kzalloc(sizeof(*v), GFP_KERNEL | __GFP_RETRY_MAYFAIL);
10311027
if (!v)
10321028
return -ENOMEM;

0 commit comments

Comments
 (0)