* Copyright 2019 Mellanox Technologies, Ltd
*/
-#include <dlfcn.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
+#ifdef RTE_IBVERBS_LINK_DLOPEN
+#include <dlfcn.h>
+#endif
#include <rte_errno.h>
*/
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)
/* 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
unsigned int i;
for (i = 0; i != sizeof(*mlx5_glue) / sizeof(void *); ++i)
- assert(((const void *const *)mlx5_glue)[i]);
+ MLX5_ASSERT(((const void *const *)mlx5_glue)[i]);
}
#endif
if (strcmp(mlx5_glue->version, MLX5_GLUE_VERSION)) {
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)");