bus/vmbus: fix ring buffer mapping in secondary process
authorLong Li <longli@microsoft.com>
Wed, 29 Sep 2021 20:46:10 +0000 (13:46 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 13 Oct 2021 11:55:09 +0000 (13:55 +0200)
commit70cdd92e041acd7a0aad295f639f435fbe688190
tree87d116dc5bf85f7af1aef59120465a5b08951feb
parent8e506da755c5712dbccc75abec8cf376abb085b1
bus/vmbus: fix ring buffer mapping in secondary process

The driver code had wrong assumption that all the addresses to ring buffers
in the secondary process are the same as those in the primary process. This
is not always correct as the channels could be mapped to different
addresses in the secondary process.

Fix this by keeping track of all the mapped addresses from the primary
process in the shared uio_res, and have second process map to the same
addresses.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Cc: stable@dpdk.org
Reported-by: Jonathan Erb <jonathan.erb@banduracyber.com>
Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Stephen Hemminger <sthemmin@microsoft.com>
drivers/bus/vmbus/linux/vmbus_uio.c
drivers/bus/vmbus/private.h
drivers/bus/vmbus/vmbus_channel.c
drivers/bus/vmbus/vmbus_common_uio.c