eal: fix IOVA mode selection as VA for PCI drivers
authorDavid Marchand <david.marchand@redhat.com>
Mon, 22 Jul 2019 12:56:51 +0000 (14:56 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 22 Jul 2019 15:45:52 +0000 (17:45 +0200)
commitb76fafb174d2cd5247c3573bb3d49444e195e760
treecdb2f1ac9bf344e0a35fa38d5d843b7e42d18410
parent62f8f5ace506b336afcb9022d4c456f893f1d732
eal: fix IOVA mode selection as VA for PCI drivers

The incriminated commit broke the use of RTE_PCI_DRV_IOVA_AS_VA which
was intended to mean "driver only supports VA" but had been understood
as "driver supports both PA and VA" by most net drivers and used to let
dpdk processes to run as non root (which do not have access to physical
addresses on recent kernels).

The check on physical addresses actually closed the gap for those
drivers. We don't need to mark them with RTE_PCI_DRV_IOVA_AS_VA and this
flag can retain its intended meaning.
Document explicitly its meaning.

We can check that a driver requirement wrt to IOVA mode is fulfilled
before trying to probe a device.

Finally, document the heuristic used to select the IOVA mode and hope
that we won't break it again.

Fixes: 703458e19c16 ("bus/pci: consider only usable devices for IOVA mode")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
22 files changed:
doc/guides/prog_guide/env_abstraction_layer.rst
drivers/bus/pci/linux/pci.c
drivers/bus/pci/pci_common.c
drivers/bus/pci/rte_bus_pci.h
drivers/net/atlantic/atl_ethdev.c
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/e1000/em_ethdev.c
drivers/net/e1000/igb_ethdev.c
drivers/net/enic/enic_ethdev.c
drivers/net/fm10k/fm10k_ethdev.c
drivers/net/i40e/i40e_ethdev.c
drivers/net/i40e/i40e_ethdev_vf.c
drivers/net/iavf/iavf_ethdev.c
drivers/net/ice/ice_ethdev.c
drivers/net/ixgbe/ixgbe_ethdev.c
drivers/net/mlx4/mlx4.c
drivers/net/mlx5/mlx5.c
drivers/net/nfp/nfp_net.c
drivers/net/octeontx2/otx2_ethdev.c
drivers/net/qede/qede_ethdev.c
drivers/raw/ioat/ioat_rawdev.c
lib/librte_eal/common/eal_common_bus.c