aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/vdpa.h
diff options
context:
space:
mode:
authorMax Gurtovoy <maxg@mellanox.com>2020-08-04 19:20:42 +0300
committerMichael S. Tsirkin <mst@redhat.com>2020-08-05 18:39:18 -0400
commita9974489b61c09c702c85c6cba3d1a3fd1be7a15 (patch)
treea05beae6faf4eefaec70b2bf0311d9ae085794a5 /include/linux/vdpa.h
parentvdpasim: support batch updating (diff)
downloadlinux-dev-a9974489b61c09c702c85c6cba3d1a3fd1be7a15.tar.xz
linux-dev-a9974489b61c09c702c85c6cba3d1a3fd1be7a15.zip
vdpa: remove hard coded virtq num
This will enable vdpa providers to add support for multi queue feature and publish it to upper layers (vhost and virtio). Signed-off-by: Max Gurtovoy <maxg@mellanox.com> Reviewed-by: Jason Wang <jasowang@redhat.com> Link: https://lore.kernel.org/r/20200804162048.22587-7-eli@mellanox.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/linux/vdpa.h')
-rw-r--r--include/linux/vdpa.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index 565298cb45d2..b5901cde73e0 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -41,6 +41,7 @@ struct vdpa_device {
const struct vdpa_config_ops *config;
unsigned int index;
bool features_valid;
+ int nvqs;
};
/**
@@ -218,11 +219,12 @@ struct vdpa_config_ops {
struct vdpa_device *__vdpa_alloc_device(struct device *parent,
const struct vdpa_config_ops *config,
+ int nvqs,
size_t size);
-#define vdpa_alloc_device(dev_struct, member, parent, config) \
+#define vdpa_alloc_device(dev_struct, member, parent, config, nvqs) \
container_of(__vdpa_alloc_device( \
- parent, config, \
+ parent, config, nvqs, \
sizeof(dev_struct) + \
BUILD_BUG_ON_ZERO(offsetof( \
dev_struct, member))), \