From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jisheng Zhang Subject: Re: [PATCH v1 6/7] net: mvneta: Don't use GRO on Armada 3720 Date: Thu, 9 Aug 2018 19:27:55 +0800 Message-ID: <20180809192755.24e57782@xhacker.debian> References: <20180808152706.21727-1-marek.behun@nic.cz> <20180808152706.21727-7-marek.behun@nic.cz> <20180809124022.790f1784@xhacker.debian> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, Gregory CLEMENT , Tomas Hlavacek , Russell King - ARM Linux , "David S. Miller" To: Marek =?UTF-8?B?QmVow7pu?= , Thomas Petazzoni , Andrew Lunn Return-path: Received: from mail-eopbgr720051.outbound.protection.outlook.com ([40.107.72.51]:14636 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730243AbeHINzE (ORCPT ); Thu, 9 Aug 2018 09:55:04 -0400 In-Reply-To: <20180809124022.790f1784@xhacker.debian> Sender: netdev-owner@vger.kernel.org List-ID: Hi, On Thu, 9 Aug 2018 12:40:41 +0800 Jisheng Zhang wrote: > + more people >=20 > On Wed, 8 Aug 2018 17:27:05 +0200 Marek Beh=C3=BAn wrote: >=20 > > For some reason on Armada 3720 boards (EspressoBin and Turris Mox) the > > networking driver behaves weirdly when using napi_gro_receive. > >=20 > > For example downloading a big file from a local network (low ping) is > > fast, but when downloading from a remote server (higher ping), the > > download speed is at first high but drops rapidly to almost nothing or > > absolutely nothing. =20 >=20 > We also met this issue on some berlin platforms. I tried to fix the bug, > but no clue so far. >=20 > >=20 > > This is fixed when using netif_receive_skb instead of napi_gro_receive.= =20 >=20 > This is a workaround. The good news is this workaround also fixes the iss= ue > we saw on berlin. >=20 > >=20 > > Signed-off-by: Marek Behun > > Cc: Russell King - ARM Linux > > Cc: netdev@vger.kernel.org > >=20 > > diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethern= et/marvell/mvneta.c > > index 0ad2f3f7da85..27f3017d94c5 100644 > > --- a/drivers/net/ethernet/marvell/mvneta.c > > +++ b/drivers/net/ethernet/marvell/mvneta.c > > @@ -1959,7 +1959,10 @@ static int mvneta_rx_swbm(struct mvneta_port *pp= , int rx_todo, > > =20 > > skb->protocol =3D eth_type_trans(skb, dev); > > mvneta_rx_csum(pp, rx_status, skb); > > - napi_gro_receive(&port->napi, skb); > > + if (pp->neta_armada3700) > > + netif_receive_skb(skb); > > + else > > + napi_gro_receive(&port->napi, skb); I think I found the root cause, if neta_armada3700 is true, the port got fr= om this_cpu_ptr(pp->ports) is invalid, this is bug... I'll cook a patch for th= is Thanks > > =20 > > rcvd_pkts++; > > rcvd_bytes +=3D rx_bytes; > > @@ -2001,7 +2004,10 @@ static int mvneta_rx_swbm(struct mvneta_port *pp= , int rx_todo, > > =20 > > mvneta_rx_csum(pp, rx_status, skb); > > =20 > > - napi_gro_receive(&port->napi, skb); > > + if (pp->neta_armada3700) > > + netif_receive_skb(skb); > > + else > > + napi_gro_receive(&port->napi, skb); > > } > > =20 > > if (rcvd_pkts) { =20 >=20 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jisheng.Zhang@synaptics.com (Jisheng Zhang) Date: Thu, 9 Aug 2018 19:27:55 +0800 Subject: [PATCH v1 6/7] net: mvneta: Don't use GRO on Armada 3720 In-Reply-To: <20180809124022.790f1784@xhacker.debian> References: <20180808152706.21727-1-marek.behun@nic.cz> <20180808152706.21727-7-marek.behun@nic.cz> <20180809124022.790f1784@xhacker.debian> Message-ID: <20180809192755.24e57782@xhacker.debian> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, On Thu, 9 Aug 2018 12:40:41 +0800 Jisheng Zhang wrote: > + more people > > On Wed, 8 Aug 2018 17:27:05 +0200 Marek Beh?n wrote: > > > For some reason on Armada 3720 boards (EspressoBin and Turris Mox) the > > networking driver behaves weirdly when using napi_gro_receive. > > > > For example downloading a big file from a local network (low ping) is > > fast, but when downloading from a remote server (higher ping), the > > download speed is at first high but drops rapidly to almost nothing or > > absolutely nothing. > > We also met this issue on some berlin platforms. I tried to fix the bug, > but no clue so far. > > > > > This is fixed when using netif_receive_skb instead of napi_gro_receive. > > This is a workaround. The good news is this workaround also fixes the issue > we saw on berlin. > > > > > Signed-off-by: Marek Behun > > Cc: Russell King - ARM Linux > > Cc: netdev at vger.kernel.org > > > > diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c > > index 0ad2f3f7da85..27f3017d94c5 100644 > > --- a/drivers/net/ethernet/marvell/mvneta.c > > +++ b/drivers/net/ethernet/marvell/mvneta.c > > @@ -1959,7 +1959,10 @@ static int mvneta_rx_swbm(struct mvneta_port *pp, int rx_todo, > > > > skb->protocol = eth_type_trans(skb, dev); > > mvneta_rx_csum(pp, rx_status, skb); > > - napi_gro_receive(&port->napi, skb); > > + if (pp->neta_armada3700) > > + netif_receive_skb(skb); > > + else > > + napi_gro_receive(&port->napi, skb); I think I found the root cause, if neta_armada3700 is true, the port got from this_cpu_ptr(pp->ports) is invalid, this is bug... I'll cook a patch for this Thanks > > > > rcvd_pkts++; > > rcvd_bytes += rx_bytes; > > @@ -2001,7 +2004,10 @@ static int mvneta_rx_swbm(struct mvneta_port *pp, int rx_todo, > > > > mvneta_rx_csum(pp, rx_status, skb); > > > > - napi_gro_receive(&port->napi, skb); > > + if (pp->neta_armada3700) > > + netif_receive_skb(skb); > > + else > > + napi_gro_receive(&port->napi, skb); > > } > > > > if (rcvd_pkts) { >