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.
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.