Re: [PATCH v3] tools/hv: fcopy: Fix irregularities with size of ring buffer
From: Naman Jain
Date: Tue Jul 08 2025 - 04:08:11 EST
On 7/8/2025 1:33 PM, Naman Jain wrote:
Size of ring buffer, as defined in uio_hv_generic driver, is no longer
fixed to 16 KB. This creates a problem in fcopy, since this size was
hardcoded. With the change in place to make ring sysfs node actually
reflect the size of underlying ring buffer, it is safe to get the size
of ring sysfs file and use it for ring buffer size in fcopy daemon.
Fix the issue of disparity in ring buffer size, by making it dynamic
in fcopy uio daemon.
Cc: stable@xxxxxxxxxxxxxxx
Fixes: 0315fef2aff9 ("uio_hv_generic: Align ring size to system page")
Signed-off-by: Naman Jain <namjain@xxxxxxxxxxxxxxxxxxx>
---
Noticed that I missed adding change logs. Adding them now.
Changes since v2:
https://lore.kernel.org/all/20250701104837.3006-1-namjain@xxxxxxxxxxxxxxxxxxx/
* Removed fallback mechanism to default size, to keep fcopy behavior
consistent (Long's suggestion). If ring sysfs file is not present for
some reason, things are already bad and its the right thing for fcopy to
abort.
Changes since v1:
https://lore.kernel.org/all/20250620070618.3097-1-namjain@xxxxxxxxxxxxxxxxxxx/
* Removed unnecessary type casting in malloc for desc variable (Olaf)
* Added retry mechanisms to avoid potential race conditions (Michael)
* Moved the logic to fetch ring size to a later part in main (Michael)
tools/hv/hv_fcopy_uio_daemon.c | 82 +++++++++++++++++++++++++++++++---
1 file changed, 75 insertions(+), 7 deletions(-)
Regards,
Naman