Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20201215144256.155342-17-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

authored by

Stefano Garzarella and committed by
Michael S. Tsirkin
da7af696 165be1f8

+3 -1
+3 -1
drivers/vdpa/vdpa_sim/vdpa_sim.c
··· 73 73 struct vdpasim_dev_attr { 74 74 u64 supported_features; 75 75 size_t config_size; 76 + size_t buffer_size; 76 77 int nvqs; 77 78 u32 id; 78 79 ··· 419 418 if (!vdpasim->iommu) 420 419 goto err_iommu; 421 420 422 - vdpasim->buffer = kvmalloc(PAGE_SIZE, GFP_KERNEL); 421 + vdpasim->buffer = kvmalloc(dev_attr->buffer_size, GFP_KERNEL); 423 422 if (!vdpasim->buffer) 424 423 goto err_iommu; 425 424 ··· 788 787 dev_attr.config_size = sizeof(struct virtio_net_config); 789 788 dev_attr.get_config = vdpasim_net_get_config; 790 789 dev_attr.work_fn = vdpasim_net_work; 790 + dev_attr.buffer_size = PAGE_SIZE; 791 791 792 792 vdpasim_dev = vdpasim_create(&dev_attr); 793 793