[dpdk-dev] lib/lib_eal:add mellanox kernel driver type
Checks
Commit Message
When use bond function in mellanox driver environment, we call the
find_port_id_by_pci_addr() function,if we don't add mellanox kernel
driver type in enum rte_kernel_driver, the function will return -1
because kdrv unknow, so we add the mellanox driver type, and when
scan the pci, fill the kdrv to fix this problem.
Signed-off-by: Rongqiang XIE <xie.rongqiang@zte.com.cn>
---
lib/librte_eal/common/include/rte_dev.h | 2 ++
lib/librte_eal/linuxapp/eal/eal_pci.c | 4 ++++
2 files changed, 6 insertions(+)
@@ -123,6 +123,8 @@ enum rte_kernel_driver {
RTE_KDRV_VFIO,
RTE_KDRV_UIO_GENERIC,
RTE_KDRV_NIC_UIO,
+ RTE_KDRV_MLX4,
+ RTE_KDRV_MLX5,
RTE_KDRV_NONE,
};
@@ -349,6 +349,10 @@
dev->kdrv = RTE_KDRV_IGB_UIO;
else if (!strcmp(driver, "uio_pci_generic"))
dev->kdrv = RTE_KDRV_UIO_GENERIC;
+ else if (!strcmp(driver, "mlx4_core"))
+ dev->kdrv = RTE_KDRV_MLX4;
+ else if (!strcmp(driver, "mlx5_core"))
+ dev->kdrv = RTE_KDRV_MLX5;
else
dev->kdrv = RTE_KDRV_UNKNOWN;
} else