RE: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-05 Thread David Laight
> Well, for the 10/100 MACB interface, I am stuck with 128 Bytes buffers! > So this use of pages seems sensible. If you have dma coherent memory you can make the rx buffer space be an array of short buffers referenced by adjacent ring entries (possibly with the last one slightly short to allow

Re: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-05 Thread Nicolas Ferre
On 12/05/2012 10:35 AM, David Laight : >> If I understand well, you mean that the call to: >> >> dma_sync_single_range_for_device(>pdev->dev, phys, >> pg_offset, frag_len, DMA_FROM_DEVICE); >> >> in the rx path after having copied the data to skb is not

RE: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-05 Thread David Laight
> If I understand well, you mean that the call to: > > dma_sync_single_range_for_device(>pdev->dev, phys, > pg_offset, frag_len, DMA_FROM_DEVICE); > > in the rx path after having copied the data to skb is not needed? > That is also the conclusion that

RE: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-05 Thread David Laight
If I understand well, you mean that the call to: dma_sync_single_range_for_device(bp-pdev-dev, phys, pg_offset, frag_len, DMA_FROM_DEVICE); in the rx path after having copied the data to skb is not needed? That is also the conclusion that I

Re: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-05 Thread Nicolas Ferre
On 12/05/2012 10:35 AM, David Laight : If I understand well, you mean that the call to: dma_sync_single_range_for_device(bp-pdev-dev, phys, pg_offset, frag_len, DMA_FROM_DEVICE); in the rx path after having copied the data to skb is not needed? That

RE: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-05 Thread David Laight
Well, for the 10/100 MACB interface, I am stuck with 128 Bytes buffers! So this use of pages seems sensible. If you have dma coherent memory you can make the rx buffer space be an array of short buffers referenced by adjacent ring entries (possibly with the last one slightly short to allow for

Re: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-04 Thread Nicolas Ferre
On 12/03/2012 03:25 PM, David Laight : >> On 12/03/2012 01:43 PM, David Laight : Allocate regular pages to use as backing for the RX ring and use the DMA API to sync the caches. This should give a bit better performance since it allows the CPU to do burst transfers from memory. It

Re: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-04 Thread Nicolas Ferre
On 12/03/2012 03:25 PM, David Laight : On 12/03/2012 01:43 PM, David Laight : Allocate regular pages to use as backing for the RX ring and use the DMA API to sync the caches. This should give a bit better performance since it allows the CPU to do burst transfers from memory. It is also a

RE: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-03 Thread David Laight
> On 12/03/2012 01:43 PM, David Laight : > >> Allocate regular pages to use as backing for the RX ring and use the > >> DMA API to sync the caches. This should give a bit better performance > >> since it allows the CPU to do burst transfers from memory. It is also > >> a necessary step on the way

Re: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-03 Thread Nicolas Ferre
On 12/03/2012 01:43 PM, David Laight : >> Allocate regular pages to use as backing for the RX ring and use the >> DMA API to sync the caches. This should give a bit better performance >> since it allows the CPU to do burst transfers from memory. It is also >> a necessary step on the way to reduce

RE: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-03 Thread David Laight
> Allocate regular pages to use as backing for the RX ring and use the > DMA API to sync the caches. This should give a bit better performance > since it allows the CPU to do burst transfers from memory. It is also > a necessary step on the way to reduce the amount of copying done by > the driver.

RE: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-03 Thread David Laight
Allocate regular pages to use as backing for the RX ring and use the DMA API to sync the caches. This should give a bit better performance since it allows the CPU to do burst transfers from memory. It is also a necessary step on the way to reduce the amount of copying done by the driver.

Re: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-03 Thread Nicolas Ferre
On 12/03/2012 01:43 PM, David Laight : Allocate regular pages to use as backing for the RX ring and use the DMA API to sync the caches. This should give a bit better performance since it allows the CPU to do burst transfers from memory. It is also a necessary step on the way to reduce the

RE: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-03 Thread David Laight
On 12/03/2012 01:43 PM, David Laight : Allocate regular pages to use as backing for the RX ring and use the DMA API to sync the caches. This should give a bit better performance since it allows the CPU to do burst transfers from memory. It is also a necessary step on the way to reduce the