Lines Matching full:qp
31 * If a packet's QP[23:16] bits match this value, then it is
60 * RVT_S_SIGNAL_REQ_WR - set if QP send WRs contain completion signaled
61 * RVT_S_BUSY - send tasklet is processing the QP
124 /* Number of bits to pay attention to in the opcode for checking qp type */
127 /* Flags for checking QP state (see ib_rvt_state_ops[]) */
164 * The size of the sg_list is determined when the QP is created and stored
165 * in qp->s_max_sge.
314 * @qpt_support - a bit mask indicating QP type support
331 * which only happens in modify_qp() or changing the QP 'state'.
348 u32 qkey; /* QKEY for this QP (for UD or RD) */
353 u8 state; /* QP state */
356 u8 alt_timeout; /* Alternate path timeout for this QP */
357 u8 timeout; /* Timeout for this QP */
486 spinlock_t lock; /* protect changes to the qp table */
488 u32 last; /* last QP number allocated */
492 /* bit map of free QP numbers other than 0/1 */
511 struct rvt_qp *qp;
532 static inline struct rvt_swqe *rvt_get_swqe_ptr(struct rvt_qp *qp,
535 return (struct rvt_swqe *)((char *)qp->s_wq +
537 qp->s_max_sge *
554 * rvt_is_user_qp - return if this is user mode QP
555 * @qp - the target QP
557 static inline bool rvt_is_user_qp(struct rvt_qp *qp)
559 return !!qp->pid;
563 * rvt_get_qp - get a QP reference
564 * @qp - the QP to hold
566 static inline void rvt_get_qp(struct rvt_qp *qp)
568 atomic_inc(&qp->refcount);
572 * rvt_put_qp - release a QP reference
573 * @qp - the QP to release
575 static inline void rvt_put_qp(struct rvt_qp *qp)
577 if (qp && atomic_dec_and_test(&qp->refcount))
578 wake_up(&qp->wait);
600 * @qp - the rvt qp
607 struct rvt_qp *qp,
610 atomic_inc(&qp->s_reserved_used);
615 * @qp - the rvt qp
628 static inline void rvt_qp_wqe_unreserve(struct rvt_qp *qp, int flags)
631 atomic_dec(&qp->s_reserved_used);
648 __be32 rvt_compute_aeth(struct rvt_qp *qp);
650 void rvt_get_credit(struct rvt_qp *qp, u32 aeth);
656 * @qp - the qp pair
661 static inline u32 rvt_div_round_up_mtu(struct rvt_qp *qp, u32 len)
663 return (len + qp->pmtu - 1) >> qp->log_pmtu;
667 * @qp - the qp pair
672 static inline u32 rvt_div_mtu(struct rvt_qp *qp, u32 len)
674 return len >> qp->log_pmtu;
692 * rvt_lookup_qpn - return the QP with the given QPN
694 * @qpn: the QP number to look up
697 * the returned qp is no longer in use.
703 struct rvt_qp *qp = NULL;
706 qp = rcu_dereference(rvp->qp[qpn]);
710 for (qp = rcu_dereference(rdi->qp_dev->qp_table[n]); qp;
711 qp = rcu_dereference(qp->next))
712 if (qp->ibqp.qp_num == qpn)
715 return qp;
720 * @qp - the QP
724 static inline void rvt_mod_retry_timer_ext(struct rvt_qp *qp, u8 shift)
726 struct ib_qp *ibqp = &qp->ibqp;
729 lockdep_assert_held(&qp->s_lock);
730 qp->s_flags |= RVT_S_TIMER;
731 /* 4.096 usec. * (1 << qp->timeout) */
732 mod_timer(&qp->s_timer, jiffies + rdi->busy_jiffies +
733 (qp->timeout_jiffies << shift));
736 static inline void rvt_mod_retry_timer(struct rvt_qp *qp)
738 return rvt_mod_retry_timer_ext(qp, 0);
743 * @qp: the send qp
748 static inline void rvt_put_qp_swqe(struct rvt_qp *qp, struct rvt_swqe *wqe)
751 if (qp->allowed_ops == IB_OPCODE_UD)
757 * @qp: the qp
763 rvt_qp_swqe_incr(struct rvt_qp *qp, u32 val)
765 if (++val >= qp->s_size)
770 int rvt_error_qp(struct rvt_qp *qp, enum ib_wc_status err);
775 * @qp: receive queue
781 * full and the qp is put into error state.
783 static inline void rvt_recv_cq(struct rvt_qp *qp, struct ib_wc *wc,
786 struct rvt_cq *cq = ibcq_to_rvtcq(qp->ibqp.recv_cq);
789 rvt_error_qp(qp, IB_WC_LOC_QP_OP_ERR);
795 * @qp: send queue
801 * full and the qp is put into error state.
803 static inline void rvt_send_cq(struct rvt_qp *qp, struct ib_wc *wc,
806 struct rvt_cq *cq = ibcq_to_rvtcq(qp->ibqp.send_cq);
809 rvt_error_qp(qp, IB_WC_LOC_QP_OP_ERR);
814 * @qp - the qp
821 * queue if the qp indicates it should be done.
829 rvt_qp_complete_swqe(struct rvt_qp *qp,
839 rvt_qp_wqe_unreserve(qp, flags);
840 rvt_put_qp_swqe(qp, wqe);
844 (!(qp->s_flags & RVT_S_SIGNAL_REQ_WR) ||
852 last = rvt_qp_swqe_incr(qp, qp->s_last);
854 smp_store_release(&qp->s_last, last);
860 .qp = &qp->ibqp,
863 rvt_send_cq(qp, &w, status != IB_WC_SUCCESS);
871 int rvt_get_rwqe(struct rvt_qp *qp, bool wr_id_only);
872 void rvt_comm_est(struct rvt_qp *qp);
873 void rvt_rc_error(struct rvt_qp *qp, enum ib_wc_status err);
876 void rvt_add_rnr_timer(struct rvt_qp *qp, u32 aeth);
877 void rvt_del_timers_sync(struct rvt_qp *qp);
878 void rvt_stop_rc_timers(struct rvt_qp *qp);
879 void rvt_add_retry_timer_ext(struct rvt_qp *qp, u8 shift);
880 static inline void rvt_add_retry_timer(struct rvt_qp *qp)
882 rvt_add_retry_timer_ext(qp, 0);
885 void rvt_copy_sge(struct rvt_qp *qp, struct rvt_sge_state *ss,
888 void rvt_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe,
890 void rvt_ruc_loopback(struct rvt_qp *qp);
894 * @qp - the current QP
901 struct rvt_qp *qp;
905 void (*cb)(struct rvt_qp *qp, u64 v);
963 * @qp: the qp pointer
965 * This function returns the ibport pointer from the qp pointer.
967 static inline struct rvt_ibport *rvt_to_iport(struct rvt_qp *qp)
969 struct rvt_dev_info *rdi = ib_to_rvt(qp->ibqp.device);
971 return rdi->ports[qp->port_num - 1];
976 * @qp: the qp
982 static inline bool rvt_rc_credit_avail(struct rvt_qp *qp, struct rvt_swqe *wqe)
984 lockdep_assert_held(&qp->s_lock);
985 if (!(qp->s_flags & RVT_S_UNLIMITED_CREDIT) &&
986 rvt_cmp_msn(wqe->ssn, qp->s_lsn + 1) > 0) {
987 struct rvt_ibport *rvp = rvt_to_iport(qp);
989 qp->s_flags |= RVT_S_WAIT_SSN_CREDIT;
998 void (*cb)(struct rvt_qp *qp, u64 v));
1002 void (*cb)(struct rvt_qp *qp, u64 v));
1003 void rvt_qp_mr_clean(struct rvt_qp *qp, u32 lkey);