X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fmlx5%2Fmlx5_common.c;h=9ea56f2ef2b252fffcad50d476fd43090b868d0c;hb=a6e7cd81fa41a9938d4d056e0b6c18adc0b67546;hp=610fb480b53ebf74c0577a7d0219b02783df4d33;hpb=e8e5fdfdd63488e958e0009b775cd717fe16fa5c;p=dpdk.git diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c index 610fb480b5..9ea56f2ef2 100644 --- a/drivers/common/mlx5/mlx5_common.c +++ b/drivers/common/mlx5/mlx5_common.c @@ -2,10 +2,12 @@ * Copyright 2019 Mellanox Technologies, Ltd */ -#include #include #include #include +#ifdef RTE_IBVERBS_LINK_DLOPEN +#include +#endif #include @@ -209,8 +211,6 @@ error: */ RTE_INIT_PRIO(mlx5_glue_init, CLASS) { - void *handle = NULL; - /* Initialize common log type. */ mlx5_common_logtype = rte_log_register("pmd.common.mlx5"); if (mlx5_common_logtype >= 0) @@ -233,6 +233,8 @@ RTE_INIT_PRIO(mlx5_glue_init, CLASS) /* The glue initialization was done earlier by mlx5 common library. */ #ifdef RTE_IBVERBS_LINK_DLOPEN char glue_path[sizeof(RTE_EAL_PMD_PATH) - 1 + sizeof("-glue")]; + void *handle = NULL; + const char *path[] = { /* * A basic security check is necessary before trusting @@ -320,8 +322,10 @@ RTE_INIT_PRIO(mlx5_glue_init, CLASS) mlx5_glue->fork_init(); return; glue_error: +#ifdef RTE_IBVERBS_LINK_DLOPEN if (handle) dlclose(handle); +#endif DRV_LOG(WARNING, "Cannot initialize MLX5 common due to missing" " run-time dependency on rdma-core libraries (libibverbs," " libmlx5)");