cxgbe(4): Fix an incorrect assert.

CTRL and OFLD tx queues do not have automatic tx credit flush enabled so
it is okay for the cidx not to be the same as the pidx when the queue is
destroyed.

Reported by:	Jithesh Arakkan @ Chelsio
MFC after:	1 week
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2021-05-26 19:18:42 -07:00
parent 740d722def
commit 5ef87bf8b6

View File

@ -4346,6 +4346,7 @@ static void
free_eq(struct adapter *sc, struct sge_eq *eq) free_eq(struct adapter *sc, struct sge_eq *eq)
{ {
MPASS(eq->flags & EQ_SW_ALLOCATED); MPASS(eq->flags & EQ_SW_ALLOCATED);
if (eq->type == EQ_ETH)
MPASS(eq->pidx == eq->cidx); MPASS(eq->pidx == eq->cidx);
free_ring(sc, eq->desc_tag, eq->desc_map, eq->ba, eq->desc); free_ring(sc, eq->desc_tag, eq->desc_map, eq->ba, eq->desc);
@ -4499,6 +4500,8 @@ free_wrq(struct adapter *sc, struct sge_wrq *wrq)
{ {
free_eq(sc, &wrq->eq); free_eq(sc, &wrq->eq);
MPASS(wrq->nwr_pending == 0); MPASS(wrq->nwr_pending == 0);
MPASS(TAILQ_EMPTY(&wrq->incomplete_wrs));
MPASS(STAILQ_EMPTY(&wrq->wr_list));
bzero(wrq, sizeof(*wrq)); bzero(wrq, sizeof(*wrq));
} }