summaryrefslogtreecommitdiffstats
path: root/drivers/vdpa/vdpa_sim
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 /drivers/vdpa/vdpa_sim
parentde91a4d0e725db34db64502fad84e8fb1026146b (diff)
downloadlinux-a9974489b61c09c702c85c6cba3d1a3fd1be7a15.tar.bz2
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 'drivers/vdpa/vdpa_sim')
-rw-r--r--drivers/vdpa/vdpa_sim/vdpa_sim.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index 7b34d663778f..58baff89cc29 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -65,7 +65,7 @@ static u64 vdpasim_features = (1ULL << VIRTIO_F_ANY_LAYOUT) |
/* State of each vdpasim device */
struct vdpasim {
struct vdpa_device vdpa;
- struct vdpasim_virtqueue vqs[2];
+ struct vdpasim_virtqueue vqs[VDPASIM_VQ_NUM];
struct work_struct work;
/* spinlock to synchronize virtqueue state */
spinlock_t lock;
@@ -352,7 +352,7 @@ static struct vdpasim *vdpasim_create(void)
else
ops = &vdpasim_net_config_ops;
- vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL, ops);
+ vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL, ops, VDPASIM_VQ_NUM);
if (!vdpasim)
goto err_alloc;