patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH dpdk-dev v2] common/mlx5: fix possible building error
@ 2020-03-02 10:55 xiangxia.m.yue
  2020-03-03  7:15 ` Matan Azrad
  2020-03-06 14:27 ` [dpdk-stable] [PATCH dpdk-dev v3] common/mlx5: fix dynamic loading reference xiangxia.m.yue
  0 siblings, 2 replies; 10+ messages in thread
From: xiangxia.m.yue @ 2020-03-02 10:55 UTC (permalink / raw)
  To: matan, rasland, alialnu; +Cc: dev, Tonghao Zhang, stable

From: Tonghao Zhang <xiangxia.m.yue@gmail.com>

When setting the CONFIG_RTE_BUILD_SHARED_LIB to y,
and build the mlx5 pmd, there is a building error.
To fix it, add RTE_IBVERBS_LINK_DLOPEN to include
relative codes.

> mlx5_common.o: In function `mlx5_glue_init':
> drivers/common/mlx5/mlx5_common.c:324: undefined reference to `dlclose'

Fixes: 7b4f1e6bd367 ("common/mlx5: introduce common library")
Cc: stable@dpdk.org

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
---
 drivers/common/mlx5/mlx5_common.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
index 610fb48..570a3f4 100644
--- a/drivers/common/mlx5/mlx5_common.c
+++ b/drivers/common/mlx5/mlx5_common.c
@@ -209,8 +209,6 @@ enum mlx5_class
  */
 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)
@@ -249,6 +247,7 @@ enum mlx5_class
 		 mlx5_glue_path(glue_path, sizeof(glue_path)) : ""),
 	};
 	unsigned int i = 0;
+	void *handle = NULL;
 	void **sym;
 	const char *dlmsg;
 
@@ -320,8 +319,10 @@ enum mlx5_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)");
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-03-09  9:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-02 10:55 [dpdk-stable] [PATCH dpdk-dev v2] common/mlx5: fix possible building error xiangxia.m.yue
2020-03-03  7:15 ` Matan Azrad
2020-03-04 13:55   ` Tonghao Zhang
2020-03-04 14:25     ` Matan Azrad
2020-03-04 15:13       ` Tonghao Zhang
2020-03-04 16:03         ` Matan Azrad
2020-03-05  6:59           ` Tonghao Zhang
2020-03-06 14:27 ` [dpdk-stable] [PATCH dpdk-dev v3] common/mlx5: fix dynamic loading reference xiangxia.m.yue
2020-03-08  6:39   ` Matan Azrad
2020-03-09  9:10   ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).