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