realtek: dsa: Record number of supported MSTs
authorSven Eckelmann <[email protected]>
Mon, 27 Oct 2025 14:29:01 +0000 (15:29 +0100)
committerHauke Mehrtens <[email protected]>
Sat, 15 Nov 2025 15:21:16 +0000 (16:21 +0100)
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 <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20421
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h

index 3cbbb1a5224c3bda29aa18f31a5c20e43912009b..dfb4c2f24cae4a0335e7c9f411a5f59c5fbe4b7f 100644 (file)
@@ -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;
index 8a5c8ce4fdfbac5c8dec7b5a41672f4794ddde66..c2c166d545e615ac3574899d3d7de27001cbedb9 100644 (file)
@@ -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 */