| 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 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 48 | #define RDS_INFO_FIRST 10000 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 { | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 61 | __u8 name[32]; | 
|  | 62 | __u64 value; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 63 | } __attribute__((packed)); | 
|  | 64 | #define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 { | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 69 | __u64 next_tx_seq; | 
|  | 70 | __u64 next_rx_seq; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | __be32 laddr; | 
|  | 72 | __be32 faddr; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 73 | __u8 transport[TRANSNAMSIZ]; | 
|  | 74 | __u8 flags; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 75 | } __attribute__((packed)); | 
|  | 76 | #define RDS_INFO_MESSAGE_FLAG_ACK 0x01 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 77 | #define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 | 
|  | 78 | struct rds_info_message { | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 79 | __u64 seq; | 
|  | 80 | __u32 len; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 81 | __be32 laddr; | 
|  | 82 | __be32 faddr; | 
|  | 83 | __be16 lport; | 
|  | 84 | __be16 fport; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 85 | __u8 flags; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 86 | } __attribute__((packed)); | 
|  | 87 | struct rds_info_socket { | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 88 | __u32 sndbuf; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 89 | __be32 bound_addr; | 
|  | 90 | __be32 connected_addr; | 
|  | 91 | __be16 bound_port; | 
|  | 92 | __be16 connected_port; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 93 | __u32 rcvbuf; | 
|  | 94 | __u64 inum; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 95 | } __attribute__((packed)); | 
|  | 96 | struct rds_info_tcp_socket { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 97 | __be32 local_addr; | 
|  | 98 | __be16 local_port; | 
|  | 99 | __be32 peer_addr; | 
|  | 100 | __be16 peer_port; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 101 | __u64 hdr_rem; | 
|  | 102 | __u64 data_rem; | 
|  | 103 | __u32 last_sent_nxt; | 
|  | 104 | __u32 last_expected_una; | 
|  | 105 | __u32 last_seen_una; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 106 | } __attribute__((packed)); | 
|  | 107 | #define RDS_IB_GID_LEN 16 | 
|  | 108 | struct rds_info_rdma_connection { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 109 | __be32 src_addr; | 
|  | 110 | __be32 dst_addr; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 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]; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 133 | }; | 
|  | 134 | #define RDS_CONG_MONITOR_SIZE 64 | 
|  | 135 | #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] | 136 | #define RDS_CONG_MONITOR_MASK(port) (1ULL << RDS_CONG_MONITOR_BIT(port)) | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 137 | typedef __u64 rds_rdma_cookie_t; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 138 | struct rds_iovec { | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 139 | __u64 addr; | 
|  | 140 | __u64 bytes; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 141 | }; | 
|  | 142 | struct rds_get_mr_args { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 143 | struct rds_iovec vec; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 144 | __u64 cookie_addr; | 
|  | 145 | __u64 flags; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 146 | }; | 
|  | 147 | struct rds_get_mr_for_dest_args { | 
| Elliott Hughes | 64f355f | 2017-08-30 16:10:24 -0700 | [diff] [blame] | 148 | struct sockaddr_storage dest_addr; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 149 | struct rds_iovec vec; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 150 | __u64 cookie_addr; | 
|  | 151 | __u64 flags; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 152 | }; | 
|  | 153 | struct rds_free_mr_args { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 154 | rds_rdma_cookie_t cookie; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 155 | __u64 flags; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 156 | }; | 
|  | 157 | struct rds_rdma_args { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 158 | rds_rdma_cookie_t cookie; | 
|  | 159 | struct rds_iovec remote_vec; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 160 | __u64 local_vec_addr; | 
|  | 161 | __u64 nr_local; | 
|  | 162 | __u64 flags; | 
|  | 163 | __u64 user_token; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 164 | }; | 
|  | 165 | struct rds_atomic_args { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 166 | rds_rdma_cookie_t cookie; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 167 | __u64 local_addr; | 
|  | 168 | __u64 remote_addr; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 169 | union { | 
|  | 170 | struct { | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 171 | __u64 compare; | 
|  | 172 | __u64 swap; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 173 | } cswp; | 
|  | 174 | struct { | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 175 | __u64 add; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 176 | } fadd; | 
|  | 177 | struct { | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 178 | __u64 compare; | 
|  | 179 | __u64 swap; | 
|  | 180 | __u64 compare_mask; | 
|  | 181 | __u64 swap_mask; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 182 | } m_cswp; | 
|  | 183 | struct { | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 184 | __u64 add; | 
|  | 185 | __u64 nocarry_mask; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 186 | } m_fadd; | 
|  | 187 | }; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 188 | __u64 flags; | 
|  | 189 | __u64 user_token; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 190 | }; | 
|  | 191 | struct rds_rdma_notify { | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 192 | __u64 user_token; | 
|  | 193 | __s32 status; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 194 | }; | 
|  | 195 | #define RDS_RDMA_SUCCESS 0 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 204 | #define RDS_RDMA_DONTWAIT 0x0010 | 
|  | 205 | #define RDS_RDMA_NOTIFY_ME 0x0020 | 
|  | 206 | #define RDS_RDMA_SILENT 0x0040 | 
|  | 207 | #endif |