hv_utils: Set the maximum packet size for VSS driver to the length of the receive...
authorVitaly Kuznetsov <vkuznets@redhat.com>
Wed, 25 Aug 2021 13:38:57 +0000 (15:38 +0200)
committerWei Liu <wei.liu@kernel.org>
Wed, 25 Aug 2021 19:03:20 +0000 (19:03 +0000)
commit9d68cd9120e4e3af38f843e165631c323b86b4e4
treee7d0f2ffc8d1b52529aa5c9b317de5bc1986be56
parent7aff79e297ee1aa0126924921fd87a4ae59d2467
hv_utils: Set the maximum packet size for VSS driver to the length of the receive buffer

Commit adae1e931acd ("Drivers: hv: vmbus: Copy packets sent by Hyper-V out
of the ring buffer") introduced a notion of maximum packet size and for
KVM and FCOPY drivers set it to the length of the receive buffer. VSS
driver wasn't updated, this means that the maximum packet size is now
VMBUS_DEFAULT_MAX_PKT_SIZE (4k). Apparently, this is not enough. I'm
observing a packet of 6304 bytes which is being truncated to 4096. When
VSS driver tries to read next packet from ring buffer it starts from the
wrong offset and receives garbage.

Set the maximum packet size to 'HV_HYP_PAGE_SIZE * 2' in VSS driver. This
matches the length of the receive buffer and is in line with other utils
drivers.

Fixes: adae1e931acd ("Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20210825133857.847866-1-vkuznets@redhat.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/hv_snapshot.c