[openwrt/openwrt] realtek: dsa: Record number of supported MSTs

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 15 07:22:09 PST 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/280cf19cdbcf41ddaad43e0ff9a1e8ed1e92f4a5

commit 280cf19cdbcf41ddaad43e0ff9a1e8ed1e92f4a5
Author: Sven Eckelmann <se at simonwunderlich.de>
AuthorDate: Mon Oct 27 15:29:01 2025 +0100

    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 <se at simonwunderlich.de>
    Link: https://github.com/openwrt/openwrt/pull/20421
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c  | 4 ++++
 target/linux/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 */




More information about the lede-commits mailing list