Lines Matching refs:wc

511 				     struct ib_wc *wc)  in mlx4_ib_handle_error_cqe()  argument
525 wc->status = IB_WC_LOC_LEN_ERR; in mlx4_ib_handle_error_cqe()
528 wc->status = IB_WC_LOC_QP_OP_ERR; in mlx4_ib_handle_error_cqe()
531 wc->status = IB_WC_LOC_PROT_ERR; in mlx4_ib_handle_error_cqe()
534 wc->status = IB_WC_WR_FLUSH_ERR; in mlx4_ib_handle_error_cqe()
537 wc->status = IB_WC_MW_BIND_ERR; in mlx4_ib_handle_error_cqe()
540 wc->status = IB_WC_BAD_RESP_ERR; in mlx4_ib_handle_error_cqe()
543 wc->status = IB_WC_LOC_ACCESS_ERR; in mlx4_ib_handle_error_cqe()
546 wc->status = IB_WC_REM_INV_REQ_ERR; in mlx4_ib_handle_error_cqe()
549 wc->status = IB_WC_REM_ACCESS_ERR; in mlx4_ib_handle_error_cqe()
552 wc->status = IB_WC_REM_OP_ERR; in mlx4_ib_handle_error_cqe()
555 wc->status = IB_WC_RETRY_EXC_ERR; in mlx4_ib_handle_error_cqe()
558 wc->status = IB_WC_RNR_RETRY_EXC_ERR; in mlx4_ib_handle_error_cqe()
561 wc->status = IB_WC_REM_ABORT_ERR; in mlx4_ib_handle_error_cqe()
564 wc->status = IB_WC_GENERAL_ERR; in mlx4_ib_handle_error_cqe()
568 wc->vendor_err = cqe->vendor_err_syndrome; in mlx4_ib_handle_error_cqe()
580 static void use_tunnel_data(struct mlx4_ib_qp *qp, struct mlx4_ib_cq *cq, struct ib_wc *wc, in use_tunnel_data() argument
590 wc->pkey_index = be16_to_cpu(hdr->tun.pkey_index); in use_tunnel_data()
591 wc->src_qp = be32_to_cpu(hdr->tun.flags_src_qp) & 0xFFFFFF; in use_tunnel_data()
592 wc->wc_flags |= (hdr->tun.g_ml_path & 0x80) ? (IB_WC_GRH) : 0; in use_tunnel_data()
593 wc->dlid_path_bits = 0; in use_tunnel_data()
596 wc->slid = 0; in use_tunnel_data()
597 wc->vlan_id = be16_to_cpu(hdr->tun.sl_vid); in use_tunnel_data()
598 memcpy(&(wc->smac[0]), (char *)&hdr->tun.mac_31_0, 4); in use_tunnel_data()
599 memcpy(&(wc->smac[4]), (char *)&hdr->tun.slid_mac_47_32, 2); in use_tunnel_data()
600 wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC); in use_tunnel_data()
602 wc->slid = be16_to_cpu(hdr->tun.slid_mac_47_32); in use_tunnel_data()
603 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
720 wc->qp = &(*cur_qp)->ibqp; in mlx4_ib_poll_one()
722 if (wc->qp->qp_type == IB_QPT_XRC_TGT) { in mlx4_ib_poll_one()
737 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx4_ib_poll_one()
742 wc->wr_id = srq->wrid[wqe_ctr]; in mlx4_ib_poll_one()
747 wc->wr_id = srq->wrid[wqe_ctr]; in mlx4_ib_poll_one()
752 wc->wr_id = wq->wrid[tail]; in mlx4_ib_poll_one()
757 mlx4_ib_handle_error_cqe((struct mlx4_err_cqe *) cqe, wc); in mlx4_ib_poll_one()
761 wc->status = IB_WC_SUCCESS; in mlx4_ib_poll_one()
764 wc->wc_flags = 0; in mlx4_ib_poll_one()
767 wc->wc_flags |= IB_WC_WITH_IMM; in mlx4_ib_poll_one()
770 wc->opcode = IB_WC_RDMA_WRITE; in mlx4_ib_poll_one()
773 wc->wc_flags |= IB_WC_WITH_IMM; in mlx4_ib_poll_one()
777 wc->opcode = IB_WC_SEND; in mlx4_ib_poll_one()
780 wc->opcode = IB_WC_RDMA_READ; in mlx4_ib_poll_one()
781 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
784 wc->opcode = IB_WC_COMP_SWAP; in mlx4_ib_poll_one()
785 wc->byte_len = 8; in mlx4_ib_poll_one()
788 wc->opcode = IB_WC_FETCH_ADD; in mlx4_ib_poll_one()
789 wc->byte_len = 8; in mlx4_ib_poll_one()
792 wc->opcode = IB_WC_MASKED_COMP_SWAP; in mlx4_ib_poll_one()
793 wc->byte_len = 8; in mlx4_ib_poll_one()
796 wc->opcode = IB_WC_MASKED_FETCH_ADD; in mlx4_ib_poll_one()
797 wc->byte_len = 8; in mlx4_ib_poll_one()
800 wc->opcode = IB_WC_LSO; in mlx4_ib_poll_one()
803 wc->opcode = IB_WC_REG_MR; in mlx4_ib_poll_one()
806 wc->opcode = IB_WC_LOCAL_INV; in mlx4_ib_poll_one()
810 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
814 wc->opcode = IB_WC_RECV_RDMA_WITH_IMM; in mlx4_ib_poll_one()
815 wc->wc_flags = IB_WC_WITH_IMM; in mlx4_ib_poll_one()
816 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
819 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
820 wc->wc_flags = IB_WC_WITH_INVALIDATE; in mlx4_ib_poll_one()
821 wc->ex.invalidate_rkey = be32_to_cpu(cqe->immed_rss_invalid); in mlx4_ib_poll_one()
824 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
825 wc->wc_flags = 0; in mlx4_ib_poll_one()
828 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
829 wc->wc_flags = IB_WC_WITH_IMM; in mlx4_ib_poll_one()
830 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
834 is_eth = (rdma_port_get_link_layer(wc->qp->device, in mlx4_ib_poll_one()
841 use_tunnel_data(*cur_qp, cq, wc, tail, cqe, in mlx4_ib_poll_one()
848 wc->src_qp = g_mlpath_rqpn & 0xffffff; in mlx4_ib_poll_one()
849 wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f; in mlx4_ib_poll_one()
850 wc->wc_flags |= g_mlpath_rqpn & 0x80000000 ? IB_WC_GRH : 0; in mlx4_ib_poll_one()
851 wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f; in mlx4_ib_poll_one()
852 wc->wc_flags |= mlx4_ib_ipoib_csum_ok(cqe->status, in mlx4_ib_poll_one()
856 wc->slid = 0; in mlx4_ib_poll_one()
857 wc->sl = be16_to_cpu(cqe->sl_vid) >> 13; in mlx4_ib_poll_one()
860 wc->vlan_id = be16_to_cpu(cqe->sl_vid) & in mlx4_ib_poll_one()
863 wc->vlan_id = 0xffff; in mlx4_ib_poll_one()
865 memcpy(wc->smac, cqe->smac, ETH_ALEN); in mlx4_ib_poll_one()
866 wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC); in mlx4_ib_poll_one()
868 wc->slid = be16_to_cpu(cqe->rlid); in mlx4_ib_poll_one()
869 wc->sl = be16_to_cpu(cqe->sl_vid) >> 12; in mlx4_ib_poll_one()
870 wc->vlan_id = 0xffff; in mlx4_ib_poll_one()
877 int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) in mlx4_ib_poll_cq() argument
887 mlx4_ib_poll_sw_comp(cq, num_entries, wc, &npolled); in mlx4_ib_poll_cq()
892 if (mlx4_ib_poll_one(cq, &cur_qp, wc + npolled)) in mlx4_ib_poll_cq()