]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: dsa: add bridge member iteration macro
authorDaniel Golle <daniel@makrotopia.org>
Wed, 1 Apr 2026 13:34:42 +0000 (14:34 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 7 Apr 2026 01:30:33 +0000 (18:30 -0700)
commitf259e08494c47c614ce7b6d3079d1e0d3f30ae66
tree5cb7f9a5bb684d9c36bddba75b6e3e8b8097b026
parentb0a79590d10847f190ed377d2664377d7068191d
net: dsa: add bridge member iteration macro

Drivers that offload bridges need to iterate over the ports that are
members of a given bridge, for example to rebuild per-port forwarding
bitmaps when membership changes. Currently drivers typically open-code
this by combining dsa_switch_for_each_user_port() with a
dsa_port_offloads_bridge_dev() check, or cache bridge membership
within the driver.

Add dsa_switch_for_each_bridge_member() macro to express this pattern
directly, and use it for the existing dsa_bridge_ports() inline
helper.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://patch.msgid.link/e7136aaa26773f39e805a00fe4ecf13cd2b83fc0.1775049897.git.daniel@makrotopia.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/dsa.h