Lines Matching defs:qp
90 * @qp: the queue pair to compute the AETH for
94 __be32 rvt_compute_aeth(struct rvt_qp *qp)
96 u32 aeth = qp->r_msn & IB_MSN_MASK;
98 if (qp->ibqp.srq) {
110 credits = READ_ONCE(qp->r_rq.kwq->count);
113 if (qp->ip) {
114 head = RDMA_READ_UAPI_ATOMIC(qp->r_rq.wq->head);
115 tail = RDMA_READ_UAPI_ATOMIC(qp->r_rq.wq->tail);
117 head = READ_ONCE(qp->r_rq.kwq->head);
118 tail = READ_ONCE(qp->r_rq.kwq->tail);
120 if (head >= qp->r_rq.size)
122 if (tail >= qp->r_rq.size)
130 credits = rvt_get_rq_count(&qp->r_rq, head, tail);
158 * @qp: the qp who's send work queue to flush
163 void rvt_get_credit(struct rvt_qp *qp, u32 aeth)
165 struct rvt_dev_info *rdi = ib_to_rvt(qp->ibqp.device);
168 lockdep_assert_held(&qp->s_lock);
175 if (!(qp->s_flags & RVT_S_UNLIMITED_CREDIT)) {
176 qp->s_flags |= RVT_S_UNLIMITED_CREDIT;
177 if (qp->s_flags & RVT_S_WAIT_SSN_CREDIT) {
178 qp->s_flags &= ~RVT_S_WAIT_SSN_CREDIT;
179 rdi->driver_f.schedule_send(qp);
182 } else if (!(qp->s_flags & RVT_S_UNLIMITED_CREDIT)) {
185 if (rvt_cmp_msn(credit, qp->s_lsn) > 0) {
186 qp->s_lsn = credit;
187 if (qp->s_flags & RVT_S_WAIT_SSN_CREDIT) {
188 qp->s_flags &= ~RVT_S_WAIT_SSN_CREDIT;
189 rdi->driver_f.schedule_send(qp);