From c263e48bdb5b1c05ad6fdba536a2cbbaf80405e7 Mon Sep 17 00:00:00 2001 From: Sirshak Das Date: Sat, 22 Sep 2018 14:57:26 -0500 Subject: dpdk_plugin: fix mlx5 build and runtime issues There are issues with VPP finding and linking the mlx5 shared glue library which was built by default if mlx5 was enabled. Runtime Errors this patch fixes: net_mlx5: cannot load glue library: librte_pmd_mlx5_glue.so.18.05.0: cannot open shared object file: No such file or directory net_mlx5: cannot initialize PMD due to missing run-time dependency on rdma-core libraries (libibverbs, libmlx5) This patch introduces additional config parameter to disable glue library building and instead statically link ibverbs and mlx5 libraries to the PMD and dpdk_plugin. Change-Id: I0b2f67652a57854c778e991780903fb15706ace8 Signed-off-by: Sirshak Das Reviewed-by: Lijian Zhang --- src/plugins/dpdk/CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/dpdk/CMakeLists.txt b/src/plugins/dpdk/CMakeLists.txt index a0a083966b3..ed743ea6d9d 100644 --- a/src/plugins/dpdk/CMakeLists.txt +++ b/src/plugins/dpdk/CMakeLists.txt @@ -39,6 +39,9 @@ int main() #endif #ifdef RTE_LIBRTE_MLX5_PMD printf(\"RTE_LIBRTE_MLX5_PMD=%u\\n\", RTE_LIBRTE_MLX5_PMD); +#ifdef RTE_LIBRTE_MLX5_DLOPEN_DEPS + printf(\"RTE_LIBRTE_MLX5_DLOPEN_DEPS=%u\\n\", RTE_LIBRTE_MLX5_DLOPEN_DEPS); +#endif #endif return 0; } @@ -95,8 +98,13 @@ if(DPDK_INCLUDE_DIR AND DPDK_LIB) message(STATUS "DPDK depends on IPSec MB library") endif() if(DPDK_RTE_LIBRTE_MLX4_PMD OR DPDK_RTE_LIBRTE_MLX5_PMD) - set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -Wl,-lmnl") - message(STATUS "DPDK depends on libmnl (Mellanox PMD requirement)") + if (DPDK_RTE_LIBRTE_MLX5_DLOPEN_DEPS) + set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -Wl,-lmnl") + message(STATUS "DPDK depends on libmnl (Mellanox PMD requirement)") + else() + set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -Wl,-lmnl,-libverbs,-lmlx5") + message(STATUS "DPDK depends on libmnl, libibverbs, libmlx5 (Mellanox PMD requirement)") + endif() endif() set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -Wl,-lnuma") add_vpp_plugin(dpdk -- cgit 1.2.3-korg