[dpdk-stable] [PATCH] common/mlx5: fix build with rdma-core 21

Thomas Monjalon thomas at monjalon.net
Thu Apr 16 17:59:04 CEST 2020


drivers/common/mlx5/mlx5_glue.c: In function 'mlx5_glue_devx_qp_query':
drivers/common/mlx5/mlx5_glue.c:1010:9: error:
implicit declaration of function 'mlx5dv_devx_qp_query'

The function mlx5dv_devx_qp_query() was added in rdma-core 22.
This function is compiled only if HAVE_IBV_DEVX_OBJ,
which is true if the function mlx5dv_devx_obj_create is found.
Unfortunately mlx5dv_devx_obj_create() was introduced in rdma-core 21,
when mlx5dv_devx_qp_query() did not exist yet.

A new flag HAVE_IBV_DEVX_QP is added when mlx5dv_devx_qp_query()
is found.

Fixes: 62d6f70f30f4 ("net/mlx5: add glue for queue query via DevX")
Cc: stable at dpdk.org

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
 drivers/common/mlx5/Makefile    | 5 +++++
 drivers/common/mlx5/meson.build | 2 ++
 drivers/common/mlx5/mlx5_glue.c | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/common/mlx5/Makefile b/drivers/common/mlx5/Makefile
index f32933d592..22dc4b2eb4 100644
--- a/drivers/common/mlx5/Makefile
+++ b/drivers/common/mlx5/Makefile
@@ -150,6 +150,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
 		infiniband/mlx5dv.h \
 		func mlx5dv_devx_obj_query_async \
 		$(AUTOCONF_OUTPUT)
+	$Q sh -- '$<' '$@' \
+		HAVE_IBV_DEVX_QP \
+		infiniband/mlx5dv.h \
+		func mlx5dv_devx_qp_query \
+		$(AUTOCONF_OUTPUT)
 	$Q sh -- '$<' '$@' \
 		HAVE_MLX5DV_DR_ACTION_DEST_DEVX_TIR \
 		infiniband/mlx5dv.h \
diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build
index ac2cfa6236..6f007eea1b 100644
--- a/drivers/common/mlx5/meson.build
+++ b/drivers/common/mlx5/meson.build
@@ -118,6 +118,8 @@ has_sym_args = [
 	'MLX5DV_FLOW_ACTION_COUNTERS_DEVX' ],
 	[ 'HAVE_IBV_DEVX_ASYNC', 'infiniband/mlx5dv.h',
 	'mlx5dv_devx_obj_query_async' ],
+	[ 'HAVE_IBV_DEVX_QP', 'infiniband/mlx5dv.h',
+	'mlx5dv_devx_qp_query' ],
 	[ 'HAVE_MLX5DV_DR_ACTION_DEST_DEVX_TIR', 'infiniband/mlx5dv.h',
 	'mlx5dv_dr_action_create_dest_devx_tir' ],
 	[ 'HAVE_IBV_DEVX_EVENT', 'infiniband/mlx5dv.h',
diff --git a/drivers/common/mlx5/mlx5_glue.c b/drivers/common/mlx5/mlx5_glue.c
index 0af0b86677..e2d3beb9cc 100644
--- a/drivers/common/mlx5/mlx5_glue.c
+++ b/drivers/common/mlx5/mlx5_glue.c
@@ -1006,7 +1006,7 @@ mlx5_glue_devx_qp_query(struct ibv_qp *qp,
 			const void *in, size_t inlen,
 			void *out, size_t outlen)
 {
-#ifdef HAVE_IBV_DEVX_OBJ
+#ifdef HAVE_IBV_DEVX_QP
 	return mlx5dv_devx_qp_query(qp, in, inlen, out, outlen);
 #else
 	(void)qp;
-- 
2.26.0



More information about the stable mailing list