On Tue, Jan 12, 2016 at 2:35 PM, Yuanhan Liu <yuanhan.liu at linux.intel.com> wrote: > On Tue, Jan 12, 2016 at 04:40:43PM +0800, Yuanhan Liu wrote: >> On Tue, Jan 12, 2016 at 09:31:05AM +0100, David Marchand wrote: >> > On Tue, Jan 12, 2016 at 7:59 AM, Yuanhan Liu <yuanhan.liu at >> > linux.intel.com> >> > wrote: >> > >> > Normally we could set RTE_PCI_DRV_NEED_MAPPING flag so that eal will >> > invoke pci_map_device internally for us. From that point view, there >> > is no need to export pci_map_device. >> > >> > However, for virtio pmd driver, which is designed to work without >> > binding UIO (or something similar first), pci_map_device() will fail, >> > which ends up with virtio pmd driver being skipped. Therefore, we can >> > not set RTE_PCI_DRV_NEED_MAPPING blindly at virtio pmd driver. >> > >> > Therefore, this patch exports pci_map_device, and let virtio pmd >> > call it when necessary. >> > >> > >> > Well, if you introduce map function, I suppose, for hotplug, you would need >> > unmap. >> >> Good remind. Thanks. I will export pci_unmap_device as well. > > And here you go. > > --yliu > > -- >8 -- > From aa3d9d0fa827781d1563fd4c06ba04a8fafdc41c Mon Sep 17 00:00:00 2001 > From: Yuanhan Liu <yuanhan.liu at linux.intel.com> > Date: Mon, 11 Jan 2016 16:51:35 +0800 > Subject: [PATCH] eal: pci: export pci_[un]map_device > > Normally we could set RTE_PCI_DRV_NEED_MAPPING flag so that eal will > invoke pci_map_device internally for us. From that point view, there > is no need to export pci_map_device. > > However, for virtio pmd driver, which is designed to work without > binding UIO (or something similar first), pci_map_device() will fail, > which ends up with virtio pmd driver being skipped. Therefore, we can > not set RTE_PCI_DRV_NEED_MAPPING blindly at virtio pmd driver. > > Therefore, this patch exports pci_map_device, and let virtio pmd > call it when necessary. > > Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com> > --- > v2: - export pci_unmap_device as well > > - Add few more comments about rte_eal_pci_map_device().
This patch tested for vfio-noIOMMU mode for arm64 platform. Tested-By: Santosh Shukla <sshukla at mvista.com>