[dpdk-dev] [PATCH] bus/pci: always check IOMMU capabilities
David Marchand
david.marchand at redhat.com
Fri Aug 2 12:20:38 CEST 2019
On Fri, Aug 2, 2019 at 12:14 PM David Marchand
<david.marchand at redhat.com> wrote:
>
> IOMMU capabilities won't change and must be checked even if no PCI device
> seem to be supported yet when EAL initialised.
>
> This is to accommodate with SPDK that registers its drivers after
> rte_eal_init(), especially on PPC platform where the IOMMU does not
> support VA.
David, Takeshi,
Can you test your setups with (only) this patch?
This should address both of your issues.
>
> Fixes: 703458e19c16 ("bus/pci: consider only usable devices for IOVA mode")
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> drivers/bus/pci/bsd/pci.c | 6 ++++++
> drivers/bus/pci/linux/pci.c | 25 ++++++-------------------
> drivers/bus/pci/pci_common.c | 16 +++++++++++++++-
> drivers/bus/pci/private.h | 5 ++++-
> 4 files changed, 31 insertions(+), 21 deletions(-)
>
[snip]
> diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
> index 9794552..8d1d6ab 100644
> --- a/drivers/bus/pci/pci_common.c
> +++ b/drivers/bus/pci/pci_common.c
[snip]
> @@ -643,7 +651,13 @@ rte_pci_get_iommu_class(void)
> devices_want_va = true;
> }
> }
> - if (devices_want_va && !devices_want_pa) {
> + if (iommu_no_va == 1) {
> + iova_mode = RTE_IOVA_PA;
> + if (devices_want_va) {
> + RTE_LOG(WARNING, EAL, "Some devices want 'VA' but because IOMMU does not support 'VA'.\n");
Note to self, s/but because/but/
> + RTE_LOG(WARNING, EAL, "The devices that want 'VA' won't initialize.\n");
> + }
> + } else if (devices_want_va && !devices_want_pa) {
> iova_mode = RTE_IOVA_VA;
> } else if (devices_want_pa && !devices_want_va) {
> iova_mode = RTE_IOVA_PA;
--
David Marchand
More information about the dev
mailing list