Lines Matching refs:wc

117 static void handle_good_req(struct ib_wc *wc, struct mlx5_cqe64 *cqe,  in handle_good_req()  argument
120 wc->wc_flags = 0; in handle_good_req()
123 wc->wc_flags |= IB_WC_WITH_IMM; in handle_good_req()
126 wc->opcode = IB_WC_RDMA_WRITE; in handle_good_req()
129 wc->wc_flags |= IB_WC_WITH_IMM; in handle_good_req()
133 wc->opcode = IB_WC_SEND; in handle_good_req()
136 wc->opcode = IB_WC_RDMA_READ; in handle_good_req()
137 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in handle_good_req()
140 wc->opcode = IB_WC_COMP_SWAP; in handle_good_req()
141 wc->byte_len = 8; in handle_good_req()
144 wc->opcode = IB_WC_FETCH_ADD; in handle_good_req()
145 wc->byte_len = 8; in handle_good_req()
148 wc->opcode = IB_WC_MASKED_COMP_SWAP; in handle_good_req()
149 wc->byte_len = 8; in handle_good_req()
152 wc->opcode = IB_WC_MASKED_FETCH_ADD; in handle_good_req()
153 wc->byte_len = 8; in handle_good_req()
156 wc->opcode = get_umr_comp(wq, idx); in handle_good_req()
166 static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe, in handle_responder() argument
190 wc->wr_id = srq->wrid[wqe_ctr]; in handle_responder()
197 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in handle_responder()
200 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in handle_responder()
204 wc->opcode = IB_WC_RECV_RDMA_WITH_IMM; in handle_responder()
205 wc->wc_flags = IB_WC_WITH_IMM; in handle_responder()
206 wc->ex.imm_data = cqe->immediate; in handle_responder()
209 wc->opcode = IB_WC_RECV; in handle_responder()
210 wc->wc_flags = IB_WC_IP_CSUM_OK; in handle_responder()
213 wc->wc_flags = 0; in handle_responder()
216 wc->opcode = IB_WC_RECV; in handle_responder()
217 wc->wc_flags = IB_WC_WITH_IMM; in handle_responder()
218 wc->ex.imm_data = cqe->immediate; in handle_responder()
221 wc->opcode = IB_WC_RECV; in handle_responder()
222 wc->wc_flags = IB_WC_WITH_INVALIDATE; in handle_responder()
223 wc->ex.invalidate_rkey = be32_to_cpu(cqe->inval_rkey); in handle_responder()
226 wc->src_qp = be32_to_cpu(cqe->flags_rqpn) & 0xffffff; in handle_responder()
227 wc->dlid_path_bits = cqe->ml_path; in handle_responder()
229 wc->wc_flags |= g ? IB_WC_GRH : 0; in handle_responder()
234 &wc->pkey_index); in handle_responder()
236 wc->pkey_index = 0; in handle_responder()
240 wc->slid = be16_to_cpu(cqe->slid); in handle_responder()
241 wc->sl = (be32_to_cpu(cqe->flags_rqpn) >> 24) & 0xf; in handle_responder()
245 wc->slid = 0; in handle_responder()
249 wc->vlan_id = (be16_to_cpu(cqe->vlan_info)) & 0xfff; in handle_responder()
250 wc->sl = (be16_to_cpu(cqe->vlan_info) >> 13) & 0x7; in handle_responder()
251 wc->wc_flags |= IB_WC_WITH_VLAN; in handle_responder()
253 wc->sl = 0; in handle_responder()
258 wc->network_hdr_type = RDMA_NETWORK_ROCE_V1; in handle_responder()
261 wc->network_hdr_type = RDMA_NETWORK_IPV6; in handle_responder()
264 wc->network_hdr_type = RDMA_NETWORK_IPV4; in handle_responder()
267 wc->wc_flags |= IB_WC_WITH_NETWORK_HDR_TYPE; in handle_responder()
271 struct ib_wc *wc, const char *level) in dump_cqe() argument
273 mlx5_ib_log(level, dev, "WC error: %d, Message: %s\n", wc->status, in dump_cqe()
274 ib_wc_status_msg(wc->status)); in dump_cqe()
281 struct ib_wc *wc) in mlx5_handle_error_cqe() argument
287 wc->status = IB_WC_LOC_LEN_ERR; in mlx5_handle_error_cqe()
290 wc->status = IB_WC_LOC_QP_OP_ERR; in mlx5_handle_error_cqe()
294 wc->status = IB_WC_LOC_PROT_ERR; in mlx5_handle_error_cqe()
298 wc->status = IB_WC_WR_FLUSH_ERR; in mlx5_handle_error_cqe()
301 wc->status = IB_WC_MW_BIND_ERR; in mlx5_handle_error_cqe()
304 wc->status = IB_WC_BAD_RESP_ERR; in mlx5_handle_error_cqe()
307 wc->status = IB_WC_LOC_ACCESS_ERR; in mlx5_handle_error_cqe()
310 wc->status = IB_WC_REM_INV_REQ_ERR; in mlx5_handle_error_cqe()
314 wc->status = IB_WC_REM_ACCESS_ERR; in mlx5_handle_error_cqe()
318 wc->status = IB_WC_REM_OP_ERR; in mlx5_handle_error_cqe()
322 wc->status = IB_WC_RETRY_EXC_ERR; in mlx5_handle_error_cqe()
326 wc->status = IB_WC_RNR_RETRY_EXC_ERR; in mlx5_handle_error_cqe()
329 wc->status = IB_WC_REM_ABORT_ERR; in mlx5_handle_error_cqe()
332 wc->status = IB_WC_GENERAL_ERR; in mlx5_handle_error_cqe()
336 wc->vendor_err = cqe->vendor_err_synd; in mlx5_handle_error_cqe()
338 dump_cqe(dev, cqe, wc, dump); in mlx5_handle_error_cqe()
394 static void sw_comp(struct mlx5_ib_qp *qp, int num_entries, struct ib_wc *wc, in sw_comp() argument
414 wc->wr_id = wq->wrid[idx]; in sw_comp()
415 wc->status = IB_WC_WR_FLUSH_ERR; in sw_comp()
416 wc->vendor_err = MLX5_CQE_SYNDROME_WR_FLUSH_ERR; in sw_comp()
421 wc->qp = &qp->ibqp; in sw_comp()
422 wc++; in sw_comp()
428 struct ib_wc *wc, int *npolled) in mlx5_ib_poll_sw_comp() argument
435 sw_comp(qp, num_entries, wc + *npolled, npolled, true); in mlx5_ib_poll_sw_comp()
441 sw_comp(qp, num_entries, wc + *npolled, npolled, false); in mlx5_ib_poll_sw_comp()
449 struct ib_wc *wc) in mlx5_poll_one() argument
499 wc->qp = &(*cur_qp)->ibqp; in mlx5_poll_one()
505 handle_good_req(wc, cqe64, wq, idx); in mlx5_poll_one()
507 wc->wr_id = wq->wrid[idx]; in mlx5_poll_one()
509 wc->status = IB_WC_SUCCESS; in mlx5_poll_one()
515 handle_responder(wc, cqe64, *cur_qp); in mlx5_poll_one()
516 wc->status = IB_WC_SUCCESS; in mlx5_poll_one()
523 mlx5_handle_error_cqe(dev, err_cqe, wc); in mlx5_poll_one()
529 if (wc->status != IB_WC_WR_FLUSH_ERR && in mlx5_poll_one()
537 wc->wr_id = wq->wrid[idx]; in mlx5_poll_one()
545 wc->wr_id = srq->wrid[wqe_ctr]; in mlx5_poll_one()
549 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx5_poll_one()
582 struct ib_wc *wc, bool is_fatal_err) in poll_soft_wc() argument
596 soft_wc->wc.status = IB_WC_WR_FLUSH_ERR; in poll_soft_wc()
597 soft_wc->wc.vendor_err = MLX5_CQE_SYNDROME_WR_FLUSH_ERR; in poll_soft_wc()
599 wc[npolled++] = soft_wc->wc; in poll_soft_wc()
607 int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) in mlx5_ib_poll_cq() argument
621 soft_polled = poll_soft_wc(cq, num_entries, wc, true); in mlx5_ib_poll_cq()
624 wc + soft_polled, &npolled); in mlx5_ib_poll_cq()
629 soft_polled = poll_soft_wc(cq, num_entries, wc, false); in mlx5_ib_poll_cq()
632 if (mlx5_poll_one(cq, &cur_qp, wc + soft_polled + npolled)) in mlx5_ib_poll_cq()
1423 int mlx5_ib_generate_wc(struct ib_cq *ibcq, struct ib_wc *wc) in mlx5_ib_generate_wc() argument
1433 soft_wc->wc = *wc; in mlx5_ib_generate_wc()
1437 wc->status != IB_WC_SUCCESS) { in mlx5_ib_generate_wc()