Lines Matching full:qp

48  * @qp: the queue pair to compute the AETH for
52 __be32 rvt_compute_aeth(struct rvt_qp *qp) in rvt_compute_aeth() argument
54 u32 aeth = qp->r_msn & IB_MSN_MASK; in rvt_compute_aeth()
56 if (qp->ibqp.srq) { in rvt_compute_aeth()
68 credits = READ_ONCE(qp->r_rq.kwq->count); in rvt_compute_aeth()
71 if (qp->ip) { in rvt_compute_aeth()
72 head = RDMA_READ_UAPI_ATOMIC(qp->r_rq.wq->head); in rvt_compute_aeth()
73 tail = RDMA_READ_UAPI_ATOMIC(qp->r_rq.wq->tail); in rvt_compute_aeth()
75 head = READ_ONCE(qp->r_rq.kwq->head); in rvt_compute_aeth()
76 tail = READ_ONCE(qp->r_rq.kwq->tail); in rvt_compute_aeth()
78 if (head >= qp->r_rq.size) in rvt_compute_aeth()
80 if (tail >= qp->r_rq.size) in rvt_compute_aeth()
88 credits = rvt_get_rq_count(&qp->r_rq, head, tail); in rvt_compute_aeth()
115 * rvt_get_credit - flush the send work queue of a QP
116 * @qp: the qp who's send work queue to flush
119 * The QP s_lock should be held.
121 void rvt_get_credit(struct rvt_qp *qp, u32 aeth) in rvt_get_credit() argument
123 struct rvt_dev_info *rdi = ib_to_rvt(qp->ibqp.device); in rvt_get_credit()
126 lockdep_assert_held(&qp->s_lock); in rvt_get_credit()
133 if (!(qp->s_flags & RVT_S_UNLIMITED_CREDIT)) { in rvt_get_credit()
134 qp->s_flags |= RVT_S_UNLIMITED_CREDIT; in rvt_get_credit()
135 if (qp->s_flags & RVT_S_WAIT_SSN_CREDIT) { in rvt_get_credit()
136 qp->s_flags &= ~RVT_S_WAIT_SSN_CREDIT; in rvt_get_credit()
137 rdi->driver_f.schedule_send(qp); in rvt_get_credit()
140 } else if (!(qp->s_flags & RVT_S_UNLIMITED_CREDIT)) { in rvt_get_credit()
143 if (rvt_cmp_msn(credit, qp->s_lsn) > 0) { in rvt_get_credit()
144 qp->s_lsn = credit; in rvt_get_credit()
145 if (qp->s_flags & RVT_S_WAIT_SSN_CREDIT) { in rvt_get_credit()
146 qp->s_flags &= ~RVT_S_WAIT_SSN_CREDIT; in rvt_get_credit()
147 rdi->driver_f.schedule_send(qp); in rvt_get_credit()