vhost: introduce guest IOVA to backend VA helper
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Thu, 5 Oct 2017 08:36:19 +0000 (10:36 +0200)
committerYuanhan Liu <yliu@fridaylinux.org>
Tue, 10 Oct 2017 13:52:27 +0000 (15:52 +0200)
commitfed67a20ac94d4d985aa5bf5ac66102b0fd5211c
treec436f9440e50429e11fb25d62aee88ecba873cc1
parente95f34d3808e620c4e5648e75f415b3d7c2feaf0
vhost: introduce guest IOVA to backend VA helper

This patch introduces vhost_iova_to_vva() function to translate
guest's IO virtual addresses to backend's virtual addresses.

When IOMMU is enabled, the IOTLB cache is queried to get the
translation. If missing from the IOTLB cache, an IOTLB_MISS request
is sent to Qemu, and IOTLB cache is queried again on IOTLB event
notification.

When IOMMU is disabled, the passed address is a guest's physical
address, so the legacy rte_vhost_gpa_to_vva() API is used.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
lib/librte_vhost/vhost.c
lib/librte_vhost/vhost.h