• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include <linux/socket.h>
23 #define RDS_IB_ABI_VERSION 0x301
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 #define RDS_RECVERR 5
29 #define RDS_CONG_MONITOR 6
30 #define RDS_GET_MR_FOR_DEST 7
31 #define SO_RDS_TRANSPORT 8
32 #define SO_RDS_MSG_RXPATH_LATENCY 10
33 #define RDS_TRANS_IB 0
34 #define RDS_TRANS_IWARP 1
35 #define RDS_TRANS_TCP 2
36 #define RDS_TRANS_COUNT 3
37 #define RDS_TRANS_NONE (~0)
38 #define RDS_CMSG_RDMA_ARGS 1
39 #define RDS_CMSG_RDMA_DEST 2
40 #define RDS_CMSG_RDMA_MAP 3
41 #define RDS_CMSG_RDMA_STATUS 4
42 #define RDS_CMSG_CONG_UPDATE 5
43 #define RDS_CMSG_ATOMIC_FADD 6
44 #define RDS_CMSG_ATOMIC_CSWP 7
45 #define RDS_CMSG_MASKED_ATOMIC_FADD 8
46 #define RDS_CMSG_MASKED_ATOMIC_CSWP 9
47 #define RDS_CMSG_RXPATH_LATENCY 11
48 #define RDS_INFO_FIRST 10000
49 #define RDS_INFO_COUNTERS 10000
50 #define RDS_INFO_CONNECTIONS 10001
51 #define RDS_INFO_SEND_MESSAGES 10003
52 #define RDS_INFO_RETRANS_MESSAGES 10004
53 #define RDS_INFO_RECV_MESSAGES 10005
54 #define RDS_INFO_SOCKETS 10006
55 #define RDS_INFO_TCP_SOCKETS 10007
56 #define RDS_INFO_IB_CONNECTIONS 10008
57 #define RDS_INFO_CONNECTION_STATS 10009
58 #define RDS_INFO_IWARP_CONNECTIONS 10010
59 #define RDS_INFO_LAST 10010
60 struct rds_info_counter {
61   __u8 name[32];
62   __u64 value;
63 } __attribute__((packed));
64 #define RDS_INFO_CONNECTION_FLAG_SENDING 0x01
65 #define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02
66 #define RDS_INFO_CONNECTION_FLAG_CONNECTED 0x04
67 #define TRANSNAMSIZ 16
68 struct rds_info_connection {
69   __u64 next_tx_seq;
70   __u64 next_rx_seq;
71   __be32 laddr;
72   __be32 faddr;
73   __u8 transport[TRANSNAMSIZ];
74   __u8 flags;
75 } __attribute__((packed));
76 #define RDS_INFO_MESSAGE_FLAG_ACK 0x01
77 #define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02
78 struct rds_info_message {
79   __u64 seq;
80   __u32 len;
81   __be32 laddr;
82   __be32 faddr;
83   __be16 lport;
84   __be16 fport;
85   __u8 flags;
86 } __attribute__((packed));
87 struct rds_info_socket {
88   __u32 sndbuf;
89   __be32 bound_addr;
90   __be32 connected_addr;
91   __be16 bound_port;
92   __be16 connected_port;
93   __u32 rcvbuf;
94   __u64 inum;
95 } __attribute__((packed));
96 struct rds_info_tcp_socket {
97   __be32 local_addr;
98   __be16 local_port;
99   __be32 peer_addr;
100   __be16 peer_port;
101   __u64 hdr_rem;
102   __u64 data_rem;
103   __u32 last_sent_nxt;
104   __u32 last_expected_una;
105   __u32 last_seen_una;
106 } __attribute__((packed));
107 #define RDS_IB_GID_LEN 16
108 struct rds_info_rdma_connection {
109   __be32 src_addr;
110   __be32 dst_addr;
111   __u8 src_gid[RDS_IB_GID_LEN];
112   __u8 dst_gid[RDS_IB_GID_LEN];
113   __u32 max_send_wr;
114   __u32 max_recv_wr;
115   __u32 max_send_sge;
116   __u32 rdma_mr_max;
117   __u32 rdma_mr_size;
118 };
119 enum rds_message_rxpath_latency {
120   RDS_MSG_RX_HDR_TO_DGRAM_START = 0,
121   RDS_MSG_RX_DGRAM_REASSEMBLE,
122   RDS_MSG_RX_DGRAM_DELIVERED,
123   RDS_MSG_RX_DGRAM_TRACE_MAX
124 };
125 struct rds_rx_trace_so {
126   __u8 rx_traces;
127   __u8 rx_trace_pos[RDS_MSG_RX_DGRAM_TRACE_MAX];
128 };
129 struct rds_cmsg_rx_trace {
130   __u8 rx_traces;
131   __u8 rx_trace_pos[RDS_MSG_RX_DGRAM_TRACE_MAX];
132   __u64 rx_trace[RDS_MSG_RX_DGRAM_TRACE_MAX];
133 };
134 #define RDS_CONG_MONITOR_SIZE 64
135 #define RDS_CONG_MONITOR_BIT(port) (((unsigned int) port) % RDS_CONG_MONITOR_SIZE)
136 #define RDS_CONG_MONITOR_MASK(port) (1ULL << RDS_CONG_MONITOR_BIT(port))
137 typedef __u64 rds_rdma_cookie_t;
138 struct rds_iovec {
139   __u64 addr;
140   __u64 bytes;
141 };
142 struct rds_get_mr_args {
143   struct rds_iovec vec;
144   __u64 cookie_addr;
145   __u64 flags;
146 };
147 struct rds_get_mr_for_dest_args {
148   struct sockaddr_storage dest_addr;
149   struct rds_iovec vec;
150   __u64 cookie_addr;
151   __u64 flags;
152 };
153 struct rds_free_mr_args {
154   rds_rdma_cookie_t cookie;
155   __u64 flags;
156 };
157 struct rds_rdma_args {
158   rds_rdma_cookie_t cookie;
159   struct rds_iovec remote_vec;
160   __u64 local_vec_addr;
161   __u64 nr_local;
162   __u64 flags;
163   __u64 user_token;
164 };
165 struct rds_atomic_args {
166   rds_rdma_cookie_t cookie;
167   __u64 local_addr;
168   __u64 remote_addr;
169   union {
170     struct {
171       __u64 compare;
172       __u64 swap;
173     } cswp;
174     struct {
175       __u64 add;
176     } fadd;
177     struct {
178       __u64 compare;
179       __u64 swap;
180       __u64 compare_mask;
181       __u64 swap_mask;
182     } m_cswp;
183     struct {
184       __u64 add;
185       __u64 nocarry_mask;
186     } m_fadd;
187   };
188   __u64 flags;
189   __u64 user_token;
190 };
191 struct rds_rdma_notify {
192   __u64 user_token;
193   __s32 status;
194 };
195 #define RDS_RDMA_SUCCESS 0
196 #define RDS_RDMA_REMOTE_ERROR 1
197 #define RDS_RDMA_CANCELED 2
198 #define RDS_RDMA_DROPPED 3
199 #define RDS_RDMA_OTHER_ERROR 4
200 #define RDS_RDMA_READWRITE 0x0001
201 #define RDS_RDMA_FENCE 0x0002
202 #define RDS_RDMA_INVALIDATE 0x0004
203 #define RDS_RDMA_USE_ONCE 0x0008
204 #define RDS_RDMA_DONTWAIT 0x0010
205 #define RDS_RDMA_NOTIFY_ME 0x0020
206 #define RDS_RDMA_SILENT 0x0040
207 #endif
208