raw/ioat: skip VA requirement for bus without device
authorBruce Richardson <bruce.richardson@intel.com>
Thu, 6 May 2021 15:09:08 +0000 (16:09 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 10 May 2021 10:32:43 +0000 (12:32 +0200)
commitf51c826f84448304aef2e80a548824c55dc78175
tree1604bf06e7babaa96d5f3376868a3c1e1c4e91d6
parent2341397eb752209bc22c519d583d9ea8a31e7245
raw/ioat: skip VA requirement for bus without device

If after a bus scan, there are no devices using a particular bus, then
that bus should not be taken into account when deciding whether DPDK
should be run in VA or PA addressing mode. This becomes an issue when
the DSA bus driver code is used on a system without an IOMMU. The PCI
bus correctly reports that it only works in PA mode, while the DSA bus -
also correctly - reports that it works only in VA mode. The difference
is that there will be no devices found in a scan for the DSA bus, since
the kernel driver can only present those to userspace in the presence of
an IOMMU.

While we could change DSA instance to always report that it does not
care about the addressing mode, this would imply that it could be used
with DPDK in PA mode which is not the case. Therefore, this patch
changes the driver to report DC (don't care) in the case where no
devices are present, and VA otherwise.

NOTE: this addressing mode use of VA-only applies only in the case of
using DSA through the idxd kernel driver. The use of DSA though vfio-pci
is unaffected and works as with other PCI devices.

Fixes: b7aaf417f936 ("raw/ioat: add bus driver for device scanning automatically")

Reported-by: Harry van Haaren <harry.van.haaren@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Tested-by: Conor Walsh <conor.walsh@intel.com>
drivers/raw/ioat/idxd_bus.c