From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: Regression: mv88e6xxx packet loss after 4.18's PHYLINK merge Date: Mon, 14 Jan 2019 10:03:57 -0800 Message-ID: <48924158-5ce6-41b5-18af-c4aff205311d@gmail.com> References: <20190114113444.GB16632@samu-ThinkPad-T480s> <20190114142358.GJ4635@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org, Vivien Didelot , "David S. Miller" To: Andrew Lunn , Samu Nuutamo Return-path: Received: from mail-yw1-f49.google.com ([209.85.161.49]:36890 "EHLO mail-yw1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726643AbfANSEK (ORCPT ); Mon, 14 Jan 2019 13:04:10 -0500 Received: by mail-yw1-f49.google.com with SMTP id h193so8971244ywc.4 for ; Mon, 14 Jan 2019 10:04:09 -0800 (PST) In-Reply-To: <20190114142358.GJ4635@lunn.ch> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 1/14/19 6:23 AM, Andrew Lunn wrote: > On Mon, Jan 14, 2019 at 01:34:44PM +0200, Samu Nuutamo wrote: >> Hi, >> >> We have an imx6q-b450v3 board that has one of the switch ports configured as a >> fixed link. After upgrading the kernel to version 4.18 the link has experienced >> a small amount of packet loss, around 0.15%. >> >> The issue was bisected to a commit: aab9c4067d23 net: dsa: Plug in PHYLINK support >> >> After enabling debug we could see that the new phylink code causes the link to >> reset once every second: >> >> [ 309.992368] mv88e6085 gpio-0:00 enembc: phylink_mac_config: mode=fixed//100Mbps/Full adv=00000,00000208 pause=10 link=1 an=1 >> [ 309.998451] mv88e6085 gpio-0:00: p5: Force link down >> [ 309.998869] mv88e6085 gpio-0:00: p5: Speed set to 100 Mbps >> [ 309.999280] mv88e6085 gpio-0:00: p5: Force full duplex >> [ 309.999895] mv88e6085 gpio-0:00: p5: Force link up >> [ 311.032400] mv88e6085 gpio-0:00 enembc: phylink_mac_config: mode=fixed//100Mbps/Full adv=00000,00000208 pause=10 link=1 an=1 >> [ 311.038248] mv88e6085 gpio-0:00: p5: Force link down >> [ 311.038660] mv88e6085 gpio-0:00: p5: Speed set to 100 Mbps >> [ 311.039069] mv88e6085 gpio-0:00: p5: Force full duplex >> [ 311.039678] mv88e6085 gpio-0:00: p5: Force link up >> [ 312.072328] mv88e6085 gpio-0:00 enembc: phylink_mac_config: mode=fixed//100Mbps/Full adv=00000,00000208 pause=10 link=1 an=1 >> [ 312.077603] mv88e6085 gpio-0:00: p5: Force link down >> [ 312.078010] mv88e6085 gpio-0:00: p5: Speed set to 100 Mbps >> [ 312.078417] mv88e6085 gpio-0:00: p5: Force full duplex >> [ 312.079026] mv88e6085 gpio-0:00: p5: Force link up > > Hi Samu > > Thanks for the report. > > I think we should be fixing this from the other end. Why does PHYLINK > reset the link once per second? If you have time, please could you > investigate that. Samu, is this fixed link using a GPIO to determine the link state? Does this patch help at all? diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 8a517d8fb9d1..9dedb9b22c13 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -721,7 +721,7 @@ static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port, return; if (mode == MLO_AN_FIXED) { - link = LINK_FORCED_UP; + link = state->link; speed = state->speed; duplex = state->duplex; } else if (!mv88e6xxx_phy_is_internal(ds, port)) { -- Florian