All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 net-next 0/7] Let switchdev drivers offload and unoffload bridge ports at their own convenience
@ 2021-07-21 16:23 ` Vladimir Oltean
  0 siblings, 0 replies; 28+ messages in thread
From: Vladimir Oltean @ 2021-07-21 16:23 UTC (permalink / raw)
  To: netdev, Jakub Kicinski, David S. Miller
  Cc: Andrew Lunn, Florian Fainelli, Vivien Didelot, Jiri Pirko,
	Ido Schimmel, Tobias Waldekranz, Roopa Prabhu,
	Nikolay Aleksandrov, Stephen Hemminger, bridge,
	Grygorii Strashko, Marek Behun, DENG Qingfang

This series introduces an explicit API through which switchdev drivers
mark a bridge port as offloaded or not:
- switchdev_bridge_port_offload()
- switchdev_bridge_port_unoffload()

Currently, the bridge assumes that a port is offloaded if
dev_get_port_parent_id(dev, &ppid, recurse=true) returns something, but
that is just an assumption that breaks some use cases (like a
non-offloaded LAG interface on top of a switchdev port, bridged with
other switchdev ports).

Along with some consolidation of the bridge logic to assign a "switchdev
offloading mark" to a port (now better called a "hardware domain"), this
series allows the bridge driver side to no longer impose restrictions on
that configuration.

Right now, all switchdev drivers must be modified to use the explicit
API, but more and more logic can then be placed centrally in the bridge
and therefore ease the job of a switchdev driver writer in the future.

For example, the first thing we can hook into the explicit switchdev
offloading API calls are the switchdev object and FDB replay helpers.
So far, these have only been used by DSA in "pull" mode (where the
driver must ask for them). Adding the replay helpers to other drivers
involves a lot of repetition. But by moving the helpers inside the
bridge port offload/unoffload hook points, we can move the entire replay
process to "push" mode (where the bridge provides them automatically).

The explicit switchdev offloading API will see further extensions in the
future.

The patches were split from a larger series for easier review:
https://patchwork.kernel.org/project/netdevbpf/cover/20210718214434.3938850-1-vladimir.oltean@nxp.com/

Changes in v6:
- Make the switchdev replay helpers opt-in
- Opt out of the replay helpers for mlxsw, rocker, prestera, sparx5,
  cpsw, am65-cpsw

Tobias Waldekranz (2):
  net: bridge: disambiguate offload_fwd_mark
  net: bridge: switchdev: recycle unused hwdoms

Vladimir Oltean (5):
  net: dpaa2-switch: use extack in dpaa2_switch_port_bridge_join
  net: dpaa2-switch: refactor prechangeupper sanity checks
  net: bridge: switchdev: let drivers inform which bridge ports are
    offloaded
  net: bridge: guard the switchdev replay helpers against a NULL
    notifier block
  net: bridge: move the switchdev object replay helpers to "push" mode

 .../ethernet/freescale/dpaa2/dpaa2-switch.c   |  67 ++++--
 .../ethernet/marvell/prestera/prestera_main.c |   3 +-
 .../marvell/prestera/prestera_switchdev.c     |  12 +-
 .../marvell/prestera/prestera_switchdev.h     |   3 +-
 .../mellanox/mlxsw/spectrum_switchdev.c       |  24 +-
 .../microchip/sparx5/sparx5_switchdev.c       |  24 +-
 drivers/net/ethernet/mscc/ocelot_net.c        | 104 ++++++--
 drivers/net/ethernet/rocker/rocker.h          |   3 +-
 drivers/net/ethernet/rocker/rocker_main.c     |   9 +-
 drivers/net/ethernet/rocker/rocker_ofdpa.c    |  19 +-
 drivers/net/ethernet/ti/am65-cpsw-nuss.c      |  18 +-
 drivers/net/ethernet/ti/cpsw_new.c            |  16 +-
 include/linux/if_bridge.h                     |  57 ++---
 net/bridge/br_fdb.c                           |   4 +-
 net/bridge/br_if.c                            |  11 +-
 net/bridge/br_mdb.c                           |   4 +-
 net/bridge/br_private.h                       |  60 ++++-
 net/bridge/br_switchdev.c                     | 227 +++++++++++++++---
 net/bridge/br_vlan.c                          |   4 +-
 net/dsa/dsa_priv.h                            |   6 +-
 net/dsa/port.c                                |  90 ++-----
 net/dsa/slave.c                               |  10 +-
 22 files changed, 560 insertions(+), 215 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2021-07-27  4:04 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21 16:23 [PATCH v6 net-next 0/7] Let switchdev drivers offload and unoffload bridge ports at their own convenience Vladimir Oltean
2021-07-21 16:23 ` [Bridge] " Vladimir Oltean
2021-07-21 16:23 ` [PATCH v6 net-next 1/7] net: dpaa2-switch: use extack in dpaa2_switch_port_bridge_join Vladimir Oltean
2021-07-21 16:23   ` [Bridge] " Vladimir Oltean
2021-07-21 16:23 ` [PATCH v6 net-next 2/7] net: dpaa2-switch: refactor prechangeupper sanity checks Vladimir Oltean
2021-07-21 16:23   ` [Bridge] " Vladimir Oltean
2021-07-21 16:23 ` [PATCH v6 net-next 3/7] net: bridge: disambiguate offload_fwd_mark Vladimir Oltean
2021-07-21 16:23   ` [Bridge] " Vladimir Oltean
2021-07-21 16:24 ` [PATCH v6 net-next 4/7] net: bridge: switchdev: recycle unused hwdoms Vladimir Oltean
2021-07-21 16:24   ` [Bridge] " Vladimir Oltean
2021-07-21 16:24 ` [PATCH v6 net-next 5/7] net: bridge: switchdev: let drivers inform which bridge ports are offloaded Vladimir Oltean
2021-07-21 16:24   ` [Bridge] " Vladimir Oltean
2021-07-26 13:51   ` Naresh Kamboju
2021-07-26 13:51     ` [Bridge] " Naresh Kamboju
2021-07-26 14:08     ` Andrew Lunn
2021-07-26 14:08       ` [Bridge] " Andrew Lunn
2021-07-26 14:37       ` Vladimir Oltean
2021-07-26 14:37         ` [Bridge] " Vladimir Oltean
2021-07-27  4:03       ` Naresh Kamboju
2021-07-27  4:03         ` [Bridge] " Naresh Kamboju
2021-07-21 16:24 ` [PATCH v6 net-next 6/7] net: bridge: guard the switchdev replay helpers against a NULL notifier block Vladimir Oltean
2021-07-21 16:24   ` [Bridge] " Vladimir Oltean
2021-07-21 16:27   ` Florian Fainelli
2021-07-21 16:27     ` [Bridge] " Florian Fainelli
2021-07-21 16:24 ` [PATCH v6 net-next 7/7] net: bridge: move the switchdev object replay helpers to "push" mode Vladimir Oltean
2021-07-21 16:24   ` [Bridge] " Vladimir Oltean
2021-07-22  7:40 ` [PATCH v6 net-next 0/7] Let switchdev drivers offload and unoffload bridge ports at their own convenience patchwork-bot+netdevbpf
2021-07-22  7:40   ` [Bridge] " patchwork-bot+netdevbpf

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.