bus/pci: consider only usable devices for IOVA mode
authorBen Walker <benjamin.walker@intel.com>
Fri, 14 Jun 2019 09:39:17 +0000 (11:39 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 5 Jul 2019 14:56:00 +0000 (16:56 +0200)
commit703458e19c16135143b3f30089e1af66100c82dc
tree188e0d93cb2ab3c37220da245f719c9ca8a1c406
parentc2361bab70c56f64e50f07946b1b20bf688d782a
bus/pci: consider only usable devices for IOVA mode

When selecting the preferred IOVA mode of the pci bus, the current
heuristic ("are devices bound?", "are devices bound to UIO?", "are pmd
drivers supporting IOVA as VA?" etc..) should honor the device
white/blacklist so that an unwanted device does not impact the decision.

There is no reason to consider a device which has no driver available.

This applies to all OS, so implements this in common code then call a
OS specific callback.

On Linux side:
- the VFIO special considerations should be evaluated only if VFIO
  support is built,
- there is no strong requirement on using VA rather than PA if a driver
  supports VA, so defaulting to DC in such a case.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
drivers/bus/pci/bsd/pci.c
drivers/bus/pci/linux/pci.c
drivers/bus/pci/pci_common.c
drivers/bus/pci/private.h