Lines Matching refs: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()
128 wc->opcode = IB_WC_RDMA_WRITE; in handle_good_req()
131 wc->wc_flags |= IB_WC_WITH_IMM; in handle_good_req()
134 wc->opcode = IB_WC_SEND; in handle_good_req()
137 wc->opcode = IB_WC_RDMA_READ; in handle_good_req()
138 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in handle_good_req()
141 wc->opcode = IB_WC_COMP_SWAP; in handle_good_req()
142 wc->byte_len = 8; in handle_good_req()
145 wc->opcode = IB_WC_FETCH_ADD; in handle_good_req()
146 wc->byte_len = 8; in handle_good_req()
149 wc->opcode = IB_WC_MASKED_COMP_SWAP; in handle_good_req()
150 wc->byte_len = 8; in handle_good_req()
153 wc->opcode = IB_WC_MASKED_FETCH_ADD; in handle_good_req()
154 wc->byte_len = 8; in handle_good_req()
157 wc->opcode = IB_WC_BIND_MW; in handle_good_req()
160 wc->opcode = get_umr_comp(wq, idx); in handle_good_req()
170 static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe, in handle_responder() argument
191 wc->wr_id = srq->wrid[wqe_ctr]; in handle_responder()
198 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in handle_responder()
201 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in handle_responder()
205 wc->opcode = IB_WC_RECV_RDMA_WITH_IMM; in handle_responder()
206 wc->wc_flags = IB_WC_WITH_IMM; in handle_responder()
207 wc->ex.imm_data = cqe->imm_inval_pkey; in handle_responder()
210 wc->opcode = IB_WC_RECV; in handle_responder()
211 wc->wc_flags = 0; in handle_responder()
214 wc->opcode = IB_WC_RECV; in handle_responder()
215 wc->wc_flags = IB_WC_WITH_IMM; in handle_responder()
216 wc->ex.imm_data = cqe->imm_inval_pkey; in handle_responder()
219 wc->opcode = IB_WC_RECV; in handle_responder()
220 wc->wc_flags = IB_WC_WITH_INVALIDATE; in handle_responder()
221 wc->ex.invalidate_rkey = be32_to_cpu(cqe->imm_inval_pkey); in handle_responder()
224 wc->slid = be16_to_cpu(cqe->slid); in handle_responder()
225 wc->sl = (be32_to_cpu(cqe->flags_rqpn) >> 24) & 0xf; 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()
230 wc->pkey_index = be32_to_cpu(cqe->imm_inval_pkey) & 0xffff; in handle_responder()
247 struct ib_wc *wc) in mlx5_handle_error_cqe() argument
253 wc->status = IB_WC_LOC_LEN_ERR; in mlx5_handle_error_cqe()
256 wc->status = IB_WC_LOC_QP_OP_ERR; in mlx5_handle_error_cqe()
259 wc->status = IB_WC_LOC_PROT_ERR; in mlx5_handle_error_cqe()
263 wc->status = IB_WC_WR_FLUSH_ERR; in mlx5_handle_error_cqe()
266 wc->status = IB_WC_MW_BIND_ERR; in mlx5_handle_error_cqe()
269 wc->status = IB_WC_BAD_RESP_ERR; in mlx5_handle_error_cqe()
272 wc->status = IB_WC_LOC_ACCESS_ERR; in mlx5_handle_error_cqe()
275 wc->status = IB_WC_REM_INV_REQ_ERR; in mlx5_handle_error_cqe()
278 wc->status = IB_WC_REM_ACCESS_ERR; in mlx5_handle_error_cqe()
281 wc->status = IB_WC_REM_OP_ERR; in mlx5_handle_error_cqe()
284 wc->status = IB_WC_RETRY_EXC_ERR; in mlx5_handle_error_cqe()
288 wc->status = IB_WC_RNR_RETRY_EXC_ERR; in mlx5_handle_error_cqe()
292 wc->status = IB_WC_REM_ABORT_ERR; in mlx5_handle_error_cqe()
295 wc->status = IB_WC_GENERAL_ERR; in mlx5_handle_error_cqe()
299 wc->vendor_err = cqe->vendor_err_synd; in mlx5_handle_error_cqe()
404 struct ib_wc *wc) in mlx5_poll_one() argument
463 wc->qp = &(*cur_qp)->ibqp; in mlx5_poll_one()
469 handle_good_req(wc, cqe64, wq, idx); in mlx5_poll_one()
471 wc->wr_id = wq->wrid[idx]; in mlx5_poll_one()
473 wc->status = IB_WC_SUCCESS; in mlx5_poll_one()
479 handle_responder(wc, cqe64, *cur_qp); in mlx5_poll_one()
480 wc->status = IB_WC_SUCCESS; in mlx5_poll_one()
487 mlx5_handle_error_cqe(dev, err_cqe, wc); in mlx5_poll_one()
497 wc->wr_id = wq->wrid[idx]; in mlx5_poll_one()
505 wc->wr_id = srq->wrid[wqe_ctr]; in mlx5_poll_one()
509 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx5_poll_one()
546 int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) in mlx5_ib_poll_cq() argument
557 err = mlx5_poll_one(cq, &cur_qp, wc + npolled); in mlx5_ib_poll_cq()