Lines Matching full:wr

647 		       const struct ib_reg_wr *wr)  in set_reg_seg()  argument
649 struct pvrdma_user_mr *mr = to_vmr(wr->mr); in set_reg_seg()
651 wqe_hdr->wr.fast_reg.iova_start = mr->ibmr.iova; in set_reg_seg()
652 wqe_hdr->wr.fast_reg.pl_pdir_dma = mr->pdir.dir_dma; in set_reg_seg()
653 wqe_hdr->wr.fast_reg.page_shift = mr->page_shift; in set_reg_seg()
654 wqe_hdr->wr.fast_reg.page_list_len = mr->npages; in set_reg_seg()
655 wqe_hdr->wr.fast_reg.length = mr->ibmr.length; in set_reg_seg()
656 wqe_hdr->wr.fast_reg.access_flags = wr->access; in set_reg_seg()
657 wqe_hdr->wr.fast_reg.rkey = wr->key; in set_reg_seg()
666 * @wr: work request list to post
667 * @bad_wr: the first bad WR returned
671 int pvrdma_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr, in pvrdma_post_send() argument
686 *bad_wr = wr; in pvrdma_post_send()
692 while (wr) { in pvrdma_post_send()
699 *bad_wr = wr; in pvrdma_post_send()
704 if (unlikely(wr->num_sge > qp->sq.max_sg || wr->num_sge < 0)) { in pvrdma_post_send()
707 *bad_wr = wr; in pvrdma_post_send()
732 wr->opcode != IB_WR_SEND) { in pvrdma_post_send()
735 *bad_wr = wr; in pvrdma_post_send()
740 if (wr->opcode != IB_WR_SEND && in pvrdma_post_send()
741 wr->opcode != IB_WR_SEND_WITH_IMM) { in pvrdma_post_send()
744 *bad_wr = wr; in pvrdma_post_send()
752 wqe_hdr->wr_id = wr->wr_id; in pvrdma_post_send()
753 wqe_hdr->num_sge = wr->num_sge; in pvrdma_post_send()
754 wqe_hdr->opcode = ib_wr_opcode_to_pvrdma(wr->opcode); in pvrdma_post_send()
755 wqe_hdr->send_flags = ib_send_flags_to_pvrdma(wr->send_flags); in pvrdma_post_send()
756 if (wr->opcode == IB_WR_SEND_WITH_IMM || in pvrdma_post_send()
757 wr->opcode == IB_WR_RDMA_WRITE_WITH_IMM) in pvrdma_post_send()
758 wqe_hdr->ex.imm_data = wr->ex.imm_data; in pvrdma_post_send()
761 *bad_wr = wr; in pvrdma_post_send()
769 if (unlikely(!ud_wr(wr)->ah)) { in pvrdma_post_send()
772 *bad_wr = wr; in pvrdma_post_send()
781 wqe_hdr->wr.ud.remote_qpn = ud_wr(wr)->remote_qpn; in pvrdma_post_send()
782 wqe_hdr->wr.ud.remote_qkey = in pvrdma_post_send()
783 ud_wr(wr)->remote_qkey & 0x80000000 ? in pvrdma_post_send()
784 qp->qkey : ud_wr(wr)->remote_qkey; in pvrdma_post_send()
785 wqe_hdr->wr.ud.av = to_vah(ud_wr(wr)->ah)->av; in pvrdma_post_send()
789 switch (wr->opcode) { in pvrdma_post_send()
793 wqe_hdr->wr.rdma.remote_addr = in pvrdma_post_send()
794 rdma_wr(wr)->remote_addr; in pvrdma_post_send()
795 wqe_hdr->wr.rdma.rkey = rdma_wr(wr)->rkey; in pvrdma_post_send()
800 wr->ex.invalidate_rkey; in pvrdma_post_send()
804 wqe_hdr->wr.atomic.remote_addr = in pvrdma_post_send()
805 atomic_wr(wr)->remote_addr; in pvrdma_post_send()
806 wqe_hdr->wr.atomic.rkey = atomic_wr(wr)->rkey; in pvrdma_post_send()
807 wqe_hdr->wr.atomic.compare_add = in pvrdma_post_send()
808 atomic_wr(wr)->compare_add; in pvrdma_post_send()
809 if (wr->opcode == IB_WR_ATOMIC_CMP_AND_SWP) in pvrdma_post_send()
810 wqe_hdr->wr.atomic.swap = in pvrdma_post_send()
811 atomic_wr(wr)->swap; in pvrdma_post_send()
814 ret = set_reg_seg(wqe_hdr, reg_wr(wr)); in pvrdma_post_send()
818 *bad_wr = wr; in pvrdma_post_send()
831 *bad_wr = wr; in pvrdma_post_send()
836 for (i = 0; i < wr->num_sge; i++) { in pvrdma_post_send()
838 sge->addr = wr->sg_list[i].addr; in pvrdma_post_send()
839 sge->length = wr->sg_list[i].length; in pvrdma_post_send()
840 sge->lkey = wr->sg_list[i].lkey; in pvrdma_post_send()
851 wr = wr->next; in pvrdma_post_send()
868 * @wr: the work request list to post
869 * @bad_wr: the first bad WR returned
873 int pvrdma_post_recv(struct ib_qp *ibqp, const struct ib_recv_wr *wr, in pvrdma_post_recv() argument
889 *bad_wr = wr; in pvrdma_post_recv()
895 *bad_wr = wr; in pvrdma_post_recv()
901 while (wr) { in pvrdma_post_recv()
904 if (unlikely(wr->num_sge > qp->rq.max_sg || in pvrdma_post_recv()
905 wr->num_sge < 0)) { in pvrdma_post_recv()
907 *bad_wr = wr; in pvrdma_post_recv()
916 *bad_wr = wr; in pvrdma_post_recv()
923 wqe_hdr->wr_id = wr->wr_id; in pvrdma_post_recv()
924 wqe_hdr->num_sge = wr->num_sge; in pvrdma_post_recv()
928 for (i = 0; i < wr->num_sge; i++) { in pvrdma_post_recv()
929 sge->addr = wr->sg_list[i].addr; in pvrdma_post_recv()
930 sge->length = wr->sg_list[i].length; in pvrdma_post_recv()
931 sge->lkey = wr->sg_list[i].lkey; in pvrdma_post_recv()
942 wr = wr->next; in pvrdma_post_recv()