vhost: fix physical address mapping
authorXuan Ding <xuan.ding@intel.com>
Tue, 15 Feb 2022 15:02:26 +0000 (15:02 +0000)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Tue, 15 Feb 2022 10:49:47 +0000 (11:49 +0100)
commit52ade97e36413ba0dbfbaca03adc5d17d3b770bb
tree2e25c7f6a73d45ec493d30ef307f5335c46858e2
parent2ec359747e61db15ab18a78fa35f503a4f647463
vhost: fix physical address mapping

When choosing IOVA as PA mode, IOVA is likely to be discontinuous,
which requires page by page mapping for DMA devices. To be consistent,
this patch implements page by page mapping instead of mapping at the
region granularity for both IOVA as VA and PA mode.

Fixes: 7c61fa08b716 ("vhost: enable IOMMU for async vhost")
Cc: stable@dpdk.org
Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/vhost/vhost.h
lib/vhost/vhost_user.c