Lines Matching full:wc
516 struct ib_wc *wc) in mlx4_ib_handle_error_cqe() argument
530 wc->status = IB_WC_LOC_LEN_ERR; in mlx4_ib_handle_error_cqe()
533 wc->status = IB_WC_LOC_QP_OP_ERR; in mlx4_ib_handle_error_cqe()
536 wc->status = IB_WC_LOC_PROT_ERR; in mlx4_ib_handle_error_cqe()
539 wc->status = IB_WC_WR_FLUSH_ERR; in mlx4_ib_handle_error_cqe()
542 wc->status = IB_WC_MW_BIND_ERR; in mlx4_ib_handle_error_cqe()
545 wc->status = IB_WC_BAD_RESP_ERR; in mlx4_ib_handle_error_cqe()
548 wc->status = IB_WC_LOC_ACCESS_ERR; in mlx4_ib_handle_error_cqe()
551 wc->status = IB_WC_REM_INV_REQ_ERR; in mlx4_ib_handle_error_cqe()
554 wc->status = IB_WC_REM_ACCESS_ERR; in mlx4_ib_handle_error_cqe()
557 wc->status = IB_WC_REM_OP_ERR; in mlx4_ib_handle_error_cqe()
560 wc->status = IB_WC_RETRY_EXC_ERR; in mlx4_ib_handle_error_cqe()
563 wc->status = IB_WC_RNR_RETRY_EXC_ERR; in mlx4_ib_handle_error_cqe()
566 wc->status = IB_WC_REM_ABORT_ERR; in mlx4_ib_handle_error_cqe()
569 wc->status = IB_WC_GENERAL_ERR; in mlx4_ib_handle_error_cqe()
573 wc->vendor_err = cqe->vendor_err_syndrome; in mlx4_ib_handle_error_cqe()
585 static void use_tunnel_data(struct mlx4_ib_qp *qp, struct mlx4_ib_cq *cq, struct ib_wc *wc, in use_tunnel_data() argument
595 wc->pkey_index = be16_to_cpu(hdr->tun.pkey_index); in use_tunnel_data()
596 wc->src_qp = be32_to_cpu(hdr->tun.flags_src_qp) & 0xFFFFFF; in use_tunnel_data()
597 wc->wc_flags |= (hdr->tun.g_ml_path & 0x80) ? (IB_WC_GRH) : 0; in use_tunnel_data()
598 wc->dlid_path_bits = 0; in use_tunnel_data()
601 wc->slid = 0; in use_tunnel_data()
602 wc->vlan_id = be16_to_cpu(hdr->tun.sl_vid); in use_tunnel_data()
603 memcpy(&(wc->smac[0]), (char *)&hdr->tun.mac_31_0, 4); in use_tunnel_data()
604 memcpy(&(wc->smac[4]), (char *)&hdr->tun.slid_mac_47_32, 2); in use_tunnel_data()
605 wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC); in use_tunnel_data()
607 wc->slid = be16_to_cpu(hdr->tun.slid_mac_47_32); in use_tunnel_data()
608 wc->sl = (u8) (be16_to_cpu(hdr->tun.sl_vid) >> 12); in use_tunnel_data()
613 struct ib_wc *wc, int *npolled, int is_send) in mlx4_ib_qp_sw_comp() argument
626 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx4_ib_qp_sw_comp()
627 wc->status = IB_WC_WR_FLUSH_ERR; in mlx4_ib_qp_sw_comp()
628 wc->vendor_err = MLX4_CQE_SYNDROME_WR_FLUSH_ERR; in mlx4_ib_qp_sw_comp()
631 wc->qp = &qp->ibqp; in mlx4_ib_qp_sw_comp()
632 wc++; in mlx4_ib_qp_sw_comp()
637 struct ib_wc *wc, int *npolled) in mlx4_ib_poll_sw_comp() argument
646 mlx4_ib_qp_sw_comp(qp, num_entries, wc + *npolled, npolled, 1); in mlx4_ib_poll_sw_comp()
652 mlx4_ib_qp_sw_comp(qp, num_entries, wc + *npolled, npolled, 0); in mlx4_ib_poll_sw_comp()
663 struct ib_wc *wc) in mlx4_ib_poll_one() argument
725 wc->qp = &(*cur_qp)->ibqp; in mlx4_ib_poll_one()
727 if (wc->qp->qp_type == IB_QPT_XRC_TGT) { in mlx4_ib_poll_one()
742 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx4_ib_poll_one()
747 wc->wr_id = srq->wrid[wqe_ctr]; in mlx4_ib_poll_one()
752 wc->wr_id = srq->wrid[wqe_ctr]; in mlx4_ib_poll_one()
757 wc->wr_id = wq->wrid[tail]; in mlx4_ib_poll_one()
762 mlx4_ib_handle_error_cqe((struct mlx4_err_cqe *) cqe, wc); in mlx4_ib_poll_one()
766 wc->status = IB_WC_SUCCESS; in mlx4_ib_poll_one()
769 wc->wc_flags = 0; in mlx4_ib_poll_one()
772 wc->wc_flags |= IB_WC_WITH_IMM; in mlx4_ib_poll_one()
775 wc->opcode = IB_WC_RDMA_WRITE; in mlx4_ib_poll_one()
778 wc->wc_flags |= IB_WC_WITH_IMM; in mlx4_ib_poll_one()
782 wc->opcode = IB_WC_SEND; in mlx4_ib_poll_one()
785 wc->opcode = IB_WC_RDMA_READ; in mlx4_ib_poll_one()
786 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
789 wc->opcode = IB_WC_COMP_SWAP; in mlx4_ib_poll_one()
790 wc->byte_len = 8; in mlx4_ib_poll_one()
793 wc->opcode = IB_WC_FETCH_ADD; in mlx4_ib_poll_one()
794 wc->byte_len = 8; in mlx4_ib_poll_one()
797 wc->opcode = IB_WC_MASKED_COMP_SWAP; in mlx4_ib_poll_one()
798 wc->byte_len = 8; in mlx4_ib_poll_one()
801 wc->opcode = IB_WC_MASKED_FETCH_ADD; in mlx4_ib_poll_one()
802 wc->byte_len = 8; in mlx4_ib_poll_one()
805 wc->opcode = IB_WC_LSO; in mlx4_ib_poll_one()
808 wc->opcode = IB_WC_REG_MR; in mlx4_ib_poll_one()
811 wc->opcode = IB_WC_LOCAL_INV; in mlx4_ib_poll_one()
815 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
819 wc->opcode = IB_WC_RECV_RDMA_WITH_IMM; in mlx4_ib_poll_one()
820 wc->wc_flags = IB_WC_WITH_IMM; in mlx4_ib_poll_one()
821 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
824 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
825 wc->wc_flags = IB_WC_WITH_INVALIDATE; in mlx4_ib_poll_one()
826 wc->ex.invalidate_rkey = be32_to_cpu(cqe->immed_rss_invalid); in mlx4_ib_poll_one()
829 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
830 wc->wc_flags = 0; in mlx4_ib_poll_one()
833 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
834 wc->wc_flags = IB_WC_WITH_IMM; in mlx4_ib_poll_one()
835 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
839 is_eth = (rdma_port_get_link_layer(wc->qp->device, in mlx4_ib_poll_one()
846 use_tunnel_data(*cur_qp, cq, wc, tail, cqe, in mlx4_ib_poll_one()
853 wc->src_qp = g_mlpath_rqpn & 0xffffff; in mlx4_ib_poll_one()
854 wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f; in mlx4_ib_poll_one()
855 wc->wc_flags |= g_mlpath_rqpn & 0x80000000 ? IB_WC_GRH : 0; in mlx4_ib_poll_one()
856 wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f; in mlx4_ib_poll_one()
857 wc->wc_flags |= mlx4_ib_ipoib_csum_ok(cqe->status, in mlx4_ib_poll_one()
861 wc->slid = 0; in mlx4_ib_poll_one()
862 wc->sl = be16_to_cpu(cqe->sl_vid) >> 13; in mlx4_ib_poll_one()
865 wc->vlan_id = be16_to_cpu(cqe->sl_vid) & in mlx4_ib_poll_one()
868 wc->vlan_id = 0xffff; in mlx4_ib_poll_one()
870 memcpy(wc->smac, cqe->smac, ETH_ALEN); in mlx4_ib_poll_one()
871 wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC); in mlx4_ib_poll_one()
873 wc->slid = be16_to_cpu(cqe->rlid); in mlx4_ib_poll_one()
874 wc->sl = be16_to_cpu(cqe->sl_vid) >> 12; in mlx4_ib_poll_one()
875 wc->vlan_id = 0xffff; in mlx4_ib_poll_one()
882 int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) in mlx4_ib_poll_cq() argument
892 mlx4_ib_poll_sw_comp(cq, num_entries, wc, &npolled); in mlx4_ib_poll_cq()
897 if (mlx4_ib_poll_one(cq, &cur_qp, wc + npolled)) in mlx4_ib_poll_cq()