svn commit: r188713 - head/sys/dev/tsec

Rafal Jaworowski raj at FreeBSD.org
Tue Feb 17 07:39:21 PST 2009


Author: raj
Date: Tue Feb 17 15:39:16 2009
New Revision: 188713
URL: http://svn.freebsd.org/changeset/base/188713

Log:
  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

Modified:
  head/sys/dev/tsec/if_tsec.c

Modified: head/sys/dev/tsec/if_tsec.c
==============================================================================
--- head/sys/dev/tsec/if_tsec.c	Tue Feb 17 14:59:47 2009	(r188712)
+++ head/sys/dev/tsec/if_tsec.c	Tue Feb 17 15:39:16 2009	(r188713)
@@ -1332,7 +1332,12 @@ tsec_receive_intr_locked(struct tsec_sof
 		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 */


More information about the svn-src-all mailing list