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: Remove use of PAGE_SIZE

Remove use of PAGE_SIZE for device ring buffer size calculation, as
there is no dependency on device ring buffer size for linux kernel's
PAGE_SIZE. Use the absolute value of 2 MB instead.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Link: https://lore.kernel.org/r/1711788723-8593-8-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
76457f9a ec314f61

+3 -4
+3 -4
drivers/uio/uio_hv_generic.c
··· 36 36 #define DRIVER_AUTHOR "Stephen Hemminger <sthemmin at microsoft.com>" 37 37 #define DRIVER_DESC "Generic UIO driver for VMBus devices" 38 38 39 - #define HV_RING_SIZE 512 /* pages */ 40 39 #define SEND_BUFFER_SIZE (16 * 1024 * 1024) 41 40 #define RECV_BUFFER_SIZE (31 * 1024 * 1024) 42 41 ··· 145 146 .name = "ring", 146 147 .mode = 0600, 147 148 }, 148 - .size = 2 * HV_RING_SIZE * PAGE_SIZE, 149 + .size = 2 * SZ_2M, 149 150 .mmap = hv_uio_ring_mmap, 150 151 }; 151 152 ··· 155 156 { 156 157 struct hv_device *hv_dev = new_sc->primary_channel->device_obj; 157 158 struct device *device = &hv_dev->device; 158 - const size_t ring_bytes = HV_RING_SIZE * PAGE_SIZE; 159 + const size_t ring_bytes = SZ_2M; 159 160 int ret; 160 161 161 162 /* Create host communication ring */ ··· 243 244 size_t ring_size = hv_dev_ring_size(channel); 244 245 245 246 if (!ring_size) 246 - ring_size = HV_RING_SIZE * PAGE_SIZE; 247 + ring_size = SZ_2M; 247 248 248 249 pdata = devm_kzalloc(&dev->device, sizeof(*pdata), GFP_KERNEL); 249 250 if (!pdata)