All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Permanent Fix for RK33 gmac 1500 mtu bug
@ 2019-12-12 13:21 Peter Geis
       [not found] ` <CAMdYzYpHxMELdB4HzsViFvrLcDzG0A4000PJU6wHTaq4V9c1Nw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Geis @ 2019-12-12 13:21 UTC (permalink / raw)
  To: open list:ARM/Rockchip SoC...

Good Morning,

So I've continued work on fixing the rk3328/rk3399 gmac mtu tx coe offload bug.
I've found two fixes that maintain full performance and work consistently.

First, is ayufan's tx coe patch [0], which takes the bugged_jumbo
concept introduced in [1] and applies it to 1498 and above, vice 1500
and above.

The only downside is this disables tx coe for full size packets, which
has a negligible performance impact in my testing.

The other option I've found that reliably works is bringing the mtu
down to 1498.
This allows tx coe to remain enabled, but with the downside of total
loss of jumbo frames.
The reduction in size has a negligible performance impact in my testing.

I have also discovered that the rockchip implementation of the stmmac
driver does not process flags such as max-frame-size.

A third option, which I haven't explored because I don't know enough
about how it works, is possibly tuning the axi settings, via the
snps,axi-config and snps,mtl-tx-config handles.
I don't know if this is feasible, but since tuning the dma settings
affects the rk3328 I have hope.
I do know that my current fix for the rk3328 does not provide full
performance and does not work at all on the rk3399.

Thoughts?

[0] https://github.com/ayufan-rock64/linux-kernel/commit/8a41c672dd77e48b06c1b2dec3aa9db4bad30b49#diff-c897c0b53bd633240f4b12c4d29a5ff1
[1] https://github.com/torvalds/linux/commit/ebbb293f8b3021ae2009fcb7cb3b8a52fb5fd06a

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Permanent Fix for RK33 gmac 1500 mtu bug
       [not found] ` <CAMdYzYpHxMELdB4HzsViFvrLcDzG0A4000PJU6wHTaq4V9c1Nw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-12-13 12:48   ` Peter Geis
       [not found]     ` <CAMdYzYo6HG+NK2BHNaULtD=Lu=Ozd6pFW4YRXF8QF_UGLjJN_w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Geis @ 2019-12-13 12:48 UTC (permalink / raw)
  To: open list:ARM/Rockchip SoC...

On Thu, Dec 12, 2019 at 8:21 AM Peter Geis <pgwipeout-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> Good Morning,
>
> So I've continued work on fixing the rk3328/rk3399 gmac mtu tx coe offload bug.
> I've found two fixes that maintain full performance and work consistently.
>
> First, is ayufan's tx coe patch [0], which takes the bugged_jumbo
> concept introduced in [1] and applies it to 1498 and above, vice 1500
> and above.
>
> The only downside is this disables tx coe for full size packets, which
> has a negligible performance impact in my testing.
>
> The other option I've found that reliably works is bringing the mtu
> down to 1498.
> This allows tx coe to remain enabled, but with the downside of total
> loss of jumbo frames.
> The reduction in size has a negligible performance impact in my testing.

Shortly after sending this I discovered that setting the mtu lower is
not sufficient in some corner cases.
I managed to make offload break even at a 1496 mtu by `apt install
kubuntu-desktop` over ssh on a gigabit internet connection.

After porting ayufan's patch the issue went away.
So unless we can fix this by axi tuning, his patch seems to be the
most viable option.

>
> I have also discovered that the rockchip implementation of the stmmac
> driver does not process flags such as max-frame-size.
>
> A third option, which I haven't explored because I don't know enough
> about how it works, is possibly tuning the axi settings, via the
> snps,axi-config and snps,mtl-tx-config handles.
> I don't know if this is feasible, but since tuning the dma settings
> affects the rk3328 I have hope.
> I do know that my current fix for the rk3328 does not provide full
> performance and does not work at all on the rk3399.
>
> Thoughts?
>
> [0] https://github.com/ayufan-rock64/linux-kernel/commit/8a41c672dd77e48b06c1b2dec3aa9db4bad30b49#diff-c897c0b53bd633240f4b12c4d29a5ff1
> [1] https://github.com/torvalds/linux/commit/ebbb293f8b3021ae2009fcb7cb3b8a52fb5fd06a

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Permanent Fix for RK33 gmac 1500 mtu bug
       [not found]     ` <CAMdYzYo6HG+NK2BHNaULtD=Lu=Ozd6pFW4YRXF8QF_UGLjJN_w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-12-14 14:30       ` Hugh Cole-Baker
       [not found]         ` <E3092315-8D1F-4A43-B485-02D526F57B21-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Hugh Cole-Baker @ 2019-12-14 14:30 UTC (permalink / raw)
  To: Peter Geis; +Cc: open list:ARM/Rockchip SoC...

Hi Peter,

> On 13 Dec 2019, at 12:48, Peter Geis <pgwipeout-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> On Thu, Dec 12, 2019 at 8:21 AM Peter Geis <pgwipeout-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> 
>> Good Morning,
>> 
>> So I've continued work on fixing the rk3328/rk3399 gmac mtu tx coe offload bug.
>> I've found two fixes that maintain full performance and work consistently.
>> 
>> First, is ayufan's tx coe patch [0], which takes the bugged_jumbo
>> concept introduced in [1] and applies it to 1498 and above, vice 1500
>> and above.
>> 
>> The only downside is this disables tx coe for full size packets, which
>> has a negligible performance impact in my testing.
>> 
>> The other option I've found that reliably works is bringing the mtu
>> down to 1498.
>> This allows tx coe to remain enabled, but with the downside of total
>> loss of jumbo frames.
>> The reduction in size has a negligible performance impact in my testing.
> 
> Shortly after sending this I discovered that setting the mtu lower is
> not sufficient in some corner cases.
> I managed to make offload break even at a 1496 mtu by `apt install
> kubuntu-desktop` over ssh on a gigabit internet connection.
> 
> After porting ayufan's patch the issue went away.
> So unless we can fix this by axi tuning, his patch seems to be the
> most viable option.
> 

Have you tried suggestions from Jose in https://lkml.org/lkml/2019/4/1/1382?
I've added "snps,no-pbl-x8;" and "snps,txpbl = <0x20>;" to the
gmac in the DT, on rk3399-rockpro64. This seems to fix the slow performance
on IPv6 specifically that I was seeing.

I haven't done exhaustive testing beyond a few runs of iperf3, which seem
to show OK performance for a gigabit link on home networking hardware.
874 Mbits/sec for IPv4, 856 Mbits/sec for IPv6, with MTU 1500.

>> 
>> 
>> I have also discovered that the rockchip implementation of the stmmac
>> driver does not process flags such as max-frame-size.
>> 
>> A third option, which I haven't explored because I don't know enough
>> about how it works, is possibly tuning the axi settings, via the
>> snps,axi-config and snps,mtl-tx-config handles.
>> I don't know if this is feasible, but since tuning the dma settings
>> affects the rk3328 I have hope.
>> I do know that my current fix for the rk3328 does not provide full
>> performance and does not work at all on the rk3399.
>> 
>> Thoughts?
>> 
>> [0] https://github.com/ayufan-rock64/linux-kernel/commit/8a41c672dd77e48b06c1b2dec3aa9db4bad30b49#diff-c897c0b53bd633240f4b12c4d29a5ff1
>> [1] https://github.com/torvalds/linux/commit/ebbb293f8b3021ae2009fcb7cb3b8a52fb5fd06a
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Permanent Fix for RK33 gmac 1500 mtu bug
       [not found]         ` <E3092315-8D1F-4A43-B485-02D526F57B21-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2019-12-18 13:54           ` Peter Geis
       [not found]             ` <CAMdYzYordu8S4S9nT=af4SeuLq-nvUT12XN9TgE=EbSYo4=81A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Geis @ 2019-12-18 13:54 UTC (permalink / raw)
  To: Hugh Cole-Baker; +Cc: open list:ARM/Rockchip SoC...

On Sat, Dec 14, 2019 at 9:30 AM Hugh Cole-Baker <sigmaris-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> Hi Peter,
>
> > On 13 Dec 2019, at 12:48, Peter Geis <pgwipeout-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> > On Thu, Dec 12, 2019 at 8:21 AM Peter Geis <pgwipeout-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >>
> >> Good Morning,
> >>
> >> So I've continued work on fixing the rk3328/rk3399 gmac mtu tx coe offload bug.
> >> I've found two fixes that maintain full performance and work consistently.
> >>
> >> First, is ayufan's tx coe patch [0], which takes the bugged_jumbo
> >> concept introduced in [1] and applies it to 1498 and above, vice 1500
> >> and above.
> >>
> >> The only downside is this disables tx coe for full size packets, which
> >> has a negligible performance impact in my testing.
> >>
> >> The other option I've found that reliably works is bringing the mtu
> >> down to 1498.
> >> This allows tx coe to remain enabled, but with the downside of total
> >> loss of jumbo frames.
> >> The reduction in size has a negligible performance impact in my testing.
> >
> > Shortly after sending this I discovered that setting the mtu lower is
> > not sufficient in some corner cases.
> > I managed to make offload break even at a 1496 mtu by `apt install
> > kubuntu-desktop` over ssh on a gigabit internet connection.
> >
> > After porting ayufan's patch the issue went away.
> > So unless we can fix this by axi tuning, his patch seems to be the
> > most viable option.
> >
>
> Have you tried suggestions from Jose in https://lkml.org/lkml/2019/4/1/1382?
> I've added "snps,no-pbl-x8;" and "snps,txpbl = <0x20>;" to the
> gmac in the DT, on rk3399-rockpro64. This seems to fix the slow performance
> on IPv6 specifically that I was seeing.
>
> I haven't done exhaustive testing beyond a few runs of iperf3, which seem
> to show OK performance for a gigabit link on home networking hardware.
> 874 Mbits/sec for IPv4, 856 Mbits/sec for IPv6, with MTU 1500.

I'll test this out as well.
Unfortunately I didn't catch that reducing the mtu size would break
under heavy load because I was using iperf3 to test.
It wasn't until I did a massive apt upgrade over ssh did it trigger.

I don't experience any difference between ipv4 and ipv6, both work equally well.
With ayufan's selective coe offload disable patch, I'm hitting about
960Mbits/sec on iperf3.

For clarification sake, this is on 5.4.
>
> >>
> >>
> >> I have also discovered that the rockchip implementation of the stmmac
> >> driver does not process flags such as max-frame-size.
> >>
> >> A third option, which I haven't explored because I don't know enough
> >> about how it works, is possibly tuning the axi settings, via the
> >> snps,axi-config and snps,mtl-tx-config handles.
> >> I don't know if this is feasible, but since tuning the dma settings
> >> affects the rk3328 I have hope.
> >> I do know that my current fix for the rk3328 does not provide full
> >> performance and does not work at all on the rk3399.
> >>
> >> Thoughts?
> >>
> >> [0] https://github.com/ayufan-rock64/linux-kernel/commit/8a41c672dd77e48b06c1b2dec3aa9db4bad30b49#diff-c897c0b53bd633240f4b12c4d29a5ff1
> >> [1] https://github.com/torvalds/linux/commit/ebbb293f8b3021ae2009fcb7cb3b8a52fb5fd06a
> >
> > _______________________________________________
> > Linux-rockchip mailing list
> > Linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> > http://lists.infradead.org/mailman/listinfo/linux-rockchip
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Permanent Fix for RK33 gmac 1500 mtu bug
       [not found]             ` <CAMdYzYordu8S4S9nT=af4SeuLq-nvUT12XN9TgE=EbSYo4=81A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-01-10 19:36               ` Peter Geis
       [not found]                 ` <CAMdYzYokRUXRQiZ8d0QxvmT9KZkypZfNpQUbzWovx+WzKu_OFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Geis @ 2020-01-10 19:36 UTC (permalink / raw)
  To: Hugh Cole-Baker; +Cc: open list:ARM/Rockchip SoC...

<snip>

Good Afternoon,

There has been significant code dumped in to 5.4.x by Jose Abreu
<Jose.Abreu-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>.
Today I clean built 5.4.10 and it seems at least on the rk3399 our tx
offload issue is resolved.

I'm currently load testing, but if a few others would be willing to
test as well it would be greatly appreciated.

Happy New Year!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Permanent Fix for RK33 gmac 1500 mtu bug
       [not found]                 ` <CAMdYzYokRUXRQiZ8d0QxvmT9KZkypZfNpQUbzWovx+WzKu_OFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-01-12 13:41                   ` Peter Geis
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Geis @ 2020-01-12 13:41 UTC (permalink / raw)
  To: Hugh Cole-Baker; +Cc: open list:ARM/Rockchip SoC...

On Fri, Jan 10, 2020 at 2:36 PM Peter Geis <pgwipeout-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> <snip>
>
> Good Afternoon,
>
> There has been significant code dumped in to 5.4.x by Jose Abreu
> <Jose.Abreu-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>.
> Today I clean built 5.4.10 and it seems at least on the rk3399 our tx
> offload issue is resolved.

Just a note, you'll need to cherry pick the following commit,
otherwise ethernet is broken on 5.4.10
commit 42ed6e2fa9f167ce8197a41ebcf8974c4d90f9d4 (HEAD -> rk3399-rockpro64)
Author: Jose Abreu <Jose.Abreu-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
Date:   Tue Jan 7 13:35:42 2020 +0100

    net: stmmac: Fixed link does not need MDIO Bus

>
> I'm currently load testing, but if a few others would be willing to
> test as well it would be greatly appreciated.
>
> Happy New Year!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-12 13:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-12 13:21 [RFC] Permanent Fix for RK33 gmac 1500 mtu bug Peter Geis
     [not found] ` <CAMdYzYpHxMELdB4HzsViFvrLcDzG0A4000PJU6wHTaq4V9c1Nw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-12-13 12:48   ` Peter Geis
     [not found]     ` <CAMdYzYo6HG+NK2BHNaULtD=Lu=Ozd6pFW4YRXF8QF_UGLjJN_w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-12-14 14:30       ` Hugh Cole-Baker
     [not found]         ` <E3092315-8D1F-4A43-B485-02D526F57B21-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-12-18 13:54           ` Peter Geis
     [not found]             ` <CAMdYzYordu8S4S9nT=af4SeuLq-nvUT12XN9TgE=EbSYo4=81A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-01-10 19:36               ` Peter Geis
     [not found]                 ` <CAMdYzYokRUXRQiZ8d0QxvmT9KZkypZfNpQUbzWovx+WzKu_OFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-01-12 13:41                   ` Peter Geis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.