blob: f6fde06db4b4ea720b6aa88dee68daf60a5db787 [file] [log] [blame]
Jason Gunthorped50e14a2018-04-20 09:49:10 -06001/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
oulijun9a443532016-07-21 19:06:38 +08002/*
3 * Copyright (c) 2016 Hisilicon Limited.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
Leon Romanovsky4d409952016-10-19 20:13:07 +030034#ifndef HNS_ABI_USER_H
35#define HNS_ABI_USER_H
36
37#include <linux/types.h>
oulijun9a443532016-07-21 19:06:38 +080038
39struct hns_roce_ib_create_cq {
Jason Gunthorpe26b99062018-03-20 14:19:51 -060040 __aligned_u64 buf_addr;
41 __aligned_u64 db_addr;
Wenpeng Liang09a5f212020-09-16 16:43:24 +080042 __u32 cqe_size;
43 __u32 reserved;
Yixian Liu9b447032018-03-09 18:36:30 +080044};
45
Weihang Li53ef4992020-12-02 09:29:20 +080046enum hns_roce_cq_cap_flags {
47 HNS_ROCE_CQ_FLAG_RECORD_DB = 1 << 0,
48};
49
Yixian Liu9b447032018-03-09 18:36:30 +080050struct hns_roce_ib_create_cq_resp {
Jason Gunthorpe26b99062018-03-20 14:19:51 -060051 __aligned_u64 cqn; /* Only 32 bits used, 64 for compat */
52 __aligned_u64 cap_flags;
oulijun9a443532016-07-21 19:06:38 +080053};
54
Lijun Ouc7bcb132018-11-24 16:49:21 +080055struct hns_roce_ib_create_srq {
56 __aligned_u64 buf_addr;
57 __aligned_u64 db_addr;
58 __aligned_u64 que_addr;
59};
60
Lijun Ou9d9d4ff2019-01-23 10:09:27 +080061struct hns_roce_ib_create_srq_resp {
62 __u32 srqn;
63 __u32 reserved;
64};
65
oulijun9a443532016-07-21 19:06:38 +080066struct hns_roce_ib_create_qp {
Jason Gunthorpe26b99062018-03-20 14:19:51 -060067 __aligned_u64 buf_addr;
68 __aligned_u64 db_addr;
oulijun9a443532016-07-21 19:06:38 +080069 __u8 log_sq_bb_count;
70 __u8 log_sq_stride;
71 __u8 sq_no_prefetch;
72 __u8 reserved[5];
Yixian Liu0425e3e2018-08-02 10:38:05 +080073 __aligned_u64 sdb_addr;
oulijun9a443532016-07-21 19:06:38 +080074};
75
Weihang Li53ef4992020-12-02 09:29:20 +080076enum hns_roce_qp_cap_flags {
77 HNS_ROCE_QP_CAP_RQ_RECORD_DB = 1 << 0,
78 HNS_ROCE_QP_CAP_SQ_RECORD_DB = 1 << 1,
79 HNS_ROCE_QP_CAP_OWNER_DB = 1 << 2,
Yixing Liu0045e0d2021-12-07 20:49:01 +080080 HNS_ROCE_QP_CAP_DIRECT_WQE = 1 << 5,
Weihang Li53ef4992020-12-02 09:29:20 +080081};
82
Yixian Liue088a682018-03-09 18:36:29 +080083struct hns_roce_ib_create_qp_resp {
Jason Gunthorpe26b99062018-03-20 14:19:51 -060084 __aligned_u64 cap_flags;
Yixing Liu0045e0d2021-12-07 20:49:01 +080085 __aligned_u64 dwqe_mmap_key;
Yixian Liue088a682018-03-09 18:36:29 +080086};
87
oulijun9a443532016-07-21 19:06:38 +080088struct hns_roce_ib_alloc_ucontext_resp {
89 __u32 qp_tab_size;
Wenpeng Liang09a5f212020-09-16 16:43:24 +080090 __u32 cqe_size;
Wenpeng Liang32548872021-03-04 10:55:58 +080091 __u32 srq_tab_size;
92 __u32 reserved;
oulijun9a443532016-07-21 19:06:38 +080093};
Jason Gunthorpe633fb4d2018-03-14 14:39:42 -060094
95struct hns_roce_ib_alloc_pd_resp {
96 __u32 pdn;
97};
98
Leon Romanovsky4d409952016-10-19 20:13:07 +030099#endif /* HNS_ABI_USER_H */