summaryrefslogtreecommitdiffstats
path: root/sys/dev/tsec
diff options
context:
space:
mode:
authorraj <raj@FreeBSD.org>2009-02-17 15:39:16 +0000
committerraj <raj@FreeBSD.org>2009-02-17 15:39:16 +0000
commit3fe0ff5e6c57f42cb5b0400f2ce2ba42d4e251f7 (patch)
tree44be20ebe563c3d61b325acff97197eb187e1206 /sys/dev/tsec
parentfbfe9d5998e0c33fb0b816846504c03461b5cb56 (diff)
downloadFreeBSD-src-3fe0ff5e6c57f42cb5b0400f2ce2ba42d4e251f7.zip
FreeBSD-src-3fe0ff5e6c57f42cb5b0400f2ce2ba42d4e251f7.tar.gz
Handle mbuf exhaustion scenario in tsec(4).
Without this fix the system would hang under heavy networking load. Submitted by: Leon Theunissen leon ! parsec dot co dot za
Diffstat (limited to 'sys/dev/tsec')
-rw-r--r--sys/dev/tsec/if_tsec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/tsec/if_tsec.c b/sys/dev/tsec/if_tsec.c
index bde6aed..d6d5edd 100644
--- a/sys/dev/tsec/if_tsec.c
+++ b/sys/dev/tsec/if_tsec.c
@@ -1332,7 +1332,12 @@ tsec_receive_intr_locked(struct tsec_softc *sc, int count)
if (tsec_new_rxbuf(sc->tsec_rx_mtag, rx_data[i].map,
&rx_data[i].mbuf, &rx_data[i].paddr)) {
ifp->if_ierrors++;
- continue;
+ /*
+ * We ran out of mbufs; didn't consume current
+ * descriptor and have to return it to the queue.
+ */
+ TSEC_BACK_CUR_RX_DESC(sc);
+ break;
}
/* Attach new buffer to descriptor and clear flags */
OpenPOWER on IntegriCloud