[PATCH 1/14] Spidernet DMA coalescing

Linas Vepstas linas at austin.ibm.com
Fri Dec 15 04:07:37 EST 2006


On Thu, Dec 14, 2006 at 11:05:17AM +0000, Christoph Hellwig wrote:
> On Wed, Dec 13, 2006 at 03:06:59PM -0600, Linas Vepstas wrote:
> > 
> > The current driver code performs 512 DMA mappings of a bunch of 
> > 32-byte ring descriptor structures. This is silly, as they are 
> > all in contiguous memory. This patch changes the code to 
> > dma_map_coherent() each rx/tx ring as a whole.
> 
> It's acutally dma_alloc_coherent now that you updated the patch :)
> 
> > +	chain->ring = dma_alloc_coherent(&card->pdev->dev, alloc_size,
> > +		&chain->dma_addr, GFP_KERNEL);
> >  
> > +	if (!chain->ring)
> > +		return -ENOMEM;
> >  
> > +	descr = chain->ring;
> > +	memset(descr, 0, alloc_size);
> 
> dma_alloc_coherent is defined to zero the allocated memory, so you
> won't need this memset.

Being unclear on the concept, should a send a new version of this patch,
or should I send a new patch that removes this?

--linas



More information about the Linuxppc-dev mailing list