mbox series

[RFT/RFC,net-next,0/2] net: dsa: Plug in PHYLINK support

Message ID 20171215002850.27862-1-f.fainelli@gmail.com
Headers show
Series net: dsa: Plug in PHYLINK support | expand

Message

Florian Fainelli Dec. 15, 2017, 12:28 a.m. UTC
Hi all,

This patch series replaces the existing PHYLIB integration with PHYLINK which
is a superior solution since we need to support a collection of fixed links,
integrated PHYs, SFP, non-pluggable SFPs etc.

I am expecting quite a lot of breakage, for a number of reasons:

- PHYLINK does not create a PHY device for fixed links (MLO_AN_FIXED), which
  means that user-facing port (not DSA, not CPU) need to be explicitly handled
  with phylink_mac_ops now

- only been able to test this on a limited number of platforms, and not the
  ZII devel B/C boards yet

Please test and report!

Florian Fainelli (2):
  net: dsa: Plug in PHYLINK support
  net: dsa: bcm_sf2: Kick PHYLINK upon link interrupts

 drivers/net/dsa/bcm_sf2.c |  29 +++--
 include/net/dsa.h         |  23 +++-
 net/dsa/Kconfig           |   1 +
 net/dsa/dsa_priv.h        |   9 --
 net/dsa/slave.c           | 294 +++++++++++++++++++++++++++-------------------
 5 files changed, 210 insertions(+), 146 deletions(-)

Comments

Russell King (Oracle) Dec. 15, 2017, 12:08 p.m. UTC | #1
On Thu, Dec 14, 2017 at 04:28:48PM -0800, Florian Fainelli wrote:
> Hi all,
> 
> This patch series replaces the existing PHYLIB integration with PHYLINK which
> is a superior solution since we need to support a collection of fixed links,
> integrated PHYs, SFP, non-pluggable SFPs etc.
> 
> I am expecting quite a lot of breakage, for a number of reasons:
> 
> - PHYLINK does not create a PHY device for fixed links (MLO_AN_FIXED), which
>   means that user-facing port (not DSA, not CPU) need to be explicitly handled
>   with phylink_mac_ops now
> 
> - only been able to test this on a limited number of platforms, and not the
>   ZII devel B/C boards yet
> 
> Please test and report!

The good news is that it almost works on the ZII Rev C with the SFF
modules, but there's a few issues that need solving:

1. s/WARN_ON(!lockdep_rtnl_is_held())/ASSERT_RTNL()/ in phylink.c -
   probably wouldn't have been noticed if it wasn't for the lockdep
   splat with DSA's interrupt handling during boot that's been there
   since -rc1.  (Andrew mentioned that it's known, so I haven't
   reported that.)

2. ports without a phy but with sfp cause the "no phy at" and
   "failed to connect to port" message - I think we need a way for
   DSA to know whether it should be attempting to attach a PHY.

3. We need mv88e6xxx to implement at least phylink_mac_link_state()
   so that SFPs report sane ethtool information.  It also needs to
   implement phylink_mac_config() so that the link can be appropriately
   configured to the module's capabilities, and phylink_validate() to
   do the jiggery for choosing between 1000base-X vs 2500base-X mode
   if the DSA switches can't automatically select the appropriate one.

With a few hacks for the above, I can get TX_DISABLE on the SFF2 module
to follow the interface up/down status, but as I say more work is needed
so that mv88e6xxx works with the phylink callbacks for the SFF modules
to be properly supported.
Andrew Lunn Dec. 15, 2017, 12:48 p.m. UTC | #2
> 1. s/WARN_ON(!lockdep_rtnl_is_held())/ASSERT_RTNL()/ in phylink.c -
>    probably wouldn't have been noticed if it wasn't for the lockdep
>    splat with DSA's interrupt handling during boot that's been there
>    since -rc1.  (Andrew mentioned that it's known, so I haven't
>    reported that.)

Hi Russell

https://lkml.org/lkml/2017/12/2/260

This should fix that splat. I hope it will get picked up at some
point. It is probably getting on time to repost it.

       Andrew
Egil Hjelmeland Dec. 15, 2017, 3:51 p.m. UTC | #3
Hi


Den 15. des. 2017 01:28, skrev Florian Fainelli:
> Hi all,
> 
> This patch series replaces the existing PHYLIB integration with PHYLINK which
> is a superior solution since we need to support a collection of fixed links,
> integrated PHYs, SFP, non-pluggable SFPs etc.
> 
> I am expecting quite a lot of breakage, for a number of reasons:
> 
> - PHYLINK does not create a PHY device for fixed links (MLO_AN_FIXED), which
>    means that user-facing port (not DSA, not CPU) need to be explicitly handled
>    with phylink_mac_ops now
> 

FWIW:  We (zenitel) does not use fixed-link on user-port. I gave the 
patches a spin on our board with lan9303. As expected: no breakage.

Egil