[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201203170511.216407-18-sgarzare@redhat.com>
Date: Thu, 3 Dec 2020 18:05:09 +0100
From: Stefano Garzarella <sgarzare@...hat.com>
To: virtualization@...ts.linux-foundation.org
Cc: Stefan Hajnoczi <stefanha@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>, Oren Duer <oren@...dia.com>,
Jason Wang <jasowang@...hat.com>,
Laurent Vivier <lvivier@...hat.com>,
Stefano Garzarella <sgarzare@...hat.com>,
linux-kernel@...r.kernel.org, Max Gurtovoy <mgurtovoy@...dia.com>,
Shahaf Shuler <shahafs@...dia.com>, Eli Cohen <elic@...dia.com>
Subject: [PATCH v3 17/19] vdpa_sim: make vdpasim->buffer size configurable
Allow each device to specify the size of the buffer allocated
in vdpa_sim.
Acked-by: Jason Wang <jasowang@...hat.com>
Signed-off-by: Stefano Garzarella <sgarzare@...hat.com>
---
drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index fb714d88e77f..38b6b5e7348c 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -65,6 +65,7 @@ struct vdpasim;
struct vdpasim_dev_attr {
u64 supported_features;
size_t config_size;
+ size_t buffer_size;
int nvqs;
u32 id;
@@ -410,7 +411,7 @@ static struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr)
if (!vdpasim->iommu)
goto err_iommu;
- vdpasim->buffer = kvmalloc(PAGE_SIZE, GFP_KERNEL);
+ vdpasim->buffer = kvmalloc(dev_attr->buffer_size, GFP_KERNEL);
if (!vdpasim->buffer)
goto err_iommu;
@@ -779,6 +780,7 @@ static int __init vdpasim_dev_init(void)
dev_attr.config_size = sizeof(struct virtio_net_config);
dev_attr.get_config = vdpasim_net_get_config;
dev_attr.work_fn = vdpasim_net_work;
+ dev_attr.buffer_size = PAGE_SIZE;
vdpasim_dev = vdpasim_create(&dev_attr);
--
2.26.2
Powered by blists - more mailing lists