netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Behun <marek.behun@nic.cz>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, Vivien Didelot <vivien.didelot@gmail.com>
Subject: Re: [PATCH net-next 0/10] net: dsa: improve serdes integration
Date: Fri, 6 Mar 2020 14:53:32 +0100	[thread overview]
Message-ID: <20200306145332.7b7a85da@nic.cz> (raw)
In-Reply-To: <20200306103934.GF25745@shell.armlinux.org.uk>

On Fri, 6 Mar 2020 10:39:34 +0000
Russell King - ARM Linux admin <linux@armlinux.org.uk> wrote:

> On Fri, Mar 06, 2020 at 04:57:20AM +0100, Andrew Lunn wrote:
> > Hi Russell
> >   
> > > I will try to figure out which patch broke it.  
> > 
> > ommit e67b45adefa8d43c68560906f3955845a5ee14d8 (HEAD)
> > Author: Russell King <rmk+kernel@armlinux.org.uk>
> > Date:   Thu Mar 5 12:42:26 2020 +0000
> > 
> >     net: dsa: mv88e6xxx: configure interface settings in mac_config
> >     
> >     Only configure the interface settings in mac_config(), leaving the
> >     speed and duplex settings to mac_link_up to deal with.
> > 
> > Maybe:
> > 
> > 
> > +       /* FIXME: should we force the link down here - but if we do, how
> > +        * do we restore the link force/unforce state? The driver layering
> > +        * gets in the way.
> > +        */
> > 
> > ???  
> 
> That's a possibility.  Is the MAC already configured for the interface
> mode though?
> 
> The problem occurs because the CPU and DSA ports are forced up during
> DSA initialisation, but phylink expects the link to initially be down.
> So, one may think that simply forcing the link down here to work around
> that would be a solution.
> 
> Unfortunately, that means that CPU and DSA ports without a fixed-link
> spec will stay down because phylink won't call mac_link_up() - so we're
> back to the poor integration of phylink for CPU and DSA ports problem.
> Even if phylink /were/ to call mac_link_up() for that situation,
> phylink has no information on the speed and duplex for such a port, so
> speed and duplex would be nonsense.
> 
> That conversion is very problematical.
> 
> I do have some patches that solve it by changing phylink, but it's
> quite a hack - the problem is detecting the uninitialised state in
> phylink_start(), which is really quite late.  You can find them in my
> "zii" branch:
> 
> net: dsa: mv88e6xxx: split out SPEED_MAX setting
> net: phylink/dsa: fix DSA and CPU links
> 
> So, I think we're back to... what do we do about the broken phylink
> integration for CPU and DSA ports.
> 

What I have been wondering about is if it would make sense to have the
ability to set CPU/DSA link settings from userspace. Currently the
CPU and DSA ports do not correspond to any system interface, so this is
impossible via ethtool. I have been thinking about how this could be
done.

What I don't like about current implementation is that it is impossible
to query the DSA ports from userspace.

For example in a configuration when eth0 is connected to port 5 on
Topaz, and ports 1-4 are lan1 - lan4, when I query statistics via
ethtool, on interfaces lanN I get staticstics for the swithc ports 1-4.
On interface eth0 the driver passes stats from the network interface on
the SOC and also stats from switch port 5.

But when there are two switches cascaded, there is currently no way to
query for stats on their DSA ports.

Sure, it could be solved by adding DSA ports into
dsa_master_get_ethtool_stats. But if DSA ports somehow could be queried
via ethtool, this problem could be solved.

Marek

  parent reply	other threads:[~2020-03-06 13:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-05 12:41 [PATCH net-next 0/10] net: dsa: improve serdes integration Russell King - ARM Linux admin
2020-03-05 12:42 ` [PATCH net-next 01/10] net: mii: convert mii_lpa_to_ethtool_lpa_x() to linkmode variant Russell King
2020-03-05 12:42 ` [PATCH net-next 02/10] net: mii: add linkmode_adv_to_mii_adv_x() Russell King
2020-03-05 12:42 ` [PATCH net-next 03/10] net: dsa: warn if phylink_mac_link_state returns error Russell King
2020-03-05 12:42 ` [PATCH net-next 04/10] net: dsa: mv88e6xxx: use BMCR definitions for serdes control register Russell King
2020-03-05 12:42 ` [PATCH net-next 05/10] net: dsa: mv88e6xxx: configure interface settings in mac_config Russell King
2020-03-05 12:42 ` [PATCH net-next 06/10] net: dsa: mv88e6xxx: extend phylink to Serdes PHYs Russell King
2020-03-05 13:38   ` Marek Behun
2020-03-05 13:43     ` Russell King - ARM Linux admin
2020-03-05 12:42 ` [PATCH net-next 07/10] net: dsa: mv88e6xxx: fix Serdes link changes Russell King
2020-03-05 12:42 ` [PATCH net-next 08/10] net: dsa: mv88e6xxx: combine port_set_speed and port_set_duplex Russell King
2020-03-05 12:42 ` [PATCH net-next 09/10] net: dsa: mv88e6xxx: remove port_link_state functions Russell King
2020-03-05 12:42 ` [PATCH net-next 10/10] net: dsa: mv88e6xxx: use PHY_DETECT in mac_link_up/mac_link_down Russell King
2020-03-05 22:54 ` [PATCH net-next 0/10] net: dsa: improve serdes integration Andrew Lunn
2020-03-05 23:45   ` Russell King - ARM Linux admin
2020-03-06  0:27     ` Andrew Lunn
2020-03-06  1:13     ` Andrew Lunn
2020-03-06  3:57       ` Andrew Lunn
2020-03-06 10:39         ` Russell King - ARM Linux admin
2020-03-06 13:29           ` Andrew Lunn
2020-03-06 13:53           ` Marek Behun [this message]
2020-03-06 14:51             ` Andrew Lunn
2020-03-09  5:04 ` David Miller
2020-03-09  9:48   ` Russell King - ARM Linux admin
2020-03-09 12:40     ` Andrew Lunn
2020-03-09 12:50       ` Russell King - ARM Linux admin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200306145332.7b7a85da@nic.cz \
    --to=marek.behun@nic.cz \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).