netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 net-next 00/11] FDB entries on DSA LAG interfaces
@ 2022-02-21 21:23 Vladimir Oltean
  2022-02-21 21:23 ` [PATCH v4 net-next 01/11] net: dsa: rename references to "lag" as "lag_dev" Vladimir Oltean
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Vladimir Oltean @ 2022-02-21 21:23 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Jakub Kicinski, Andrew Lunn, Vivien Didelot,
	Florian Fainelli, Vladimir Oltean, Ansuel Smith,
	Tobias Waldekranz, DENG Qingfang, Claudiu Manoil,
	Alexandre Belloni, UNGLinuxDriver, Jiri Pirko, Ivan Vecera

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/20210205130240.4072854-1-vladimir.oltean@nxp.com/

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(-)

-- 
2.25.1


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

end of thread, other threads:[~2022-02-22  3:51 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-21 21:23 [PATCH v4 net-next 00/11] FDB entries on DSA LAG interfaces Vladimir Oltean
2022-02-21 21:23 ` [PATCH v4 net-next 01/11] net: dsa: rename references to "lag" as "lag_dev" Vladimir Oltean
2022-02-22  3:24   ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 02/11] net: dsa: mv88e6xxx: " Vladimir Oltean
2022-02-22  3:25   ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 03/11] net: dsa: qca8k: " Vladimir Oltean
2022-02-22  3:26   ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 04/11] net: dsa: make LAG IDs one-based Vladimir Oltean
2022-02-22  3:43   ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 05/11] net: dsa: mv88e6xxx: use dsa_switch_for_each_port in mv88e6xxx_lag_sync_masks Vladimir Oltean
2022-02-22  3:27   ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 06/11] net: dsa: create a dsa_lag structure Vladimir Oltean
2022-02-22  3:47   ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 07/11] net: switchdev: remove lag_mod_cb from switchdev_handle_fdb_event_to_device Vladimir Oltean
2022-02-22  3:50   ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 08/11] net: dsa: remove "ds" and "port" from struct dsa_switchdev_event_work Vladimir Oltean
2022-02-22  3:50   ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 09/11] net: dsa: call SWITCHDEV_FDB_OFFLOADED for the orig_dev Vladimir Oltean
2022-02-22  3:51   ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 10/11] net: dsa: support FDB events on offloaded LAG interfaces Vladimir Oltean
2022-02-21 21:23 ` [PATCH v4 net-next 11/11] net: dsa: felix: support FDB entries " Vladimir Oltean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).