Subject: Re: nfe, kvakmem wait, and arp_drain: locked; punting
To: David Maxwell <david@crlf.net>
From: Chuck Silvers <chuq@chuq.com>
List: current-users
Date: 03/17/2006 07:33:20
--h31gzZEtNLTqOjlF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Mar 17, 2006 at 02:17:26AM -0500, David Maxwell wrote:
> > there's another, slower leak in the transmit path, which only
> > seems to occur with packets larger than about 250 bytes.
> > I don't see anything wrong in the code for this one yet though.
> 
> The arp_drain problem is indeed gone. Now, after a while, ftpd hangs
> in wait-state sokva.

right, that's the slower mbuf leak I mentioned.  for large writes,
this leaks kernel virtual space used by sosend_loan() as a side-effect.

the attached patch avoids these leaks, but I don't know why the
underlying problem occurs yet.

-Chuck

--h31gzZEtNLTqOjlF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diff.nfe-noleak"

Index: src/sys/dev/pci/if_nfe.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_nfe.c,v
retrieving revision 1.2
diff -u -p -r1.2 if_nfe.c
--- src/sys/dev/pci/if_nfe.c	16 Mar 2006 17:26:13 -0000	1.2
+++ src/sys/dev/pci/if_nfe.c	17 Mar 2006 15:19:39 -0000
@@ -852,7 +852,7 @@ nfe_txeof(struct nfe_softc *sc)
 		data = &sc->txq.data[sc->txq.next];
 
 		if ((sc->sc_flags & (NFE_JUMBO_SUP | NFE_40BIT_ADDR)) == 0) {
-			if (!(flags & NFE_TX_LASTFRAG_V1))
+			if (!(flags & NFE_TX_LASTFRAG_V1) && data->m == NULL)
 				goto skip;
 
 			if ((flags & NFE_TX_ERROR_V1) != 0) {
@@ -862,7 +862,7 @@ nfe_txeof(struct nfe_softc *sc)
 			} else
 				ifp->if_opackets++;
 		} else {
-			if (!(flags & NFE_TX_LASTFRAG_V2))
+			if (!(flags & NFE_TX_LASTFRAG_V2) && data->m == NULL)
 				goto skip;
 
 			if ((flags & NFE_TX_ERROR_V2) != 0) {

--h31gzZEtNLTqOjlF--