Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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> |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 22 | #include <linux/socket.h> |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame^] | 23 | #include <linux/in6.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 24 | #define RDS_IB_ABI_VERSION 0x301 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 25 | #define SOL_RDS 276 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 26 | #define RDS_CANCEL_SENT_TO 1 |
| 27 | #define RDS_GET_MR 2 |
| 28 | #define RDS_FREE_MR 3 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 29 | #define RDS_RECVERR 5 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 30 | #define RDS_CONG_MONITOR 6 |
| 31 | #define RDS_GET_MR_FOR_DEST 7 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 32 | #define SO_RDS_TRANSPORT 8 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 33 | #define SO_RDS_MSG_RXPATH_LATENCY 10 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 34 | #define RDS_TRANS_IB 0 |
| 35 | #define RDS_TRANS_IWARP 1 |
| 36 | #define RDS_TRANS_TCP 2 |
| 37 | #define RDS_TRANS_COUNT 3 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 38 | #define RDS_TRANS_NONE (~0) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | #define RDS_CMSG_RDMA_ARGS 1 |
| 40 | #define RDS_CMSG_RDMA_DEST 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 41 | #define RDS_CMSG_RDMA_MAP 3 |
| 42 | #define RDS_CMSG_RDMA_STATUS 4 |
| 43 | #define RDS_CMSG_CONG_UPDATE 5 |
| 44 | #define RDS_CMSG_ATOMIC_FADD 6 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 45 | #define RDS_CMSG_ATOMIC_CSWP 7 |
| 46 | #define RDS_CMSG_MASKED_ATOMIC_FADD 8 |
| 47 | #define RDS_CMSG_MASKED_ATOMIC_CSWP 9 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 48 | #define RDS_CMSG_RXPATH_LATENCY 11 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 49 | #define RDS_CMSG_ZCOPY_COOKIE 12 |
| 50 | #define RDS_CMSG_ZCOPY_COMPLETION 13 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #define RDS_INFO_FIRST 10000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 52 | #define RDS_INFO_COUNTERS 10000 |
| 53 | #define RDS_INFO_CONNECTIONS 10001 |
| 54 | #define RDS_INFO_SEND_MESSAGES 10003 |
| 55 | #define RDS_INFO_RETRANS_MESSAGES 10004 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 56 | #define RDS_INFO_RECV_MESSAGES 10005 |
| 57 | #define RDS_INFO_SOCKETS 10006 |
| 58 | #define RDS_INFO_TCP_SOCKETS 10007 |
| 59 | #define RDS_INFO_IB_CONNECTIONS 10008 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 60 | #define RDS_INFO_CONNECTION_STATS 10009 |
| 61 | #define RDS_INFO_IWARP_CONNECTIONS 10010 |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame^] | 62 | #define RDS6_INFO_CONNECTIONS 10011 |
| 63 | #define RDS6_INFO_SEND_MESSAGES 10012 |
| 64 | #define RDS6_INFO_RETRANS_MESSAGES 10013 |
| 65 | #define RDS6_INFO_RECV_MESSAGES 10014 |
| 66 | #define RDS6_INFO_SOCKETS 10015 |
| 67 | #define RDS6_INFO_TCP_SOCKETS 10016 |
| 68 | #define RDS6_INFO_IB_CONNECTIONS 10017 |
| 69 | #define RDS_INFO_LAST 10017 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 70 | struct rds_info_counter { |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 71 | __u8 name[32]; |
| 72 | __u64 value; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 73 | } __attribute__((packed)); |
| 74 | #define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 75 | #define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02 |
| 76 | #define RDS_INFO_CONNECTION_FLAG_CONNECTED 0x04 |
| 77 | #define TRANSNAMSIZ 16 |
| 78 | struct rds_info_connection { |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 79 | __u64 next_tx_seq; |
| 80 | __u64 next_rx_seq; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 81 | __be32 laddr; |
| 82 | __be32 faddr; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 83 | __u8 transport[TRANSNAMSIZ]; |
| 84 | __u8 flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 85 | } __attribute__((packed)); |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame^] | 86 | struct rds6_info_connection { |
| 87 | __u64 next_tx_seq; |
| 88 | __u64 next_rx_seq; |
| 89 | struct in6_addr laddr; |
| 90 | struct in6_addr faddr; |
| 91 | __u8 transport[TRANSNAMSIZ]; |
| 92 | __u8 flags; |
| 93 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 94 | #define RDS_INFO_MESSAGE_FLAG_ACK 0x01 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 95 | #define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 |
| 96 | struct rds_info_message { |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 97 | __u64 seq; |
| 98 | __u32 len; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 99 | __be32 laddr; |
| 100 | __be32 faddr; |
| 101 | __be16 lport; |
| 102 | __be16 fport; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 103 | __u8 flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 104 | } __attribute__((packed)); |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame^] | 105 | struct rds6_info_message { |
| 106 | __u64 seq; |
| 107 | __u32 len; |
| 108 | struct in6_addr laddr; |
| 109 | struct in6_addr faddr; |
| 110 | __be16 lport; |
| 111 | __be16 fport; |
| 112 | __u8 flags; |
| 113 | __u8 tos; |
| 114 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 115 | struct rds_info_socket { |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 116 | __u32 sndbuf; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 117 | __be32 bound_addr; |
| 118 | __be32 connected_addr; |
| 119 | __be16 bound_port; |
| 120 | __be16 connected_port; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 121 | __u32 rcvbuf; |
| 122 | __u64 inum; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 123 | } __attribute__((packed)); |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame^] | 124 | struct rds6_info_socket { |
| 125 | __u32 sndbuf; |
| 126 | struct in6_addr bound_addr; |
| 127 | struct in6_addr connected_addr; |
| 128 | __be16 bound_port; |
| 129 | __be16 connected_port; |
| 130 | __u32 rcvbuf; |
| 131 | __u64 inum; |
| 132 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 133 | struct rds_info_tcp_socket { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 134 | __be32 local_addr; |
| 135 | __be16 local_port; |
| 136 | __be32 peer_addr; |
| 137 | __be16 peer_port; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 138 | __u64 hdr_rem; |
| 139 | __u64 data_rem; |
| 140 | __u32 last_sent_nxt; |
| 141 | __u32 last_expected_una; |
| 142 | __u32 last_seen_una; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 143 | } __attribute__((packed)); |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame^] | 144 | struct rds6_info_tcp_socket { |
| 145 | struct in6_addr local_addr; |
| 146 | __be16 local_port; |
| 147 | struct in6_addr peer_addr; |
| 148 | __be16 peer_port; |
| 149 | __u64 hdr_rem; |
| 150 | __u64 data_rem; |
| 151 | __u32 last_sent_nxt; |
| 152 | __u32 last_expected_una; |
| 153 | __u32 last_seen_una; |
| 154 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 155 | #define RDS_IB_GID_LEN 16 |
| 156 | struct rds_info_rdma_connection { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 157 | __be32 src_addr; |
| 158 | __be32 dst_addr; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 159 | __u8 src_gid[RDS_IB_GID_LEN]; |
| 160 | __u8 dst_gid[RDS_IB_GID_LEN]; |
| 161 | __u32 max_send_wr; |
| 162 | __u32 max_recv_wr; |
| 163 | __u32 max_send_sge; |
| 164 | __u32 rdma_mr_max; |
| 165 | __u32 rdma_mr_size; |
| 166 | }; |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame^] | 167 | struct rds6_info_rdma_connection { |
| 168 | struct in6_addr src_addr; |
| 169 | struct in6_addr dst_addr; |
| 170 | __u8 src_gid[RDS_IB_GID_LEN]; |
| 171 | __u8 dst_gid[RDS_IB_GID_LEN]; |
| 172 | __u32 max_send_wr; |
| 173 | __u32 max_recv_wr; |
| 174 | __u32 max_send_sge; |
| 175 | __u32 rdma_mr_max; |
| 176 | __u32 rdma_mr_size; |
| 177 | }; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 178 | enum rds_message_rxpath_latency { |
| 179 | RDS_MSG_RX_HDR_TO_DGRAM_START = 0, |
| 180 | RDS_MSG_RX_DGRAM_REASSEMBLE, |
| 181 | RDS_MSG_RX_DGRAM_DELIVERED, |
| 182 | RDS_MSG_RX_DGRAM_TRACE_MAX |
| 183 | }; |
| 184 | struct rds_rx_trace_so { |
| 185 | __u8 rx_traces; |
| 186 | __u8 rx_trace_pos[RDS_MSG_RX_DGRAM_TRACE_MAX]; |
| 187 | }; |
| 188 | struct rds_cmsg_rx_trace { |
| 189 | __u8 rx_traces; |
| 190 | __u8 rx_trace_pos[RDS_MSG_RX_DGRAM_TRACE_MAX]; |
| 191 | __u64 rx_trace[RDS_MSG_RX_DGRAM_TRACE_MAX]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 192 | }; |
| 193 | #define RDS_CONG_MONITOR_SIZE 64 |
| 194 | #define RDS_CONG_MONITOR_BIT(port) (((unsigned int) port) % RDS_CONG_MONITOR_SIZE) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 195 | #define RDS_CONG_MONITOR_MASK(port) (1ULL << RDS_CONG_MONITOR_BIT(port)) |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 196 | typedef __u64 rds_rdma_cookie_t; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 197 | struct rds_iovec { |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 198 | __u64 addr; |
| 199 | __u64 bytes; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 200 | }; |
| 201 | struct rds_get_mr_args { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 202 | struct rds_iovec vec; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 203 | __u64 cookie_addr; |
| 204 | __u64 flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 205 | }; |
| 206 | struct rds_get_mr_for_dest_args { |
Elliott Hughes | 64f355f | 2017-08-30 16:10:24 -0700 | [diff] [blame] | 207 | struct sockaddr_storage dest_addr; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 208 | struct rds_iovec vec; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 209 | __u64 cookie_addr; |
| 210 | __u64 flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 211 | }; |
| 212 | struct rds_free_mr_args { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 213 | rds_rdma_cookie_t cookie; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 214 | __u64 flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 215 | }; |
| 216 | struct rds_rdma_args { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 217 | rds_rdma_cookie_t cookie; |
| 218 | struct rds_iovec remote_vec; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 219 | __u64 local_vec_addr; |
| 220 | __u64 nr_local; |
| 221 | __u64 flags; |
| 222 | __u64 user_token; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 223 | }; |
| 224 | struct rds_atomic_args { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 225 | rds_rdma_cookie_t cookie; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 226 | __u64 local_addr; |
| 227 | __u64 remote_addr; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 228 | union { |
| 229 | struct { |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 230 | __u64 compare; |
| 231 | __u64 swap; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 232 | } cswp; |
| 233 | struct { |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 234 | __u64 add; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 235 | } fadd; |
| 236 | struct { |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 237 | __u64 compare; |
| 238 | __u64 swap; |
| 239 | __u64 compare_mask; |
| 240 | __u64 swap_mask; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 241 | } m_cswp; |
| 242 | struct { |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 243 | __u64 add; |
| 244 | __u64 nocarry_mask; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 245 | } m_fadd; |
| 246 | }; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 247 | __u64 flags; |
| 248 | __u64 user_token; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 249 | }; |
| 250 | struct rds_rdma_notify { |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 251 | __u64 user_token; |
| 252 | __s32 status; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 253 | }; |
| 254 | #define RDS_RDMA_SUCCESS 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 255 | #define RDS_RDMA_REMOTE_ERROR 1 |
| 256 | #define RDS_RDMA_CANCELED 2 |
| 257 | #define RDS_RDMA_DROPPED 3 |
| 258 | #define RDS_RDMA_OTHER_ERROR 4 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 259 | #define RDS_MAX_ZCOOKIES 8 |
| 260 | struct rds_zcopy_cookies { |
| 261 | __u32 num; |
| 262 | __u32 cookies[RDS_MAX_ZCOOKIES]; |
| 263 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 264 | #define RDS_RDMA_READWRITE 0x0001 |
| 265 | #define RDS_RDMA_FENCE 0x0002 |
| 266 | #define RDS_RDMA_INVALIDATE 0x0004 |
| 267 | #define RDS_RDMA_USE_ONCE 0x0008 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 268 | #define RDS_RDMA_DONTWAIT 0x0010 |
| 269 | #define RDS_RDMA_NOTIFY_ME 0x0020 |
| 270 | #define RDS_RDMA_SILENT 0x0040 |
| 271 | #endif |