Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-23 Thread Simon Horman
On Mon, Jan 16, 2017 at 11:41:51PM +0300, Sergei Shtylyov wrote: > Hello! > > On 01/12/2017 04:18 PM, Simon Horman wrote: > > >... > > Here, it stop once an untransmitted buffer is encountered... > >>> > >>>Yes, I see that now. > >>> > >>>I wonder if we should: > >>> > >>>a) paramatise

Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-16 Thread Sergei Shtylyov
Hello! On 01/12/2017 04:18 PM, Simon Horman wrote: ... Here, it stop once an untransmitted buffer is encountered... Yes, I see that now. I wonder if we should: a) paramatise ravb_tx_free() so it may either clear all transmitted buffers (current behaviour) or all buffers (new

Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-13 Thread Simon Horman
On Thu, Jan 12, 2017 at 07:33:51PM +0300, Sergei Shtylyov wrote: > On 01/12/2017 04:18 PM, Simon Horman wrote: > > >... > > > Here, it stop once an untransmitted buffer is encountered... > >>> > >>>Yes, I see that now. > >>> > >>>I wonder if we should: > >>> > >>>a) paramatise

Re: [EXT] Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-12 Thread Sergei Shtylyov
On 01/12/2017 07:55 PM, Lino Sanfilippo wrote: + +for (; priv->cur_tx[q] - priv->dirty_tx[q] > 0; priv->dirty_tx[q]++) { BTW: How can this work correctly when cur_tx wraps and dirty_tx is greater? {cur|dirty}_tx never wrap. Both values are 32 bit and AFAICS they are only

Re: [EXT] Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-12 Thread Lino Sanfilippo
Hi, On 12.01.2017 17:37, Sergei Shtylyov wrote: External Email -- On 01/12/2017 04:23 PM, Lino Sanfilippo wrote: + +for (; priv->cur_tx[q] - priv->dirty_tx[q] > 0; priv->dirty_tx[q]++) { BTW: How can this work

Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-12 Thread Sergei Shtylyov
On 01/12/2017 04:23 PM, Lino Sanfilippo wrote: + +for (; priv->cur_tx[q] - priv->dirty_tx[q] > 0; priv->dirty_tx[q]++) { BTW: How can this work correctly when cur_tx wraps and dirty_tx is greater? {cur|dirty}_tx never wrap. Regards, Lino MBR, Sergei

Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-12 Thread Sergei Shtylyov
On 01/12/2017 04:18 PM, Simon Horman wrote: ... Here, it stop once an untransmitted buffer is encountered... Yes, I see that now. I wonder if we should: a) paramatise ravb_tx_free() so it may either clear all transmitted buffers (current behaviour) or all buffers (new behaviour). b)

Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-12 Thread Lino Sanfilippo
Hi, On 12.01.2017 10:11, Simon Horman wrote: + + for (; priv->cur_tx[q] - priv->dirty_tx[q] > 0; priv->dirty_tx[q]++) { BTW: How can this work correctly when cur_tx wraps and dirty_tx is greater? Regards, Lino

Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-12 Thread Simon Horman
On Thu, Jan 12, 2017 at 03:03:05PM +0300, Sergei Shtylyov wrote: > On 01/12/2017 12:11 PM, Simon Horman wrote: ... > >> Here, it stop once an untransmitted buffer is encountered... > > > >Yes, I see that now. > > > >I wonder if we should: > > > >a) paramatise ravb_tx_free() so it may either

Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-12 Thread Sergei Shtylyov
On 01/12/2017 12:11 PM, Simon Horman wrote: From: Kazuya Mizuguchi "swiotlb buffer is full" errors occur after repeated initialisation of a device - f.e. suspend/resume or ip link set up/down. This is because memory mapped using dma_map_single() in

Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-12 Thread Simon Horman
On Fri, Jan 06, 2017 at 10:02:36PM +0300, Sergei Shtylyov wrote: > Hello! > > On 01/05/2017 01:43 PM, Simon Horman wrote: > > >From: Kazuya Mizuguchi > > > >"swiotlb buffer is full" errors occur after repeated initialisation of a > >device - f.e. suspend/resume

Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-06 Thread Sergei Shtylyov
Hello! On 01/05/2017 01:43 PM, Simon Horman wrote: From: Kazuya Mizuguchi "swiotlb buffer is full" errors occur after repeated initialisation of a device - f.e. suspend/resume or ip link set up/down. This is because memory mapped using dma_map_single() in

[PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-05 Thread Simon Horman
From: Kazuya Mizuguchi "swiotlb buffer is full" errors occur after repeated initialisation of a device - f.e. suspend/resume or ip link set up/down. This is because memory mapped using dma_map_single() in ravb_ring_format() and ravb_start_xmit() is not released.