summaryrefslogtreecommitdiffstats
path: root/sys/dev/cxgbe/tom/t4_tom.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/cxgbe/tom/t4_tom.c')
-rw-r--r--sys/dev/cxgbe/tom/t4_tom.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c
index bcf322e..c136834 100644
--- a/sys/dev/cxgbe/tom/t4_tom.c
+++ b/sys/dev/cxgbe/tom/t4_tom.c
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/lock.h>
+#include <sys/limits.h>
#include <sys/module.h>
#include <sys/protosw.h>
#include <sys/domain.h>
@@ -158,6 +159,8 @@ alloc_toepcb(struct vi_info *vi, int txqid, int rxqid, int flags)
toep->ofld_txq = &sc->sge.ofld_txq[txqid];
toep->ofld_rxq = &sc->sge.ofld_rxq[rxqid];
toep->ctrlq = &sc->sge.ctrlq[pi->port_id];
+ mbufq_init(&toep->ulp_pduq, INT_MAX);
+ mbufq_init(&toep->ulp_pdu_reclaimq, INT_MAX);
toep->txsd_total = txsd_total;
toep->txsd_avail = txsd_total;
toep->txsd_pidx = 0;
@@ -273,6 +276,14 @@ release_offload_resources(struct toepcb *toep)
CTR5(KTR_CXGBE, "%s: toep %p (tid %d, l2te %p, ce %p)",
__func__, toep, tid, toep->l2te, toep->ce);
+ /*
+ * These queues should have been emptied at approximately the same time
+ * that a normal connection's socket's so_snd would have been purged or
+ * drained. Do _not_ clean up here.
+ */
+ MPASS(mbufq_len(&toep->ulp_pduq) == 0);
+ MPASS(mbufq_len(&toep->ulp_pdu_reclaimq) == 0);
+
if (toep->ulp_mode == ULP_MODE_TCPDDP)
release_ddp_resources(toep);
@@ -380,6 +391,7 @@ final_cpl_received(struct toepcb *toep)
toep->inp = NULL;
toep->flags &= ~TPF_CPL_PENDING;
+ mbufq_drain(&toep->ulp_pdu_reclaimq);
if (!(toep->flags & TPF_ATTACHED))
release_offload_resources(toep);
OpenPOWER on IntegriCloud