mbox series

[v3,net-next,00/12] Rework DSA bridge TX forwarding offload API

Message ID 20211206165758.1553882-1-vladimir.oltean@nxp.com (mailing list archive)
Headers show
Series Rework DSA bridge TX forwarding offload API | expand

Message

Vladimir Oltean Dec. 6, 2021, 4:57 p.m. UTC
This change set is preparation work for DSA support of bridge FDB
isolation. It replaces struct net_device *dp->bridge_dev with a struct
dsa_bridge *dp->bridge that contains some extra information about that
bridge, like a unique number kept by DSA.

Up until now we computed that number only with the bridge TX forwarding
offload feature, but it will be needed for other features too, like for
isolation of FDB entries belonging to different bridges. Hardware
implementations vary, but one common pattern seems to be the presence of
a FID field which can be associated with that bridge number kept by DSA.
The idea was outlined here:
https://patchwork.kernel.org/project/netdevbpf/patch/20210818120150.892647-16-vladimir.oltean@nxp.com/
(the difference being that with this new proposal, drivers would not
need to call dsa_bridge_num_find, instead the bridge_num would be part
of the struct dsa_bridge :: num passed as argument).

No functional change is intended for drivers that don't already make use
of the bridge TX forwarding offload. I've tested the changes on the
felix, sja1105 and mv88e6xxx drivers, but nonetheless I'm copying all
DSA driver maintainers due to API changes that are taking place.

Compared to v1 and v2, the amount of patches is larger, but the contents
is mostly the same, just split up hopefully a bit better for review.

Vladimir Oltean (12):
  net: dsa: make dp->bridge_num one-based
  net: dsa: assign a bridge number even without TX forwarding offload
  net: dsa: mt7530: iterate using dsa_switch_for_each_user_port in
    bridging ops
  net: dsa: mv88e6xxx: iterate using dsa_switch_for_each_user_port in
    mv88e6xxx_port_check_hw_vlan
  net: dsa: mv88e6xxx: compute port vlan membership based on
    dp->bridge_dev comparison
  net: dsa: hide dp->bridge_dev and dp->bridge_num in the core behind
    helpers
  net: dsa: hide dp->bridge_dev and dp->bridge_num in drivers behind
    helpers
  net: dsa: rename dsa_port_offloads_bridge to
    dsa_port_offloads_bridge_dev
  net: dsa: export bridging offload helpers to drivers
  net: dsa: keep the bridge_dev and bridge_num as part of the same
    structure
  net: dsa: add a "tx_fwd_offload" argument to ->port_bridge_join
  net: dsa: eliminate dsa_switch_ops :: port_bridge_tx_fwd_{,un}offload

 drivers/net/dsa/b53/b53_common.c       |   9 +-
 drivers/net/dsa/b53/b53_priv.h         |   5 +-
 drivers/net/dsa/dsa_loop.c             |   9 +-
 drivers/net/dsa/hirschmann/hellcreek.c |   5 +-
 drivers/net/dsa/lan9303-core.c         |   7 +-
 drivers/net/dsa/lantiq_gswip.c         |  25 +++--
 drivers/net/dsa/microchip/ksz_common.c |   7 +-
 drivers/net/dsa/microchip/ksz_common.h |   4 +-
 drivers/net/dsa/mt7530.c               |  58 +++++-----
 drivers/net/dsa/mv88e6xxx/chip.c       | 142 +++++++++++--------------
 drivers/net/dsa/ocelot/felix.c         |   8 +-
 drivers/net/dsa/qca8k.c                |  13 +--
 drivers/net/dsa/rtl8366rb.c            |   9 +-
 drivers/net/dsa/sja1105/sja1105_main.c |  40 ++++---
 drivers/net/dsa/xrs700x/xrs700x.c      |  10 +-
 include/linux/dsa/8021q.h              |   9 +-
 include/net/dsa.h                      | 108 +++++++++++++++----
 net/dsa/dsa2.c                         |  67 +++++++-----
 net/dsa/dsa_priv.h                     |  59 ++--------
 net/dsa/port.c                         | 124 ++++++++++-----------
 net/dsa/slave.c                        |  33 +++---
 net/dsa/switch.c                       |  20 ++--
 net/dsa/tag_8021q.c                    |  20 ++--
 net/dsa/tag_dsa.c                      |   5 +-
 net/dsa/tag_ocelot.c                   |   2 +-
 net/dsa/tag_sja1105.c                  |  11 +-
 26 files changed, 440 insertions(+), 369 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Dec. 8, 2021, 11 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  6 Dec 2021 18:57:46 +0200 you wrote:
> This change set is preparation work for DSA support of bridge FDB
> isolation. It replaces struct net_device *dp->bridge_dev with a struct
> dsa_bridge *dp->bridge that contains some extra information about that
> bridge, like a unique number kept by DSA.
> 
> Up until now we computed that number only with the bridge TX forwarding
> offload feature, but it will be needed for other features too, like for
> isolation of FDB entries belonging to different bridges. Hardware
> implementations vary, but one common pattern seems to be the presence of
> a FID field which can be associated with that bridge number kept by DSA.
> The idea was outlined here:
> https://patchwork.kernel.org/project/netdevbpf/patch/20210818120150.892647-16-vladimir.oltean@nxp.com/
> (the difference being that with this new proposal, drivers would not
> need to call dsa_bridge_num_find, instead the bridge_num would be part
> of the struct dsa_bridge :: num passed as argument).
> 
> [...]

Here is the summary with links:
  - [v3,net-next,01/12] net: dsa: make dp->bridge_num one-based
    https://git.kernel.org/netdev/net-next/c/3f9bb0301d50
  - [v3,net-next,02/12] net: dsa: assign a bridge number even without TX forwarding offload
    https://git.kernel.org/netdev/net-next/c/947c8746e2c3
  - [v3,net-next,03/12] net: dsa: mt7530: iterate using dsa_switch_for_each_user_port in bridging ops
    https://git.kernel.org/netdev/net-next/c/872bb81dfbc3
  - [v3,net-next,04/12] net: dsa: mv88e6xxx: iterate using dsa_switch_for_each_user_port in mv88e6xxx_port_check_hw_vlan
    https://git.kernel.org/netdev/net-next/c/0493fa7927af
  - [v3,net-next,05/12] net: dsa: mv88e6xxx: compute port vlan membership based on dp->bridge_dev comparison
    https://git.kernel.org/netdev/net-next/c/65144067d360
  - [v3,net-next,06/12] net: dsa: hide dp->bridge_dev and dp->bridge_num in the core behind helpers
    https://git.kernel.org/netdev/net-next/c/36cbf39b5690
  - [v3,net-next,07/12] net: dsa: hide dp->bridge_dev and dp->bridge_num in drivers behind helpers
    https://git.kernel.org/netdev/net-next/c/41fb0cf1bced
  - [v3,net-next,08/12] net: dsa: rename dsa_port_offloads_bridge to dsa_port_offloads_bridge_dev
    https://git.kernel.org/netdev/net-next/c/936db8a2dba2
  - [v3,net-next,09/12] net: dsa: export bridging offload helpers to drivers
    https://git.kernel.org/netdev/net-next/c/6a43cba30340
  - [v3,net-next,10/12] net: dsa: keep the bridge_dev and bridge_num as part of the same structure
    https://git.kernel.org/netdev/net-next/c/d3eed0e57d5d
  - [v3,net-next,11/12] net: dsa: add a "tx_fwd_offload" argument to ->port_bridge_join
    https://git.kernel.org/netdev/net-next/c/b079922ba2ac
  - [v3,net-next,12/12] net: dsa: eliminate dsa_switch_ops :: port_bridge_tx_fwd_{,un}offload
    https://git.kernel.org/netdev/net-next/c/857fdd74fb38

You are awesome, thank you!