xref: /openbmc/linux/include/uapi/rdma/mana-abi.h (revision 0c6dfa75)
1 /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) */
2 /*
3  * Copyright (c) 2022, Microsoft Corporation. All rights reserved.
4  */
5 
6 #ifndef MANA_ABI_USER_H
7 #define MANA_ABI_USER_H
8 
9 #include <linux/types.h>
10 #include <rdma/ib_user_ioctl_verbs.h>
11 
12 /*
13  * Increment this value if any changes that break userspace ABI
14  * compatibility are made.
15  */
16 
17 #define MANA_IB_UVERBS_ABI_VERSION 1
18 
19 struct mana_ib_create_cq {
20 	__aligned_u64 buf_addr;
21 };
22 
23 struct mana_ib_create_qp {
24 	__aligned_u64 sq_buf_addr;
25 	__u32 sq_buf_size;
26 	__u32 port;
27 };
28 
29 struct mana_ib_create_qp_resp {
30 	__u32 sqid;
31 	__u32 cqid;
32 	__u32 tx_vp_offset;
33 	__u32 reserved;
34 };
35 
36 struct mana_ib_create_wq {
37 	__aligned_u64 wq_buf_addr;
38 	__u32 wq_buf_size;
39 	__u32 reserved;
40 };
41 
42 /* RX Hash function flags */
43 enum mana_ib_rx_hash_function_flags {
44 	MANA_IB_RX_HASH_FUNC_TOEPLITZ = 1 << 0,
45 };
46 
47 struct mana_ib_create_qp_rss {
48 	__aligned_u64 rx_hash_fields_mask;
49 	__u8 rx_hash_function;
50 	__u8 reserved[7];
51 	__u32 rx_hash_key_len;
52 	__u8 rx_hash_key[40];
53 	__u32 port;
54 };
55 
56 struct rss_resp_entry {
57 	__u32 cqid;
58 	__u32 wqid;
59 };
60 
61 struct mana_ib_create_qp_rss_resp {
62 	__aligned_u64 num_entries;
63 	struct rss_resp_entry entries[64];
64 };
65 
66 #endif
67