common/mlx5/linux: add glue function to query WQ
authorMatan Azrad <matan@nvidia.com>
Thu, 25 Feb 2021 10:44:58 +0000 (10:44 +0000)
committerRaslan Darawsheh <rasland@nvidia.com>
Wed, 3 Mar 2021 16:27:14 +0000 (17:27 +0100)
When Rx queue is created by VERBS API ibv_create_wq there is a dedicated
rdma-core API to query an information about this WQ(Work Queue).

VERBS WQ querying is needed for PMD cases which combine VERBS objects
with DevX objects.

Next feature to use this glue function is the HW queue counters.

Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/common/mlx5/linux/mlx5_glue.c
drivers/common/mlx5/linux/mlx5_glue.h

index 8146c79..964f7e7 100644 (file)
@@ -1067,6 +1067,23 @@ mlx5_glue_devx_qp_query(struct ibv_qp *qp,
 #endif
 }
 
+static int
+mlx5_glue_devx_wq_query(struct ibv_wq *wq, const void *in, size_t inlen,
+                       void *out, size_t outlen)
+{
+#ifdef HAVE_IBV_DEVX_QP
+       return mlx5dv_devx_wq_query(wq, in, inlen, out, outlen);
+#else
+       (void)wq;
+       (void)in;
+       (void)inlen;
+       (void)out;
+       (void)outlen;
+       errno = ENOTSUP;
+       return errno;
+#endif
+}
+
 static int
 mlx5_glue_devx_port_query(struct ibv_context *ctx,
                          uint32_t port_num,
@@ -1403,6 +1420,7 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) {
        .devx_umem_reg = mlx5_glue_devx_umem_reg,
        .devx_umem_dereg = mlx5_glue_devx_umem_dereg,
        .devx_qp_query = mlx5_glue_devx_qp_query,
+       .devx_wq_query = mlx5_glue_devx_wq_query,
        .devx_port_query = mlx5_glue_devx_port_query,
        .dr_dump_domain = mlx5_glue_dr_dump_domain,
        .dr_reclaim_domain_memory = mlx5_glue_dr_reclaim_domain_memory,
index 8be446a..9e385be 100644 (file)
@@ -307,6 +307,8 @@ struct mlx5_glue {
        int (*devx_qp_query)(struct ibv_qp *qp,
                             const void *in, size_t inlen,
                             void *out, size_t outlen);
+       int (*devx_wq_query)(struct ibv_wq *wq, const void *in, size_t inlen,
+                            void *out, size_t outlen);
        int (*devx_port_query)(struct ibv_context *ctx,
                               uint32_t port_num,
                               struct mlx5dv_devx_port *mlx5_devx_port);