Skip to content

Commit 67f8f10

Browse files
stefano-garzarellamstsirkin
authored andcommitted
vdpa_sim: use max_iotlb_entries as a limit in vhost_iotlb_init
Commit bda324f ("vdpasim: control virtqueue support") changed the allocation of iotlbs calling vhost_iotlb_init() for each address space, instead of vhost_iotlb_alloc(). With this change we forgot to use the limit we had introduced with the `max_iotlb_entries` module parameter. Fixes: bda324f ("vdpasim: control virtqueue support") Cc: [email protected] Signed-off-by: Stefano Garzarella <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Eugenio Pérez <[email protected]>
1 parent 19cd4a5 commit 67f8f10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/vdpa/vdpa_sim/vdpa_sim.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ MODULE_PARM_DESC(batch_mapping, "Batched mapping 1 -Enable; 0 - Disable");
3333
static int max_iotlb_entries = 2048;
3434
module_param(max_iotlb_entries, int, 0444);
3535
MODULE_PARM_DESC(max_iotlb_entries,
36-
"Maximum number of iotlb entries. 0 means unlimited. (default: 2048)");
36+
"Maximum number of iotlb entries for each address space. 0 means unlimited. (default: 2048)");
3737

3838
#define VDPASIM_QUEUE_ALIGN PAGE_SIZE
3939
#define VDPASIM_QUEUE_MAX 256
@@ -291,7 +291,7 @@ struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr)
291291
goto err_iommu;
292292

293293
for (i = 0; i < vdpasim->dev_attr.nas; i++)
294-
vhost_iotlb_init(&vdpasim->iommu[i], 0, 0);
294+
vhost_iotlb_init(&vdpasim->iommu[i], max_iotlb_entries, 0);
295295

296296
vdpasim->buffer = kvmalloc(dev_attr->buffer_size, GFP_KERNEL);
297297
if (!vdpasim->buffer)

0 commit comments

Comments
 (0)