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
Makefile
conduit.c
conduit.h
devlink.c
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
port.h
stubs.c
switch.c
switch.h
tag.c
tag.h
tag_8021q.c
tag_8021q.h
tag_ar9331.c
tag_brcm.c
tag_dsa.c
tag_gswip.c
tag_hellcreek.c
tag_ksz.c
tag_lan9303.c
tag_mtk.c
tag_mxl-gsw1xx.c
tag_none.c
tag_ocelot.c
tag_ocelot_8021q.c
tag_qca.c
tag_rtl4_a.c
tag_rtl8_4.c
tag_rzn1_a5psw.c
tag_sja1105.c
tag_trailer.c
tag_vsc73xx_8021q.c
tag_xrs700x.c
tag_yt921x.c
trace.c
trace.h
user.c
user.h