| 156 | return CQ; |
| 157 | } |
| 158 | int Poll(ibv_wc* res, int bufSize) { |
| 159 | Y_ASSERT(bufSize >= 1); |
| 160 | //struct ibv_wc |
| 161 | //{ |
| 162 | // ui64 wr_id; |
| 163 | // enum ibv_wc_status status; |
| 164 | // enum ibv_wc_opcode opcode; |
| 165 | // ui32 vendor_err; |
| 166 | // ui32 byte_len; |
| 167 | // ui32 imm_data;/* network byte order */ |
| 168 | // ui32 qp_num; |
| 169 | // ui32 src_qp; |
| 170 | // enum ibv_wc_flags wc_flags; |
| 171 | // ui16 pkey_index; |
| 172 | // ui16 slid; |
| 173 | // ui8 sl; |
| 174 | // ui8 dlid_path_bits; |
| 175 | //}; |
| 176 | int rv = ibv_poll_cq(CQ, bufSize, res); |
| 177 | if (rv < 0) { |
| 178 | Y_ABORT_UNLESS(0, "ibv_poll_cq failed"); |
| 179 | } |
| 180 | if (rv > 0) { |
| 181 | //printf("Completed wr\n"); |
| 182 | //printf(" wr_id = %" PRIx64 "\n", wc.wr_id); |
| 183 | //printf(" status = %d\n", wc.status); |
| 184 | //printf(" opcode = %d\n", wc.opcode); |
| 185 | //printf(" byte_len = %d\n", wc.byte_len); |
| 186 | //printf(" imm_data = %d\n", wc.imm_data); |
| 187 | //printf(" qp_num = %d\n", wc.qp_num); |
| 188 | //printf(" src_qp = %d\n", wc.src_qp); |
| 189 | //printf(" wc_flags = %x\n", wc.wc_flags); |
| 190 | //printf(" slid = %d\n", wc.slid); |
| 191 | } |
| 192 | //rv = number_of_toggled_wc; |
| 193 | return rv; |
| 194 | } |
| 195 | }; |
| 196 | |
| 197 | //struct ibv_mr |