Lines Matching full:wc

512 				     struct ib_wc *wc)  in mlx4_ib_handle_error_cqe()  argument
526 wc->status = IB_WC_LOC_LEN_ERR; in mlx4_ib_handle_error_cqe()
529 wc->status = IB_WC_LOC_QP_OP_ERR; in mlx4_ib_handle_error_cqe()
532 wc->status = IB_WC_LOC_PROT_ERR; in mlx4_ib_handle_error_cqe()
535 wc->status = IB_WC_WR_FLUSH_ERR; in mlx4_ib_handle_error_cqe()
538 wc->status = IB_WC_MW_BIND_ERR; in mlx4_ib_handle_error_cqe()
541 wc->status = IB_WC_BAD_RESP_ERR; in mlx4_ib_handle_error_cqe()
544 wc->status = IB_WC_LOC_ACCESS_ERR; in mlx4_ib_handle_error_cqe()
547 wc->status = IB_WC_REM_INV_REQ_ERR; in mlx4_ib_handle_error_cqe()
550 wc->status = IB_WC_REM_ACCESS_ERR; in mlx4_ib_handle_error_cqe()
553 wc->status = IB_WC_REM_OP_ERR; in mlx4_ib_handle_error_cqe()
556 wc->status = IB_WC_RETRY_EXC_ERR; in mlx4_ib_handle_error_cqe()
559 wc->status = IB_WC_RNR_RETRY_EXC_ERR; in mlx4_ib_handle_error_cqe()
562 wc->status = IB_WC_REM_ABORT_ERR; in mlx4_ib_handle_error_cqe()
565 wc->status = IB_WC_GENERAL_ERR; in mlx4_ib_handle_error_cqe()
569 wc->vendor_err = cqe->vendor_err_syndrome; in mlx4_ib_handle_error_cqe()
581 static void use_tunnel_data(struct mlx4_ib_qp *qp, struct mlx4_ib_cq *cq, struct ib_wc *wc, in use_tunnel_data() argument
591 wc->pkey_index = be16_to_cpu(hdr->tun.pkey_index); in use_tunnel_data()
592 wc->src_qp = be32_to_cpu(hdr->tun.flags_src_qp) & 0xFFFFFF; in use_tunnel_data()
593 wc->wc_flags |= (hdr->tun.g_ml_path & 0x80) ? (IB_WC_GRH) : 0; in use_tunnel_data()
594 wc->dlid_path_bits = 0; in use_tunnel_data()
597 wc->slid = 0; in use_tunnel_data()
598 wc->vlan_id = be16_to_cpu(hdr->tun.sl_vid); in use_tunnel_data()
599 memcpy(&(wc->smac[0]), (char *)&hdr->tun.mac_31_0, 4); in use_tunnel_data()
600 memcpy(&(wc->smac[4]), (char *)&hdr->tun.slid_mac_47_32, 2); in use_tunnel_data()
601 wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC); in use_tunnel_data()
603 wc->slid = be16_to_cpu(hdr->tun.slid_mac_47_32); in use_tunnel_data()
604 wc->sl = (u8) (be16_to_cpu(hdr->tun.sl_vid) >> 12); in use_tunnel_data()
609 struct ib_wc *wc, int *npolled, int is_send) in mlx4_ib_qp_sw_comp() argument
622 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx4_ib_qp_sw_comp()
623 wc->status = IB_WC_WR_FLUSH_ERR; in mlx4_ib_qp_sw_comp()
624 wc->vendor_err = MLX4_CQE_SYNDROME_WR_FLUSH_ERR; in mlx4_ib_qp_sw_comp()
627 wc->qp = &qp->ibqp; in mlx4_ib_qp_sw_comp()
628 wc++; in mlx4_ib_qp_sw_comp()
633 struct ib_wc *wc, int *npolled) in mlx4_ib_poll_sw_comp() argument
642 mlx4_ib_qp_sw_comp(qp, num_entries, wc + *npolled, npolled, 1); in mlx4_ib_poll_sw_comp()
648 mlx4_ib_qp_sw_comp(qp, num_entries, wc + *npolled, npolled, 0); in mlx4_ib_poll_sw_comp()
659 struct ib_wc *wc) in mlx4_ib_poll_one() argument
721 wc->qp = &(*cur_qp)->ibqp; in mlx4_ib_poll_one()
723 if (wc->qp->qp_type == IB_QPT_XRC_TGT) { in mlx4_ib_poll_one()
738 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx4_ib_poll_one()
743 wc->wr_id = srq->wrid[wqe_ctr]; in mlx4_ib_poll_one()
748 wc->wr_id = srq->wrid[wqe_ctr]; in mlx4_ib_poll_one()
753 wc->wr_id = wq->wrid[tail]; in mlx4_ib_poll_one()
758 mlx4_ib_handle_error_cqe((struct mlx4_err_cqe *) cqe, wc); in mlx4_ib_poll_one()
762 wc->status = IB_WC_SUCCESS; in mlx4_ib_poll_one()
765 wc->wc_flags = 0; in mlx4_ib_poll_one()
768 wc->wc_flags |= IB_WC_WITH_IMM; in mlx4_ib_poll_one()
771 wc->opcode = IB_WC_RDMA_WRITE; in mlx4_ib_poll_one()
774 wc->wc_flags |= IB_WC_WITH_IMM; in mlx4_ib_poll_one()
778 wc->opcode = IB_WC_SEND; in mlx4_ib_poll_one()
781 wc->opcode = IB_WC_RDMA_READ; in mlx4_ib_poll_one()
782 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
785 wc->opcode = IB_WC_COMP_SWAP; in mlx4_ib_poll_one()
786 wc->byte_len = 8; in mlx4_ib_poll_one()
789 wc->opcode = IB_WC_FETCH_ADD; in mlx4_ib_poll_one()
790 wc->byte_len = 8; in mlx4_ib_poll_one()
793 wc->opcode = IB_WC_MASKED_COMP_SWAP; in mlx4_ib_poll_one()
794 wc->byte_len = 8; in mlx4_ib_poll_one()
797 wc->opcode = IB_WC_MASKED_FETCH_ADD; in mlx4_ib_poll_one()
798 wc->byte_len = 8; in mlx4_ib_poll_one()
801 wc->opcode = IB_WC_LSO; in mlx4_ib_poll_one()
804 wc->opcode = IB_WC_REG_MR; in mlx4_ib_poll_one()
807 wc->opcode = IB_WC_LOCAL_INV; in mlx4_ib_poll_one()
811 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
815 wc->opcode = IB_WC_RECV_RDMA_WITH_IMM; in mlx4_ib_poll_one()
816 wc->wc_flags = IB_WC_WITH_IMM; in mlx4_ib_poll_one()
817 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
820 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
821 wc->wc_flags = IB_WC_WITH_INVALIDATE; in mlx4_ib_poll_one()
822 wc->ex.invalidate_rkey = be32_to_cpu(cqe->immed_rss_invalid); in mlx4_ib_poll_one()
825 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
826 wc->wc_flags = 0; in mlx4_ib_poll_one()
829 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
830 wc->wc_flags = IB_WC_WITH_IMM; in mlx4_ib_poll_one()
831 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
835 is_eth = (rdma_port_get_link_layer(wc->qp->device, in mlx4_ib_poll_one()
842 use_tunnel_data(*cur_qp, cq, wc, tail, cqe, in mlx4_ib_poll_one()
849 wc->src_qp = g_mlpath_rqpn & 0xffffff; in mlx4_ib_poll_one()
850 wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f; in mlx4_ib_poll_one()
851 wc->wc_flags |= g_mlpath_rqpn & 0x80000000 ? IB_WC_GRH : 0; in mlx4_ib_poll_one()
852 wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f; in mlx4_ib_poll_one()
853 wc->wc_flags |= mlx4_ib_ipoib_csum_ok(cqe->status, in mlx4_ib_poll_one()
857 wc->slid = 0; in mlx4_ib_poll_one()
858 wc->sl = be16_to_cpu(cqe->sl_vid) >> 13; in mlx4_ib_poll_one()
861 wc->vlan_id = be16_to_cpu(cqe->sl_vid) & in mlx4_ib_poll_one()
864 wc->vlan_id = 0xffff; in mlx4_ib_poll_one()
866 memcpy(wc->smac, cqe->smac, ETH_ALEN); in mlx4_ib_poll_one()
867 wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC); in mlx4_ib_poll_one()
869 wc->slid = be16_to_cpu(cqe->rlid); in mlx4_ib_poll_one()
870 wc->sl = be16_to_cpu(cqe->sl_vid) >> 12; in mlx4_ib_poll_one()
871 wc->vlan_id = 0xffff; in mlx4_ib_poll_one()
878 int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) in mlx4_ib_poll_cq() argument
888 mlx4_ib_poll_sw_comp(cq, num_entries, wc, &npolled); in mlx4_ib_poll_cq()
893 if (mlx4_ib_poll_one(cq, &cur_qp, wc + npolled)) in mlx4_ib_poll_cq()