All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] Decoupling PHYLINK from struct net_device
@ 2019-05-27 21:21 Ioana Ciornei
  2019-05-27 21:21 ` [PATCH 01/11] net: phy: Add phy_sysfs_create_links helper function Ioana Ciornei
                   ` (10 more replies)
  0 siblings, 11 replies; 34+ messages in thread
From: Ioana Ciornei @ 2019-05-27 21:21 UTC (permalink / raw)
  To: linux, f.fainelli, andrew, hkallweit1, maxime.chevallier,
	olteanv, thomas.petazzoni, davem, vivien.didelot
  Cc: netdev, Ioana Ciornei

Following two separate discussion threads in:
  https://www.spinics.net/lists/netdev/msg569087.html
and:
  https://www.spinics.net/lists/netdev/msg570450.html

Previous RFC patch set: https://www.spinics.net/lists/netdev/msg571995.html

PHYLINK was reworked in order to accept multiple operation types,
PHYLINK_NETDEV and PHYLINK_DEV, passed through a phylink_config
structure alongside the corresponding struct device.

One of the main concerns expressed in the RFC was that using notifiers
to signal the corresponding phylink_mac_ops would break PHYLINK's API
unity and that it would become harder to grep for its users.
Using the current approach, we maintain a common API for all users.
Also, printing useful information in PHYLINK, when decoupled from a
net_device, is achieved using dev_err&co on the struct device received
(in DSA's case is the device corresponding to the dsa_switch).

PHYLIB (which PHYLINK uses) was reworked to the extent that it does not
crash when connecting to a PHY and the net_device pointer is NULL.

Lastly, DSA has been reworked in its way that it handles PHYs for ports
that lack a net_device (CPU and DSA ports).  For these, it was
previously using PHYLIB and is now using the PHYLINK_DEV operation type.
Previously, a driver that wanted to support PHY operations on CPU/DSA
ports has to implement .adjust_link(). This patch set not only gives
drivers the options to use PHYLINK uniformly but also urges them to
convert to it. For compatibility, the old code is kept but it will be
removed once all drivers switch over.

The patchset was tested on the NXP LS1021A-TSN board having the
following Ethernet layout:
  https://lkml.org/lkml/2019/5/5/279
The CPU port was moved from the internal RGMII fixed-link (enet2 ->
switch port 4) to an external loopback Cat5 cable between the enet1 port
and the front-facing swp2 SJA1105 port. In this mode, both the master
and the CPU port have an attached PHY which detects link change events:

[   49.105426] fsl-gianfar soc:ethernet@2d50000 eth1: Link is Down
[   50.305486] sja1105 spi0.1: Link is Down
[   53.265596] fsl-gianfar soc:ethernet@2d50000 eth1: Link is Up - 1Gbps/Full - flow control off
[   54.466304] sja1105 spi0.1: Link is Up - 1Gbps/Full - flow control off

Ioana Ciornei (9):
  net: phy: Guard against the presence of a netdev
  net: phy: Check against net_device being NULL
  net: phy: Add phy_standalone sysfs entry
  net: phylink: Add phylink_mac_link_{up,down} wrapper functions
  net: phylink: Add struct phylink_config to PHYLINK API
  net: phylink: Add PHYLINK_DEV operation type
  net: phylink: Add phylink_{printk,err,warn,info,dbg} macros
  net: dsa: Move the phylink driver calls into port.c
  net: dsa: Use PHYLINK for the CPU/DSA ports

Vladimir Oltean (2):
  net: phy: Add phy_sysfs_create_links helper function
  net: dsa: sja1105: Fix broken fixed-link interfaces on user ports

 Documentation/networking/sfp-phylink.rst      |   5 +-
 drivers/net/dsa/sja1105/sja1105_main.c        |  11 +-
 drivers/net/ethernet/marvell/mvneta.c         |  36 ++-
 drivers/net/ethernet/marvell/mvpp2/mvpp2.h    |   1 +
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  43 ++--
 drivers/net/phy/phy_device.c                  | 100 ++++++--
 drivers/net/phy/phylink.c                     | 220 +++++++++++-------
 include/linux/phylink.h                       |  57 +++--
 include/net/dsa.h                             |   2 +
 net/dsa/dsa_priv.h                            |  17 ++
 net/dsa/port.c                                | 157 +++++++++++++
 net/dsa/slave.c                               |  99 +-------
 12 files changed, 491 insertions(+), 257 deletions(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2019-05-29 23:03 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-27 21:21 [PATCH 00/11] Decoupling PHYLINK from struct net_device Ioana Ciornei
2019-05-27 21:21 ` [PATCH 01/11] net: phy: Add phy_sysfs_create_links helper function Ioana Ciornei
2019-05-27 23:32   ` Fabio Estevam
2019-05-28  6:53     ` Ioana Ciornei
2019-05-27 21:21 ` [PATCH 02/11] net: phy: Guard against the presence of a netdev Ioana Ciornei
2019-05-27 21:21 ` [PATCH 03/11] net: phy: Check against net_device being NULL Ioana Ciornei
2019-05-27 23:07   ` kbuild test robot
2019-05-28  2:27   ` kbuild test robot
2019-05-28 15:50   ` Andrew Lunn
2019-05-28 15:51   ` Andrew Lunn
2019-05-27 21:22 ` [PATCH 04/11] net: phy: Add phy_standalone sysfs entry Ioana Ciornei
2019-05-28  2:00   ` Florian Fainelli
2019-05-27 21:22 ` [PATCH 05/11] net: phylink: Add phylink_mac_link_{up,down} wrapper functions Ioana Ciornei
2019-05-27 21:22 ` [PATCH 06/11] net: phylink: Add struct phylink_config to PHYLINK API Ioana Ciornei
2019-05-28  1:51   ` Florian Fainelli
2019-05-27 21:22 ` [PATCH 07/11] net: phylink: Add PHYLINK_DEV operation type Ioana Ciornei
2019-05-28  2:01   ` Florian Fainelli
2019-05-28 17:11     ` Ioana Ciornei
2019-05-27 21:22 ` [PATCH 08/11] net: phylink: Add phylink_{printk,err,warn,info,dbg} macros Ioana Ciornei
2019-05-28  1:53   ` Florian Fainelli
2019-05-27 21:22 ` [PATCH 09/11] net: dsa: Move the phylink driver calls into port.c Ioana Ciornei
2019-05-28  2:02   ` Florian Fainelli
2019-05-27 21:22 ` [PATCH 10/11] net: dsa: Use PHYLINK for the CPU/DSA ports Ioana Ciornei
2019-05-28  1:55   ` Florian Fainelli
2019-05-28  3:36   ` kbuild test robot
2019-05-28  3:36   ` [RFC PATCH] net: dsa: dsa_port_phylink_register() can be static kbuild test robot
2019-05-29  2:35   ` [net] 9dd6d07682: kernel_BUG_at_drivers/net/phy/mdio_bus.c kernel test robot
2019-05-29  2:35     ` kernel test robot
2019-05-29 16:11     ` Ioana Ciornei
2019-05-29 16:25       ` Russell King - ARM Linux admin
2019-05-29 20:08         ` Ioana Ciornei
2019-05-29 23:03           ` Andrew Lunn
2019-05-29 23:03             ` Andrew Lunn
2019-05-27 21:22 ` [PATCH 11/11] net: dsa: sja1105: Fix broken fixed-link interfaces on user ports Ioana Ciornei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.