From 1a13e40f03702e475fa0d210faf9614fbaf8cdef Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 1 Nov 2018 21:39:33 +0000 Subject: [PATCH] Assert that reclaim_tx_descs() is always making forward progress. MFC after: 2 months Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_sge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 9b0e2628b235..a9120a036056 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -5079,6 +5079,9 @@ reclaim_tx_descs(struct sge_txq *txq, u_int n) KASSERT(can_reclaim >= ndesc, ("%s: unexpected number of credits: %d, %d", __func__, can_reclaim, ndesc)); + KASSERT(ndesc != 0, + ("%s: descriptor with no credits: cidx %d", + __func__, eq->cidx)); for (m = txsd->m; m != NULL; m = nextpkt) { nextpkt = m->m_nextpkt;