common/mlx5: fix build with rdma-core 21
authorThomas Monjalon <thomas@monjalon.net>
Thu, 16 Apr 2020 15:59:04 +0000 (17:59 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 14:18:13 +0000 (16:18 +0200)
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@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
drivers/common/mlx5/Makefile
drivers/common/mlx5/meson.build
drivers/common/mlx5/mlx5_glue.c

index 0c67755..8b663ef 100644 (file)
@@ -152,6 +152,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 \
index 347d282..165aa25 100644 (file)
@@ -120,6 +120,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',
index 428de0f..f270f67 100644 (file)
@@ -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;