Skip to content

FDB entries on DSA LAG interfaces

Vladimir Oltean netdev 5 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest11 patches 0 repliesApplied 11/11
  2. v411 patches 9 repliesSuperseded
  3. v311 patches 1 replySuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v212 patches2 repliesSuperseded
v1 RFC12 patches0 repliesSuperseded

Changes in v5 from the cover letter

- resent v4, which was marked as non applicable in patchwork (due to other patches getting accepted in the meanwhile, the offsets of some hunks changed a little, no other changes)

Patches in v5 All 11 applied

#Subject and filesSizeRepliesApplied
1/11net: dsa: rename references to "lag" as "lag_dev"include/net/dsa.h net/dsa/dsa2.c net/dsa/dsa_priv.h +2 more+31 -310 repliesApplied
2/11net: dsa: mv88e6xxx: rename references to "lag" as "lag_dev"drivers/net/dsa/mv88e6xxx/chip.c+25 -240 repliesApplied
3/11net: dsa: qca8k: rename references to "lag" as "lag_dev"drivers/net/dsa/qca8k.c+14 -140 repliesApplied
4/11net: dsa: make LAG IDs one-baseddrivers/net/dsa/mv88e6xxx/chip.c drivers/net/dsa/qca8k.c include/net/dsa.h +2 more+21 -150 repliesApplied
5/11net: dsa: mv88e6xxx: use dsa_switch_for_each_port in mv88e6xxx_lag_sync_masksdrivers/net/dsa/mv88e6xxx/chip.c+2 -20 repliesApplied
6/11net: dsa: create a dsa_lag structuredrivers/net/dsa/mv88e6xxx/chip.c drivers/net/dsa/ocelot/felix.c drivers/net/dsa/qca8k.c +7 more+173 -1090 repliesApplied
7/11net: switchdev: remove lag_mod_cb from switchdev_handle_fdb_event_to_devicedrivers/net/ethernet/microchip/lan966x/lan966x_switchdev.c include/net/switchdev.h net/dsa/slave.c +1 more+42 -660 repliesApplied
8/11net: dsa: remove "ds" and "port" from struct dsa_switchdev_event_worknet/dsa/dsa_priv.h net/dsa/slave.c+5 -130 repliesApplied
9/11net: dsa: call SWITCHDEV_FDB_OFFLOADED for the orig_devnet/dsa/dsa_priv.h net/dsa/slave.c+3 -10 repliesApplied
10/11net: dsa: support FDB events on offloaded LAG interfacesinclude/net/dsa.h net/dsa/dsa_priv.h net/dsa/port.c +2 more+183 -150 repliesApplied
11/11net: dsa: felix: support FDB entries on offloaded LAG interfacesdrivers/net/dsa/ocelot/felix.c drivers/net/ethernet/mscc/ocelot.c include/soc/mscc/ocelot.h+157 -10 repliesApplied

Reviews trailers per patch

9 of 11 patches have a Reviewed-by or Acked-by.

PatchFlorian Fainelli
1/11R-b
2/11R-b
3/11R-b
4/11R-b
5/11R-b
6/11R-b
7/11R-b
8/11R-b
9/11R-b
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 net-next 00/11] FDB entries on DSA LAG interfaces

v4->v5:
- resent v4, which was marked as non applicable in patchwork (due to other patches getting accepted in the meanwhile, the offsets of some hunks changed a little, no other changes)
v3->v4:
- avoid NULL pointer dereference in dsa_port_lag_leave() when the LAG is not offloaded (thanks to Alvin Šipraga)
- remove the "void *ctx" left over in struct dsa_switchdev_event_work
- make sure the dp->lag assignment is last in dsa_port_lag_create() v2->v3:
- Move the complexity of iterating over DSA slave interfaces that are members of the LAG bridge port from dsa_slave_fdb_event() to switchdev_handle_fdb_event_to_device().

This work permits having static and local FDB entries on LAG interfaces that are offloaded by DSA ports. New API needs to be introduced in drivers. To maintain consistency with the bridging offload code, I've taken the liberty to reorganize the data structures added by Tobias in the DSA core a little bit.

Tested on NXP LS1028A (felix switch). Would appreciate feedback/testing on other platforms too. Testing procedure was the one described here:
https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/

with this script:

ip link del bond0
ip link add bond0 type bond mode 802.3ad
ip link set swp1 down && ip link set swp1 master bond0 && ip link set swp1 up ip link set swp2 down && ip link set swp2 master bond0 && ip link set swp2 up ip link del br0
ip link add br0 type bridge && ip link set br0 up
ip link set br0 arp off
ip link set bond0 master br0 && ip link set bond0 up
ip link set swp0 master br0 && ip link set swp0 up
ip link set dev bond0 type bridge_slave flood off learning off bridge fdb add dev bond0 <mac address of other eno0> master static

I'm noticing a problem in 'bridge fdb dump' with the 'self' entries, and I didn't solve this. On Ocelot, an entry learned on a LAG is reported as being on the first member port of it (so instead of saying 'self bond0', it says 'self swp1'). This is better than not seeing the entry at all, but when DSA queries for the FDBs on a port via ds->ops->port_fdb_dump, it never queries for FDBs on a LAG. Not clear what we should do there, we aren't in control of the ->ndo_fdb_dump of the bonding/team drivers. Alternatively, we could just consider the 'self' entries reported via ndo_fdb_dump as "better than nothing", and concentrate on the 'master' entries that are in sync with the bridge when packets are flooded to software.

Vladimir Oltean (11):
net: dsa: rename references to "lag" as "lag_dev"
net: dsa: mv88e6xxx: rename references to "lag" as "lag_dev"
net: dsa: qca8k: rename references to "lag" as "lag_dev"
net: dsa: make LAG IDs one-based
net: dsa: mv88e6xxx: use dsa_switch_for_each_port in
mv88e6xxx_lag_sync_masks
net: dsa: create a dsa_lag structure
net: switchdev: remove lag_mod_cb from
switchdev_handle_fdb_event_to_device
net: dsa: remove "ds" and "port" from struct dsa_switchdev_event_work
net: dsa: call SWITCHDEV_FDB_OFFLOADED for the orig_dev
net: dsa: support FDB events on offloaded LAG interfaces
net: dsa: felix: support FDB entries on offloaded LAG interfaces

 drivers/net/dsa/mv88e6xxx/chip.c              |  46 ++++---
 drivers/net/dsa/ocelot/felix.c                |  26 +++-
 drivers/net/dsa/qca8k.c                       |  32 ++---
 .../microchip/lan966x/lan966x_switchdev.c     |  12 +-
 drivers/net/ethernet/mscc/ocelot.c            | 128 +++++++++++++++++-
 include/net/dsa.h                             |  66 ++++++---
 include/net/switchdev.h                       |  10 +-
 include/soc/mscc/ocelot.h                     |  12 ++
 net/dsa/dsa2.c                                |  45 +++---
 net/dsa/dsa_priv.h                            |  24 +++-
 net/dsa/port.c                                |  97 ++++++++++---
 net/dsa/slave.c                               |  64 +++++----
 net/dsa/switch.c                              | 109 +++++++++++++++
 net/dsa/tag_dsa.c                             |   4 +-
 net/switchdev/switchdev.c                     |  80 ++++-------
 15 files changed, 560 insertions(+), 195 deletions(-)
Signature · 1 line
2.25.1