vfio: fix PCI resource mapping
authorYong Wang <yongwang@vmware.com>
Fri, 15 Jul 2016 00:15:10 +0000 (17:15 -0700)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 15 Jul 2016 16:43:09 +0000 (18:43 +0200)
commit9ba723566440d79f572bc88ce53241121fead43d
treeac781b3bf350e820e7256f395144fbb9ed0ebea9
parent1cc275ef61c5ddd5f9be7519b3b9db381947782e
vfio: fix PCI resource mapping

The offset of the 2nd mmap() when mapping the region after msix_bar
needs to take region address into consideration as mmap() takes
address that is resource-relative instead of bar-relative.  This is
exposed when binding vmxnet3 to vfio-pci.

Fixes: 90a1633b2347 ("eal/linux: allow to map BARs with MSI-X tables")

Signed-off-by: Yong Wang <yongwang@vmware.com>
Signed-off-by: Ronghua Zhang <rzhang@vmware.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c