]> Gentwo Git Trees - linux/.git/commitdiff
net: dsa: realtek: use simple HSR offload helpers
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 30 Nov 2025 13:16:50 +0000 (15:16 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 2 Dec 2025 00:45:07 +0000 (16:45 -0800)
All known Realtek protocols: "rtl4a", "rtl8_4" and "rtl8_4t" use
dsa_xmit_port_mask(), so they are compatible with accelerating TX packet
duplication for HSR rings.

Enable that feature by setting the port_hsr_join() and port_hsr_leave()
operations to the simple helpers provided by DSA.

Cc: "Alvin Šipraga" <alsi@bang-olufsen.dk>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20251130131657.65080-9-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/realtek/rtl8365mb.c
drivers/net/dsa/realtek/rtl8366rb.c

index 964a56ee16cc941f10593597d251ffd52bc35bf9..c575e164368c84f1bbbd29a38d12c9a1dc26856f 100644 (file)
@@ -2134,6 +2134,8 @@ static const struct dsa_switch_ops rtl8365mb_switch_ops = {
        .get_stats64 = rtl8365mb_get_stats64,
        .port_change_mtu = rtl8365mb_port_change_mtu,
        .port_max_mtu = rtl8365mb_port_max_mtu,
+       .port_hsr_join = dsa_port_simple_hsr_join,
+       .port_hsr_leave = dsa_port_simple_hsr_leave,
 };
 
 static const struct realtek_ops rtl8365mb_ops = {
index 8bdb52b5fdcb5a1823131e3a8637232dd9906769..d96ae72b0a5c12abd5e3f45a8247810a0c50c8b6 100644 (file)
@@ -1815,6 +1815,8 @@ static const struct dsa_switch_ops rtl8366rb_switch_ops = {
        .port_fast_age = rtl8366rb_port_fast_age,
        .port_change_mtu = rtl8366rb_change_mtu,
        .port_max_mtu = rtl8366rb_max_mtu,
+       .port_hsr_join = dsa_port_simple_hsr_join,
+       .port_hsr_leave = dsa_port_simple_hsr_leave,
 };
 
 static const struct realtek_ops rtl8366rb_ops = {