linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: colibri-imx7: fix ethernet performance
@ 2020-01-16 10:13 Oleksandr Suvorov
  2020-01-16 11:35 ` Lucas Stach
  0 siblings, 1 reply; 3+ messages in thread
From: Oleksandr Suvorov @ 2020-01-16 10:13 UTC (permalink / raw)
  To: linux-next
  Cc: Igor Opanyuk, Marcel Ziswiler, Oleksandr Suvorov, Fabio Estevam,
	Mark Rutland, NXP Linux Team, Pengutronix Kernel Team,
	Rob Herring, Sascha Hauer, Shawn Guo, devicetree,
	linux-arm-kernel, linux-kernel

Performance test of ethernet interface shows extremely low result:

=== w/o fix =================
Connecting to host 192.168.x.x, port 5201
[  5] local 192.168.x.y port59020 connected to 192.168.x.x port 5201
...
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  2.78 MBytes  2.33 Mbits/sec  337      sender
[  5]   0.00-10.00  sec  2.66 MBytes  2.23 Mbits/sec           receiver
=============================

Adding correct settings of the mdio bus with the respective phy
fixes this issue.

=== after fix ===============
iperf3 -c 192.168.x.x
Connecting to host 192.168.x.x, port 5201
[  5] local 192.168.x.y port 50702 connected to 192.168.x.x port 5201
...
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   114 MBytes  95.4 Mbits/sec   56      sender
[  5]   0.00-10.00  sec   112 MBytes  94.1 Mbits/sec           receiver
=============================

Fixed: commit b326629f25b7 ("ARM: dts: imx7: add Toradex Colibri
                    iMX7S/iMX7D support")
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

---

 arch/arm/boot/dts/imx7-colibri.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi b/arch/arm/boot/dts/imx7-colibri.dtsi
index d05be3f0e2a7..7b6a7c124345 100644
--- a/arch/arm/boot/dts/imx7-colibri.dtsi
+++ b/arch/arm/boot/dts/imx7-colibri.dtsi
@@ -115,7 +115,20 @@ &fec1 {
 	assigned-clock-rates = <0>, <100000000>;
 	phy-mode = "rmii";
 	phy-supply = <&reg_LDO1>;
+	phy-handle = <&ethphy0>;
 	fsl,magic-packet;
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethphy0: ethernet-phy@0 {
+			compatible = "ethernet-phy-ieee802.3-c22";
+			max-speed = <100>;
+			micrel,led-mode = <0>;
+			reg = <0>;
+		};
+	};
 };
 
 &flexcan1 {
-- 
2.24.1


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

* Re: [PATCH] ARM: dts: colibri-imx7: fix ethernet performance
  2020-01-16 10:13 [PATCH] ARM: dts: colibri-imx7: fix ethernet performance Oleksandr Suvorov
@ 2020-01-16 11:35 ` Lucas Stach
  2020-01-17 19:25   ` Oleksandr Suvorov
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas Stach @ 2020-01-16 11:35 UTC (permalink / raw)
  To: Oleksandr Suvorov, linux-next
  Cc: Mark Rutland, devicetree, Marcel Ziswiler, Shawn Guo,
	Sascha Hauer, linux-kernel, Igor Opanyuk, Rob Herring,
	NXP Linux Team, Pengutronix Kernel Team, Fabio Estevam,
	linux-arm-kernel

On Do, 2020-01-16 at 10:13 +0000, Oleksandr Suvorov wrote:
> Performance test of ethernet interface shows extremely low result:
> 
> === w/o fix =================
> Connecting to host 192.168.x.x, port 5201
> [  5] local 192.168.x.y port59020 connected to 192.168.x.x port 5201
> ...
> [ ID] Interval           Transfer     Bitrate         Retr
> [  5]   0.00-10.00  sec  2.78 MBytes  2.33 Mbits/sec  337      sender
> [  5]   0.00-10.00  sec  2.66 MBytes  2.23
> Mbits/sec           receiver
> =============================
> 
> Adding correct settings of the mdio bus with the respective phy
> fixes this issue.

So what's the actual issue being fixed here? High packet loss due to
trying to force GBit speeds through 100MBit magnetics? So the addition
of "max-speed = <100>;" is the real core of the fix?

The commit log should mention this.

Regards,
Lucas

> 
> === after fix ===============
> iperf3 -c 192.168.x.x
> Connecting to host 192.168.x.x, port 5201
> [  5] local 192.168.x.y port 50702 connected to 192.168.x.x port 5201
> ...
> [ ID] Interval           Transfer     Bitrate         Retr
> [  5]   0.00-10.00  sec   114 MBytes  95.4 Mbits/sec   56      sender
> [  5]   0.00-10.00  sec   112 MBytes  94.1
> Mbits/sec           receiver
> =============================
> 
> Fixed: commit b326629f25b7 ("ARM: dts: imx7: add Toradex Colibri
>                     iMX7S/iMX7D support")
> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> 
> ---
> 
>  arch/arm/boot/dts/imx7-colibri.dtsi | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi
> b/arch/arm/boot/dts/imx7-colibri.dtsi
> index d05be3f0e2a7..7b6a7c124345 100644
> --- a/arch/arm/boot/dts/imx7-colibri.dtsi
> +++ b/arch/arm/boot/dts/imx7-colibri.dtsi
> @@ -115,7 +115,20 @@ &fec1 {
>  	assigned-clock-rates = <0>, <100000000>;
>  	phy-mode = "rmii";
>  	phy-supply = <&reg_LDO1>;
> +	phy-handle = <&ethphy0>;
>  	fsl,magic-packet;
> +
> +	mdio {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		ethphy0: ethernet-phy@0 {
> +			compatible = "ethernet-phy-ieee802.3-c22";
> +			max-speed = <100>;
> +			micrel,led-mode = <0>;
> +			reg = <0>;
> +		};
> +	};
>  };
>  
>  &flexcan1 {


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

* Re: [PATCH] ARM: dts: colibri-imx7: fix ethernet performance
  2020-01-16 11:35 ` Lucas Stach
@ 2020-01-17 19:25   ` Oleksandr Suvorov
  0 siblings, 0 replies; 3+ messages in thread
From: Oleksandr Suvorov @ 2020-01-17 19:25 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Oleksandr Suvorov, linux-next, Mark Rutland, devicetree,
	Marcel Ziswiler, Shawn Guo, Sascha Hauer, linux-kernel,
	Igor Opanyuk, Rob Herring, NXP Linux Team,
	Pengutronix Kernel Team, Fabio Estevam, linux-arm-kernel

2mntnrs: please ignore this patchset.

On Thu, Jan 16, 2020 at 1:35 PM Lucas Stach <l.stach@pengutronix.de> wrote:
>
> On Do, 2020-01-16 at 10:13 +0000, Oleksandr Suvorov wrote:
> > Performance test of ethernet interface shows extremely low result:
> >
> > === w/o fix =================
> > Connecting to host 192.168.x.x, port 5201
> > [  5] local 192.168.x.y port59020 connected to 192.168.x.x port 5201
> > ...
> > [ ID] Interval           Transfer     Bitrate         Retr
> > [  5]   0.00-10.00  sec  2.78 MBytes  2.33 Mbits/sec  337      sender
> > [  5]   0.00-10.00  sec  2.66 MBytes  2.23
> > Mbits/sec           receiver
> > =============================
> >
> > Adding correct settings of the mdio bus with the respective phy
> > fixes this issue.
>
> So what's the actual issue being fixed here? High packet loss due to
> trying to force GBit speeds through 100MBit magnetics? So the addition
> of "max-speed = <100>;" is the real core of the fix?

Lucas, max-speed is not the core of this fix, actually, Micrel 8041 is
a 10/100 phy only.
But thank you for paying attention to this patchset. This is just a
part of a fix,
and it was mistakenly posted partially and with messed commit log.
I'll resend a complete solution when it is ready and retested again.

> The commit log should mention this.
>
> Regards,
> Lucas
>
> >
> > === after fix ===============
> > iperf3 -c 192.168.x.x
> > Connecting to host 192.168.x.x, port 5201
> > [  5] local 192.168.x.y port 50702 connected to 192.168.x.x port 5201
> > ...
> > [ ID] Interval           Transfer     Bitrate         Retr
> > [  5]   0.00-10.00  sec   114 MBytes  95.4 Mbits/sec   56      sender
> > [  5]   0.00-10.00  sec   112 MBytes  94.1
> > Mbits/sec           receiver
> > =============================
> >
> > Fixed: commit b326629f25b7 ("ARM: dts: imx7: add Toradex Colibri
> >                     iMX7S/iMX7D support")
> > Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> > Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> >
> > ---
> >
> >  arch/arm/boot/dts/imx7-colibri.dtsi | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi
> > b/arch/arm/boot/dts/imx7-colibri.dtsi
> > index d05be3f0e2a7..7b6a7c124345 100644
> > --- a/arch/arm/boot/dts/imx7-colibri.dtsi
> > +++ b/arch/arm/boot/dts/imx7-colibri.dtsi
> > @@ -115,7 +115,20 @@ &fec1 {
> >       assigned-clock-rates = <0>, <100000000>;
> >       phy-mode = "rmii";
> >       phy-supply = <&reg_LDO1>;
> > +     phy-handle = <&ethphy0>;
> >       fsl,magic-packet;
> > +
> > +     mdio {
> > +             #address-cells = <1>;
> > +             #size-cells = <0>;
> > +
> > +             ethphy0: ethernet-phy@0 {
> > +                     compatible = "ethernet-phy-ieee802.3-c22";
> > +                     max-speed = <100>;
> > +                     micrel,led-mode = <0>;
> > +                     reg = <0>;
> > +             };
> > +     };
> >  };
> >
> >  &flexcan1 {
>


-- 
Best regards
Oleksandr Suvorov

Toradex AG
Altsagenstrasse 5 | 6048 Horw/Luzern | Switzerland | T: +41 41 500
4800 (main line)

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

end of thread, other threads:[~2020-01-17 19:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16 10:13 [PATCH] ARM: dts: colibri-imx7: fix ethernet performance Oleksandr Suvorov
2020-01-16 11:35 ` Lucas Stach
2020-01-17 19:25   ` Oleksandr Suvorov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).