common/mlx5: flag Verbs dependency in a DevX command
authorOphir Munk <ophirmu@mellanox.com>
Wed, 10 Jun 2020 09:32:31 +0000 (09:32 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jun 2020 17:21:07 +0000 (19:21 +0200)
Function mlx5_devx_cmd_qp_query_tis_td() receives as parameter a pointer
to verbs QP returned by ibv_create_qp. Therefore support it only if
HAVE_IBV_FLOW_DV_SUPPORT is defined. Otherwise return an error ENOTSUP.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/common/mlx5/mlx5_devx_cmds.c

index fba485e..091a825 100644 (file)
@@ -577,6 +577,7 @@ int
 mlx5_devx_cmd_qp_query_tis_td(void *qp, uint32_t tis_num,
                              uint32_t *tis_td)
 {
+#ifdef HAVE_IBV_FLOW_DV_SUPPORT
        uint32_t in[MLX5_ST_SZ_DW(query_tis_in)] = {0};
        uint32_t out[MLX5_ST_SZ_DW(query_tis_out)] = {0};
        int rc;
@@ -592,6 +593,12 @@ mlx5_devx_cmd_qp_query_tis_td(void *qp, uint32_t tis_num,
        tis_ctx = MLX5_ADDR_OF(query_tis_out, out, tis_context);
        *tis_td = MLX5_GET(tisc, tis_ctx, transport_domain);
        return 0;
+#else
+       (void)qp;
+       (void)tis_num;
+       (void)tis_td;
+       return -ENOTSUP;
+#endif
 }
 
 /**