linux/net/dsa
Vladimir Oltean dfca045cd4 net: dsa: fix off-by-one in maximum bridge ID determination
Prior to the blamed commit, the bridge_num range was from
0 to ds->max_num_bridges - 1. After the commit, it is from
1 to ds->max_num_bridges.

So this check:
	if (bridge_num >= max)
		return 0;
must be updated to:
	if (bridge_num > max)
		return 0;

in order to allow the last bridge_num value (==max) to be used.

This is easiest visible when a driver sets ds->max_num_bridges=1.
The observed behaviour is that even the first created bridge triggers
the netlink extack "Range of offloadable bridges exceeded" warning, and
is handled in software rather than being offloaded.

Fixes: 3f9bb0301d ("net: dsa: make dp->bridge_num one-based")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20260120211039.3228999-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-01-21 19:52:29 -08:00
..
Kconfig net: dsa: add tagging driver for MaxLinear GSW1xx switch family 2025-11-06 14:16:17 -08:00
Makefile net: dsa: add tagging driver for MaxLinear GSW1xx switch family 2025-11-06 14:16:17 -08:00
conduit.c net: dsa: append ethtool counters of all hidden ports to conduit 2025-11-25 17:33:55 -08:00
conduit.h
devlink.c devlink: pass extack through to devlink_param::get() 2025-11-20 19:01:22 -08:00
devlink.h
dsa.c net: dsa: fix off-by-one in maximum bridge ID determination 2026-01-21 19:52:29 -08:00
dsa.h
netlink.c
netlink.h
port.c net: dsa: avoid calling ds->ops->port_hsr_leave() when unoffloaded 2025-12-01 16:45:06 -08:00
port.h
stubs.c
switch.c
switch.h
tag.c net: dsa: provide a software untagging function on RX for VLAN-aware bridges 2024-08-16 09:59:32 +01:00
tag.h net: dsa: introduce the dsa_xmit_port_mask() tagging protocol helper 2025-11-28 20:03:39 -08:00
tag_8021q.c net: dsa: avoid refcount warnings when ds->ops->tag_8021q_vlan_del() fails 2025-04-16 18:14:44 -07:00
tag_8021q.h
tag_ar9331.c
tag_brcm.c net: dsa: tag_brcm: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:39 -08:00
tag_dsa.c
tag_gswip.c net: dsa: tag_gswip: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:39 -08:00
tag_hellcreek.c net: dsa: tag_hellcreek: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:39 -08:00
tag_ksz.c net: dsa: tag_ksz: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:39 -08:00
tag_lan9303.c
tag_mtk.c net: dsa: tag_mtk: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:40 -08:00
tag_mxl-gsw1xx.c net: dsa: tag_mxl_gsw1xx: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:40 -08:00
tag_none.c
tag_ocelot.c net: dsa: tag_ocelot: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:40 -08:00
tag_ocelot_8021q.c Kthreads affinity follow either of 4 existing different patterns: 2025-01-21 17:10:05 -08:00
tag_qca.c net: dsa: tag_qca: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:40 -08:00
tag_rtl4_a.c net: dsa: tag_rtl4_a: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:40 -08:00
tag_rtl8_4.c net: dsa: tag_rtl8_4: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:40 -08:00
tag_rzn1_a5psw.c net: dsa: tag_rzn1_a5psw: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:41 -08:00
tag_sja1105.c treewide: Introduce kthread_run_worker[_on_cpu]() 2025-01-08 18:15:03 +01:00
tag_trailer.c net: dsa: tag_trailer: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:41 -08:00
tag_vsc73xx_8021q.c
tag_xrs700x.c net: dsa: tag_xrs700x: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:41 -08:00
tag_yt921x.c net: dsa: tag_yt921x: use the dsa_xmit_port_mask() helper 2025-11-28 20:03:41 -08:00
trace.c
trace.h
user.c net: s/dev_close_many/netif_close_many/ 2025-07-18 17:27:47 -07:00
user.h