From patchwork Mon Nov 14 15:33:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mason X-Patchwork-Id: 694577 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3tHZMB4ZlFz9t0X for ; Tue, 15 Nov 2016 02:34:30 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753689AbcKNPe0 (ORCPT ); Mon, 14 Nov 2016 10:34:26 -0500 Received: from smtp5-g21.free.fr ([212.27.42.5]:34631 "EHLO smtp5-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751662AbcKNPeZ (ORCPT ); Mon, 14 Nov 2016 10:34:25 -0500 Received: from [172.27.0.114] (unknown [92.154.11.170]) (Authenticated sender: slash.tmp) by smtp5-g21.free.fr (Postfix) with ESMTPSA id A06755FFC4; Mon, 14 Nov 2016 16:33:48 +0100 (CET) Subject: Re: Debugging Ethernet issues To: Andrew Lunn Cc: Florian Fainelli , netdev , Mans Rullgard , Sergei Shtylyov , Tom Lendacky , Zach Brown , Shaohui Xie , Tim Beale , Brian Hill , Vince Bridgers , Balakumaran Kannan , "David S. Miller" , Sebastian Frias , Kirill Kapranov References: <5827AD4A.7010908@free.fr> <20161113030919.GA2892@lunn.ch> <5828C452.6050808@free.fr> <9d1f28a7-959b-fdde-3403-f6da5f521125@gmail.com> <5829BBFC.7040800@free.fr> <20161114133428.GF26710@lunn.ch> <5829D10F.30206@free.fr> From: Mason Message-ID: <5829D95C.6060509@free.fr> Date: Mon, 14 Nov 2016 16:33:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40 MIME-Version: 1.0 In-Reply-To: <5829D10F.30206@free.fr> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 14/11/2016 15:58, Mason wrote: > nb8800 26000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx > vs > nb8800 26000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off > > I'm not sure whether "flow control" is relevant... Based on phy_print_status() phydev->pause ? "rx/tx" : "off" I added the following patch. Connected to 1000 Mbps switch: # time udhcpc | while read LINE; do date; echo $LINE; done Thu Jan 1 00:00:22 UTC 1970 udhcpc (v1.22.1) started Thu Jan 1 00:00:22 UTC 1970 Sending discover... [ 24.565346] nb8800_link_reconfigure from phy_state_machine Thu Jan 1 00:00:25 UTC 1970 Sending discover... [ 26.575402] nb8800_link_reconfigure from phy_state_machine [ 26.580972] nb8800 26000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx Thu Jan 1 00:00:28 UTC 1970 Sending discover... Thu Jan 1 00:00:29 UTC 1970 Sending select for 172.27.64.58... Thu Jan 1 00:00:29 UTC 1970 Lease of 172.27.64.58 obtained, lease time 604800 Thu Jan 1 00:00:29 UTC 1970 deleting routers Thu Jan 1 00:00:29 UTC 1970 adding dns 172.27.0.17 real 0m7.388s user 0m0.040s sys 0m0.090s Connected to 100 Mbps switch: # time udhcpc | while read LINE; do date; echo $LINE; done Thu Jan 1 00:00:14 UTC 1970 udhcpc (v1.22.1) started Thu Jan 1 00:00:15 UTC 1970 Sending discover... [ 16.968621] nb8800_link_reconfigure from phy_state_machine [ 17.975359] nb8800_link_reconfigure from phy_state_machine [ 17.980923] nb8800 26000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx Thu Jan 1 00:00:18 UTC 1970 Sending discover... Thu Jan 1 00:00:19 UTC 1970 Sending select for 172.27.64.58... Thu Jan 1 00:00:19 UTC 1970 Lease of 172.27.64.58 obtained, lease time 604800 Thu Jan 1 00:00:19 UTC 1970 deleting routers Thu Jan 1 00:00:19 UTC 1970 adding dns 172.27.0.17 real 0m4.355s user 0m0.043s sys 0m0.083s OK, so now it works (by accident?) even on 100 Mbps switch, but it still prints "flow control rx/tx"... # ethtool -a eth0 Pause parameters for eth0: Autonegotiate: off RX: off TX: off These values make sense considering my changes in the driver. Are 100 Mbps switches supposed to support these pause features, and are they supposed to be able to auto-negotiate them? Regards. diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c index defc22a15f67..4e758c1cfa4e 100644 --- a/drivers/net/ethernet/aurora/nb8800.c +++ b/drivers/net/ethernet/aurora/nb8800.c @@ -667,6 +667,8 @@ static void nb8800_link_reconfigure(struct net_device *dev) struct phy_device *phydev = priv->phydev; int change = 0; + printk("%s from %pf\n", __func__, __builtin_return_address(0)); + if (phydev->link) { if (phydev->speed != priv->speed) { priv->speed = phydev->speed; @@ -1274,9 +1276,9 @@ static int nb8800_hw_init(struct net_device *dev) nb8800_writeb(priv, NB8800_PQ2, val & 0xff); /* Auto-negotiate by default */ - priv->pause_aneg = true; - priv->pause_rx = true; - priv->pause_tx = true; + priv->pause_aneg = false; + priv->pause_rx = false; + priv->pause_tx = false; nb8800_mc_init(dev, 0);