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; member
532 static inline struct rvt_swqe *rvt_get_swqe_ptr(struct rvt_qp *qp, in rvt_get_swqe_ptr() argument
535 return (struct rvt_swqe *)((char *)qp->s_wq + in rvt_get_swqe_ptr()
537 qp->s_max_sge * in rvt_get_swqe_ptr()
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) in rvt_is_user_qp() argument
559 return !!qp->pid; in rvt_is_user_qp()
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) in rvt_get_qp() argument
568 atomic_inc(&qp->refcount); in rvt_get_qp()
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) in rvt_put_qp() argument
577 if (qp && atomic_dec_and_test(&qp->refcount)) in rvt_put_qp()
578 wake_up(&qp->wait); in rvt_put_qp()
600 * @qp - the rvt qp
607 struct rvt_qp *qp, in rvt_qp_wqe_reserve() argument
610 atomic_inc(&qp->s_reserved_used); in rvt_qp_wqe_reserve()
615 * @qp - the rvt qp
628 static inline void rvt_qp_wqe_unreserve(struct rvt_qp *qp, int flags) in rvt_qp_wqe_unreserve() argument
631 atomic_dec(&qp->s_reserved_used); in rvt_qp_wqe_unreserve()
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) in rvt_div_round_up_mtu() argument
663 return (len + qp->pmtu - 1) >> qp->log_pmtu; in rvt_div_round_up_mtu()
667 * @qp - the qp pair
672 static inline u32 rvt_div_mtu(struct rvt_qp *qp, u32 len) in rvt_div_mtu() argument
674 return len >> qp->log_pmtu; in rvt_div_mtu()
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; in rvt_lookup_qpn() local
706 qp = rcu_dereference(rvp->qp[qpn]); in rvt_lookup_qpn()
710 for (qp = rcu_dereference(rdi->qp_dev->qp_table[n]); qp; in rvt_lookup_qpn()
711 qp = rcu_dereference(qp->next)) in rvt_lookup_qpn()
712 if (qp->ibqp.qp_num == qpn) in rvt_lookup_qpn()
715 return qp; in rvt_lookup_qpn()
720 * @qp - the QP
724 static inline void rvt_mod_retry_timer_ext(struct rvt_qp *qp, u8 shift) in rvt_mod_retry_timer_ext() argument
726 struct ib_qp *ibqp = &qp->ibqp; in rvt_mod_retry_timer_ext()
729 lockdep_assert_held(&qp->s_lock); in rvt_mod_retry_timer_ext()
730 qp->s_flags |= RVT_S_TIMER; in rvt_mod_retry_timer_ext()
731 /* 4.096 usec. * (1 << qp->timeout) */ in rvt_mod_retry_timer_ext()
732 mod_timer(&qp->s_timer, jiffies + rdi->busy_jiffies + in rvt_mod_retry_timer_ext()
733 (qp->timeout_jiffies << shift)); in rvt_mod_retry_timer_ext()
736 static inline void rvt_mod_retry_timer(struct rvt_qp *qp) in rvt_mod_retry_timer() argument
738 return rvt_mod_retry_timer_ext(qp, 0); in rvt_mod_retry_timer()
743 * @qp: the send qp
748 static inline void rvt_put_qp_swqe(struct rvt_qp *qp, struct rvt_swqe *wqe) in rvt_put_qp_swqe() argument
751 if (qp->allowed_ops == IB_OPCODE_UD) in rvt_put_qp_swqe()
757 * @qp: the qp
763 rvt_qp_swqe_incr(struct rvt_qp *qp, u32 val) in rvt_qp_swqe_incr() argument
765 if (++val >= qp->s_size) in rvt_qp_swqe_incr()
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, in rvt_recv_cq() argument
786 struct rvt_cq *cq = ibcq_to_rvtcq(qp->ibqp.recv_cq); in rvt_recv_cq()
789 rvt_error_qp(qp, IB_WC_LOC_QP_OP_ERR); in rvt_recv_cq()
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, in rvt_send_cq() argument
806 struct rvt_cq *cq = ibcq_to_rvtcq(qp->ibqp.send_cq); in rvt_send_cq()
809 rvt_error_qp(qp, IB_WC_LOC_QP_OP_ERR); in rvt_send_cq()
814 * @qp - the qp
821 * queue if the qp indicates it should be done.
829 rvt_qp_complete_swqe(struct rvt_qp *qp, in rvt_qp_complete_swqe() argument
839 rvt_qp_wqe_unreserve(qp, flags); in rvt_qp_complete_swqe()
840 rvt_put_qp_swqe(qp, wqe); in rvt_qp_complete_swqe()
844 (!(qp->s_flags & RVT_S_SIGNAL_REQ_WR) || in rvt_qp_complete_swqe()
852 last = rvt_qp_swqe_incr(qp, qp->s_last); in rvt_qp_complete_swqe()
854 smp_store_release(&qp->s_last, last); in rvt_qp_complete_swqe()
860 .qp = &qp->ibqp, in rvt_qp_complete_swqe()
863 rvt_send_cq(qp, &w, status != IB_WC_SUCCESS); in rvt_qp_complete_swqe()
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) in rvt_add_retry_timer() argument
882 rvt_add_retry_timer_ext(qp, 0); in rvt_add_retry_timer()
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; member
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) in rvt_to_iport() argument
969 struct rvt_dev_info *rdi = ib_to_rvt(qp->ibqp.device); in rvt_to_iport()
971 return rdi->ports[qp->port_num - 1]; in rvt_to_iport()
976 * @qp: the qp
982 static inline bool rvt_rc_credit_avail(struct rvt_qp *qp, struct rvt_swqe *wqe) in rvt_rc_credit_avail() argument
984 lockdep_assert_held(&qp->s_lock); in rvt_rc_credit_avail()
985 if (!(qp->s_flags & RVT_S_UNLIMITED_CREDIT) && in rvt_rc_credit_avail()
986 rvt_cmp_msn(wqe->ssn, qp->s_lsn + 1) > 0) { in rvt_rc_credit_avail()
987 struct rvt_ibport *rvp = rvt_to_iport(qp); in rvt_rc_credit_avail()
989 qp->s_flags |= RVT_S_WAIT_SSN_CREDIT; in rvt_rc_credit_avail()
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);