From 280cf19cdbcf41ddaad43e0ff9a1e8ed1e92f4a5 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 27 Oct 2025 15:29:01 +0100 Subject: [PATCH] realtek: dsa: Record number of supported MSTs Each SoC supports a different number of MST(I)s. The code must know this limitation to correctly reject unsupported MSTIs or to allocate a large enough mapping table. Signed-off-by: Sven Eckelmann Link: https://github.com/openwrt/openwrt/pull/20421 Signed-off-by: Hauke Mehrtens --- .../linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c | 4 ++++ .../realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h | 1 + 2 files changed, 5 insertions(+) diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c index 3cbbb1a522..dfb4c2f24c 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c @@ -1467,6 +1467,7 @@ static int __init rtl83xx_sw_probe(struct platform_device *pdev) rtl8380_get_version(priv); priv->ds->num_lag_ids = 8; priv->l2_bucket_size = 4; + priv->n_mst = 64; priv->n_pie_blocks = 12; priv->port_ignore = 0x1f; priv->n_counters = 128; @@ -1483,6 +1484,7 @@ static int __init rtl83xx_sw_probe(struct platform_device *pdev) rtl8390_get_version(priv); priv->ds->num_lag_ids = 16; priv->l2_bucket_size = 4; + priv->n_mst = 256; priv->n_pie_blocks = 18; priv->port_ignore = 0x3f; priv->n_counters = 1024; @@ -1503,6 +1505,7 @@ static int __init rtl83xx_sw_probe(struct platform_device *pdev) priv->ds->num_lag_ids = 16; sw_w32(0, RTL930X_ST_CTRL); priv->l2_bucket_size = 8; + priv->n_mst = 64; priv->n_pie_blocks = 16; priv->port_ignore = 0x3f; priv->n_counters = 2048; @@ -1523,6 +1526,7 @@ static int __init rtl83xx_sw_probe(struct platform_device *pdev) priv->ds->num_lag_ids = 16; sw_w32(0, RTL931x_ST_CTRL); priv->l2_bucket_size = 8; + priv->n_mst = 128; priv->n_pie_blocks = 16; priv->port_ignore = 0x3f; priv->n_counters = 2048; diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h index 8a5c8ce4fd..c2c166d545 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h @@ -1215,6 +1215,7 @@ struct rtl838x_switch_priv { u64 irq_mask; u32 fib_entries; int l2_bucket_size; + u16 n_mst; struct dentry *dbgfs_dir; /** @lags_port_members: Port (bit) is part of a specific LAG */ -- 2.30.2