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.

uio_hv_generic: Query the ringbuffer size for device

Query the ring buffer size from pre defined table per device
and use that value for allocating the ring buffer for that
device. Keep the size as current default which is 2 MB if
the device doesn't have any preferred ring size.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Link: https://lore.kernel.org/r/1711788723-8593-3-git-send-email-ssengar@linux.microsoft.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Saurabh Sengar and committed by
Greg Kroah-Hartman
e566ed5b e8c4bd6c

+5 -2
+5 -2
drivers/uio/uio_hv_generic.c
··· 238 238 struct hv_uio_private_data *pdata; 239 239 void *ring_buffer; 240 240 int ret; 241 + size_t ring_size = hv_dev_ring_size(channel); 241 242 242 243 /* Communicating with host has to be via shared memory not hypercall */ 243 244 if (!channel->offermsg.monitor_allocated) { ··· 246 245 return -ENOTSUPP; 247 246 } 248 247 248 + if (!ring_size) 249 + ring_size = HV_RING_SIZE * PAGE_SIZE; 250 + 249 251 pdata = devm_kzalloc(&dev->device, sizeof(*pdata), GFP_KERNEL); 250 252 if (!pdata) 251 253 return -ENOMEM; 252 254 253 - ret = vmbus_alloc_ring(channel, HV_RING_SIZE * PAGE_SIZE, 254 - HV_RING_SIZE * PAGE_SIZE); 255 + ret = vmbus_alloc_ring(channel, ring_size, ring_size); 255 256 if (ret) 256 257 return ret; 257 258