Skip to content

EAL: VFIO support not initialized. EAL: Couldn't map new region for DMA #2340

@albe19029

Description

@albe19029

Good day. I have compiled odp with enable-dpdk-zero-copy option. Everything is working good.
But when I try to run my application without any vfio devices (sock mmap for tests or only vdev devices) in console I see next logs:

EAL: VFIO support initialized

EAL: VFIO support not initialized
EAL: Couldn't map new region for DMA
EAL: VFIO support not initialized
EAL: Couldn't map new region for DMA

The problem in this line of code:
https://github.com/OpenDataPlane/odp/blob/master/platform/linux-generic/pktio/dpdk.c#L457

When running odp with vf device we have next log:

EAL: VFIO support initialized
EAL: Using IOMMU type 1 (Type 1)

So as I can see the problem is that we run rte_vfio_container_dma_map but don't check if iommu type was detected.
So my question:
can we call vfio_get_iommu_type before loop cycle to determine if calling rte_vfio_container_dma_map required?

In case there are no vfio devices - vfio_set_iommu_type will not be called, and default_vfio_cfg->vfio_iommu_type will not be initialized. So vfio_get_iommu_type will just return -1.

https://github.com/DPDK/dpdk/blob/main/lib/eal/linux/eal_vfio.c#L1187
https://github.com/DPDK/dpdk/blob/main/lib/eal/linux/eal_vfio.c#L862

As I can see rte_vfio_setup_device is calling only on pci bus iteration for probing. So if there are no vf pci devices - vfio_set_iommu_type will not be called, and default_vfio_cfg->vfio_iommu_type will be NULL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions