netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* meson-gxbb-p200 4.12.0 network TCP transfer stalls
@ 2017-07-08  0:55 Marc Duponcheel
  2017-07-10 23:48 ` Marc Duponcheel
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Duponcheel @ 2017-07-08  0:55 UTC (permalink / raw)
  To: netdev; +Cc: Marc Duponcheel

Hi all

Similar to 'crow'

ARM GLX Khadas VIM Pro - Ethernet detected as only 10Mbps and stalled after some traffic

I also have the situation where copying large file over LAN stalls.

3.14.29 performance is good 4.12.0 performance not

output of 'mii-tool -vvv eth0' differs (e.g. flow-control)

 --
$ echo *
3.14.29 4.12.0

$ diff */mii-tool-vvv.eth0
4,5c4,5
<     1040 79ad 001c c916 0de1 c5e1 006d 2801
<     4806 0200 3800 0000 0000 4007 0000 2000
---
>     1040 79ad 001c c916 01e1 c5e1 006f 2001
>     5806 0200 3800 0000 0000 4007 0002 2000
7c7
<     211a 0862 30ee 0002 6295 0000 0000 0000
---
>     211a 0863 302c 0002 0000 0020 0000 0000
12c12
<   advertising:  1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
---
>   advertising:  1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
 --

When capturing with tcpdump stalled transfer shows various
retransmits, duplicate acks and fast retransmit issues.

# nstat | grep ^Tcp

also shows much more exceptions in 4.12.0 versus 3.14.29

$ cat 3.14.29/nstat^Tcp
TcpInSegs                       18                 0.0
TcpOutSegs                      11                 0.0
TcpExtTCPHPAcks                 11                 0.0

$ cat 4.12.0/nstat^Tcp
TcpPassiveOpens                 2                  0.0
TcpInSegs                       687                0.0
TcpOutSegs                      379                0.0
TcpExtDelayedACKs               4                  0.0
TcpExtTCPHPHits                 207                0.0
TcpExtTCPPureAcks               10                 0.0
TcpExtTCPHPAcks                 350                0.0
TcpExtTCPAutoCorking            6                  0.0
TcpExtTCPOrigDataSent           365                0.0


 Perhaps one must compare 3.14.29 am_realtek.c and realtek.c with 4.12.0realtek.c


 thanks

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

* Re: meson-gxbb-p200 4.12.0 network TCP transfer stalls
  2017-07-08  0:55 meson-gxbb-p200 4.12.0 network TCP transfer stalls Marc Duponcheel
@ 2017-07-10 23:48 ` Marc Duponcheel
  2017-07-11  0:34   ` Marc Duponcheel
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Duponcheel @ 2017-07-10 23:48 UTC (permalink / raw)
  To: netdev; +Cc: Marc Duponcheel

 FYI

I changed 4.12.0 drivers/net/phy/realtek.c RTL8211F code to equal the
3.14.29 amlogic/ethernet/phy/am_realtek.c code and now the networking
works without TCP stalls.

I don't say below patch should be considered mainstream (as maybe some
4.12.0 rtl8211f_config_init code should not be removed) but sure
someone could figure out what best patch is...

 --
# diff -U2 realtek.c.orig realtek.c
--- realtek.c.orig	2017-07-03 01:07:02.000000000 +0200
+++ realtek.c	2017-07-11 01:32:20.273445023 +0200
@@ -94,28 +94,27 @@
 }
 
+#define RTL8211F_MMD_CTRL       0x0D
+#define RTL8211F_MMD_DATA       0x0E
+#define RTL8211E_INER_LINK_STAT 0x10
+
 static int rtl8211f_config_init(struct phy_device *phydev)
 {
-	int ret;
-	u16 reg;
-
-	ret = genphy_config_init(phydev);
-	if (ret < 0)
-		return ret;
-
-	phy_write(phydev, RTL8211F_PAGE_SELECT, 0xd08);
-	reg = phy_read(phydev, 0x11);
-
-	/* enable TX-delay for rgmii-id and rgmii-txid, otherwise disable it */
-	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
-	    phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
-		reg |= RTL8211F_TX_DELAY;
-	else
-		reg &= ~RTL8211F_TX_DELAY;
-
-	phy_write(phydev, 0x11, reg);
-	/* restore to default page 0 */
-	phy_write(phydev, RTL8211F_PAGE_SELECT, 0x0);
-
+	int val;
+/* we want to disable eee */
+	phy_write(phydev, RTL8211F_MMD_CTRL, 0x7);
+	phy_write(phydev, RTL8211F_MMD_DATA, 0x3c);
+	phy_write(phydev, RTL8211F_MMD_CTRL, 0x4007);
+	phy_write(phydev, RTL8211F_MMD_DATA, 0x0);
+/* disable 1000m adv*/
+	val = phy_read(phydev, 0x9);
+	phy_write(phydev, 0x9, val&(~(1<<9)));
+/* rx reg 21 bit 3 tx reg 17 bit 8 */
+/*
+	phy_write(phydev, 0x1f, 0xd08);
+	val =  phy_read(phydev, 0x15);
+	phy_write(phydev, 0x15,val| 1<<21);
+ */
 	return 0;
+/* Enable Auto Power Saving mode */
 }
 
@@ -167,6 +166,6 @@
 		.name		= "RTL8211F Gigabit Ethernet",
 		.phy_id_mask	= 0x001fffff,
-		.features	= PHY_GBIT_FEATURES,
-		.flags		= PHY_HAS_INTERRUPT,
+		.features	= PHY_GBIT_FEATURES | SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+		.flags		= PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG,
 		.config_aneg	= &genphy_config_aneg,
 --


On 2017 Jul 08, Marc Duponcheel wrote:
> Hi all
> 
> Similar to 'crow'
> 
> ARM GLX Khadas VIM Pro - Ethernet detected as only 10Mbps and stalled after some traffic
> 
> I also have the situation where copying large file over LAN stalls.
> 
> 3.14.29 performance is good 4.12.0 performance not
> 
> 
>  Perhaps one must compare 3.14.29 am_realtek.c and realtek.c with 4.12.0 realtek.c
> 
> 
>  thanks

have a nice day

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

* Re: meson-gxbb-p200 4.12.0 network TCP transfer stalls
  2017-07-10 23:48 ` Marc Duponcheel
@ 2017-07-11  0:34   ` Marc Duponcheel
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Duponcheel @ 2017-07-11  0:34 UTC (permalink / raw)
  To: netdev; +Cc: Marc Duponcheel

 I use NBD for fast building and savif SD card and, sadly, the TV box crashes after few min of building

On 2017 Jul 11, Marc Duponcheel wrote:
>  FYI
> 
> I changed 4.12.0 drivers/net/phy/realtek.c RTL8211F code to equal the
> 3.14.29 amlogic/ethernet/phy/am_realtek.c code and now the networking
> works without TCP stalls.
> 
> I don't say below patch should be considered mainstream (as maybe some
> 4.12.0 rtl8211f_config_init code should not be removed) but sure
> someone could figure out what best patch is...

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

end of thread, other threads:[~2017-07-11  0:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-08  0:55 meson-gxbb-p200 4.12.0 network TCP transfer stalls Marc Duponcheel
2017-07-10 23:48 ` Marc Duponcheel
2017-07-11  0:34   ` Marc Duponcheel

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).