Home | History | Annotate | Download | only in linux
      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 #include <linux/socket.h>
     23 #include <linux/in6.h>
     24 #define RDS_IB_ABI_VERSION 0x301
     25 #define SOL_RDS 276
     26 #define RDS_CANCEL_SENT_TO 1
     27 #define RDS_GET_MR 2
     28 #define RDS_FREE_MR 3
     29 #define RDS_RECVERR 5
     30 #define RDS_CONG_MONITOR 6
     31 #define RDS_GET_MR_FOR_DEST 7
     32 #define SO_RDS_TRANSPORT 8
     33 #define SO_RDS_MSG_RXPATH_LATENCY 10
     34 #define RDS_TRANS_IB 0
     35 #define RDS_TRANS_IWARP 1
     36 #define RDS_TRANS_TCP 2
     37 #define RDS_TRANS_COUNT 3
     38 #define RDS_TRANS_NONE (~0)
     39 #define RDS_CMSG_RDMA_ARGS 1
     40 #define RDS_CMSG_RDMA_DEST 2
     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
     45 #define RDS_CMSG_ATOMIC_CSWP 7
     46 #define RDS_CMSG_MASKED_ATOMIC_FADD 8
     47 #define RDS_CMSG_MASKED_ATOMIC_CSWP 9
     48 #define RDS_CMSG_RXPATH_LATENCY 11
     49 #define RDS_CMSG_ZCOPY_COOKIE 12
     50 #define RDS_CMSG_ZCOPY_COMPLETION 13
     51 #define RDS_INFO_FIRST 10000
     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
     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
     60 #define RDS_INFO_CONNECTION_STATS 10009
     61 #define RDS_INFO_IWARP_CONNECTIONS 10010
     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
     70 struct rds_info_counter {
     71   __u8 name[32];
     72   __u64 value;
     73 } __attribute__((packed));
     74 #define RDS_INFO_CONNECTION_FLAG_SENDING 0x01
     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 {
     79   __u64 next_tx_seq;
     80   __u64 next_rx_seq;
     81   __be32 laddr;
     82   __be32 faddr;
     83   __u8 transport[TRANSNAMSIZ];
     84   __u8 flags;
     85 } __attribute__((packed));
     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));
     94 #define RDS_INFO_MESSAGE_FLAG_ACK 0x01
     95 #define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02
     96 struct rds_info_message {
     97   __u64 seq;
     98   __u32 len;
     99   __be32 laddr;
    100   __be32 faddr;
    101   __be16 lport;
    102   __be16 fport;
    103   __u8 flags;
    104 } __attribute__((packed));
    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));
    115 struct rds_info_socket {
    116   __u32 sndbuf;
    117   __be32 bound_addr;
    118   __be32 connected_addr;
    119   __be16 bound_port;
    120   __be16 connected_port;
    121   __u32 rcvbuf;
    122   __u64 inum;
    123 } __attribute__((packed));
    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));
    133 struct rds_info_tcp_socket {
    134   __be32 local_addr;
    135   __be16 local_port;
    136   __be32 peer_addr;
    137   __be16 peer_port;
    138   __u64 hdr_rem;
    139   __u64 data_rem;
    140   __u32 last_sent_nxt;
    141   __u32 last_expected_una;
    142   __u32 last_seen_una;
    143 } __attribute__((packed));
    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));
    155 #define RDS_IB_GID_LEN 16
    156 struct rds_info_rdma_connection {
    157   __be32 src_addr;
    158   __be32 dst_addr;
    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 };
    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 };
    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];
    192 };
    193 #define RDS_CONG_MONITOR_SIZE 64
    194 #define RDS_CONG_MONITOR_BIT(port) (((unsigned int) port) % RDS_CONG_MONITOR_SIZE)
    195 #define RDS_CONG_MONITOR_MASK(port) (1ULL << RDS_CONG_MONITOR_BIT(port))
    196 typedef __u64 rds_rdma_cookie_t;
    197 struct rds_iovec {
    198   __u64 addr;
    199   __u64 bytes;
    200 };
    201 struct rds_get_mr_args {
    202   struct rds_iovec vec;
    203   __u64 cookie_addr;
    204   __u64 flags;
    205 };
    206 struct rds_get_mr_for_dest_args {
    207   struct sockaddr_storage dest_addr;
    208   struct rds_iovec vec;
    209   __u64 cookie_addr;
    210   __u64 flags;
    211 };
    212 struct rds_free_mr_args {
    213   rds_rdma_cookie_t cookie;
    214   __u64 flags;
    215 };
    216 struct rds_rdma_args {
    217   rds_rdma_cookie_t cookie;
    218   struct rds_iovec remote_vec;
    219   __u64 local_vec_addr;
    220   __u64 nr_local;
    221   __u64 flags;
    222   __u64 user_token;
    223 };
    224 struct rds_atomic_args {
    225   rds_rdma_cookie_t cookie;
    226   __u64 local_addr;
    227   __u64 remote_addr;
    228   union {
    229     struct {
    230       __u64 compare;
    231       __u64 swap;
    232     } cswp;
    233     struct {
    234       __u64 add;
    235     } fadd;
    236     struct {
    237       __u64 compare;
    238       __u64 swap;
    239       __u64 compare_mask;
    240       __u64 swap_mask;
    241     } m_cswp;
    242     struct {
    243       __u64 add;
    244       __u64 nocarry_mask;
    245     } m_fadd;
    246   };
    247   __u64 flags;
    248   __u64 user_token;
    249 };
    250 struct rds_rdma_notify {
    251   __u64 user_token;
    252   __s32 status;
    253 };
    254 #define RDS_RDMA_SUCCESS 0
    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
    259 #define RDS_MAX_ZCOOKIES 8
    260 struct rds_zcopy_cookies {
    261   __u32 num;
    262   __u32 cookies[RDS_MAX_ZCOOKIES];
    263 };
    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
    268 #define RDS_RDMA_DONTWAIT 0x0010
    269 #define RDS_RDMA_NOTIFY_ME 0x0020
    270 #define RDS_RDMA_SILENT 0x0040
    271 #endif
    272