vhost: fix vring memory partially mapped
authorAdrian Moreno <amorenoz@redhat.com>
Fri, 6 Sep 2019 12:50:20 +0000 (14:50 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 7 Oct 2019 13:00:57 +0000 (15:00 +0200)
commit5d9dc18e1bccfe74c6fc962042d01147b49a5bed
tree05d72ff41ce0cc1011813d5d82d21a9528385564
parente76097f8489a0c4c8044f3382ad81452c4771624
vhost: fix vring memory partially mapped

Only the mapping of the vring addresses is being ensured. This causes
errors when the vring size is larger than the IOTLB page size. E.g:
queue sizes > 256 for 4K IOTLB pages

Ensure the entire vring memory range gets mapped. Refactor duplicated
code for for IOTLB UPDATE and IOTLB INVALIDATE and add packed virtqueue
support.

Fixes: 09927b524969 ("vhost: translate ring addresses when IOMMU enabled")
Cc: stable@dpdk.org
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost_user.c