| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [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 RDMA_USER_RXE_H | 
 | 20 | #define RDMA_USER_RXE_H | 
 | 21 | #include <linux/types.h> | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 22 | #include <linux/socket.h> | 
 | 23 | #include <linux/in.h> | 
 | 24 | #include <linux/in6.h> | 
| Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 25 | enum { | 
 | 26 |   RXE_NETWORK_TYPE_IPV4 = 1, | 
 | 27 |   RXE_NETWORK_TYPE_IPV6 = 2, | 
 | 28 | }; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 29 | union rxe_gid { | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 30 |   __u8 raw[16]; | 
 | 31 |   struct { | 
 | 32 |     __be64 subnet_prefix; | 
 | 33 |     __be64 interface_id; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 34 |   } global; | 
 | 35 | }; | 
 | 36 | struct rxe_global_route { | 
 | 37 |   union rxe_gid dgid; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 38 |   __u32 flow_label; | 
 | 39 |   __u8 sgid_index; | 
 | 40 |   __u8 hop_limit; | 
 | 41 |   __u8 traffic_class; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 42 | }; | 
 | 43 | struct rxe_av { | 
 | 44 |   __u8 port_num; | 
 | 45 |   __u8 network_type; | 
| Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 46 |   __u8 dmac[6]; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 47 |   struct rxe_global_route grh; | 
 | 48 |   union { | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 49 |     struct sockaddr_in _sockaddr_in; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 50 |     struct sockaddr_in6 _sockaddr_in6; | 
 | 51 |   } sgid_addr, dgid_addr; | 
 | 52 | }; | 
 | 53 | struct rxe_send_wr { | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 54 |   __aligned_u64 wr_id; | 
| Christopher Ferris | 6cd53a5 | 2022-12-12 23:39:16 +0000 | [diff] [blame] | 55 |   __u32 reserved; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 56 |   __u32 opcode; | 
 | 57 |   __u32 send_flags; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 58 |   union { | 
 | 59 |     __be32 imm_data; | 
 | 60 |     __u32 invalidate_rkey; | 
 | 61 |   } ex; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 62 |   union { | 
 | 63 |     struct { | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 64 |       __aligned_u64 remote_addr; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 65 |       __u32 rkey; | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 66 |       __u32 reserved; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 67 |     } rdma; | 
 | 68 |     struct { | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 69 |       __aligned_u64 remote_addr; | 
 | 70 |       __aligned_u64 compare_add; | 
 | 71 |       __aligned_u64 swap; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 72 |       __u32 rkey; | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 73 |       __u32 reserved; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 74 |     } atomic; | 
 | 75 |     struct { | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 76 |       __u32 remote_qpn; | 
 | 77 |       __u32 remote_qkey; | 
 | 78 |       __u16 pkey_index; | 
| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 79 |       __u16 reserved; | 
 | 80 |       __u32 ah_num; | 
 | 81 |       __u32 pad[4]; | 
 | 82 |       struct rxe_av av; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 83 |     } ud; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 84 |     struct { | 
| Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 85 |       __aligned_u64 addr; | 
 | 86 |       __aligned_u64 length; | 
 | 87 |       __u32 mr_lkey; | 
 | 88 |       __u32 mw_rkey; | 
 | 89 |       __u32 rkey; | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 90 |       __u32 access; | 
| Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 91 |     } mw; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 92 |   } wr; | 
 | 93 | }; | 
 | 94 | struct rxe_sge { | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 95 |   __aligned_u64 addr; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 96 |   __u32 length; | 
 | 97 |   __u32 lkey; | 
 | 98 | }; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 99 | struct mminfo { | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 100 |   __aligned_u64 offset; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 101 |   __u32 size; | 
 | 102 |   __u32 pad; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 103 | }; | 
 | 104 | struct rxe_dma_info { | 
 | 105 |   __u32 length; | 
 | 106 |   __u32 resid; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 107 |   __u32 cur_sge; | 
 | 108 |   __u32 num_sge; | 
 | 109 |   __u32 sge_offset; | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 110 |   __u32 reserved; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 111 |   union { | 
| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 112 |     __DECLARE_FLEX_ARRAY(__u8, inline_data); | 
 | 113 |     __DECLARE_FLEX_ARRAY(struct rxe_sge, sge); | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 114 |   }; | 
 | 115 | }; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 116 | struct rxe_send_wqe { | 
 | 117 |   struct rxe_send_wr wr; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 118 |   __u32 status; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 119 |   __u32 state; | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 120 |   __aligned_u64 iova; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 121 |   __u32 mask; | 
 | 122 |   __u32 first_psn; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 123 |   __u32 last_psn; | 
 | 124 |   __u32 ack_length; | 
 | 125 |   __u32 ssn; | 
 | 126 |   __u32 has_rd_atomic; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 127 |   struct rxe_dma_info dma; | 
 | 128 | }; | 
 | 129 | struct rxe_recv_wqe { | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 130 |   __aligned_u64 wr_id; | 
| Christopher Ferris | 6cd53a5 | 2022-12-12 23:39:16 +0000 | [diff] [blame] | 131 |   __u32 reserved; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 132 |   __u32 padding; | 
 | 133 |   struct rxe_dma_info dma; | 
 | 134 | }; | 
| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 135 | struct rxe_create_ah_resp { | 
 | 136 |   __u32 ah_num; | 
 | 137 |   __u32 reserved; | 
 | 138 | }; | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 139 | struct rxe_create_cq_resp { | 
 | 140 |   struct mminfo mi; | 
 | 141 | }; | 
 | 142 | struct rxe_resize_cq_resp { | 
 | 143 |   struct mminfo mi; | 
 | 144 | }; | 
 | 145 | struct rxe_create_qp_resp { | 
 | 146 |   struct mminfo rq_mi; | 
 | 147 |   struct mminfo sq_mi; | 
 | 148 | }; | 
 | 149 | struct rxe_create_srq_resp { | 
 | 150 |   struct mminfo mi; | 
 | 151 |   __u32 srq_num; | 
 | 152 |   __u32 reserved; | 
 | 153 | }; | 
 | 154 | struct rxe_modify_srq_cmd { | 
 | 155 |   __aligned_u64 mmap_info_addr; | 
 | 156 | }; | 
| Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 157 | struct rxe_queue_buf { | 
 | 158 |   __u32 log2_elem_size; | 
 | 159 |   __u32 index_mask; | 
 | 160 |   __u32 pad_1[30]; | 
 | 161 |   __u32 producer_index; | 
 | 162 |   __u32 pad_2[31]; | 
 | 163 |   __u32 consumer_index; | 
 | 164 |   __u32 pad_3[31]; | 
 | 165 |   __u8 data[]; | 
 | 166 | }; | 
| Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 167 | #endif |