Lines Matching full: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()
278 struct ib_wc *wc) in mlx5_handle_error_cqe() argument
284 wc->status = IB_WC_LOC_LEN_ERR; in mlx5_handle_error_cqe()
287 wc->status = IB_WC_LOC_QP_OP_ERR; in mlx5_handle_error_cqe()
290 wc->status = IB_WC_LOC_PROT_ERR; in mlx5_handle_error_cqe()
294 wc->status = IB_WC_WR_FLUSH_ERR; in mlx5_handle_error_cqe()
297 wc->status = IB_WC_MW_BIND_ERR; in mlx5_handle_error_cqe()
300 wc->status = IB_WC_BAD_RESP_ERR; in mlx5_handle_error_cqe()
303 wc->status = IB_WC_LOC_ACCESS_ERR; in mlx5_handle_error_cqe()
306 wc->status = IB_WC_REM_INV_REQ_ERR; in mlx5_handle_error_cqe()
309 wc->status = IB_WC_REM_ACCESS_ERR; in mlx5_handle_error_cqe()
312 wc->status = IB_WC_REM_OP_ERR; in mlx5_handle_error_cqe()
315 wc->status = IB_WC_RETRY_EXC_ERR; in mlx5_handle_error_cqe()
319 wc->status = IB_WC_RNR_RETRY_EXC_ERR; in mlx5_handle_error_cqe()
323 wc->status = IB_WC_REM_ABORT_ERR; in mlx5_handle_error_cqe()
326 wc->status = IB_WC_GENERAL_ERR; in mlx5_handle_error_cqe()
330 wc->vendor_err = cqe->vendor_err_synd; in mlx5_handle_error_cqe()
332 mlx5_ib_warn(dev, "WC error: %d, Message: %s\n", wc->status, in mlx5_handle_error_cqe()
333 ib_wc_status_msg(wc->status)); in mlx5_handle_error_cqe()
391 static void sw_comp(struct mlx5_ib_qp *qp, int num_entries, struct ib_wc *wc, in sw_comp() argument
411 wc->wr_id = wq->wrid[idx]; in sw_comp()
412 wc->status = IB_WC_WR_FLUSH_ERR; in sw_comp()
413 wc->vendor_err = MLX5_CQE_SYNDROME_WR_FLUSH_ERR; in sw_comp()
418 wc->qp = &qp->ibqp; in sw_comp()
419 wc++; in sw_comp()
425 struct ib_wc *wc, int *npolled) in mlx5_ib_poll_sw_comp() argument
432 sw_comp(qp, num_entries, wc + *npolled, npolled, true); in mlx5_ib_poll_sw_comp()
438 sw_comp(qp, num_entries, wc + *npolled, npolled, false); in mlx5_ib_poll_sw_comp()
446 struct ib_wc *wc) in mlx5_poll_one() argument
496 wc->qp = &(*cur_qp)->ibqp; in mlx5_poll_one()
502 handle_good_req(wc, cqe64, wq, idx); in mlx5_poll_one()
504 wc->wr_id = wq->wrid[idx]; in mlx5_poll_one()
506 wc->status = IB_WC_SUCCESS; in mlx5_poll_one()
512 handle_responder(wc, cqe64, *cur_qp); in mlx5_poll_one()
513 wc->status = IB_WC_SUCCESS; in mlx5_poll_one()
520 mlx5_handle_error_cqe(dev, err_cqe, wc); in mlx5_poll_one()
526 if (wc->status != IB_WC_WR_FLUSH_ERR && in mlx5_poll_one()
534 wc->wr_id = wq->wrid[idx]; in mlx5_poll_one()
542 wc->wr_id = srq->wrid[wqe_ctr]; in mlx5_poll_one()
546 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx5_poll_one()
579 struct ib_wc *wc, bool is_fatal_err) in poll_soft_wc() argument
593 soft_wc->wc.status = IB_WC_WR_FLUSH_ERR; in poll_soft_wc()
594 soft_wc->wc.vendor_err = MLX5_CQE_SYNDROME_WR_FLUSH_ERR; in poll_soft_wc()
596 wc[npolled++] = soft_wc->wc; in poll_soft_wc()
604 int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) in mlx5_ib_poll_cq() argument
618 soft_polled = poll_soft_wc(cq, num_entries, wc, true); in mlx5_ib_poll_cq()
621 wc + soft_polled, &npolled); in mlx5_ib_poll_cq()
626 soft_polled = poll_soft_wc(cq, num_entries, wc, false); in mlx5_ib_poll_cq()
629 if (mlx5_poll_one(cq, &cur_qp, wc + soft_polled + npolled)) in mlx5_ib_poll_cq()
1420 int mlx5_ib_generate_wc(struct ib_cq *ibcq, struct ib_wc *wc) in mlx5_ib_generate_wc() argument
1430 soft_wc->wc = *wc; in mlx5_ib_generate_wc()
1434 wc->status != IB_WC_SUCCESS) { in mlx5_ib_generate_wc()