lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190523011958.14944-1-ioana.ciornei@nxp.com>
Date:   Thu, 23 May 2019 01:20:36 +0000
From:   Ioana Ciornei <ioana.ciornei@....com>
To:     "linux@...linux.org.uk" <linux@...linux.org.uk>,
        "f.fainelli@...il.com" <f.fainelli@...il.com>,
        "andrew@...n.ch" <andrew@...n.ch>,
        "hkallweit1@...il.com" <hkallweit1@...il.com>,
        "maxime.chevallier@...tlin.com" <maxime.chevallier@...tlin.com>,
        "olteanv@...il.com" <olteanv@...il.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        Ioana Ciornei <ioana.ciornei@....com>
Subject: [RFC PATCH net-next 0/9] Decoupling PHYLINK from struct net_device

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

PHYLINK was reworked in order to add a new "raw" interface, alongside
the one based on struct net_device. The raw interface works by passing
structures to the owner of the phylink instance through a blocking
notifier call.

The event API exposed by the new notifier mechanism is a 1:1 mapping to
the existing PHYLINK mac_ops, plus the PHYLINK fixed-link callback.

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 raw API.

The implication of the above is that DSA drivers that used to rely on
the .adjust_link to configure their CPU/DSA ports as fixed-link are now
broken.  Full explanation is found in patch 8/9, and a sample fix for
the SJA1105 driver is found in 9/9.  The drivers below are affected:

* b53: Uses .adjust_link for fixed-links on CPU port, as well as
  .phylink_mac_config.
  Migration to 100% PHYLINK does not appear trivial.

* ksz9477: rtl8366rb: mt7530: vsc73xx: Uses .adjust_link exclusively.
  Either the devicetree bindings document or code checks/comments reveal
  that the adjust_link is used for handling a fixed-link.
  Migration to PHYLINK appears trivial.

* qca8k: lan9303: Uses .adjust_link to configure fixed-link ports (skips
  the rest).
  Migration to PHYLINK appears trivial.

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:

[   42.785627] fsl-gianfar soc:ethernet@...0000 eth1: Link is Down
[   43.025678] Broadcom BCM5464 mdio@...4000:03: Link is Down
[   49.025793] fsl-gianfar soc:ethernet@...0000 eth1: Link is Up - 1Gbps/Full - flow control off
[   49.266299] Broadcom BCM5464 mdio@...4000:03: Link is Up - 1Gbps/Full - flow control off

Ioana Ciornei (7):
  net: phy: Guard against the presence of a netdev
  net: phy: Add phy_standalone sysfs entry
  net: phylink: Add phylink_mac_link_{up,down} wrapper functions
  net: phylink: Add phylink_create_raw
  net: phylink: Make fixed link notifier calls edge-triggered
  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

 drivers/net/dsa/sja1105/sja1105_main.c |  11 +-
 drivers/net/phy/phy_device.c           |  88 +++++++---
 drivers/net/phy/phylink.c              | 224 ++++++++++++++++++++-----
 include/linux/phylink.h                |  21 +++
 include/net/dsa.h                      |   3 +
 net/dsa/dsa_priv.h                     |  19 +++
 net/dsa/port.c                         | 207 ++++++++++++++++-------
 net/dsa/slave.c                        |  49 +-----
 8 files changed, 441 insertions(+), 181 deletions(-)

-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ