The timeout seems like a very large amount of time. All the drivers used to contain reuse-the-last-mbuf tricks. With MCLGETI, this hack is removed because MCLGETI should provide at least 1 mbuf. But... what if the actual total mbuf pressure is so high that MCLGETI can't get it. Then a driver will lose.
Perhaps in that case the long timeout is sufficient. It is quite a hack. > When the kernel runs out of mbuf clusters, the hme receive ring may > become empty. In that case, the hme driver cannot recover as the > ring is only filled after receiving data. My fix is to fill an > empty receive ring every second. > > ok? > > bluhm > > > Index: dev/ic/hme.c > =================================================================== > RCS file: /data/mirror/openbsd/cvs/src/sys/dev/ic/hme.c,v > retrieving revision 1.61 > diff -u -p -r1.61 hme.c > --- dev/ic/hme.c 15 Oct 2009 17:54:54 -0000 1.61 > +++ dev/ic/hme.c 23 Mar 2011 00:07:51 -0000 > @@ -362,6 +362,13 @@ hme_tick(arg) > bus_space_write_4(t, mac, HME_MACI_EXCNT, 0); > bus_space_write_4(t, mac, HME_MACI_LTCNT, 0); > > + /* > + * If buffer allocation fails, the receive ring may become > + * empty. There is no receive interrupt to recover from that. > + */ > + if (sc->sc_rx_cnt == 0) > + hme_fill_rx_ring(sc); > + > mii_tick(&sc->sc_mii); > splx(s);
