FreeBSD/sys/dev/cxgbe/t4_sge.c
/*
 * Doesn't fail.  Holds on to work requests it can't send right away.
 */
Doesn't fail.  Holds on to work requests it can't send right away.
Doesn ' t fail . Holds on to work requests it can ' t send right away .
void
t4_wrq_tx_locked(struct adapter *sc, struct sge_wrq *wrq, struct wrqe *wr)
{
#ifdef INVARIANTS
	struct sge_eq *eq = &wrq->eq;
#endif
	EQ_LOCK_ASSERT_OWNED(eq);
	MPASS(wr != NULL);
	MPASS(wr->wr_len > 0 && wr->wr_len <= SGE_MAX_WR_LEN);
	MPASS((wr->wr_len & 0x7) == 0);
	STAILQ_INSERT_TAIL(&wrq->wr_list, wr, link);
	wrq->nwr_pending++;
	wrq->ndesc_needed += howmany(wr->wr_len, EQ_ESIZE);
	if (!TAILQ_EMPTY(&wrq->incomplete_wrs))
		return;	
	drain_wrq_wr_list(sc, wrq);
	MPASS(eq->pidx == eq->dbidx);
}
void t4_wrq_tx_locked ( struct adapter * sc , struct sge_wrq * wrq , struct wrqe * wr ) { #ifdef INVARIANTS struct sge_eq * eq = & wrq -> eq ; #endif EQ_LOCK_ASSERT_OWNED ( eq ) ; MPASS ( wr != NULL ) ; MPASS ( wr -> wr_len > 0 && wr -> wr_len <= SGE_MAX_WR_LEN ) ; MPASS ( ( wr -> wr_len & 0x7 ) == 0 ) ; STAILQ_INSERT_TAIL ( & wrq -> wr_list , wr , link ) ; wrq -> nwr_pending ++ ; wrq -> ndesc_needed += howmany ( wr -> wr_len , EQ_ESIZE ) ; if ( ! TAILQ_EMPTY ( & wrq -> incomplete_wrs ) ) return ; drain_wrq_wr_list ( sc , wrq ) ; MPASS ( eq -> pidx == eq -> dbidx ) ; }
Doesn't fail.
Doesn ' t fail .
/* commit_wrq_wr will drain wr_list as well. */ /* Doorbell must have caught up to the pidx. */