Subject: Re: Bug in SONIC driver?
To: Dave Huang <khym@bga.com>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: port-mac68k
Date: 10/31/1997 10:42:09
> 
> In the sonic_get() routine, shouldn't this section (around line 1184)
> 
> 		if (datalen >= MINCLSIZE) {
> 			MCLGET(m, M_DONTWAIT);
> 			if ((m->m_flags & M_EXT) == 0) {
> 				if (top) m_freem(top);
> 				return (0);
> 			}
> 			len = MLEN;
> 		}
> 
> be more like:
> 
> 		if (datalen >= MINCLSIZE) {
> 			MCLGET(m, M_DONTWAIT);
> 			if ((m->m_flags & M_EXT) == 0) {
> 				if (top) m_freem(top);
> 				return (0);
> 			}
> 			len = MCLBYTES; /* <--- this thing here */
> 		}
> 
> ?

I don't think so. MLEN is defined (in sys/sys/mbuf.h) as
being MSIZE-sizeof(m_hdr) and so they take care of all of the overhead
implicit in the structure. MCLBYTES is by how much the mbuf cluster
can be grown by. Also, MSIZE is 128, and MCLBYTES is 2k. I think MLEN
sounds more like it.

Though from looking at sys/sys/mbuf.h, I'm not so sure. :-(

What do other drivers do?

Take care,

Bill