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: [email protected] Fixes: 0315fef2aff9 ("uio_hv_generic: Align ring size to system page") Signed-off-by: Naman Jain <[email protected]> ---
Noticed that I missed adding change logs. Adding them now. Changes since v2: https://lore.kernel.org/all/[email protected]/ * 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/[email protected]/ * 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
