diff options
Diffstat (limited to 'include/linux/rds.h')
| -rw-r--r-- | include/linux/rds.h | 115 | 
1 files changed, 65 insertions, 50 deletions
| diff --git a/include/linux/rds.h b/include/linux/rds.h index 24bce3ded9ea..91950950aa59 100644 --- a/include/linux/rds.h +++ b/include/linux/rds.h | |||
| @@ -36,15 +36,6 @@ | |||
| 36 | 36 | ||
| 37 | #include <linux/types.h> | 37 | #include <linux/types.h> | 
| 38 | 38 | ||
| 39 | /* These sparse annotated types shouldn't be in any user | ||
| 40 | * visible header file. We should clean this up rather | ||
| 41 | * than kludging around them. */ | ||
| 42 | #ifndef __KERNEL__ | ||
| 43 | #define __be16 u_int16_t | ||
| 44 | #define __be32 u_int32_t | ||
| 45 | #define __be64 u_int64_t | ||
| 46 | #endif | ||
| 47 | |||
| 48 | #define RDS_IB_ABI_VERSION 0x301 | 39 | #define RDS_IB_ABI_VERSION 0x301 | 
| 49 | 40 | ||
| 50 | /* | 41 | /* | 
| @@ -82,6 +73,10 @@ | |||
| 82 | #define RDS_CMSG_RDMA_MAP 3 | 73 | #define RDS_CMSG_RDMA_MAP 3 | 
| 83 | #define RDS_CMSG_RDMA_STATUS 4 | 74 | #define RDS_CMSG_RDMA_STATUS 4 | 
| 84 | #define RDS_CMSG_CONG_UPDATE 5 | 75 | #define RDS_CMSG_CONG_UPDATE 5 | 
| 76 | #define RDS_CMSG_ATOMIC_FADD 6 | ||
| 77 | #define RDS_CMSG_ATOMIC_CSWP 7 | ||
| 78 | #define RDS_CMSG_MASKED_ATOMIC_FADD 8 | ||
| 79 | #define RDS_CMSG_MASKED_ATOMIC_CSWP 9 | ||
| 85 | 80 | ||
| 86 | #define RDS_INFO_FIRST 10000 | 81 | #define RDS_INFO_FIRST 10000 | 
| 87 | #define RDS_INFO_COUNTERS 10000 | 82 | #define RDS_INFO_COUNTERS 10000 | 
| @@ -98,9 +93,9 @@ | |||
| 98 | #define RDS_INFO_LAST 10010 | 93 | #define RDS_INFO_LAST 10010 | 
| 99 | 94 | ||
| 100 | struct rds_info_counter { | 95 | struct rds_info_counter { | 
| 101 | u_int8_t name[32]; | 96 | uint8_t name[32]; | 
| 102 | u_int64_t value; | 97 | uint64_t value; | 
| 103 | } __packed; | 98 | } __attribute__((packed)); | 
| 104 | 99 | ||
| 105 | #define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 | 100 | #define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 | 
| 106 | #define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02 | 101 | #define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02 | 
| @@ -109,56 +104,48 @@ struct rds_info_counter { | |||
| 109 | #define TRANSNAMSIZ 16 | 104 | #define TRANSNAMSIZ 16 | 
| 110 | 105 | ||
| 111 | struct rds_info_connection { | 106 | struct rds_info_connection { | 
| 112 | u_int64_t next_tx_seq; | 107 | uint64_t next_tx_seq; | 
| 113 | u_int64_t next_rx_seq; | 108 | uint64_t next_rx_seq; | 
| 114 | __be32 laddr; | ||
| 115 | __be32 faddr; | ||
| 116 | u_int8_t transport[TRANSNAMSIZ]; /* null term ascii */ | ||
| 117 | u_int8_t flags; | ||
| 118 | } __packed; | ||
| 119 | |||
| 120 | struct rds_info_flow { | ||
| 121 | __be32 laddr; | 109 | __be32 laddr; | 
| 122 | __be32 faddr; | 110 | __be32 faddr; | 
| 123 | u_int32_t bytes; | 111 | uint8_t transport[TRANSNAMSIZ]; /* null term ascii */ | 
| 124 | __be16 lport; | 112 | uint8_t flags; | 
| 125 | __be16 fport; | 113 | } __attribute__((packed)); | 
| 126 | } __packed; | ||
| 127 | 114 | ||
| 128 | #define RDS_INFO_MESSAGE_FLAG_ACK 0x01 | 115 | #define RDS_INFO_MESSAGE_FLAG_ACK 0x01 | 
| 129 | #define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 | 116 | #define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 | 
| 130 | 117 | ||
| 131 | struct rds_info_message { | 118 | struct rds_info_message { | 
| 132 | u_int64_t seq; | 119 | uint64_t seq; | 
| 133 | u_int32_t len; | 120 | uint32_t len; | 
| 134 | __be32 laddr; | 121 | __be32 laddr; | 
| 135 | __be32 faddr; | 122 | __be32 faddr; | 
| 136 | __be16 lport; | 123 | __be16 lport; | 
| 137 | __be16 fport; | 124 | __be16 fport; | 
| 138 | u_int8_t flags; | 125 | uint8_t flags; | 
| 139 | } __packed; | 126 | } __attribute__((packed)); | 
| 140 | 127 | ||
| 141 | struct rds_info_socket { | 128 | struct rds_info_socket { | 
| 142 | u_int32_t sndbuf; | 129 | uint32_t sndbuf; | 
| 143 | __be32 bound_addr; | 130 | __be32 bound_addr; | 
| 144 | __be32 connected_addr; | 131 | __be32 connected_addr; | 
| 145 | __be16 bound_port; | 132 | __be16 bound_port; | 
| 146 | __be16 connected_port; | 133 | __be16 connected_port; | 
| 147 | u_int32_t rcvbuf; | 134 | uint32_t rcvbuf; | 
| 148 | u_int64_t inum; | 135 | uint64_t inum; | 
| 149 | } __packed; | 136 | } __attribute__((packed)); | 
| 150 | 137 | ||
| 151 | struct rds_info_tcp_socket { | 138 | struct rds_info_tcp_socket { | 
| 152 | __be32 local_addr; | 139 | __be32 local_addr; | 
| 153 | __be16 local_port; | 140 | __be16 local_port; | 
| 154 | __be32 peer_addr; | 141 | __be32 peer_addr; | 
| 155 | __be16 peer_port; | 142 | __be16 peer_port; | 
| 156 | u_int64_t hdr_rem; | 143 | uint64_t hdr_rem; | 
| 157 | u_int64_t data_rem; | 144 | uint64_t data_rem; | 
| 158 | u_int32_t last_sent_nxt; | 145 | uint32_t last_sent_nxt; | 
| 159 | u_int32_t last_expected_una; | 146 | uint32_t last_expected_una; | 
| 160 | u_int32_t last_seen_una; | 147 | uint32_t last_seen_una; | 
| 161 | } __packed; | 148 | } __attribute__((packed)); | 
| 162 | 149 | ||
| 163 | #define RDS_IB_GID_LEN 16 | 150 | #define RDS_IB_GID_LEN 16 | 
| 164 | struct rds_info_rdma_connection { | 151 | struct rds_info_rdma_connection { | 
| @@ -212,42 +199,69 @@ struct rds_info_rdma_connection { | |||
| 212 | * (so that the application does not have to worry about | 199 | * (so that the application does not have to worry about | 
| 213 | * alignment). | 200 | * alignment). | 
| 214 | */ | 201 | */ | 
| 215 | typedef u_int64_t rds_rdma_cookie_t; | 202 | typedef uint64_t rds_rdma_cookie_t; | 
| 216 | 203 | ||
| 217 | struct rds_iovec { | 204 | struct rds_iovec { | 
| 218 | u_int64_t addr; | 205 | uint64_t addr; | 
| 219 | u_int64_t bytes; | 206 | uint64_t bytes; | 
| 220 | }; | 207 | }; | 
| 221 | 208 | ||
| 222 | struct rds_get_mr_args { | 209 | struct rds_get_mr_args { | 
| 223 | struct rds_iovec vec; | 210 | struct rds_iovec vec; | 
| 224 | u_int64_t cookie_addr; | 211 | uint64_t cookie_addr; | 
| 225 | uint64_t flags; | 212 | uint64_t flags; | 
| 226 | }; | 213 | }; | 
| 227 | 214 | ||
| 228 | struct rds_get_mr_for_dest_args { | 215 | struct rds_get_mr_for_dest_args { | 
| 229 | struct sockaddr_storage dest_addr; | 216 | struct sockaddr_storage dest_addr; | 
| 230 | struct rds_iovec vec; | 217 | struct rds_iovec vec; | 
| 231 | u_int64_t cookie_addr; | 218 | uint64_t cookie_addr; | 
| 232 | uint64_t flags; | 219 | uint64_t flags; | 
| 233 | }; | 220 | }; | 
| 234 | 221 | ||
| 235 | struct rds_free_mr_args { | 222 | struct rds_free_mr_args { | 
| 236 | rds_rdma_cookie_t cookie; | 223 | rds_rdma_cookie_t cookie; | 
| 237 | u_int64_t flags; | 224 | uint64_t flags; | 
| 238 | }; | 225 | }; | 
| 239 | 226 | ||
| 240 | struct rds_rdma_args { | 227 | struct rds_rdma_args { | 
| 241 | rds_rdma_cookie_t cookie; | 228 | rds_rdma_cookie_t cookie; | 
| 242 | struct rds_iovec remote_vec; | 229 | struct rds_iovec remote_vec; | 
| 243 | u_int64_t local_vec_addr; | 230 | uint64_t local_vec_addr; | 
| 244 | u_int64_t nr_local; | 231 | uint64_t nr_local; | 
| 245 | u_int64_t flags; | 232 | uint64_t flags; | 
| 246 | u_int64_t user_token; | 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; | ||
| 247 | }; | 261 | }; | 
| 248 | 262 | ||
| 249 | struct rds_rdma_notify { | 263 | struct rds_rdma_notify { | 
| 250 | u_int64_t user_token; | 264 | uint64_t user_token; | 
| 251 | int32_t status; | 265 | int32_t status; | 
| 252 | }; | 266 | }; | 
| 253 | 267 | ||
| @@ -266,5 +280,6 @@ struct rds_rdma_notify { | |||
| 266 | #define RDS_RDMA_USE_ONCE 0x0008 /* free MR after use */ | 280 | #define RDS_RDMA_USE_ONCE 0x0008 /* free MR after use */ | 
| 267 | #define RDS_RDMA_DONTWAIT 0x0010 /* Don't wait in SET_BARRIER */ | 281 | #define RDS_RDMA_DONTWAIT 0x0010 /* Don't wait in SET_BARRIER */ | 
| 268 | #define RDS_RDMA_NOTIFY_ME 0x0020 /* Notify when operation completes */ | 282 | #define RDS_RDMA_NOTIFY_ME 0x0020 /* Notify when operation completes */ | 
| 283 | #define RDS_RDMA_SILENT 0x0040 /* Do not interrupt remote */ | ||
| 269 | 284 | ||
| 270 | #endif /* IB_RDS_H */ | 285 | #endif /* IB_RDS_H */ | 
