> From: David Gwynne <[email protected]>
> Date: Wed, 23 Mar 2011 14:21:19 +1000
> 
> makes sense to me.

While it is a potential solution for the problem at hand (and one I
didn't consider yet) can we step back and think whether this is a
solution that will work for *all* our ethernet drivers?

> On 23/03/2011, at 10:28 AM, Alexander Bluhm wrote:
> 
> > Hi,
> > 
> > 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);

Reply via email to