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