diff mbox

net: sh_eth: Fix RX packets errors on R8A7740

Message ID 1381127365-6521-2-git-send-email-nh-ky@jinso.co.jp
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Nguyen Hong Ky Oct. 7, 2013, 6:29 a.m. UTC
This patch will fix RX packets errors when receiving big size
of data by set bit RNC = 1.

RNC - Receive Enable Control

0: Upon completion of reception of one frame, the E-DMAC writes
the receive status to the descriptor and clears the RR bit in
EDRRR to 0.

1: Upon completion of reception of one frame, the E-DMAC writes
(writes back) the receive status to the descriptor. In addition,
the E-DMAC reads the next descriptor and prepares for reception
of the next frame.

In addition, for get more stable when receiving packets, I set
maximum size for the transmit/receive FIFO and inserts padding
in receive data.

Signed-off-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
---
 drivers/net/ethernet/renesas/sh_eth.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

Simon Horman Oct. 9, 2013, 4:28 a.m. UTC | #1
On Mon, Oct 07, 2013 at 03:29:25PM +0900, Nguyen Hong Ky wrote:
> This patch will fix RX packets errors when receiving big size
> of data by set bit RNC = 1.
> 
> RNC - Receive Enable Control
> 
> 0: Upon completion of reception of one frame, the E-DMAC writes
> the receive status to the descriptor and clears the RR bit in
> EDRRR to 0.
> 
> 1: Upon completion of reception of one frame, the E-DMAC writes
> (writes back) the receive status to the descriptor. In addition,
> the E-DMAC reads the next descriptor and prepares for reception
> of the next frame.
> 
> In addition, for get more stable when receiving packets, I set
> maximum size for the transmit/receive FIFO and inserts padding
> in receive data.
> 
> Signed-off-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>

I realise that this patch has been applied but regardless
I would like to acknowledge that it resolve a problem that
I observed this afternoon.

Without this patch I see the following on the console, many times:

net eth0: Receive FIFO Overflow

With this patch I do not see the warning message at all.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Oct. 9, 2013, 5:26 a.m. UTC | #2
On Wed, Oct 09, 2013 at 01:28:26PM +0900, Simon Horman wrote:
> On Mon, Oct 07, 2013 at 03:29:25PM +0900, Nguyen Hong Ky wrote:
> > This patch will fix RX packets errors when receiving big size
> > of data by set bit RNC = 1.
> > 
> > RNC - Receive Enable Control
> > 
> > 0: Upon completion of reception of one frame, the E-DMAC writes
> > the receive status to the descriptor and clears the RR bit in
> > EDRRR to 0.
> > 
> > 1: Upon completion of reception of one frame, the E-DMAC writes
> > (writes back) the receive status to the descriptor. In addition,
> > the E-DMAC reads the next descriptor and prepares for reception
> > of the next frame.
> > 
> > In addition, for get more stable when receiving packets, I set
> > maximum size for the transmit/receive FIFO and inserts padding
> > in receive data.
> > 
> > Signed-off-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
> 
> I realise that this patch has been applied but regardless
> I would like to acknowledge that it resolve a problem that
> I observed this afternoon.
> 
> Without this patch I see the following on the console, many times:
> 
> net eth0: Receive FIFO Overflow
> 
> With this patch I do not see the warning message at all.

Scratch that, I am still seeing the messages with this patch applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nguyen Hong Ky Oct. 9, 2013, 5:38 a.m. UTC | #3
On Wed, Oct 9, 2013 at 2:26 PM, Simon Horman <horms@verge.net.au> wrote:
> On Wed, Oct 09, 2013 at 01:28:26PM +0900, Simon Horman wrote:
>> On Mon, Oct 07, 2013 at 03:29:25PM +0900, Nguyen Hong Ky wrote:
>> > This patch will fix RX packets errors when receiving big size
>> > of data by set bit RNC = 1.
>> >
>> > RNC - Receive Enable Control
>> >
>> > 0: Upon completion of reception of one frame, the E-DMAC writes
>> > the receive status to the descriptor and clears the RR bit in
>> > EDRRR to 0.
>> >
>> > 1: Upon completion of reception of one frame, the E-DMAC writes
>> > (writes back) the receive status to the descriptor. In addition,
>> > the E-DMAC reads the next descriptor and prepares for reception
>> > of the next frame.
>> >
>> > In addition, for get more stable when receiving packets, I set
>> > maximum size for the transmit/receive FIFO and inserts padding
>> > in receive data.
>> >
>> > Signed-off-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
>>
>> I realise that this patch has been applied but regardless
>> I would like to acknowledge that it resolve a problem that
>> I observed this afternoon.
>>
>> Without this patch I see the following on the console, many times:
>>
>> net eth0: Receive FIFO Overflow
>>
>> With this patch I do not see the warning message at all.
>
> Scratch that, I am still seeing the messages with this patch applied.
>

Would you please confirm that it was patched in below function:

static struct sh_eth_cpu_data r8a7740_data = {...}

Thanks for your help,
Nguyen Hong Ky
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Oct. 10, 2013, 5:29 a.m. UTC | #4
On Wed, Oct 09, 2013 at 02:38:17PM +0900, Nguyen Hong Ky wrote:
> On Wed, Oct 9, 2013 at 2:26 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Wed, Oct 09, 2013 at 01:28:26PM +0900, Simon Horman wrote:
> >> On Mon, Oct 07, 2013 at 03:29:25PM +0900, Nguyen Hong Ky wrote:
> >> > This patch will fix RX packets errors when receiving big size
> >> > of data by set bit RNC = 1.
> >> >
> >> > RNC - Receive Enable Control
> >> >
> >> > 0: Upon completion of reception of one frame, the E-DMAC writes
> >> > the receive status to the descriptor and clears the RR bit in
> >> > EDRRR to 0.
> >> >
> >> > 1: Upon completion of reception of one frame, the E-DMAC writes
> >> > (writes back) the receive status to the descriptor. In addition,
> >> > the E-DMAC reads the next descriptor and prepares for reception
> >> > of the next frame.
> >> >
> >> > In addition, for get more stable when receiving packets, I set
> >> > maximum size for the transmit/receive FIFO and inserts padding
> >> > in receive data.
> >> >
> >> > Signed-off-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
> >>
> >> I realise that this patch has been applied but regardless
> >> I would like to acknowledge that it resolve a problem that
> >> I observed this afternoon.
> >>
> >> Without this patch I see the following on the console, many times:
> >>
> >> net eth0: Receive FIFO Overflow
> >>
> >> With this patch I do not see the warning message at all.
> >
> > Scratch that, I am still seeing the messages with this patch applied.
> >
> 
> Would you please confirm that it was patched in below function:
> 
> static struct sh_eth_cpu_data r8a7740_data = {...}

Thanks Ky-san.

I am seeing the problem on next-next
ba53742 ("tcp: use ACCESS_ONCE() in tcp_update_pacing_rate()")
which includes this patch.

However, it seems that the patch was applied to
sh7734_data instead of r8a7740_data.

I moved the changes from sh7734_data to r8a7740_data
and the FIFO Overflow messages seem to have disappeared.

I will post a patch to move things around accordingly.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Oct. 12, 2013, 4:58 p.m. UTC | #5
Hello.

On 07-10-2013 8:29, Nguyen Hong Ky wrote:

> This patch will fix RX packets errors when receiving big size
> of data by set bit RNC = 1.

> RNC - Receive Enable Control

> 0: Upon completion of reception of one frame, the E-DMAC writes
> the receive status to the descriptor and clears the RR bit in
> EDRRR to 0.

> 1: Upon completion of reception of one frame, the E-DMAC writes
> (writes back) the receive status to the descriptor. In addition,
> the E-DMAC reads the next descriptor and prepares for reception
> of the next frame.

> In addition, for get more stable when receiving packets, I set
> maximum size for the transmit/receive FIFO and inserts padding
> in receive data.

> Signed-off-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
> ---
>   drivers/net/ethernet/renesas/sh_eth.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)

> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index a753928..11d34f0 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -649,12 +649,16 @@ static struct sh_eth_cpu_data r8a7740_data = {
>   	.eesr_err_check	= EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT |
>   			  EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE |
>   			  EESR_TDE | EESR_ECI,
> +	.fdr_value	= 0x0000070f,
> +	.rmcr_value	= 0x00000001,
>
>   	.apr		= 1,
>   	.mpr		= 1,
>   	.tpauser	= 1,
>   	.bculr		= 1,
>   	.hw_swap	= 1,
> +	.rpadir		= 1,
> +	.rpadir_value   = 2 << 16,
>   	.no_trimd	= 1,
>   	.no_ade		= 1,
>   	.tsu		= 1,

    Guennadi, could you check if this patch fixes your issue with NFS. Make 
sure it applies to 'r8a7740_data' (it was misapplied to DaveM's tree).

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Guennadi Liakhovetski Oct. 15, 2013, 7:28 a.m. UTC | #6
Hi Sergei

On Sat, 12 Oct 2013, Sergei Shtylyov wrote:

> Hello.
> 
> On 07-10-2013 8:29, Nguyen Hong Ky wrote:
> 
> > This patch will fix RX packets errors when receiving big size
> > of data by set bit RNC = 1.
> 
> > RNC - Receive Enable Control
> 
> > 0: Upon completion of reception of one frame, the E-DMAC writes
> > the receive status to the descriptor and clears the RR bit in
> > EDRRR to 0.
> 
> > 1: Upon completion of reception of one frame, the E-DMAC writes
> > (writes back) the receive status to the descriptor. In addition,
> > the E-DMAC reads the next descriptor and prepares for reception
> > of the next frame.
> 
> > In addition, for get more stable when receiving packets, I set
> > maximum size for the transmit/receive FIFO and inserts padding
> > in receive data.
> 
> > Signed-off-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
> > ---
> >   drivers/net/ethernet/renesas/sh_eth.c |    4 ++++
> >   1 files changed, 4 insertions(+), 0 deletions(-)
> 
> > diff --git a/drivers/net/ethernet/renesas/sh_eth.c
> > b/drivers/net/ethernet/renesas/sh_eth.c
> > index a753928..11d34f0 100644
> > --- a/drivers/net/ethernet/renesas/sh_eth.c
> > +++ b/drivers/net/ethernet/renesas/sh_eth.c
> > @@ -649,12 +649,16 @@ static struct sh_eth_cpu_data r8a7740_data = {
> >   	.eesr_err_check	= EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT |
> >   			  EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE |
> >   			  EESR_TDE | EESR_ECI,
> > +	.fdr_value	= 0x0000070f,
> > +	.rmcr_value	= 0x00000001,
> > 
> >   	.apr		= 1,
> >   	.mpr		= 1,
> >   	.tpauser	= 1,
> >   	.bculr		= 1,
> >   	.hw_swap	= 1,
> > +	.rpadir		= 1,
> > +	.rpadir_value   = 2 << 16,
> >   	.no_trimd	= 1,
> >   	.no_ade		= 1,
> >   	.tsu		= 1,
> 
>    Guennadi, could you check if this patch fixes your issue with NFS. Make
> sure it applies to 'r8a7740_data' (it was misapplied to DaveM's tree).

Yes, the current -next, which includes this patch (in a slightly different 
form) boots fine over NFS for me.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Oct. 15, 2013, 9:48 p.m. UTC | #7
Hello.

On 10/15/2013 11:28 AM, Guennadi Liakhovetski wrote:

>>> This patch will fix RX packets errors when receiving big size
>>> of data by set bit RNC = 1.

>>> RNC - Receive Enable Control

>>> 0: Upon completion of reception of one frame, the E-DMAC writes
>>> the receive status to the descriptor and clears the RR bit in
>>> EDRRR to 0.

>>> 1: Upon completion of reception of one frame, the E-DMAC writes
>>> (writes back) the receive status to the descriptor. In addition,
>>> the E-DMAC reads the next descriptor and prepares for reception
>>> of the next frame.

>>> In addition, for get more stable when receiving packets, I set
>>> maximum size for the transmit/receive FIFO and inserts padding
>>> in receive data.

>>> Signed-off-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
>>> ---
>>>    drivers/net/ethernet/renesas/sh_eth.c |    4 ++++
>>>    1 files changed, 4 insertions(+), 0 deletions(-)

>>> diff --git a/drivers/net/ethernet/renesas/sh_eth.c
>>> b/drivers/net/ethernet/renesas/sh_eth.c
>>> index a753928..11d34f0 100644
>>> --- a/drivers/net/ethernet/renesas/sh_eth.c
>>> +++ b/drivers/net/ethernet/renesas/sh_eth.c
>>> @@ -649,12 +649,16 @@ static struct sh_eth_cpu_data r8a7740_data = {
>>>    	.eesr_err_check	= EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT |
>>>    			  EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE |
>>>    			  EESR_TDE | EESR_ECI,
>>> +	.fdr_value	= 0x0000070f,
>>> +	.rmcr_value	= 0x00000001,
>>>
>>>    	.apr		= 1,
>>>    	.mpr		= 1,
>>>    	.tpauser	= 1,
>>>    	.bculr		= 1,
>>>    	.hw_swap	= 1,
>>> +	.rpadir		= 1,
>>> +	.rpadir_value   = 2 << 16,
>>>    	.no_trimd	= 1,
>>>    	.no_ade		= 1,
>>>    	.tsu		= 1,

>>     Guennadi, could you check if this patch fixes your issue with NFS. Make
>> sure it applies to 'r8a7740_data' (it was misapplied to DaveM's tree).

> Yes, the current -next, which includes this patch (in a slightly different
> form) boots fine over NFS for me.

    I don't know what you mean by "slightly different form" exactly. Also, I 
was unable to locate the fresh -next tree. 'net-next.git' contains this patch 
in a mismerged form, 'net.git' has Simon's patch that corrects this mismerge.

> Thanks
> Guennadi

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Guennadi Liakhovetski Oct. 16, 2013, 5:37 a.m. UTC | #8
On Wed, 16 Oct 2013, Sergei Shtylyov wrote:

> Hello.
> 
> On 10/15/2013 11:28 AM, Guennadi Liakhovetski wrote:
> 
> > > > This patch will fix RX packets errors when receiving big size
> > > > of data by set bit RNC = 1.
> 
> > > > RNC - Receive Enable Control
> 
> > > > 0: Upon completion of reception of one frame, the E-DMAC writes
> > > > the receive status to the descriptor and clears the RR bit in
> > > > EDRRR to 0.
> 
> > > > 1: Upon completion of reception of one frame, the E-DMAC writes
> > > > (writes back) the receive status to the descriptor. In addition,
> > > > the E-DMAC reads the next descriptor and prepares for reception
> > > > of the next frame.
> 
> > > > In addition, for get more stable when receiving packets, I set
> > > > maximum size for the transmit/receive FIFO and inserts padding
> > > > in receive data.
> 
> > > > Signed-off-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
> > > > ---
> > > >    drivers/net/ethernet/renesas/sh_eth.c |    4 ++++
> > > >    1 files changed, 4 insertions(+), 0 deletions(-)
> 
> > > > diff --git a/drivers/net/ethernet/renesas/sh_eth.c
> > > > b/drivers/net/ethernet/renesas/sh_eth.c
> > > > index a753928..11d34f0 100644
> > > > --- a/drivers/net/ethernet/renesas/sh_eth.c
> > > > +++ b/drivers/net/ethernet/renesas/sh_eth.c
> > > > @@ -649,12 +649,16 @@ static struct sh_eth_cpu_data r8a7740_data = {
> > > >    	.eesr_err_check	= EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT
> > > > |
> > > >    			  EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE
> > > > |
> > > >    			  EESR_TDE | EESR_ECI,
> > > > +	.fdr_value	= 0x0000070f,
> > > > +	.rmcr_value	= 0x00000001,
> > > > 
> > > >    	.apr		= 1,
> > > >    	.mpr		= 1,
> > > >    	.tpauser	= 1,
> > > >    	.bculr		= 1,
> > > >    	.hw_swap	= 1,
> > > > +	.rpadir		= 1,
> > > > +	.rpadir_value   = 2 << 16,
> > > >    	.no_trimd	= 1,
> > > >    	.no_ade		= 1,
> > > >    	.tsu		= 1,
> 
> > >     Guennadi, could you check if this patch fixes your issue with NFS.
> > > Make
> > > sure it applies to 'r8a7740_data' (it was misapplied to DaveM's tree).
> 
> > Yes, the current -next, which includes this patch (in a slightly different
> > form) boots fine over NFS for me.
> 
>    I don't know what you mean by "slightly different form" exactly. Also, I
> was unable to locate the fresh -next tree.

git://gitorious.org/thierryreding/linux-next.git

> 'net-next.git' contains this patch
> in a mismerged form, 'net.git' has Simon's patch that corrects this mismerge.
> 
> > Thanks
> > Guennadi
> 
> WBR, Sergei
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index a753928..11d34f0 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -649,12 +649,16 @@  static struct sh_eth_cpu_data r8a7740_data = {
 	.eesr_err_check	= EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT |
 			  EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE |
 			  EESR_TDE | EESR_ECI,
+	.fdr_value	= 0x0000070f,
+	.rmcr_value	= 0x00000001,
 
 	.apr		= 1,
 	.mpr		= 1,
 	.tpauser	= 1,
 	.bculr		= 1,
 	.hw_swap	= 1,
+	.rpadir		= 1,
+	.rpadir_value   = 2 << 16,
 	.no_trimd	= 1,
 	.no_ade		= 1,
 	.tsu		= 1,