1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2020 Mellanox Technologies, Ltd
5 #ifndef RTE_PMD_MLX5_COMMON_DEVX_H_
6 #define RTE_PMD_MLX5_COMMON_DEVX_H_
8 #include "mlx5_devx_cmds.h"
10 /* The standard page size */
11 #define MLX5_LOG_PAGE_SIZE 12
13 /* DevX Completion Queue structure. */
15 struct mlx5_devx_obj *cq; /* The CQ DevX object. */
16 void *umem_obj; /* The CQ umem object. */
18 volatile void *umem_buf;
19 volatile struct mlx5_cqe *cqes; /* The CQ ring buffer. */
21 volatile uint32_t *db_rec; /* The CQ doorbell record. */
24 /* DevX Send Queue structure. */
26 struct mlx5_devx_obj *sq; /* The SQ DevX object. */
27 void *umem_obj; /* The SQ umem object. */
29 volatile void *umem_buf;
30 volatile struct mlx5_wqe *wqes; /* The SQ ring buffer. */
31 volatile struct mlx5_aso_wqe *aso_wqes;
33 volatile uint32_t *db_rec; /* The SQ doorbell record. */
36 /* DevX Queue Pair structure. */
38 struct mlx5_devx_obj *qp; /* The QP DevX object. */
39 void *umem_obj; /* The QP umem object. */
42 struct mlx5_wqe *wqes; /* The QP ring buffer. */
43 struct mlx5_aso_wqe *aso_wqes;
45 volatile uint32_t *db_rec; /* The QP doorbell record. */
48 /* DevX Receive Queue structure. */
50 struct mlx5_devx_obj *rq; /* The RQ DevX object. */
51 void *umem_obj; /* The RQ umem object. */
52 volatile void *umem_buf;
53 volatile uint32_t *db_rec; /* The RQ doorbell record. */
56 /* mlx5_common_devx.c */
59 void mlx5_devx_cq_destroy(struct mlx5_devx_cq *cq);
62 int mlx5_devx_cq_create(void *ctx, struct mlx5_devx_cq *cq_obj,
64 struct mlx5_devx_cq_attr *attr, int socket);
67 void mlx5_devx_sq_destroy(struct mlx5_devx_sq *sq);
70 int mlx5_devx_sq_create(void *ctx, struct mlx5_devx_sq *sq_obj,
72 struct mlx5_devx_create_sq_attr *attr, int socket);
75 void mlx5_devx_qp_destroy(struct mlx5_devx_qp *qp);
78 int mlx5_devx_qp_create(void *ctx, struct mlx5_devx_qp *qp_obj,
80 struct mlx5_devx_qp_attr *attr, int socket);
83 void mlx5_devx_rq_destroy(struct mlx5_devx_rq *rq);
86 int mlx5_devx_rq_create(void *ctx, struct mlx5_devx_rq *rq_obj,
87 uint32_t wqe_size, uint16_t log_wqbb_n,
88 struct mlx5_devx_create_rq_attr *attr, int socket);
91 int mlx5_devx_qp2rts(struct mlx5_devx_qp *qp, uint32_t remote_qp_id);
93 #endif /* RTE_PMD_MLX5_COMMON_DEVX_H_ */