Lines Matching refs:wc
121 static void handle_good_req(struct ib_wc *wc, struct mlx5_cqe64 *cqe, in handle_good_req() argument
124 wc->wc_flags = 0; in handle_good_req()
127 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()
135 wc->opcode = IB_WC_SEND; in handle_good_req()
138 wc->opcode = IB_WC_RDMA_READ; in handle_good_req()
139 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in handle_good_req()
142 wc->opcode = IB_WC_COMP_SWAP; in handle_good_req()
143 wc->byte_len = 8; in handle_good_req()
146 wc->opcode = IB_WC_FETCH_ADD; in handle_good_req()
147 wc->byte_len = 8; in handle_good_req()
150 wc->opcode = IB_WC_MASKED_COMP_SWAP; in handle_good_req()
151 wc->byte_len = 8; in handle_good_req()
154 wc->opcode = IB_WC_MASKED_FETCH_ADD; in handle_good_req()
155 wc->byte_len = 8; in handle_good_req()
158 wc->opcode = IB_WC_BIND_MW; in handle_good_req()
161 wc->opcode = get_umr_comp(wq, idx); in handle_good_req()
171 static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe, in handle_responder() argument
192 wc->wr_id = srq->wrid[wqe_ctr]; in handle_responder()
199 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in handle_responder()
202 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in handle_responder()
206 wc->opcode = IB_WC_RECV_RDMA_WITH_IMM; in handle_responder()
207 wc->wc_flags = IB_WC_WITH_IMM; in handle_responder()
208 wc->ex.imm_data = cqe->imm_inval_pkey; in handle_responder()
211 wc->opcode = IB_WC_RECV; in handle_responder()
212 wc->wc_flags = 0; in handle_responder()
215 wc->opcode = IB_WC_RECV; in handle_responder()
216 wc->wc_flags = IB_WC_WITH_IMM; in handle_responder()
217 wc->ex.imm_data = cqe->imm_inval_pkey; in handle_responder()
220 wc->opcode = IB_WC_RECV; in handle_responder()
221 wc->wc_flags = IB_WC_WITH_INVALIDATE; in handle_responder()
222 wc->ex.invalidate_rkey = be32_to_cpu(cqe->imm_inval_pkey); in handle_responder()
225 wc->slid = be16_to_cpu(cqe->slid); in handle_responder()
226 wc->sl = (be32_to_cpu(cqe->flags_rqpn) >> 24) & 0xf; in handle_responder()
227 wc->src_qp = be32_to_cpu(cqe->flags_rqpn) & 0xffffff; in handle_responder()
228 wc->dlid_path_bits = cqe->ml_path; in handle_responder()
230 wc->wc_flags |= g ? IB_WC_GRH : 0; in handle_responder()
235 &wc->pkey_index); in handle_responder()
237 wc->pkey_index = 0; in handle_responder()
255 struct ib_wc *wc) in mlx5_handle_error_cqe() argument
261 wc->status = IB_WC_LOC_LEN_ERR; in mlx5_handle_error_cqe()
264 wc->status = IB_WC_LOC_QP_OP_ERR; in mlx5_handle_error_cqe()
267 wc->status = IB_WC_LOC_PROT_ERR; in mlx5_handle_error_cqe()
271 wc->status = IB_WC_WR_FLUSH_ERR; in mlx5_handle_error_cqe()
274 wc->status = IB_WC_MW_BIND_ERR; in mlx5_handle_error_cqe()
277 wc->status = IB_WC_BAD_RESP_ERR; in mlx5_handle_error_cqe()
280 wc->status = IB_WC_LOC_ACCESS_ERR; in mlx5_handle_error_cqe()
283 wc->status = IB_WC_REM_INV_REQ_ERR; in mlx5_handle_error_cqe()
286 wc->status = IB_WC_REM_ACCESS_ERR; in mlx5_handle_error_cqe()
289 wc->status = IB_WC_REM_OP_ERR; in mlx5_handle_error_cqe()
292 wc->status = IB_WC_RETRY_EXC_ERR; in mlx5_handle_error_cqe()
296 wc->status = IB_WC_RNR_RETRY_EXC_ERR; in mlx5_handle_error_cqe()
300 wc->status = IB_WC_REM_ABORT_ERR; in mlx5_handle_error_cqe()
303 wc->status = IB_WC_GENERAL_ERR; in mlx5_handle_error_cqe()
307 wc->vendor_err = cqe->vendor_err_synd; in mlx5_handle_error_cqe()
412 struct ib_wc *wc) in mlx5_poll_one() argument
471 wc->qp = &(*cur_qp)->ibqp; in mlx5_poll_one()
477 handle_good_req(wc, cqe64, wq, idx); in mlx5_poll_one()
479 wc->wr_id = wq->wrid[idx]; in mlx5_poll_one()
481 wc->status = IB_WC_SUCCESS; in mlx5_poll_one()
487 handle_responder(wc, cqe64, *cur_qp); in mlx5_poll_one()
488 wc->status = IB_WC_SUCCESS; in mlx5_poll_one()
495 mlx5_handle_error_cqe(dev, err_cqe, wc); in mlx5_poll_one()
505 wc->wr_id = wq->wrid[idx]; in mlx5_poll_one()
513 wc->wr_id = srq->wrid[wqe_ctr]; in mlx5_poll_one()
517 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx5_poll_one()
554 int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) in mlx5_ib_poll_cq() argument
565 err = mlx5_poll_one(cq, &cur_qp, wc + npolled); in mlx5_ib_poll_cq()