All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: u-boot@lists.denx.de
Subject: [PATCH v4 0/7] Introduce DSA Ethernet switch class and Felix driver
Date: Mon, 25 Jan 2021 14:02:07 +0100	[thread overview]
Message-ID: <cc94250017d56e22021fdadaeda5b0e9@walle.cc> (raw)
In-Reply-To: <20210125122357.414742-1-olteanv@gmail.com>

Am 2021-01-25 13:23, schrieb Vladimir Oltean:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> DSA stands for Distributed Switch Architecture and it is a subsystem
> introduced in the Linux kernel to support switches that:
> - have an Ethernet link up to the CPU
> - use some form of tagging to identify the source/destination port for
>   Rx/Tx
> - may be cascaded in tree-like structures.
> 
> DSA is described in depth here:
> https://www.kernel.org/doc/Documentation/networking/dsa/dsa.txt
> 
> This patch set introduces a DSA class in U-Boot to support drivers of 
> DSA
> switches.  DSA drivers have to implement the following ops:
> - enable/disable of switch ports,
> - insert a tag in frames being transmitted, used by the switch to 
> select
>   the egress port,
> - parse a tag in frames being received, used for Rx traffic.
> 
> DSA class code deals with presentation of switch ports as Ethernet
> interfaces, deals with the master Ethernet device for I/O and helps 
> with
> parsing of the DT assuming the structure follows the DSA kernel 
> binding.
> 
> Support for switch cascading is not included yet.
> 
> In the sandbox environment, the DSA sandbox driver, the switch ports 
> and
> master eth interface look like this:
> => dm tree
>  Class     Index  Probed  Driver                Name
> -----------------------------------------------------------
> [...]
>  eth           4  [ + ]   eth_sandbox           |-- dsa-test-eth
>  dsa           0  [ + ]   dsa_sandbox           |-- dsa-test
>  eth           5  [ + ]   dsa-port              |   |-- lan0
>  eth           6  [ + ]   dsa-port              |   `-- lan1
> 
> => setenv ethact lan1
> => ping 1.2.3.5
> Using lan1 device
> host 1.2.3.5 is alive
> =>
> 
> This patch set also introduces a driver for the Ethernet switch 
> integrated
> into NXP LS1028A, called Felix.  The switch has 4 front panel ports, 
> I/O
> to/from it is done though an ENETC Ethernet interface and meta-data is
> carried between the switch and the driver though an additional header
> pre-pended to the original frame.
> Network commands like tftp can be used on these front panel ports.  The
> ports are disabled unless used so they do not cause issues on network
> topologies that include loops.
> 
> Felix as seen on LS1028A RDB:
> => dm tree
>  Class     Index  Probed  Driver                Name
> -----------------------------------------------------------
> [...]
>  dsa           0  [ + ]   felix-switch          |   |-- felix-switch
>  eth           4  [ + ]   dsa-port              |   |   |-- swp0
>  eth           5  [ + ]   dsa-port              |   |   |-- swp1
>  eth           6  [ + ]   dsa-port              |   |   |-- swp2
>  eth           7  [ + ]   dsa-port              |   |   `-- swp3
> 
> => mdio list
> [...]
> 10 - Vitesse VSC8514 <--> swp0
> 11 - Vitesse VSC8514 <--> swp1
> 12 - Vitesse VSC8514 <--> swp2
> 13 - Vitesse VSC8514 <--> swp3
> 
> NOTE:
> This patchset is a major rework of the dsa-class code since the last
> submission from May 5th:
> https://patchwork.ozlabs.org/project/uboot/cover/1588700588-8587-1-git-send-email-claudiu.manoil at nxp.com/
> The basic concepts and data path operation (tagging) in the DSA class
> code remain the same as in the initial patchset from Alex, however the
> external API has been changed significantly (simplified), the driver
> model integration has been improved to the point that the DSA class
> code no longer needs to allocate extra memory internally (via malloc),
> reduced memory footprint, internal state data moved from the external
> API and internalized, cleaner external API, internal code reworked,
> completely reworked DSA sandbox driver and unit tests for better 
> coverage
> and to integrate better with the eth sandbox driver and tests, etc.
> 
> v4:
> - Implemented the TODO for having a phy_device on the CPU port.
> - Enabled CONFIG_PHY_FIXED which is a new dependency of CONFIG_DM_DSA.
> 
> v3:
> - Removed all infrastructure associated with dsa_foreach_port, which
>   is no longer needed.
> - Only inherit the DSA master's MAC address if the environment does not
>   already have a specific MAC address that should be used for the DSA
>   port.
> - Be compatible with the new "ethernet-ports" container name which has
>   been introduced in the Linux kernel as commit 85e05d263ed2 ("net: 
> dsa:
>   of: Allow ethernet-ports as encapsulating node") in v5.9.
> - Fixed the felix driver not getting its ports initialized, due to
>   dsa_foreach_port() being actually unusable when called from the probe
>   function of the DSA udevice - the eth port udevices are _not_ yet
>   probed at that point. We are now initializing all ports from the
>   .port_enable() callback of each eth udevice.
> - Deleted the unit tests associated with the infrastructure for
>   dsa_foreach_port, since that function no longer exists.
> - Enabled the config options for the Kontron LS1028A board too.
> 
> v2: Switch node structure defined in dtsi now consistent with the Linux
> switch node definition. Moved aliases from dtsi to the RDB dts to
> minimize impact on other boards (and for improved flexibility).
> 
> Alex Marginean (3):
>   drivers: net: Add Felix DSA switch driver
>   arm: dts: ls1028a: Add Ethernet switch node and dependencies
>   configs: ls1028a: Enable the Ethernet switch driver in defconfig
> 
> Claudiu Manoil (2):
>   net: Introduce DSA class for Ethernet switches
>   sandbox: Add a DSA sandbox driver and unit test
> 
> Vladimir Oltean (2):
>   net: phy: fixed: support speeds of 2500 and 10000
>   net: phy: introduce fixed_phy_create for DSA CPU ports

Works now. Tested on Kontron sl28 var2 with two switch
ports routed to two SGMII lanes.

Tested-by: Michael Walle <michael@walle.cc> [on kontron_sl28]

Thanks,
-michael

  parent reply	other threads:[~2021-01-25 13:02 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 12:23 [PATCH v4 0/7] Introduce DSA Ethernet switch class and Felix driver Vladimir Oltean
2021-01-25 12:23 ` [PATCH v4 1/7] net: phy: fixed: support speeds of 2500 and 10000 Vladimir Oltean
2021-01-27  8:04   ` Claudiu Manoil
2021-02-16 21:55   ` Tom Rini
2021-01-25 12:23 ` [PATCH v4 2/7] net: phy: introduce fixed_phy_create for DSA CPU ports Vladimir Oltean
2021-01-27  8:05   ` Claudiu Manoil
2021-02-16 21:55   ` Tom Rini
2021-01-25 12:23 ` [PATCH v4 3/7] net: Introduce DSA class for Ethernet switches Vladimir Oltean
2021-02-16 21:55   ` Tom Rini
2021-01-25 12:23 ` [PATCH v4 4/7] sandbox: Add a DSA sandbox driver and unit test Vladimir Oltean
2021-02-16 18:14   ` Tom Rini
2021-02-16 21:02     ` Vladimir Oltean
2021-02-16 21:13       ` Tom Rini
2021-02-16 21:21         ` Vladimir Oltean
2021-02-16 21:33           ` Michael Walle
2021-02-16 21:38             ` Tom Rini
2021-02-16 21:53               ` Vladimir Oltean
2021-02-16 21:55                 ` Tom Rini
2021-02-16 21:58               ` Michael Walle
2021-02-16 22:15                 ` Michael Walle
2021-02-16 22:23                   ` Vladimir Oltean
2021-01-25 12:23 ` [PATCH v4 5/7] drivers: net: Add Felix DSA switch driver Vladimir Oltean
2021-02-16 21:55   ` Tom Rini
2021-01-25 12:23 ` [PATCH v4 6/7] arm: dts: ls1028a: Add Ethernet switch node and dependencies Vladimir Oltean
2021-01-25 12:33   ` Michael Walle
2021-02-16 21:56   ` Tom Rini
2021-01-25 12:23 ` [PATCH v4 7/7] configs: ls1028a: Enable the Ethernet switch driver in defconfig Vladimir Oltean
2021-02-16 21:56   ` Tom Rini
2021-01-25 13:02 ` Michael Walle [this message]
2021-01-25 13:04   ` [PATCH v4 0/7] Introduce DSA Ethernet switch class and Felix driver Vladimir Oltean

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=cc94250017d56e22021fdadaeda5b0e9@walle.cc \
    --to=michael@walle.cc \
    --cc=u-boot@lists.denx.de \
    /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 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.