Lines Matching refs:wc
505 struct ib_wc *wc) in mlx4_ib_handle_error_cqe() argument
519 wc->status = IB_WC_LOC_LEN_ERR; in mlx4_ib_handle_error_cqe()
522 wc->status = IB_WC_LOC_QP_OP_ERR; in mlx4_ib_handle_error_cqe()
525 wc->status = IB_WC_LOC_PROT_ERR; in mlx4_ib_handle_error_cqe()
528 wc->status = IB_WC_WR_FLUSH_ERR; in mlx4_ib_handle_error_cqe()
531 wc->status = IB_WC_MW_BIND_ERR; in mlx4_ib_handle_error_cqe()
534 wc->status = IB_WC_BAD_RESP_ERR; in mlx4_ib_handle_error_cqe()
537 wc->status = IB_WC_LOC_ACCESS_ERR; in mlx4_ib_handle_error_cqe()
540 wc->status = IB_WC_REM_INV_REQ_ERR; in mlx4_ib_handle_error_cqe()
543 wc->status = IB_WC_REM_ACCESS_ERR; in mlx4_ib_handle_error_cqe()
546 wc->status = IB_WC_REM_OP_ERR; in mlx4_ib_handle_error_cqe()
549 wc->status = IB_WC_RETRY_EXC_ERR; in mlx4_ib_handle_error_cqe()
552 wc->status = IB_WC_RNR_RETRY_EXC_ERR; in mlx4_ib_handle_error_cqe()
555 wc->status = IB_WC_REM_ABORT_ERR; in mlx4_ib_handle_error_cqe()
558 wc->status = IB_WC_GENERAL_ERR; in mlx4_ib_handle_error_cqe()
562 wc->vendor_err = cqe->vendor_err_syndrome; in mlx4_ib_handle_error_cqe()
579 static int use_tunnel_data(struct mlx4_ib_qp *qp, struct mlx4_ib_cq *cq, struct ib_wc *wc, in use_tunnel_data() argument
589 wc->pkey_index = be16_to_cpu(hdr->tun.pkey_index); in use_tunnel_data()
590 wc->src_qp = be32_to_cpu(hdr->tun.flags_src_qp) & 0xFFFFFF; in use_tunnel_data()
591 wc->wc_flags |= (hdr->tun.g_ml_path & 0x80) ? (IB_WC_GRH) : 0; in use_tunnel_data()
592 wc->dlid_path_bits = 0; in use_tunnel_data()
595 wc->vlan_id = be16_to_cpu(hdr->tun.sl_vid); in use_tunnel_data()
596 memcpy(&(wc->smac[0]), (char *)&hdr->tun.mac_31_0, 4); in use_tunnel_data()
597 memcpy(&(wc->smac[4]), (char *)&hdr->tun.slid_mac_47_32, 2); in use_tunnel_data()
598 wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC); in use_tunnel_data()
600 wc->slid = be16_to_cpu(hdr->tun.slid_mac_47_32); in use_tunnel_data()
601 wc->sl = (u8) (be16_to_cpu(hdr->tun.sl_vid) >> 12); in use_tunnel_data()
608 struct ib_wc *wc, int *npolled, int is_send) in mlx4_ib_qp_sw_comp() argument
621 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx4_ib_qp_sw_comp()
622 wc->status = IB_WC_WR_FLUSH_ERR; in mlx4_ib_qp_sw_comp()
623 wc->vendor_err = MLX4_CQE_SYNDROME_WR_FLUSH_ERR; in mlx4_ib_qp_sw_comp()
626 wc->qp = &qp->ibqp; in mlx4_ib_qp_sw_comp()
627 wc++; in mlx4_ib_qp_sw_comp()
632 struct ib_wc *wc, int *npolled) in mlx4_ib_poll_sw_comp() argument
641 mlx4_ib_qp_sw_comp(qp, num_entries, wc + *npolled, npolled, 1); in mlx4_ib_poll_sw_comp()
647 mlx4_ib_qp_sw_comp(qp, num_entries, wc + *npolled, npolled, 0); in mlx4_ib_poll_sw_comp()
658 struct ib_wc *wc) in mlx4_ib_poll_one() argument
732 wc->qp = &(*cur_qp)->ibqp; in mlx4_ib_poll_one()
734 if (wc->qp->qp_type == IB_QPT_XRC_TGT) { in mlx4_ib_poll_one()
754 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx4_ib_poll_one()
759 wc->wr_id = srq->wrid[wqe_ctr]; in mlx4_ib_poll_one()
764 wc->wr_id = srq->wrid[wqe_ctr]; in mlx4_ib_poll_one()
769 wc->wr_id = wq->wrid[tail]; in mlx4_ib_poll_one()
774 mlx4_ib_handle_error_cqe((struct mlx4_err_cqe *) cqe, wc); in mlx4_ib_poll_one()
778 wc->status = IB_WC_SUCCESS; in mlx4_ib_poll_one()
781 wc->wc_flags = 0; in mlx4_ib_poll_one()
784 wc->wc_flags |= IB_WC_WITH_IMM; in mlx4_ib_poll_one()
786 wc->opcode = IB_WC_RDMA_WRITE; in mlx4_ib_poll_one()
789 wc->wc_flags |= IB_WC_WITH_IMM; in mlx4_ib_poll_one()
792 wc->opcode = IB_WC_SEND; in mlx4_ib_poll_one()
795 wc->opcode = IB_WC_RDMA_READ; in mlx4_ib_poll_one()
796 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
799 wc->opcode = IB_WC_COMP_SWAP; in mlx4_ib_poll_one()
800 wc->byte_len = 8; in mlx4_ib_poll_one()
803 wc->opcode = IB_WC_FETCH_ADD; in mlx4_ib_poll_one()
804 wc->byte_len = 8; in mlx4_ib_poll_one()
807 wc->opcode = IB_WC_MASKED_COMP_SWAP; in mlx4_ib_poll_one()
808 wc->byte_len = 8; in mlx4_ib_poll_one()
811 wc->opcode = IB_WC_MASKED_FETCH_ADD; in mlx4_ib_poll_one()
812 wc->byte_len = 8; in mlx4_ib_poll_one()
815 wc->opcode = IB_WC_BIND_MW; in mlx4_ib_poll_one()
818 wc->opcode = IB_WC_LSO; in mlx4_ib_poll_one()
821 wc->opcode = IB_WC_REG_MR; in mlx4_ib_poll_one()
824 wc->opcode = IB_WC_LOCAL_INV; in mlx4_ib_poll_one()
828 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
832 wc->opcode = IB_WC_RECV_RDMA_WITH_IMM; in mlx4_ib_poll_one()
833 wc->wc_flags = IB_WC_WITH_IMM; in mlx4_ib_poll_one()
834 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
837 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
838 wc->wc_flags = IB_WC_WITH_INVALIDATE; in mlx4_ib_poll_one()
839 wc->ex.invalidate_rkey = be32_to_cpu(cqe->immed_rss_invalid); in mlx4_ib_poll_one()
842 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
843 wc->wc_flags = 0; in mlx4_ib_poll_one()
846 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
847 wc->wc_flags = IB_WC_WITH_IMM; in mlx4_ib_poll_one()
848 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
852 is_eth = (rdma_port_get_link_layer(wc->qp->device, in mlx4_ib_poll_one()
859 return use_tunnel_data(*cur_qp, cq, wc, tail, in mlx4_ib_poll_one()
863 wc->slid = be16_to_cpu(cqe->rlid); in mlx4_ib_poll_one()
865 wc->src_qp = g_mlpath_rqpn & 0xffffff; in mlx4_ib_poll_one()
866 wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f; in mlx4_ib_poll_one()
867 wc->wc_flags |= g_mlpath_rqpn & 0x80000000 ? IB_WC_GRH : 0; in mlx4_ib_poll_one()
868 wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f; in mlx4_ib_poll_one()
869 wc->wc_flags |= mlx4_ib_ipoib_csum_ok(cqe->status, in mlx4_ib_poll_one()
872 wc->sl = be16_to_cpu(cqe->sl_vid) >> 13; in mlx4_ib_poll_one()
875 wc->vlan_id = be16_to_cpu(cqe->sl_vid) & in mlx4_ib_poll_one()
878 wc->vlan_id = 0xffff; in mlx4_ib_poll_one()
880 memcpy(wc->smac, cqe->smac, ETH_ALEN); in mlx4_ib_poll_one()
881 wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC); in mlx4_ib_poll_one()
883 wc->sl = be16_to_cpu(cqe->sl_vid) >> 12; in mlx4_ib_poll_one()
884 wc->vlan_id = 0xffff; in mlx4_ib_poll_one()
891 int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) in mlx4_ib_poll_cq() argument
902 mlx4_ib_poll_sw_comp(cq, num_entries, wc, &npolled); in mlx4_ib_poll_cq()
907 err = mlx4_ib_poll_one(cq, &cur_qp, wc + npolled); in mlx4_ib_poll_cq()