Lines Matching full:wc
120 static void handle_good_req(struct ib_wc *wc, struct mlx5_cqe64 *cqe, in handle_good_req() argument
123 wc->wc_flags = 0; in handle_good_req()
126 wc->wc_flags |= IB_WC_WITH_IMM; in handle_good_req()
129 wc->opcode = IB_WC_RDMA_WRITE; in handle_good_req()
132 wc->wc_flags |= IB_WC_WITH_IMM; in handle_good_req()
136 wc->opcode = IB_WC_SEND; in handle_good_req()
139 wc->opcode = IB_WC_RDMA_READ; in handle_good_req()
140 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in handle_good_req()
143 wc->opcode = IB_WC_COMP_SWAP; in handle_good_req()
144 wc->byte_len = 8; in handle_good_req()
147 wc->opcode = IB_WC_FETCH_ADD; in handle_good_req()
148 wc->byte_len = 8; in handle_good_req()
151 wc->opcode = IB_WC_MASKED_COMP_SWAP; in handle_good_req()
152 wc->byte_len = 8; in handle_good_req()
155 wc->opcode = IB_WC_MASKED_FETCH_ADD; in handle_good_req()
156 wc->byte_len = 8; in handle_good_req()
159 wc->opcode = get_umr_comp(wq, idx); in handle_good_req()
169 static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe, in handle_responder() argument
193 wc->wr_id = srq->wrid[wqe_ctr]; in handle_responder()
200 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in handle_responder()
203 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in handle_responder()
207 wc->opcode = IB_WC_RECV_RDMA_WITH_IMM; in handle_responder()
208 wc->wc_flags = IB_WC_WITH_IMM; in handle_responder()
209 wc->ex.imm_data = cqe->immediate; in handle_responder()
212 wc->opcode = IB_WC_RECV; in handle_responder()
213 wc->wc_flags = IB_WC_IP_CSUM_OK; in handle_responder()
216 wc->wc_flags = 0; in handle_responder()
219 wc->opcode = IB_WC_RECV; in handle_responder()
220 wc->wc_flags = IB_WC_WITH_IMM; in handle_responder()
221 wc->ex.imm_data = cqe->immediate; in handle_responder()
224 wc->opcode = IB_WC_RECV; in handle_responder()
225 wc->wc_flags = IB_WC_WITH_INVALIDATE; in handle_responder()
226 wc->ex.invalidate_rkey = be32_to_cpu(cqe->inval_rkey); in handle_responder()
229 wc->src_qp = be32_to_cpu(cqe->flags_rqpn) & 0xffffff; in handle_responder()
230 wc->dlid_path_bits = cqe->ml_path; in handle_responder()
232 wc->wc_flags |= g ? IB_WC_GRH : 0; in handle_responder()
237 &wc->pkey_index); in handle_responder()
239 wc->pkey_index = 0; in handle_responder()
243 wc->slid = be16_to_cpu(cqe->slid); in handle_responder()
244 wc->sl = (be32_to_cpu(cqe->flags_rqpn) >> 24) & 0xf; in handle_responder()
248 wc->slid = 0; in handle_responder()
252 wc->vlan_id = (be16_to_cpu(cqe->vlan_info)) & 0xfff; in handle_responder()
253 wc->sl = (be16_to_cpu(cqe->vlan_info) >> 13) & 0x7; in handle_responder()
254 wc->wc_flags |= IB_WC_WITH_VLAN; in handle_responder()
256 wc->sl = 0; in handle_responder()
261 wc->network_hdr_type = RDMA_NETWORK_ROCE_V1; in handle_responder()
264 wc->network_hdr_type = RDMA_NETWORK_IPV6; in handle_responder()
267 wc->network_hdr_type = RDMA_NETWORK_IPV4; in handle_responder()
270 wc->wc_flags |= IB_WC_WITH_NETWORK_HDR_TYPE; in handle_responder()
274 struct ib_wc *wc, const char *level) in dump_cqe() argument
276 mlx5_ib_log(level, dev, "WC error: %d, Message: %s\n", wc->status, in dump_cqe()
277 ib_wc_status_msg(wc->status)); in dump_cqe()
284 struct ib_wc *wc) in mlx5_handle_error_cqe() argument
290 wc->status = IB_WC_LOC_LEN_ERR; in mlx5_handle_error_cqe()
293 wc->status = IB_WC_LOC_QP_OP_ERR; in mlx5_handle_error_cqe()
297 wc->status = IB_WC_LOC_PROT_ERR; in mlx5_handle_error_cqe()
301 wc->status = IB_WC_WR_FLUSH_ERR; in mlx5_handle_error_cqe()
304 wc->status = IB_WC_MW_BIND_ERR; in mlx5_handle_error_cqe()
307 wc->status = IB_WC_BAD_RESP_ERR; in mlx5_handle_error_cqe()
310 wc->status = IB_WC_LOC_ACCESS_ERR; in mlx5_handle_error_cqe()
313 wc->status = IB_WC_REM_INV_REQ_ERR; in mlx5_handle_error_cqe()
317 wc->status = IB_WC_REM_ACCESS_ERR; in mlx5_handle_error_cqe()
321 wc->status = IB_WC_REM_OP_ERR; in mlx5_handle_error_cqe()
325 wc->status = IB_WC_RETRY_EXC_ERR; in mlx5_handle_error_cqe()
329 wc->status = IB_WC_RNR_RETRY_EXC_ERR; in mlx5_handle_error_cqe()
332 wc->status = IB_WC_REM_ABORT_ERR; in mlx5_handle_error_cqe()
335 wc->status = IB_WC_GENERAL_ERR; in mlx5_handle_error_cqe()
339 wc->vendor_err = cqe->vendor_err_synd; in mlx5_handle_error_cqe()
341 dump_cqe(dev, cqe, wc, dump); in mlx5_handle_error_cqe()
397 static void sw_comp(struct mlx5_ib_qp *qp, int num_entries, struct ib_wc *wc, in sw_comp() argument
417 wc->wr_id = wq->wrid[idx]; in sw_comp()
418 wc->status = IB_WC_WR_FLUSH_ERR; in sw_comp()
419 wc->vendor_err = MLX5_CQE_SYNDROME_WR_FLUSH_ERR; in sw_comp()
424 wc->qp = &qp->ibqp; in sw_comp()
425 wc++; in sw_comp()
431 struct ib_wc *wc, int *npolled) in mlx5_ib_poll_sw_comp() argument
438 sw_comp(qp, num_entries, wc + *npolled, npolled, true); in mlx5_ib_poll_sw_comp()
444 sw_comp(qp, num_entries, wc + *npolled, npolled, false); in mlx5_ib_poll_sw_comp()
452 struct ib_wc *wc) in mlx5_poll_one() argument
502 wc->qp = &(*cur_qp)->ibqp; in mlx5_poll_one()
508 handle_good_req(wc, cqe64, wq, idx); in mlx5_poll_one()
510 wc->wr_id = wq->wrid[idx]; in mlx5_poll_one()
512 wc->status = IB_WC_SUCCESS; in mlx5_poll_one()
518 handle_responder(wc, cqe64, *cur_qp); in mlx5_poll_one()
519 wc->status = IB_WC_SUCCESS; in mlx5_poll_one()
526 mlx5_handle_error_cqe(dev, err_cqe, wc); in mlx5_poll_one()
532 if (wc->status != IB_WC_WR_FLUSH_ERR && in mlx5_poll_one()
540 wc->wr_id = wq->wrid[idx]; in mlx5_poll_one()
548 wc->wr_id = srq->wrid[wqe_ctr]; in mlx5_poll_one()
552 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx5_poll_one()
585 struct ib_wc *wc, bool is_fatal_err) in poll_soft_wc() argument
599 soft_wc->wc.status = IB_WC_WR_FLUSH_ERR; in poll_soft_wc()
600 soft_wc->wc.vendor_err = MLX5_CQE_SYNDROME_WR_FLUSH_ERR; in poll_soft_wc()
602 wc[npolled++] = soft_wc->wc; in poll_soft_wc()
610 int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) in mlx5_ib_poll_cq() argument
624 soft_polled = poll_soft_wc(cq, num_entries, wc, true); in mlx5_ib_poll_cq()
627 wc + soft_polled, &npolled); in mlx5_ib_poll_cq()
632 soft_polled = poll_soft_wc(cq, num_entries, wc, false); in mlx5_ib_poll_cq()
635 if (mlx5_poll_one(cq, &cur_qp, wc + soft_polled + npolled)) in mlx5_ib_poll_cq()
1432 int mlx5_ib_generate_wc(struct ib_cq *ibcq, struct ib_wc *wc) in mlx5_ib_generate_wc() argument
1442 soft_wc->wc = *wc; in mlx5_ib_generate_wc()
1446 wc->status != IB_WC_SUCCESS) { in mlx5_ib_generate_wc()