Lines Matching refs:wc
116 static void handle_good_req(struct ib_wc *wc, struct mlx5_cqe64 *cqe, in handle_good_req() argument
119 wc->wc_flags = 0; in handle_good_req()
122 wc->wc_flags |= IB_WC_WITH_IMM; in handle_good_req()
125 wc->opcode = IB_WC_RDMA_WRITE; in handle_good_req()
128 wc->wc_flags |= IB_WC_WITH_IMM; in handle_good_req()
132 wc->opcode = IB_WC_SEND; in handle_good_req()
135 wc->opcode = IB_WC_RDMA_READ; in handle_good_req()
136 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in handle_good_req()
139 wc->opcode = IB_WC_COMP_SWAP; in handle_good_req()
140 wc->byte_len = 8; in handle_good_req()
143 wc->opcode = IB_WC_FETCH_ADD; in handle_good_req()
144 wc->byte_len = 8; in handle_good_req()
147 wc->opcode = IB_WC_MASKED_COMP_SWAP; in handle_good_req()
148 wc->byte_len = 8; in handle_good_req()
151 wc->opcode = IB_WC_MASKED_FETCH_ADD; in handle_good_req()
152 wc->byte_len = 8; in handle_good_req()
155 wc->opcode = get_umr_comp(wq, idx); in handle_good_req()
165 static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe, in handle_responder() argument
188 wc->wr_id = srq->wrid[wqe_ctr]; in handle_responder()
195 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in handle_responder()
198 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in handle_responder()
202 wc->opcode = IB_WC_RECV_RDMA_WITH_IMM; in handle_responder()
203 wc->wc_flags = IB_WC_WITH_IMM; in handle_responder()
204 wc->ex.imm_data = cqe->imm_inval_pkey; in handle_responder()
207 wc->opcode = IB_WC_RECV; in handle_responder()
208 wc->wc_flags = IB_WC_IP_CSUM_OK; 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->src_qp = be32_to_cpu(cqe->flags_rqpn) & 0xffffff; in handle_responder()
225 wc->dlid_path_bits = cqe->ml_path; in handle_responder()
227 wc->wc_flags |= g ? IB_WC_GRH : 0; in handle_responder()
232 &wc->pkey_index); in handle_responder()
234 wc->pkey_index = 0; in handle_responder()
238 wc->slid = be16_to_cpu(cqe->slid); in handle_responder()
239 wc->sl = (be32_to_cpu(cqe->flags_rqpn) >> 24) & 0xf; in handle_responder()
243 wc->slid = 0; in handle_responder()
247 wc->vlan_id = (be16_to_cpu(cqe->vlan_info)) & 0xfff; in handle_responder()
248 wc->sl = (be16_to_cpu(cqe->vlan_info) >> 13) & 0x7; in handle_responder()
249 wc->wc_flags |= IB_WC_WITH_VLAN; in handle_responder()
251 wc->sl = 0; in handle_responder()
256 wc->network_hdr_type = RDMA_NETWORK_IB; in handle_responder()
259 wc->network_hdr_type = RDMA_NETWORK_IPV6; in handle_responder()
262 wc->network_hdr_type = RDMA_NETWORK_IPV4; in handle_responder()
265 wc->wc_flags |= IB_WC_WITH_NETWORK_HDR_TYPE; in handle_responder()
276 struct ib_wc *wc) in mlx5_handle_error_cqe() argument
282 wc->status = IB_WC_LOC_LEN_ERR; in mlx5_handle_error_cqe()
285 wc->status = IB_WC_LOC_QP_OP_ERR; in mlx5_handle_error_cqe()
288 wc->status = IB_WC_LOC_PROT_ERR; in mlx5_handle_error_cqe()
292 wc->status = IB_WC_WR_FLUSH_ERR; in mlx5_handle_error_cqe()
295 wc->status = IB_WC_MW_BIND_ERR; in mlx5_handle_error_cqe()
298 wc->status = IB_WC_BAD_RESP_ERR; in mlx5_handle_error_cqe()
301 wc->status = IB_WC_LOC_ACCESS_ERR; in mlx5_handle_error_cqe()
304 wc->status = IB_WC_REM_INV_REQ_ERR; in mlx5_handle_error_cqe()
307 wc->status = IB_WC_REM_ACCESS_ERR; in mlx5_handle_error_cqe()
310 wc->status = IB_WC_REM_OP_ERR; in mlx5_handle_error_cqe()
313 wc->status = IB_WC_RETRY_EXC_ERR; in mlx5_handle_error_cqe()
317 wc->status = IB_WC_RNR_RETRY_EXC_ERR; in mlx5_handle_error_cqe()
321 wc->status = IB_WC_REM_ABORT_ERR; in mlx5_handle_error_cqe()
324 wc->status = IB_WC_GENERAL_ERR; in mlx5_handle_error_cqe()
328 wc->vendor_err = cqe->vendor_err_synd; in mlx5_handle_error_cqe()
370 static void sw_comp(struct mlx5_ib_qp *qp, int num_entries, struct ib_wc *wc, in sw_comp() argument
386 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in sw_comp()
387 wc->status = IB_WC_WR_FLUSH_ERR; in sw_comp()
388 wc->vendor_err = MLX5_CQE_SYNDROME_WR_FLUSH_ERR; in sw_comp()
391 wc->qp = &qp->ibqp; in sw_comp()
392 wc++; in sw_comp()
398 struct ib_wc *wc, int *npolled) in mlx5_ib_poll_sw_comp() argument
405 sw_comp(qp, num_entries, wc + *npolled, npolled, true); in mlx5_ib_poll_sw_comp()
411 sw_comp(qp, num_entries, wc + *npolled, npolled, false); in mlx5_ib_poll_sw_comp()
419 struct ib_wc *wc) in mlx5_poll_one() argument
472 wc->qp = &(*cur_qp)->ibqp; in mlx5_poll_one()
478 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()
548 struct ib_wc *wc, bool is_fatal_err) in poll_soft_wc() argument
562 soft_wc->wc.status = IB_WC_WR_FLUSH_ERR; in poll_soft_wc()
563 soft_wc->wc.vendor_err = MLX5_CQE_SYNDROME_WR_FLUSH_ERR; in poll_soft_wc()
565 wc[npolled++] = soft_wc->wc; in poll_soft_wc()
573 int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) in mlx5_ib_poll_cq() argument
587 soft_polled = poll_soft_wc(cq, num_entries, wc, true); in mlx5_ib_poll_cq()
590 wc + soft_polled, &npolled); in mlx5_ib_poll_cq()
595 soft_polled = poll_soft_wc(cq, num_entries, wc, false); in mlx5_ib_poll_cq()
598 if (mlx5_poll_one(cq, &cur_qp, wc + soft_polled + npolled)) in mlx5_ib_poll_cq()
1353 int mlx5_ib_generate_wc(struct ib_cq *ibcq, struct ib_wc *wc) in mlx5_ib_generate_wc() argument
1363 soft_wc->wc = *wc; in mlx5_ib_generate_wc()
1367 wc->status != IB_WC_SUCCESS) { in mlx5_ib_generate_wc()