]> git.baikalelectronics.ru Git - kernel.git/commit
Drivers: hv: balloon: account for vmbus packet header in max_pkt_size
authorYanming Liu <yanminglr@gmail.com>
Wed, 19 Jan 2022 20:20:52 +0000 (04:20 +0800)
committerWei Liu <wei.liu@kernel.org>
Sun, 23 Jan 2022 22:31:23 +0000 (22:31 +0000)
commitf4bce6e7c766e2cb8f3ca6feacd1260ef25c3902
tree748c037da2bc41d3c5b8b555297c950f2f12b472
parent6e424e6bafec35e47db4b693fe41eff065b7dbf6
Drivers: hv: balloon: account for vmbus packet header in max_pkt_size

Commit 042735f94d25 ("Drivers: hv: vmbus: Copy packets sent by Hyper-V
out of the ring buffer") introduced a notion of maximum packet size in
vmbus channel and used that size to initialize a buffer holding all
incoming packet along with their vmbus packet header. hv_balloon uses
the default maximum packet size VMBUS_DEFAULT_MAX_PKT_SIZE which matches
its maximum message size, however vmbus_open expects this size to also
include vmbus packet header. This leads to 4096 bytes
dm_unballoon_request messages being truncated to 4080 bytes. When the
driver tries to read next packet it starts from a wrong read_index,
receives garbage and prints a lot of "Unhandled message: type:
<garbage>" in dmesg.

Allocate the buffer with HV_HYP_PAGE_SIZE more bytes to make room for
the header.

Fixes: 042735f94d25 ("Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer")
Suggested-by: Michael Kelley (LINUX) <mikelley@microsoft.com>
Suggested-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Signed-off-by: Yanming Liu <yanminglr@gmail.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Link: https://lore.kernel.org/r/20220119202052.3006981-1-yanminglr@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/hv_balloon.c