common/mlx5: glue event queue query
[dpdk.git] / drivers / common / mlx5 / mlx5_glue.c
index d5bc84e..fedce77 100644 (file)
@@ -226,6 +226,18 @@ mlx5_glue_reg_mr(struct ibv_pd *pd, void *addr, size_t length, int access)
        return ibv_reg_mr(pd, addr, length, access);
 }
 
+static struct ibv_mr *
+mlx5_glue_alloc_null_mr(struct ibv_pd *pd)
+{
+#ifdef HAVE_IBV_DEVX_OBJ
+       return ibv_alloc_null_mr(pd);
+#else
+       (void)pd;
+       errno = ENOTSUP;
+       return NULL;
+#endif
+}
+
 static int
 mlx5_glue_dereg_mr(struct ibv_mr *mr)
 {
@@ -1037,6 +1049,20 @@ mlx5_glue_dr_dump_domain(FILE *file, void *domain)
 #endif
 }
 
+static int
+mlx5_glue_devx_query_eqn(struct ibv_context *ctx, uint32_t cpus,
+                        uint32_t *eqn)
+{
+#ifdef HAVE_IBV_DEVX_OBJ
+       return mlx5dv_devx_query_eqn(ctx, cpus, eqn);
+#else
+       (void)ctx;
+       (void)cpus;
+       (void)eqn;
+       return -ENOTSUP;
+#endif
+}
+
 alignas(RTE_CACHE_LINE_SIZE)
 const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){
        .version = MLX5_GLUE_VERSION,
@@ -1070,6 +1096,7 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){
        .destroy_qp = mlx5_glue_destroy_qp,
        .modify_qp = mlx5_glue_modify_qp,
        .reg_mr = mlx5_glue_reg_mr,
+       .alloc_null_mr = mlx5_glue_alloc_null_mr,
        .dereg_mr = mlx5_glue_dereg_mr,
        .create_counter_set = mlx5_glue_create_counter_set,
        .destroy_counter_set = mlx5_glue_destroy_counter_set,
@@ -1135,4 +1162,5 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){
        .devx_qp_query = mlx5_glue_devx_qp_query,
        .devx_port_query = mlx5_glue_devx_port_query,
        .dr_dump_domain = mlx5_glue_dr_dump_domain,
+       .devx_query_eqn = mlx5_glue_devx_query_eqn,
 };