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