@@ -57,6 +57,7 @@ endfunction()
rdma_kernel_provider_abi(
rdma/bnxt_re-abi.h
rdma/cxgb4-abi.h
+ rdma/hns-abi.h
rdma/i40iw-abi.h
rdma/ib_user_verbs.h
rdma/mlx4-abi.h
@@ -34,43 +34,16 @@
#define _HNS_ROCE_U_ABI_H
#include <infiniband/kern-abi.h>
+#include <rdma/hns-abi.h>
+#include <kernel-abi/hns-abi.h>
+
+DECLARE_DRV_CMD(hns_roce_alloc_pd, IB_USER_VERBS_CMD_ALLOC_PD,
+ empty, hns_roce_ib_alloc_pd_resp);
+DECLARE_DRV_CMD(hns_roce_create_cq, IB_USER_VERBS_CMD_CREATE_CQ,
+ hns_roce_ib_create_cq, hns_roce_ib_create_cq_resp);
+DECLARE_DRV_CMD(hns_roce_create_qp, IB_USER_VERBS_CMD_CREATE_QP,
+ hns_roce_ib_create_qp, hns_roce_ib_create_qp_resp);
+DECLARE_DRV_CMD(hns_roce_alloc_ucontext, IB_USER_VERBS_CMD_GET_CONTEXT,
+ empty, hns_roce_ib_alloc_ucontext_resp);
-struct hns_roce_alloc_ucontext_resp {
- struct ib_uverbs_get_context_resp ibv_resp;
- __u32 qp_tab_size;
- __u32 reserved;
-};
-
-struct hns_roce_alloc_pd_resp {
- struct ib_uverbs_alloc_pd_resp ibv_resp;
- __u32 pdn;
- __u32 reserved;
-};
-
-struct hns_roce_create_cq {
- struct ibv_create_cq ibv_cmd;
- __u64 buf_addr;
- __u64 db_addr;
-};
-
-struct hns_roce_create_cq_resp {
- struct ib_uverbs_create_cq_resp ibv_resp;
- __u64 cqn; /* Only 32 bits used, 64 for compat */
- __u64 cap_flags;
-};
-
-struct hns_roce_create_qp {
- struct ibv_create_qp ibv_cmd;
- __u64 buf_addr;
- __u64 db_addr;
- __u8 log_sq_bb_count;
- __u8 log_sq_stride;
- __u8 sq_no_prefetch;
- __u8 reserved[5];
-};
-
-struct hns_roce_create_qp_resp {
- struct ib_uverbs_create_qp_resp base;
- __u64 cap_flags;
-};
#endif /* _HNS_ROCE_U_ABI_H */
@@ -605,7 +605,7 @@ struct ibv_qp *hns_roce_u_create_qp(struct ibv_pd *pd,
pthread_mutex_lock(&to_hr_ctx(pd->context)->qp_table_mutex);
ret = ibv_cmd_create_qp(pd, &qp->ibv_qp, attr, &cmd.ibv_cmd,
- sizeof(cmd), &resp.base, sizeof(resp));
+ sizeof(cmd), &resp.ibv_resp, sizeof(resp));
if (ret) {
fprintf(stderr, "ibv_cmd_create_qp failed!\n");
goto err_rq_db;