Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev/pci



On Mon, Apr 09, 2007 at 02:00:25PM -0700, Matt Thomas wrote:
> Manuel Bouyer wrote:
> >Module Name: src
> >Committed By:        bouyer
> >Date:                Mon Apr  9 19:34:51 UTC 2007
> >
> >Modified Files:
> >     src/sys/dev/pci: if_bnx.c
> >
> >Log Message:
> >RX buffers are malloced memory of 9216 bytes. This can require from 1 to
> >4 DMA memory segments, depending on how the buffer is in memory.
> >When receiving a packet, we allocate a new one to remplace the one we've
> >used. It can need more segments than the one it remplace, leading to
> >corrution of the RX descriptors, and a panic in bus_dmamap_sync() 
> >(DIAGNOSTIC
> >kernels) or possibly memory corruption.
> >
> >Fix:
> >- bnx_get_buf() allocates as many buffer as possible, checking the number
> >  of free RX descriptors. Because one receive buffer is not guaranteed to
> >  be remplaced on receive, call bnx_get_buf() from bnx_tick() too.
> >  This also improve error handling from bnx_get_buf().
> >- use MCLGET() instead of MEXTMALLOC() if we're running with the standard
> >  ethernet MTU. This gives us more receive buffers and waste less memory.
> 
> mbuf.h support alternatively-sized cluster mbufs.  You might consider adding
> a 9216 length cluster bucket.

Could you point to the function/macro to use, or to example code ?
I didn't find it in mbuf.h (I looked fot "cluster"). 

-- 
Manuel Bouyer, LIP6, Universite Paris VI.           
Manuel.Bouyer%lip6.fr@localhost
     NetBSD: 26 ans d'experience feront toujours la difference
--



Home | Main Index | Thread Index | Old Index