rds.h
001:
002:
003:
004:
005:
006:
007:
008:
009:
010:
011:
012:
013:
014:
015:
016:
017:
018:
019:
020:
021:
022:
023:
024:
025:
026:
027:
028:
029:
030:
031:
032:
033:
034: #ifndef _LINUX_RDS_H
035: #define _LINUX_RDS_H
036:
037: #include <linux/types.h>
038:
039: #define RDS_IB_ABI_VERSION 0x301
040:
041:
042:
043:
044: #define RDS_CANCEL_SENT_TO 1
045: #define RDS_GET_MR 2
046: #define RDS_FREE_MR 3
047:
048: #define RDS_RECVERR 5
049: #define RDS_CONG_MONITOR 6
050: #define RDS_GET_MR_FOR_DEST 7
051:
052:
053:
054:
055:
056:
057:
058:
059:
060:
061:
062:
063:
064:
065:
066:
067:
068:
069:
070:
071: #define RDS_CMSG_RDMA_ARGS 1
072: #define RDS_CMSG_RDMA_DEST 2
073: #define RDS_CMSG_RDMA_MAP 3
074: #define RDS_CMSG_RDMA_STATUS 4
075: #define RDS_CMSG_CONG_UPDATE 5
076: #define RDS_CMSG_ATOMIC_FADD 6
077: #define RDS_CMSG_ATOMIC_CSWP 7
078: #define RDS_CMSG_MASKED_ATOMIC_FADD 8
079: #define RDS_CMSG_MASKED_ATOMIC_CSWP 9
080:
081: #define RDS_INFO_FIRST 10000
082: #define RDS_INFO_COUNTERS 10000
083: #define RDS_INFO_CONNECTIONS 10001
084:
085: #define RDS_INFO_SEND_MESSAGES 10003
086: #define RDS_INFO_RETRANS_MESSAGES 10004
087: #define RDS_INFO_RECV_MESSAGES 10005
088: #define RDS_INFO_SOCKETS 10006
089: #define RDS_INFO_TCP_SOCKETS 10007
090: #define RDS_INFO_IB_CONNECTIONS 10008
091: #define RDS_INFO_CONNECTION_STATS 10009
092: #define RDS_INFO_IWARP_CONNECTIONS 10010
093: #define RDS_INFO_LAST 10010
094:
095: struct rds_info_counter {
096: uint8_t name[32];
097: uint64_t value;
098: } __attribute__((packed));
099:
100: #define RDS_INFO_CONNECTION_FLAG_SENDING 0x01
101: #define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02
102: #define RDS_INFO_CONNECTION_FLAG_CONNECTED 0x04
103:
104: #define TRANSNAMSIZ 16
105:
106: struct rds_info_connection {
107: uint64_t next_tx_seq;
108: uint64_t next_rx_seq;
109: __be32 laddr;
110: __be32 faddr;
111: uint8_t transport[TRANSNAMSIZ];
112: uint8_t flags;
113: } __attribute__((packed));
114:
115: #define RDS_INFO_MESSAGE_FLAG_ACK 0x01
116: #define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02
117:
118: struct rds_info_message {
119: uint64_t seq;
120: uint32_t len;
121: __be32 laddr;
122: __be32 faddr;
123: __be16 lport;
124: __be16 fport;
125: uint8_t flags;
126: } __attribute__((packed));
127:
128: struct rds_info_socket {
129: uint32_t sndbuf;
130: __be32 bound_addr;
131: __be32 connected_addr;
132: __be16 bound_port;
133: __be16 connected_port;
134: uint32_t rcvbuf;
135: uint64_t inum;
136: } __attribute__((packed));
137:
138: struct rds_info_tcp_socket {
139: __be32 local_addr;
140: __be16 local_port;
141: __be32 peer_addr;
142: __be16 peer_port;
143: uint64_t hdr_rem;
144: uint64_t data_rem;
145: uint32_t last_sent_nxt;
146: uint32_t last_expected_una;
147: uint32_t last_seen_una;
148: } __attribute__((packed));
149:
150: #define RDS_IB_GID_LEN 16
151: struct rds_info_rdma_connection {
152: __be32 src_addr;
153: __be32 dst_addr;
154: uint8_t src_gid[RDS_IB_GID_LEN];
155: uint8_t dst_gid[RDS_IB_GID_LEN];
156:
157: uint32_t max_send_wr;
158: uint32_t max_recv_wr;
159: uint32_t max_send_sge;
160: uint32_t rdma_mr_max;
161: uint32_t rdma_mr_size;
162: };
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187: #define RDS_CONG_MONITOR_SIZE 64
188: #define RDS_CONG_MONITOR_BIT(port) (((unsigned int) port) % RDS_CONG_MONITOR_SIZE)
189: #define RDS_CONG_MONITOR_MASK(port) (1ULL << RDS_CONG_MONITOR_BIT(port))
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202: typedef uint64_t rds_rdma_cookie_t;
203:
204: struct rds_iovec {
205: uint64_t addr;
206: uint64_t bytes;
207: };
208:
209: struct rds_get_mr_args {
210: struct rds_iovec vec;
211: uint64_t cookie_addr;
212: uint64_t flags;
213: };
214:
215: struct rds_get_mr_for_dest_args {
216: struct sockaddr_storage dest_addr;
217: struct rds_iovec vec;
218: uint64_t cookie_addr;
219: uint64_t flags;
220: };
221:
222: struct rds_free_mr_args {
223: rds_rdma_cookie_t cookie;
224: uint64_t flags;
225: };
226:
227: struct rds_rdma_args {
228: rds_rdma_cookie_t cookie;
229: struct rds_iovec remote_vec;
230: uint64_t local_vec_addr;
231: uint64_t nr_local;
232: uint64_t flags;
233: uint64_t user_token;
234: };
235:
236: struct rds_atomic_args {
237: rds_rdma_cookie_t cookie;
238: uint64_t local_addr;
239: uint64_t remote_addr;
240: union {
241: struct {
242: uint64_t compare;
243: uint64_t swap;
244: } cswp;
245: struct {
246: uint64_t add;
247: } fadd;
248: struct {
249: uint64_t compare;
250: uint64_t swap;
251: uint64_t compare_mask;
252: uint64_t swap_mask;
253: } m_cswp;
254: struct {
255: uint64_t add;
256: uint64_t nocarry_mask;
257: } m_fadd;
258: };
259: uint64_t flags;
260: uint64_t user_token;
261: };
262:
263: struct rds_rdma_notify {
264: uint64_t user_token;
265: int32_t status;
266: };
267:
268: #define RDS_RDMA_SUCCESS 0
269: #define RDS_RDMA_REMOTE_ERROR 1
270: #define RDS_RDMA_CANCELED 2
271: #define RDS_RDMA_DROPPED 3
272: #define RDS_RDMA_OTHER_ERROR 4
273:
274:
275:
276:
277: #define RDS_RDMA_READWRITE 0x0001
278: #define RDS_RDMA_FENCE 0x0002
279: #define RDS_RDMA_INVALIDATE 0x0004
280: #define RDS_RDMA_USE_ONCE 0x0008
281: #define RDS_RDMA_DONTWAIT 0x0010
282: #define RDS_RDMA_NOTIFY_ME 0x0020
283: #define RDS_RDMA_SILENT 0x0040
284:
285: #endif
286:
© Andrew Scott 2006 -
2025,
All Rights Reserved