1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _LINUX_RDS_H
20#define _LINUX_RDS_H
21#include <linux/types.h>
22#define RDS_IB_ABI_VERSION 0x301
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define SOL_RDS 276
25#define RDS_CANCEL_SENT_TO 1
26#define RDS_GET_MR 2
27#define RDS_FREE_MR 3
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29#define RDS_RECVERR 5
30#define RDS_CONG_MONITOR 6
31#define RDS_GET_MR_FOR_DEST 7
32#define SO_RDS_TRANSPORT 8
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34#define RDS_TRANS_IB 0
35#define RDS_TRANS_IWARP 1
36#define RDS_TRANS_TCP 2
37#define RDS_TRANS_COUNT 3
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39#define RDS_TRANS_NONE (~0)
40#define RDS_CMSG_RDMA_ARGS 1
41#define RDS_CMSG_RDMA_DEST 2
42#define RDS_CMSG_RDMA_MAP 3
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#define RDS_CMSG_RDMA_STATUS 4
45#define RDS_CMSG_CONG_UPDATE 5
46#define RDS_CMSG_ATOMIC_FADD 6
47#define RDS_CMSG_ATOMIC_CSWP 7
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#define RDS_CMSG_MASKED_ATOMIC_FADD 8
50#define RDS_CMSG_MASKED_ATOMIC_CSWP 9
51#define RDS_INFO_FIRST 10000
52#define RDS_INFO_COUNTERS 10000
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54#define RDS_INFO_CONNECTIONS 10001
55#define RDS_INFO_SEND_MESSAGES 10003
56#define RDS_INFO_RETRANS_MESSAGES 10004
57#define RDS_INFO_RECV_MESSAGES 10005
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59#define RDS_INFO_SOCKETS 10006
60#define RDS_INFO_TCP_SOCKETS 10007
61#define RDS_INFO_IB_CONNECTIONS 10008
62#define RDS_INFO_CONNECTION_STATS 10009
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64#define RDS_INFO_IWARP_CONNECTIONS 10010
65#define RDS_INFO_LAST 10010
66struct rds_info_counter {
67  uint8_t name[32];
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69  uint64_t value;
70} __attribute__((packed));
71#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01
72#define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74#define RDS_INFO_CONNECTION_FLAG_CONNECTED 0x04
75#define TRANSNAMSIZ 16
76struct rds_info_connection {
77  uint64_t next_tx_seq;
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79  uint64_t next_rx_seq;
80  __be32 laddr;
81  __be32 faddr;
82  uint8_t transport[TRANSNAMSIZ];
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84  uint8_t flags;
85} __attribute__((packed));
86#define RDS_INFO_MESSAGE_FLAG_ACK 0x01
87#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89struct rds_info_message {
90  uint64_t seq;
91  uint32_t len;
92  __be32 laddr;
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94  __be32 faddr;
95  __be16 lport;
96  __be16 fport;
97  uint8_t flags;
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99} __attribute__((packed));
100struct rds_info_socket {
101  uint32_t sndbuf;
102  __be32 bound_addr;
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104  __be32 connected_addr;
105  __be16 bound_port;
106  __be16 connected_port;
107  uint32_t rcvbuf;
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109  uint64_t inum;
110} __attribute__((packed));
111struct rds_info_tcp_socket {
112  __be32 local_addr;
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114  __be16 local_port;
115  __be32 peer_addr;
116  __be16 peer_port;
117  uint64_t hdr_rem;
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119  uint64_t data_rem;
120  uint32_t last_sent_nxt;
121  uint32_t last_expected_una;
122  uint32_t last_seen_una;
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124} __attribute__((packed));
125#define RDS_IB_GID_LEN 16
126struct rds_info_rdma_connection {
127  __be32 src_addr;
128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129  __be32 dst_addr;
130  uint8_t src_gid[RDS_IB_GID_LEN];
131  uint8_t dst_gid[RDS_IB_GID_LEN];
132  uint32_t max_send_wr;
133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134  uint32_t max_recv_wr;
135  uint32_t max_send_sge;
136  uint32_t rdma_mr_max;
137  uint32_t rdma_mr_size;
138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139};
140#define RDS_CONG_MONITOR_SIZE 64
141#define RDS_CONG_MONITOR_BIT(port) (((unsigned int) port) % RDS_CONG_MONITOR_SIZE)
142#define RDS_CONG_MONITOR_MASK(port) (1ULL << RDS_CONG_MONITOR_BIT(port))
143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144typedef uint64_t rds_rdma_cookie_t;
145struct rds_iovec {
146  uint64_t addr;
147  uint64_t bytes;
148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149};
150struct rds_get_mr_args {
151  struct rds_iovec vec;
152  uint64_t cookie_addr;
153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154  uint64_t flags;
155};
156struct rds_get_mr_for_dest_args {
157  struct sockaddr_storage dest_addr;
158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159  struct rds_iovec vec;
160  uint64_t cookie_addr;
161  uint64_t flags;
162};
163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164struct rds_free_mr_args {
165  rds_rdma_cookie_t cookie;
166  uint64_t flags;
167};
168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169struct rds_rdma_args {
170  rds_rdma_cookie_t cookie;
171  struct rds_iovec remote_vec;
172  uint64_t local_vec_addr;
173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174  uint64_t nr_local;
175  uint64_t flags;
176  uint64_t user_token;
177};
178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179struct rds_atomic_args {
180  rds_rdma_cookie_t cookie;
181  uint64_t local_addr;
182  uint64_t remote_addr;
183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184  union {
185    struct {
186      uint64_t compare;
187      uint64_t swap;
188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189    } cswp;
190    struct {
191      uint64_t add;
192    } fadd;
193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194    struct {
195      uint64_t compare;
196      uint64_t swap;
197      uint64_t compare_mask;
198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199      uint64_t swap_mask;
200    } m_cswp;
201    struct {
202      uint64_t add;
203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204      uint64_t nocarry_mask;
205    } m_fadd;
206  };
207  uint64_t flags;
208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209  uint64_t user_token;
210};
211struct rds_rdma_notify {
212  uint64_t user_token;
213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214  int32_t status;
215};
216#define RDS_RDMA_SUCCESS 0
217#define RDS_RDMA_REMOTE_ERROR 1
218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219#define RDS_RDMA_CANCELED 2
220#define RDS_RDMA_DROPPED 3
221#define RDS_RDMA_OTHER_ERROR 4
222#define RDS_RDMA_READWRITE 0x0001
223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224#define RDS_RDMA_FENCE 0x0002
225#define RDS_RDMA_INVALIDATE 0x0004
226#define RDS_RDMA_USE_ONCE 0x0008
227#define RDS_RDMA_DONTWAIT 0x0010
228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229#define RDS_RDMA_NOTIFY_ME 0x0020
230#define RDS_RDMA_SILENT 0x0040
231#endif
232