Lines Matching refs:wc
514 struct ib_wc *wc) in mlx4_ib_handle_error_cqe() argument
528 wc->status = IB_WC_LOC_LEN_ERR; in mlx4_ib_handle_error_cqe()
531 wc->status = IB_WC_LOC_QP_OP_ERR; in mlx4_ib_handle_error_cqe()
534 wc->status = IB_WC_LOC_PROT_ERR; in mlx4_ib_handle_error_cqe()
537 wc->status = IB_WC_WR_FLUSH_ERR; in mlx4_ib_handle_error_cqe()
540 wc->status = IB_WC_MW_BIND_ERR; in mlx4_ib_handle_error_cqe()
543 wc->status = IB_WC_BAD_RESP_ERR; in mlx4_ib_handle_error_cqe()
546 wc->status = IB_WC_LOC_ACCESS_ERR; in mlx4_ib_handle_error_cqe()
549 wc->status = IB_WC_REM_INV_REQ_ERR; in mlx4_ib_handle_error_cqe()
552 wc->status = IB_WC_REM_ACCESS_ERR; in mlx4_ib_handle_error_cqe()
555 wc->status = IB_WC_REM_OP_ERR; in mlx4_ib_handle_error_cqe()
558 wc->status = IB_WC_RETRY_EXC_ERR; in mlx4_ib_handle_error_cqe()
561 wc->status = IB_WC_RNR_RETRY_EXC_ERR; in mlx4_ib_handle_error_cqe()
564 wc->status = IB_WC_REM_ABORT_ERR; in mlx4_ib_handle_error_cqe()
567 wc->status = IB_WC_GENERAL_ERR; in mlx4_ib_handle_error_cqe()
571 wc->vendor_err = cqe->vendor_err_syndrome; in mlx4_ib_handle_error_cqe()
588 static void use_tunnel_data(struct mlx4_ib_qp *qp, struct mlx4_ib_cq *cq, struct ib_wc *wc, in use_tunnel_data() argument
598 wc->pkey_index = be16_to_cpu(hdr->tun.pkey_index); in use_tunnel_data()
599 wc->src_qp = be32_to_cpu(hdr->tun.flags_src_qp) & 0xFFFFFF; in use_tunnel_data()
600 wc->wc_flags |= (hdr->tun.g_ml_path & 0x80) ? (IB_WC_GRH) : 0; in use_tunnel_data()
601 wc->dlid_path_bits = 0; in use_tunnel_data()
604 wc->slid = 0; in use_tunnel_data()
605 wc->vlan_id = be16_to_cpu(hdr->tun.sl_vid); in use_tunnel_data()
606 memcpy(&(wc->smac[0]), (char *)&hdr->tun.mac_31_0, 4); in use_tunnel_data()
607 memcpy(&(wc->smac[4]), (char *)&hdr->tun.slid_mac_47_32, 2); in use_tunnel_data()
608 wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC); in use_tunnel_data()
610 wc->slid = be16_to_cpu(hdr->tun.slid_mac_47_32); in use_tunnel_data()
611 wc->sl = (u8) (be16_to_cpu(hdr->tun.sl_vid) >> 12); in use_tunnel_data()
616 struct ib_wc *wc, int *npolled, int is_send) in mlx4_ib_qp_sw_comp() argument
629 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx4_ib_qp_sw_comp()
630 wc->status = IB_WC_WR_FLUSH_ERR; in mlx4_ib_qp_sw_comp()
631 wc->vendor_err = MLX4_CQE_SYNDROME_WR_FLUSH_ERR; in mlx4_ib_qp_sw_comp()
634 wc->qp = &qp->ibqp; in mlx4_ib_qp_sw_comp()
635 wc++; in mlx4_ib_qp_sw_comp()
640 struct ib_wc *wc, int *npolled) in mlx4_ib_poll_sw_comp() argument
649 mlx4_ib_qp_sw_comp(qp, num_entries, wc + *npolled, npolled, 1); in mlx4_ib_poll_sw_comp()
655 mlx4_ib_qp_sw_comp(qp, num_entries, wc + *npolled, npolled, 0); in mlx4_ib_poll_sw_comp()
666 struct ib_wc *wc) in mlx4_ib_poll_one() argument
728 wc->qp = &(*cur_qp)->ibqp; in mlx4_ib_poll_one()
730 if (wc->qp->qp_type == IB_QPT_XRC_TGT) { in mlx4_ib_poll_one()
745 wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)]; in mlx4_ib_poll_one()
750 wc->wr_id = srq->wrid[wqe_ctr]; in mlx4_ib_poll_one()
755 wc->wr_id = srq->wrid[wqe_ctr]; in mlx4_ib_poll_one()
760 wc->wr_id = wq->wrid[tail]; in mlx4_ib_poll_one()
765 mlx4_ib_handle_error_cqe((struct mlx4_err_cqe *) cqe, wc); in mlx4_ib_poll_one()
769 wc->status = IB_WC_SUCCESS; in mlx4_ib_poll_one()
772 wc->wc_flags = 0; in mlx4_ib_poll_one()
775 wc->wc_flags |= IB_WC_WITH_IMM; in mlx4_ib_poll_one()
778 wc->opcode = IB_WC_RDMA_WRITE; in mlx4_ib_poll_one()
781 wc->wc_flags |= IB_WC_WITH_IMM; in mlx4_ib_poll_one()
785 wc->opcode = IB_WC_SEND; in mlx4_ib_poll_one()
788 wc->opcode = IB_WC_RDMA_READ; in mlx4_ib_poll_one()
789 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
792 wc->opcode = IB_WC_COMP_SWAP; in mlx4_ib_poll_one()
793 wc->byte_len = 8; in mlx4_ib_poll_one()
796 wc->opcode = IB_WC_FETCH_ADD; in mlx4_ib_poll_one()
797 wc->byte_len = 8; in mlx4_ib_poll_one()
800 wc->opcode = IB_WC_MASKED_COMP_SWAP; in mlx4_ib_poll_one()
801 wc->byte_len = 8; in mlx4_ib_poll_one()
804 wc->opcode = IB_WC_MASKED_FETCH_ADD; in mlx4_ib_poll_one()
805 wc->byte_len = 8; in mlx4_ib_poll_one()
808 wc->opcode = IB_WC_LSO; in mlx4_ib_poll_one()
811 wc->opcode = IB_WC_REG_MR; in mlx4_ib_poll_one()
814 wc->opcode = IB_WC_LOCAL_INV; in mlx4_ib_poll_one()
818 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
822 wc->opcode = IB_WC_RECV_RDMA_WITH_IMM; in mlx4_ib_poll_one()
823 wc->wc_flags = IB_WC_WITH_IMM; in mlx4_ib_poll_one()
824 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
827 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
828 wc->wc_flags = IB_WC_WITH_INVALIDATE; in mlx4_ib_poll_one()
829 wc->ex.invalidate_rkey = be32_to_cpu(cqe->immed_rss_invalid); in mlx4_ib_poll_one()
832 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
833 wc->wc_flags = 0; in mlx4_ib_poll_one()
836 wc->opcode = IB_WC_RECV; in mlx4_ib_poll_one()
837 wc->wc_flags = IB_WC_WITH_IMM; in mlx4_ib_poll_one()
838 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
842 is_eth = (rdma_port_get_link_layer(wc->qp->device, in mlx4_ib_poll_one()
849 use_tunnel_data(*cur_qp, cq, wc, tail, cqe, in mlx4_ib_poll_one()
856 wc->src_qp = g_mlpath_rqpn & 0xffffff; in mlx4_ib_poll_one()
857 wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f; in mlx4_ib_poll_one()
858 wc->wc_flags |= g_mlpath_rqpn & 0x80000000 ? IB_WC_GRH : 0; in mlx4_ib_poll_one()
859 wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f; in mlx4_ib_poll_one()
860 wc->wc_flags |= mlx4_ib_ipoib_csum_ok(cqe->status, in mlx4_ib_poll_one()
863 wc->slid = 0; in mlx4_ib_poll_one()
864 wc->sl = be16_to_cpu(cqe->sl_vid) >> 13; in mlx4_ib_poll_one()
867 wc->vlan_id = be16_to_cpu(cqe->sl_vid) & in mlx4_ib_poll_one()
870 wc->vlan_id = 0xffff; in mlx4_ib_poll_one()
872 memcpy(wc->smac, cqe->smac, ETH_ALEN); in mlx4_ib_poll_one()
873 wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC); in mlx4_ib_poll_one()
875 wc->slid = be16_to_cpu(cqe->rlid); in mlx4_ib_poll_one()
876 wc->sl = be16_to_cpu(cqe->sl_vid) >> 12; in mlx4_ib_poll_one()
877 wc->vlan_id = 0xffff; in mlx4_ib_poll_one()
884 int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) in mlx4_ib_poll_cq() argument
894 mlx4_ib_poll_sw_comp(cq, num_entries, wc, &npolled); in mlx4_ib_poll_cq()
899 if (mlx4_ib_poll_one(cq, &cur_qp, wc + npolled)) in mlx4_ib_poll_cq()