mbox series

[v2,net-next,00/10] DSA changes for multiple CPU ports (part 4)

Message ID 20220911010706.2137967-1-vladimir.oltean@nxp.com (mailing list archive)
Headers show
Series DSA changes for multiple CPU ports (part 4) | expand

Message

Vladimir Oltean Sept. 11, 2022, 1:06 a.m. UTC
Those who have been following part 1:
https://patchwork.kernel.org/project/netdevbpf/cover/20220511095020.562461-1-vladimir.oltean@nxp.com/
part 2:
https://patchwork.kernel.org/project/netdevbpf/cover/20220521213743.2735445-1-vladimir.oltean@nxp.com/
and part 3:
https://patchwork.kernel.org/project/netdevbpf/cover/20220819174820.3585002-1-vladimir.oltean@nxp.com/
will know that I am trying to enable the second internal port pair from
the NXP LS1028A Felix switch for DSA-tagged traffic via "ocelot-8021q".

This series represents the final part of that effort. We have:

- the introduction of new UAPI in the form of IFLA_DSA_MASTER, the
  iproute2 patch for which is here:
  https://patchwork.kernel.org/project/netdevbpf/patch/20220904190025.813574-1-vladimir.oltean@nxp.com/

- preparation for LAG DSA masters in terms of suppressing some
  operations for masters in the DSA core that simply don't make sense
  when those masters are a bonding/team interface

- handling all the net device events that occur between DSA and a
  LAG DSA master, including migration to a different DSA master when the
  current master joins a LAG, or the LAG gets destroyed

- updating documentation

- adding an implementation for NXP LS1028A, where things are insanely
  complicated due to hardware limitations. We have 2 tagging protocols:

  * the native "ocelot" protocol (NPI port mode). This does not support
    CPU ports in a LAG, and supports a single DSA master. The DSA master
    can be changed between eno2 (2.5G) and eno3 (1G), but all ports must
    be down during the changing process, and user ports assigned to the
    old DSA master will refuse to come up if the user requests that
    during a "transient" state.

  * the "ocelot-8021q" software-defined protocol, where the Ethernet
    ports connected to the CPU are not actually "god mode" ports as far
    as the hardware is concerned. So here, static assignment between
    user and CPU ports is possible by editing the PGID_SRC masks for
    the port-based forwarding matrix, and "CPU ports in a LAG" simply
    means "a LAG like any other".

The series was regression-tested on LS1028A using the local_termination.sh
kselftest, in most of the possible operating modes and tagging protocols.
I have not done a detailed performance evaluation yet, but using LAG, is
possible to exceed the termination bandwidth of a single CPU port in an
iperf3 test with multiple senders and multiple receivers.

Changes in v2:
- remove unused variable in dsa_port_assign_master
- add restriction that LAG slaves must be DSA masters of the same switch
  tree
- move DSA master eligibility restriction earlier, from
  dsa_master_lag_setup() to dsa_master_prechangeupper_sanity_check()
- set master_setup = true in dsa_master_lag_setup(), so that
  dsa_master_teardown() would actually get called
- new patch to propagate extack to ds->ops->port_lag_join()
- don't overwrite extack in dsa_master_lag_setup() if
  dsa_port_lag_join() provided a more specific one
- add restriction that interfaces which aren't DSA masters cannot join a
  LAG DSA master
- provide alternate description of how to put CPU ports in a LAG
- pass extack to felix_port_change_master() from felix_lag_join()

v1 at:
https://patchwork.kernel.org/project/netdevbpf/cover/20220830195932.683432-1-vladimir.oltean@nxp.com/

Previous (older) RFC at:
https://lore.kernel.org/netdev/20220523104256.3556016-1-olteanv@gmail.com/

Vladimir Oltean (10):
  net: introduce iterators over synced hw addresses
  net: dsa: introduce dsa_port_get_master()
  net: dsa: allow the DSA master to be seen and changed through
    rtnetlink
  net: dsa: don't keep track of admin/oper state on LAG DSA masters
  net: dsa: suppress appending ethtool stats to LAG DSA masters
  net: dsa: suppress device links to LAG DSA masters
  net: dsa: propagate extack to port_lag_join
  net: dsa: allow masters to join a LAG
  docs: net: dsa: update information about multiple CPU ports
  net: dsa: felix: add support for changing DSA master

 .../networking/dsa/configuration.rst          |  96 +++++
 Documentation/networking/dsa/dsa.rst          |  38 +-
 drivers/net/dsa/bcm_sf2.c                     |   4 +-
 drivers/net/dsa/bcm_sf2_cfp.c                 |   4 +-
 drivers/net/dsa/lan9303-core.c                |   4 +-
 drivers/net/dsa/mv88e6xxx/chip.c              |  27 +-
 drivers/net/dsa/ocelot/felix.c                | 121 +++++-
 drivers/net/dsa/ocelot/felix.h                |   3 +
 drivers/net/dsa/qca/qca8k-common.c            |  23 +-
 drivers/net/dsa/qca/qca8k.h                   |   3 +-
 .../net/ethernet/mediatek/mtk_ppe_offload.c   |   2 +-
 drivers/net/ethernet/mscc/ocelot.c            |  11 +-
 drivers/net/ethernet/mscc/ocelot_net.c        |   7 +-
 include/linux/netdevice.h                     |   6 +
 include/net/dsa.h                             |  31 +-
 include/soc/mscc/ocelot.h                     |   4 +-
 include/uapi/linux/if_link.h                  |  10 +
 net/dsa/Makefile                              |  10 +-
 net/dsa/dsa.c                                 |   9 +
 net/dsa/dsa2.c                                |  34 +-
 net/dsa/dsa_priv.h                            |  18 +-
 net/dsa/master.c                              |  72 +++-
 net/dsa/netlink.c                             |  62 +++
 net/dsa/port.c                                | 160 +++++++-
 net/dsa/slave.c                               | 362 +++++++++++++++++-
 net/dsa/switch.c                              |  26 +-
 net/dsa/tag_8021q.c                           |   4 +-
 27 files changed, 1064 insertions(+), 87 deletions(-)
 create mode 100644 net/dsa/netlink.c

Comments

patchwork-bot+netdevbpf@kernel.org Sept. 20, 2022, 9:40 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Sun, 11 Sep 2022 04:06:56 +0300 you wrote:
> Those who have been following part 1:
> https://patchwork.kernel.org/project/netdevbpf/cover/20220511095020.562461-1-vladimir.oltean@nxp.com/
> part 2:
> https://patchwork.kernel.org/project/netdevbpf/cover/20220521213743.2735445-1-vladimir.oltean@nxp.com/
> and part 3:
> https://patchwork.kernel.org/project/netdevbpf/cover/20220819174820.3585002-1-vladimir.oltean@nxp.com/
> will know that I am trying to enable the second internal port pair from
> the NXP LS1028A Felix switch for DSA-tagged traffic via "ocelot-8021q".
> 
> [...]

Here is the summary with links:
  - [v2,net-next,01/10] net: introduce iterators over synced hw addresses
    https://git.kernel.org/netdev/net-next/c/db01868bf2e9
  - [v2,net-next,02/10] net: dsa: introduce dsa_port_get_master()
    https://git.kernel.org/netdev/net-next/c/8f6a19c0316d
  - [v2,net-next,03/10] net: dsa: allow the DSA master to be seen and changed through rtnetlink
    https://git.kernel.org/netdev/net-next/c/95f510d0b792
  - [v2,net-next,04/10] net: dsa: don't keep track of admin/oper state on LAG DSA masters
    https://git.kernel.org/netdev/net-next/c/6e61b55c6d7f
  - [v2,net-next,05/10] net: dsa: suppress appending ethtool stats to LAG DSA masters
    https://git.kernel.org/netdev/net-next/c/cfeb84a52fcb
  - [v2,net-next,06/10] net: dsa: suppress device links to LAG DSA masters
    https://git.kernel.org/netdev/net-next/c/13eccc1bbb2e
  - [v2,net-next,07/10] net: dsa: propagate extack to port_lag_join
    https://git.kernel.org/netdev/net-next/c/2e359b00a117
  - [v2,net-next,08/10] net: dsa: allow masters to join a LAG
    https://git.kernel.org/netdev/net-next/c/acc43b7bf52a
  - [v2,net-next,09/10] docs: net: dsa: update information about multiple CPU ports
    https://git.kernel.org/netdev/net-next/c/0773e3a851c8
  - [v2,net-next,10/10] net: dsa: felix: add support for changing DSA master
    https://git.kernel.org/netdev/net-next/c/eca70102cfb1

You are awesome, thank you!