From 7f31e15de430a71e09052a42fafc07fcbb1f3a2c Mon Sep 17 00:00:00 2001 From: Quinn O'Shea Date: Sat, 10 Oct 2026 14:29:00 -0500 Subject: [PATCH] realtek: dsa: map DSA LAG ids to zero-based trunk groups DSA numbers LAGs from 1 to num_lag_ids. The driver uses the id as it is to index its LAG arrays and as the hardware trunk group, both of which start at 0. Group 0 is therefore never used and the last id is refused, so one LAG fewer than the switch supports can be offloaded. Accept ids from 1 to num_lag_ids and subtract one where the id becomes a group. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Quinn O'Shea Link: https://github.com/openwrt/openwrt/pull/25792 Signed-off-by: Markus Stockhausen --- .../linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/dsa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/dsa.c index eb9bed5ac8a..a0fcbd8572c 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/dsa.c @@ -1358,7 +1358,7 @@ static bool rtldsa_83xx_lag_can_offload(struct dsa_switch *ds, int id; id = dsa_lag_id(ds->dst, lag); - if (id < 0 || id >= ds->num_lag_ids) + if (id < 1 || id > ds->num_lag_ids) return false; if (info->tx_type != NETDEV_LAG_TX_TYPE_HASH) @@ -1418,7 +1418,7 @@ static int rtldsa_port_lag_join(struct dsa_switch *ds, goto out; } - group = lag.id; + group = lag.id - 1; pr_info("port_lag_join: group %d, port %d\n", group, port); @@ -1450,7 +1450,7 @@ static int rtldsa_port_lag_leave(struct dsa_switch *ds, int port, mutex_lock(&priv->reg_mutex); - group = lag.id; + group = lag.id - 1; if (port >= priv->r->cpu_port) { err = -EINVAL;