1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef IB_USER_CM_H 7 #define IB_USER_CM_H 8 #include <linux/types.h> 9 #include <rdma/ib_user_sa.h> 10 #define IB_USER_CM_ABI_VERSION 5 11 enum { 12 IB_USER_CM_CMD_CREATE_ID, 13 IB_USER_CM_CMD_DESTROY_ID, 14 IB_USER_CM_CMD_ATTR_ID, 15 IB_USER_CM_CMD_LISTEN, 16 IB_USER_CM_CMD_NOTIFY, 17 IB_USER_CM_CMD_SEND_REQ, 18 IB_USER_CM_CMD_SEND_REP, 19 IB_USER_CM_CMD_SEND_RTU, 20 IB_USER_CM_CMD_SEND_DREQ, 21 IB_USER_CM_CMD_SEND_DREP, 22 IB_USER_CM_CMD_SEND_REJ, 23 IB_USER_CM_CMD_SEND_MRA, 24 IB_USER_CM_CMD_SEND_LAP, 25 IB_USER_CM_CMD_SEND_APR, 26 IB_USER_CM_CMD_SEND_SIDR_REQ, 27 IB_USER_CM_CMD_SEND_SIDR_REP, 28 IB_USER_CM_CMD_EVENT, 29 IB_USER_CM_CMD_INIT_QP_ATTR, 30 }; 31 struct ib_ucm_cmd_hdr { 32 __u32 cmd; 33 __u16 in; 34 __u16 out; 35 }; 36 struct ib_ucm_create_id { 37 __aligned_u64 uid; 38 __aligned_u64 response; 39 }; 40 struct ib_ucm_create_id_resp { 41 __u32 id; 42 }; 43 struct ib_ucm_destroy_id { 44 __aligned_u64 response; 45 __u32 id; 46 __u32 reserved; 47 }; 48 struct ib_ucm_destroy_id_resp { 49 __u32 events_reported; 50 }; 51 struct ib_ucm_attr_id { 52 __aligned_u64 response; 53 __u32 id; 54 __u32 reserved; 55 }; 56 struct ib_ucm_attr_id_resp { 57 __be64 service_id; 58 __be64 service_mask; 59 __be32 local_id; 60 __be32 remote_id; 61 }; 62 struct ib_ucm_init_qp_attr { 63 __aligned_u64 response; 64 __u32 id; 65 __u32 qp_state; 66 }; 67 struct ib_ucm_listen { 68 __be64 service_id; 69 __be64 service_mask; 70 __u32 id; 71 __u32 reserved; 72 }; 73 struct ib_ucm_notify { 74 __u32 id; 75 __u32 event; 76 }; 77 struct ib_ucm_private_data { 78 __aligned_u64 data; 79 __u32 id; 80 __u8 len; 81 __u8 reserved[3]; 82 }; 83 struct ib_ucm_req { 84 __u32 id; 85 __u32 qpn; 86 __u32 qp_type; 87 __u32 psn; 88 __be64 sid; 89 __aligned_u64 data; 90 __aligned_u64 primary_path; 91 __aligned_u64 alternate_path; 92 __u8 len; 93 __u8 peer_to_peer; 94 __u8 responder_resources; 95 __u8 initiator_depth; 96 __u8 remote_cm_response_timeout; 97 __u8 flow_control; 98 __u8 local_cm_response_timeout; 99 __u8 retry_count; 100 __u8 rnr_retry_count; 101 __u8 max_cm_retries; 102 __u8 srq; 103 __u8 reserved[5]; 104 }; 105 struct ib_ucm_rep { 106 __aligned_u64 uid; 107 __aligned_u64 data; 108 __u32 id; 109 __u32 qpn; 110 __u32 psn; 111 __u8 len; 112 __u8 responder_resources; 113 __u8 initiator_depth; 114 __u8 target_ack_delay; 115 __u8 failover_accepted; 116 __u8 flow_control; 117 __u8 rnr_retry_count; 118 __u8 srq; 119 __u8 reserved[4]; 120 }; 121 struct ib_ucm_info { 122 __u32 id; 123 __u32 status; 124 __aligned_u64 info; 125 __aligned_u64 data; 126 __u8 info_len; 127 __u8 data_len; 128 __u8 reserved[6]; 129 }; 130 struct ib_ucm_mra { 131 __aligned_u64 data; 132 __u32 id; 133 __u8 len; 134 __u8 timeout; 135 __u8 reserved[2]; 136 }; 137 struct ib_ucm_lap { 138 __aligned_u64 path; 139 __aligned_u64 data; 140 __u32 id; 141 __u8 len; 142 __u8 reserved[3]; 143 }; 144 struct ib_ucm_sidr_req { 145 __u32 id; 146 __u32 timeout; 147 __be64 sid; 148 __aligned_u64 data; 149 __aligned_u64 path; 150 __u16 reserved_pkey; 151 __u8 len; 152 __u8 max_cm_retries; 153 __u8 reserved[4]; 154 }; 155 struct ib_ucm_sidr_rep { 156 __u32 id; 157 __u32 qpn; 158 __u32 qkey; 159 __u32 status; 160 __aligned_u64 info; 161 __aligned_u64 data; 162 __u8 info_len; 163 __u8 data_len; 164 __u8 reserved[6]; 165 }; 166 struct ib_ucm_event_get { 167 __aligned_u64 response; 168 __aligned_u64 data; 169 __aligned_u64 info; 170 __u8 data_len; 171 __u8 info_len; 172 __u8 reserved[6]; 173 }; 174 struct ib_ucm_req_event_resp { 175 struct ib_user_path_rec primary_path; 176 struct ib_user_path_rec alternate_path; 177 __be64 remote_ca_guid; 178 __u32 remote_qkey; 179 __u32 remote_qpn; 180 __u32 qp_type; 181 __u32 starting_psn; 182 __u8 responder_resources; 183 __u8 initiator_depth; 184 __u8 local_cm_response_timeout; 185 __u8 flow_control; 186 __u8 remote_cm_response_timeout; 187 __u8 retry_count; 188 __u8 rnr_retry_count; 189 __u8 srq; 190 __u8 port; 191 __u8 reserved[7]; 192 }; 193 struct ib_ucm_rep_event_resp { 194 __be64 remote_ca_guid; 195 __u32 remote_qkey; 196 __u32 remote_qpn; 197 __u32 starting_psn; 198 __u8 responder_resources; 199 __u8 initiator_depth; 200 __u8 target_ack_delay; 201 __u8 failover_accepted; 202 __u8 flow_control; 203 __u8 rnr_retry_count; 204 __u8 srq; 205 __u8 reserved[5]; 206 }; 207 struct ib_ucm_rej_event_resp { 208 __u32 reason; 209 210 }; 211 struct ib_ucm_mra_event_resp { 212 __u8 timeout; 213 __u8 reserved[3]; 214 }; 215 struct ib_ucm_lap_event_resp { 216 struct ib_user_path_rec path; 217 }; 218 struct ib_ucm_apr_event_resp { 219 __u32 status; 220 221 }; 222 struct ib_ucm_sidr_req_event_resp { 223 __u16 pkey; 224 __u8 port; 225 __u8 reserved; 226 }; 227 struct ib_ucm_sidr_rep_event_resp { 228 __u32 status; 229 __u32 qkey; 230 __u32 qpn; 231 232 }; 233 #define IB_UCM_PRES_DATA 0x01 234 #define IB_UCM_PRES_INFO 0x02 235 #define IB_UCM_PRES_PRIMARY 0x04 236 #define IB_UCM_PRES_ALTERNATE 0x08 237 struct ib_ucm_event_resp { 238 __aligned_u64 uid; 239 __u32 id; 240 __u32 event; 241 __u32 present; 242 __u32 reserved; 243 union { 244 struct ib_ucm_req_event_resp req_resp; 245 struct ib_ucm_rep_event_resp rep_resp; 246 struct ib_ucm_rej_event_resp rej_resp; 247 struct ib_ucm_mra_event_resp mra_resp; 248 struct ib_ucm_lap_event_resp lap_resp; 249 struct ib_ucm_apr_event_resp apr_resp; 250 struct ib_ucm_sidr_req_event_resp sidr_req_resp; 251 struct ib_ucm_sidr_rep_event_resp sidr_rep_resp; 252 __u32 send_status; 253 } u; 254 }; 255 #endif 256