net: dsa: realtek: rtl8365mb: bridge offloading and VLAN support
Luiz Angelo Daros de Luca
maintainerv2 cover net: dsa: realtek: rtl8365mb: bridge offloading and VLAN support
This series introduces bridge offloading, FDB management, and VLAN support for the Realtek rtl8365mb DSA switch driver. The primary goal is to enable hardware frame forwarding between bridge ports, reducing CPU overhead and providing advanced features like VLAN and FDB isolation.
Some of these patches are based on original work by Alvin Šipraga, subsequently adapted and updated for the current net-next state.
---
I attempted to reach Alvin for review of the final version but was unable to establish contact. Any regressions in this version are my responsibility.
Changes in v2:
- added patch to use ERR_PTR()
- dropped bitfield patch. Use FIELD_PREP instead. Suggested by Yury Norov
- tag_rtl8_4 patches were submitted on its own series (already accepted)
- dropped rtl8365mb_vlan_mc_port_{add,del}(). rtl8365mb_vlan_mc_port_set is now called directly from PVID methods.
- reordered methods in rtl8365mb_vlan.c
- use dsa_switch_for_each_user_port() instead of simple for in bridge port join/leave
- PVID check now uses dsa_switch_for_each_available_port instead of dsa_switch_for_each_port
- set EFID of user ports to 0 at setup(), although it is the expected state after reset
- STP patch was dropped and replaced by a more extensive one that disables all ports (including unused ones) before setting CPU and user ports. It also extended the CPU port isolation to include all user ports.
- refactored bridge, FDB, and MDB port operations into the common rtl83xx module, introducing new realtek_ops callbacks to abstract the hardware access
- Collected Reviewed-by and Suggested-by tags
- Link to v1:
https://patch.msgid.link/[email protected]
To: Linus Walleij <[email protected]>
To: Alvin Šipraga <[email protected]>
To: Andrew Lunn <[email protected]>
To: Vladimir Oltean <[email protected]>
To: "David S. Miller" <[email protected]>
To: Eric Dumazet <[email protected]>
To: Jakub Kicinski <[email protected]>
To: Paolo Abeni <[email protected]>
To: Russell King <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
Alvin Šipraga (6):
net: dsa: realtek: rtl8365mb: prepare for multiple source files
net: dsa: realtek: rtl8365mb: add table lookup interface
net: dsa: realtek: rtl8365mb: add VLAN support
net: dsa: realtek: rtl8365mb: add port_bridge_{join,leave}
net: dsa: realtek: rtl8365mb: add FDB support
net: dsa: realtek: rtl8365mb: add bridge port flags
Luiz Angelo Daros de Luca (2):
net: dsa: realtek: rtl8365mb: use ERR_PTR
net: dsa: realtek: rtl8365mb: use dsa helpers for port iteration
drivers/net/dsa/realtek/Makefile | 4 +
drivers/net/dsa/realtek/realtek.h | 42 ++
drivers/net/dsa/realtek/rtl8365mb_l2.c | 494 ++++++++++++
drivers/net/dsa/realtek/rtl8365mb_l2.h | 32 +
.../dsa/realtek/{rtl8365mb.c => rtl8365mb_main.c} | 548 ++++++++++++--
drivers/net/dsa/realtek/rtl8365mb_table.c | 255 +++++++
drivers/net/dsa/realtek/rtl8365mb_table.h | 133 ++++
drivers/net/dsa/realtek/rtl8365mb_vlan.c | 824 +++++++++++++++++++++
drivers/net/dsa/realtek/rtl8365mb_vlan.h | 25 +
drivers/net/dsa/realtek/rtl83xx.c | 482 ++++++++++++
drivers/net/dsa/realtek/rtl83xx.h | 27 +
11 files changed, 2798 insertions(+), 68 deletions(-)---
base-commit: edf4bee4215a173c0534d1851d7523d827149f9e
change-id: 20260323-realtek_forward-1bac3a77c664
Best regards,
Signature · 1 line
Luiz Angelo Daros de Luca <[email protected]>
Luiz Angelo Daros de Luca
maintainerPATCH v2 1/8 net: dsa: realtek: rtl8365mb: use ERR_PTR
Convert numeric error codes into human-readable strings by using %pe together with ERR_PTR() in dev_err() messages.
--- drivers/net/dsa/realtek/rtl8365mb.c | 40 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 18 deletions(-)
drivers/net/dsa/realtek/rtl8365mb.c +22 -18
@@ -789,8 +789,8 @@ static int rtl8365mb_phy_read(struct realtek_priv *priv, int phy, int regnum) ret =rtl8365mb_phy_ocp_read (priv, phy, ocp_addr, &val);if (ret) {dev_err (priv->dev, -"failed to read PHY%d reg %02x @ %04x, ret %d\n" , phy, - regnum, ocp_addr, ret); +"failed to read PHY%d reg %02x @ %04x, ret %pe\n" , phy, + regnum, ocp_addr,ERR_PTR (ret));return ret; }
@@ -817,8 +817,8 @@ static int rtl8365mb_phy_write(struct realtek_priv *priv, int phy, int regnum, ret =rtl8365mb_phy_ocp_write (priv, phy, ocp_addr, val);if (ret) {dev_err (priv->dev, -"failed to write PHY%d reg %02x @ %04x, ret %d\n" , phy, - regnum, ocp_addr, ret); +"failed to write PHY%d reg %02x @ %04x, ret %pe\n" , phy, + regnum, ocp_addr,ERR_PTR (ret));return ret; }
@@ -1068,8 +1068,8 @@ static void rtl8365mb_phylink_mac_config(struct phylink_config *config, ret =rtl8365mb_ext_config_rgmii (priv, port, state->interface);if (ret)dev_err (priv->dev, -"failed to configure RGMII mode on port %d: %d\n" , - port, ret); +"failed to configure RGMII mode on port %d: %pe\n" , + port,ERR_PTR (ret));return ; }
@@ -1098,8 +1098,8 @@ static void rtl8365mb_phylink_mac_link_down(struct phylink_config *config, false, false);if (ret)dev_err (priv->dev, -"failed to reset forced mode on port %d: %d\n" , - port, ret); +"failed to reset forced mode on port %d: %pe\n" , + port,ERR_PTR (ret));return ; }
@@ -1129,8 +1129,8 @@ static void rtl8365mb_phylink_mac_link_up(struct phylink_config *config, rx_pause);if (ret)dev_err (priv->dev, -"failed to force mode on port %d: %d\n" , port, - ret); +"failed to force mode on port %d: %pe\n" , port, +ERR_PTR (ret));return ; }
@@ -1285,8 +1285,8 @@ static void rtl8365mb_get_ethtool_stats(struct dsa_switch *ds, int port, u64 *da mib->length, &data[i]);if (ret) {dev_err (priv->dev, -"failed to read port %d counters: %d\n" , port, - ret); +"failed to read port %d counters: %pe\n" , port, +ERR_PTR (ret));break ; } }
@@ -1638,7 +1638,8 @@ static irqreturn_t rtl8365mb_irq(int irq, void *data)return IRQ_HANDLED ; out_error: -dev_err (priv->dev,"failed to read interrupt status: %d\n" , ret); +dev_err (priv->dev,"failed to read interrupt status: %pe\n" , +ERR_PTR (ret)); out_none:return IRQ_NONE ;
@@ -1776,7 +1777,8 @@ static int rtl8365mb_irq_setup(struct realtek_priv *priv) ret =request_threaded_irq (irq,NULL , rtl8365mb_irq,IRQF_ONESHOT ,"rtl8365mb" , priv);if (ret) { -dev_err (priv->dev,"failed to request irq: %d\n" , ret); +dev_err (priv->dev,"failed to request irq: %pe\n" , +ERR_PTR (ret)); goto out_remove_irqdomain; }
@@ -1952,14 +1954,16 @@ static int rtl8365mb_setup(struct dsa_switch *ds) ret =rtl8365mb_reset_chip (priv);if (ret) { -dev_err (priv->dev,"failed to reset chip: %d\n" , ret); +dev_err (priv->dev,"failed to reset chip: %pe\n" , +ERR_PTR (ret)); goto out_error; }/* Configure switch to vendor-defined initial state */ ret =rtl8365mb_switch_init (priv);if (ret) { -dev_err (priv->dev,"failed to initialize switch: %d\n" , ret); +dev_err (priv->dev,"failed to initialize switch: %pe\n" , +ERR_PTR (ret)); goto out_error; }
@@ -2077,8 +2081,8 @@ static int rtl8365mb_detect(struct realtek_priv *priv) ret =rtl8365mb_get_chip_id_and_ver (priv->map, &chip_id, &chip_ver);if (ret) { -dev_err (priv->dev,"failed to read chip id and version: %d\n" , - ret); +dev_err (priv->dev,"failed to read chip id and version: %pe\n" , +ERR_PTR (ret));return ret; }
Signature · 1 line
2.53.0
Re: [net-next PATCH v2 1/8] net: dsa: realtek: rtl8365mb: use ERR_PTR
Quoted 4 lines · Luiz Angelo Daros de Luca
Convert numeric error codes into human-readable strings by using %pe together with
ERR_PTR()indev_err()messages.Signed-off-by Luiz Angelo Daros de Luca <[email protected]>
Yours,
Linus Walleij
Luiz Angelo Daros de Luca
maintainerPATCH v2 2/8 net: dsa: realtek: rtl8365mb: use dsa helpers for port iteration
In reply to Luiz Angelo Daros de LucaUse dsa_switch_for_each_*() whenever possible.
For port setup(), a new blocking setup phase was added for all ports, including unused ones, before the user and CPU port setup.
CPU isolation now includes all user ports as traffic was being blocked in some scenarios (suggested by Abdulkader Alrezej).
--- drivers/net/dsa/realtek/rtl8365mb.c | 115 +++++++++++++++++++++--------------- 1 file changed, 66 insertions(+), 49 deletions(-)
drivers/net/dsa/realtek/rtl8365mb.c +66 -49
@@ -1540,18 +1540,15 @@ static void rtl8365mb_stats_setup(struct realtek_priv *priv) {struct rtl8365mb *mb = priv->chip_data;struct dsa_switch *ds = &priv->ds; -int i; +struct dsa_port *dp;/* Per-chip global mutex to protect MIB counter access, since doing * so requires accessing a series of registers in a particular order. */ mutex_init (&mb->mib_lock); -for (i =0 ; i < priv->num_ports; i++) { -struct rtl8365mb_port *p = &mb->ports[i]; - -if (dsa_is_unused_port (ds, i)) -continue ; +dsa_switch_for_each_available_port (dp, ds) { +struct rtl8365mb_port *p = &mb->ports[dp->index];/* Per-port spinlock to protect the stats64 data */ spin_lock_init (&p->stats_lock);
@@ -1567,13 +1564,10 @@ static void rtl8365mb_stats_teardown(struct realtek_priv *priv) {struct rtl8365mb *mb = priv->chip_data;struct dsa_switch *ds = &priv->ds; -int i; - -for (i =0 ; i < priv->num_ports; i++) { -struct rtl8365mb_port *p = &mb->ports[i]; +struct dsa_port *dp; -if (dsa_is_unused_port (ds, i)) -continue ; +dsa_switch_for_each_available_port (dp, ds) { +struct rtl8365mb_port *p = &mb->ports[dp->index];cancel_delayed_work_sync (&p->mib_work); }
@@ -1632,6 +1626,9 @@ static irqreturn_t rtl8365mb_irq(int irq, void *data)for_each_set_bit (line, &line_changes, priv->num_ports) {int child_irq =irq_find_mapping (priv->irqdomain, line); +if (!child_irq) +continue ; +handle_nested_irq (child_irq); }
@@ -1695,13 +1692,14 @@ static int rtl8365mb_irq_disable(struct realtek_priv *priv)static int rtl8365mb_irq_setup (struct realtek_priv *priv) {struct rtl8365mb *mb = priv->chip_data; +struct dsa_switch *ds = &priv->ds;struct device_node *intc; +struct dsa_port *dp;u32 irq_trig;int virq;int irq;u32 val;int ret; -int i; intc =of_get_child_by_name (priv->dev->of_node,"interrupt-controller" );if (!intc) {
@@ -1727,8 +1725,8 @@ static int rtl8365mb_irq_setup(struct realtek_priv *priv) goto out_put_node; } -for (i =0 ; i < priv->num_ports; i++) { - virq =irq_create_mapping (priv->irqdomain, i); +dsa_switch_for_each_available_port (dp, ds) { + virq =irq_create_mapping (priv->irqdomain, dp->index);if (!virq) {dev_err (priv->dev,"failed to create irq domain mapping\n" );
@@ -1798,9 +1796,11 @@ static int rtl8365mb_irq_setup(struct realtek_priv *priv) mb->irq =0 ; out_remove_irqdomain: -for (i =0 ; i < priv->num_ports; i++) { - virq =irq_find_mapping (priv->irqdomain, i); -irq_dispose_mapping (virq); +dsa_switch_for_each_available_port (dp, ds) { + virq =irq_find_mapping (priv->irqdomain, dp->index); + +if (virq) +irq_dispose_mapping (virq); }irq_domain_remove (priv->irqdomain);
@@ -1815,8 +1815,9 @@ static int rtl8365mb_irq_setup(struct realtek_priv *priv)static void rtl8365mb_irq_teardown (struct realtek_priv *priv) {struct rtl8365mb *mb = priv->chip_data; +struct dsa_switch *ds = &priv->ds; +struct dsa_port *dp;int virq; -int i;if (mb->irq) {free_irq (mb->irq, priv);
@@ -1824,9 +1825,11 @@ static void rtl8365mb_irq_teardown(struct realtek_priv *priv) }if (priv->irqdomain) { -for (i =0 ; i < priv->num_ports; i++) { - virq =irq_find_mapping (priv->irqdomain, i); -irq_dispose_mapping (virq); +dsa_switch_for_each_available_port (dp, ds) { + virq =irq_find_mapping (priv->irqdomain, dp->index); + +if (virq) +irq_dispose_mapping (virq); }irq_domain_remove (priv->irqdomain);
@@ -1943,11 +1946,11 @@ static int rtl8365mb_reset_chip(struct realtek_priv *priv)static int rtl8365mb_setup (struct dsa_switch *ds) {struct realtek_priv *priv = ds->priv; +struct dsa_port *cpu_dp, *dp;struct rtl8365mb_cpu *cpu; -struct dsa_port *cpu_dp;struct rtl8365mb *mb; +u32 userports_mask;int ret; -int i; mb = priv->chip_data; cpu = &mb->cpu;
@@ -1974,44 +1977,58 @@ static int rtl8365mb_setup(struct dsa_switch *ds)else if (ret)dev_info (priv->dev,"no interrupt support\n" ); +/* Start with all ports blocked, including unused ports */ +dsa_switch_for_each_port (dp, ds) { +struct rtl8365mb_port *p = &mb->ports[dp->index]; + +/* Set the initial STP state of all ports to DISABLED, otherwise +* ports will still forward frames to the CPU despite being +* administratively down by default. +*/ +rtl8365mb_port_stp_state_set (ds, dp->index,BR_STATE_DISABLED ); + +/* Start with all port completely isolated */ + ret =rtl8365mb_port_set_isolation (priv, dp->index,0 ); +if (ret) + goto out_teardown_irq; + +/* Disable learning */ + ret =rtl8365mb_port_set_learning (priv, dp->index, false); +if (ret) + goto out_teardown_irq; + +/* Set up per-port private data */ + p->priv = priv; + p->index = dp->index; + } + + userports_mask =dsa_user_ports (ds); +/* Configure CPU tagging */ dsa_switch_for_each_cpu_port (cpu_dp, ds) { - cpu->mask |=BIT (cpu_dp->index); - +/* Use the first CPU port as trap_port */ if (cpu->trap_port ==RTL8365MB_MAX_NUM_PORTS ) cpu->trap_port = cpu_dp->index; + +/* Forward to all user ports */ + ret =rtl8365mb_port_set_isolation (priv, cpu_dp->index, + userports_mask); +if (ret) + goto out_teardown_irq; } + + cpu->mask =dsa_cpu_ports (ds); cpu->enable = cpu->mask >0 ; ret =rtl8365mb_cpu_config (priv);if (ret) goto out_teardown_irq; -/* Configure ports */ -for (i =0 ; i < priv->num_ports; i++) { -struct rtl8365mb_port *p = &mb->ports[i]; - -if (dsa_is_unused_port (ds, i)) -continue ; - +/* Configure user ports */ +dsa_switch_for_each_user_port (dp, ds) {/* Forward only to the CPU */ - ret =rtl8365mb_port_set_isolation (priv, i, cpu->mask); + ret =rtl8365mb_port_set_isolation (priv, dp->index, cpu->mask);if (ret) goto out_teardown_irq; - -/* Disable learning */ - ret =rtl8365mb_port_set_learning (priv, i, false); -if (ret) - goto out_teardown_irq; - -/* Set the initial STP state of all ports to DISABLED, otherwise -* ports will still forward frames to the CPU despite being -* administratively down by default. -*/ -rtl8365mb_port_stp_state_set (ds, i,BR_STATE_DISABLED ); - -/* Set up per-port private data */ - p->priv = priv; - p->index = i; } ret =rtl8365mb_port_change_mtu (ds, cpu->trap_port,ETH_DATA_LEN );
Signature · 1 line
2.53.0
Re: [net-next PATCH v2 2/8] net: dsa: realtek: rtl8365mb: use dsa helpers for port iteration
Quoted 10 lines · Luiz Angelo Daros de Luca
Use dsa_switch_for_each_*() whenever possible.
For port
setup(), a new blocking setup phase was added for all ports, including unused ones, before the user and CPU port setup.CPU isolation now includes all user ports as traffic was being blocked in some scenarios (suggested by Abdulkader Alrezej).
Suggested-by Abdulkader Alrezej <[email protected]>Signed-off-by Luiz Angelo Daros de Luca <[email protected]>
Yours,
Linus Walleij
Luiz Angelo Daros de Luca
maintainerPATCH v2 3/8 net: dsa: realtek: rtl8365mb: prepare for multiple source files
In reply to Luiz Angelo Daros de LucaFrom: Alvin Šipraga <[email protected]>
Rename rtl8365mb.c to rtl8365mb_main.c in preparation for subsequent commits which add additional source files to the driver.
The trailing backslash in the Makefile is deliberate. It allows for new files to be added without clobbering git history.
---
drivers/net/dsa/realtek/Makefile | 1 +
drivers/net/dsa/realtek/{rtl8365mb.c => rtl8365mb_main.c} | 0
2 files changed, 1 insertion(+)drivers/net/dsa/realtek/Makefile +1 -0
@@ -16,3 +16,4 @@ ifdef CONFIG_NET_DSA_REALTEK_RTL8366RB_LEDS rtl8366-objs += rtl8366rb-leds.o endif obj-$(CONFIG_NET_DSA_REALTEK_RTL8365MB) += rtl8365mb.o +rtl8365mb-objs := rtl8365mb_main.o \
drivers/net/dsa/realtek/rtl8365mb_main.c renamed from drivers/net/dsa/realtek/rtl8365mb.c +0 -0
Signature · 1 line
2.53.0
Luiz Angelo Daros de Luca
maintainerPATCH v2 4/8 net: dsa: realtek: rtl8365mb: add table lookup interface
In reply to Luiz Angelo Daros de LucaFrom: Alvin Šipraga <[email protected]>
Add a generic table lookup interface to centralize access to the RTL8365MB internal tables.
This interface abstracts the low-level table access logic and will be used by subsequent commits to implement FDB and VLAN operations.
--- drivers/net/dsa/realtek/Makefile | 1 + drivers/net/dsa/realtek/rtl8365mb_table.c | 255 ++++++++++++++++++++++++++++++ drivers/net/dsa/realtek/rtl8365mb_table.h | 133 ++++++++++++++++ 3 files changed, 389 insertions(+)
drivers/net/dsa/realtek/Makefile +1 -0
@@ -17,3 +17,4 @@ rtl8366-objs += rtl8366rb-leds.o endif obj-$(CONFIG_NET_DSA_REALTEK_RTL8365MB) += rtl8365mb.o rtl8365mb-objs := rtl8365mb_main.o \ + rtl8365mb_table.o \
drivers/net/dsa/realtek/rtl8365mb_table.c new file +255 -0
255 lines not on this page · raw message
drivers/net/dsa/realtek/rtl8365mb_table.h new file +133 -0
133 lines not on this page · raw message
Signature · 1 line
2.53.0
Jakub Kicinski
maintainerRe: [net-next PATCH v2 4/8] net: dsa: realtek: rtl8365mb: add table lookup interface
Quoted 8 lines · On Sun, 03 May 2026 03:18:24 -0300 Luiz Angelo Daros de Luca wrote:
From: Alvin Šipraga <[email protected]>
Add a generic table lookup interface to centralize access to the RTL8365MB internal tables.
This interface abstracts the low-level table access logic and will be used by subsequent commits to implement FDB and VLAN operations.
kdoc says:
Warning: drivers/net/dsa/realtek/rtl8365mb_table.h:32 enum rtl8365mb_table { RTL8365MB_TABLE_ACL_RULE = 1, RTL8365MB_TABLE_ACL_ACTION = 2, RTL8365MB_TABLE_CVLAN = 3, RTL8365MB_TABLE_L2 = 4, RTL8365MB_TABLE_IGMP_GROUP = 5, }; error: Cannot parse struct or union!
Warning: drivers/net/dsa/realtek/rtl8365mb_table.h:130 No description found for return value of 'rtl8365mb_table_query'
Warning: drivers/net/dsa/realtek/rtl8365mb_table.h:130 No description found for return value of 'rtl8365mb_table_query'
Jakub Kicinski
maintainerRe: [net-next PATCH v2 4/8] net: dsa: realtek: rtl8365mb: add table lookup interface
In reply to Luiz Angelo Daros de LucaQuoted 22 lines · On Sun, 03 May 2026 03:18:24 -0300 Luiz Angelo Daros de Luca wrote:
drivers/net/dsa/realtek/rtl8365mb_table.c new file +22
-0+int rtl8365mb_table_query (struct realtek_priv *priv, +enum rtl8365mb_table table, +enum rtl8365mb_table_op op,u16 *addr, +enum rtl8365mb_table_l2_method method, +u16 port,u16 *data,size_t size) +{ +bool addr_as_input = true; +bool write_data = false; +int ret =0 ; +u32 cmd; +u32 val; +u32 hit; + +if (!addr) { +dev_err (priv->dev,"%s: addr is NULL\n" , __func__); +return -EINVAL ; + } + +if (!data) { +dev_err (priv->dev,"%s: data is NULL\n" , __func__); +return -EINVAL ; + }
drivers/net/dsa/realtek/rtl8365mb_table.c line 92
Quoted 10 lines
drivers/net/dsa/realtek/rtl8365mb_table.c new file +10
-0+ +if (size >RTL8365MB_TABLE_ENTRY_MAX_SIZE ) { +dev_err (priv->dev,"%s: size too big: %zu\n" , __func__, size); +return -E2BIG ; + } + +if (size ==0 ) { +dev_err (priv->dev,"%s: size is 0\n" , __func__); +return -EINVAL ; + }
Defensive checks are discouraged in the kernel. AI will make short work of finding such trivial violations.
Luiz Angelo Daros de Luca
maintainerRe: [net-next PATCH v2 4/8] net: dsa: realtek: rtl8365mb: add table lookup interface
Quoted 2 lines
Defensive checks are discouraged in the kernel. AI will make short work of finding such trivial violations.
Sure. I removed this and other cases. I hope it is fine now. I'll soon send v3 with the fixes.
Regards,
Luiz
Luiz Angelo Daros de Luca
maintainerPATCH v2 5/8 net: dsa: realtek: rtl8365mb: add VLAN support
In reply to Luiz Angelo Daros de LucaFrom: Alvin Šipraga <[email protected]>
Realtek RTL8365MB switches (a.k.a. RTL8367C family) use two different structures for VLANs:
- VLAN4K: A full table with 4096 entries defining port membership and tagging.
- VLANMC: A smaller table with 32 entries used primarily for PVID assignment.
In this hardware, a port's PVID must point to an index in the VLANMC table rather than a VID directly. Since the VLANMC table is limited to 32 entries, the driver implements a dynamic allocation scheme to maximize resource usage:
- VLAN4K is treated by the driver as the source of truth for membership.
- A VLANMC entry is only allocated when a port is configured to use a specific VID as its PVID.
- VLANMC entries are deleted when no longer needed as a PVID by any port.
Although VLANMC has a members field, the switch only checks membership in the VLAN4K table. However, when a corresponding VLAN entry also exists in VLANMC, this driver keeps both membership configurations in sync.
VLANMC index 0, although a valid entry, is reserved in this driver as a neutral PVID value for ports not using a specific PVID.
In the subsequent RTL8367D switch family, VLANMC table was removed and PVID assignment was delegated to a dedicated set of registers.
All ports start isolated, forwarding exclusively to CPU ports, and with VLAN transparent, ignoring VLAN membership. Once a member in a bridge, the port isolation is expanded to include the bridge members. When that bridge enables VLAN filtering, the VLAN transparent feature is disabled, letting the switch filter based on VLAN setup.
The use of FIELD_PREP for reconstructing LO/HI values was suggested by Yury Norov.
Fix for vlan_setup and vlan_filtering was suggested by Abdulkader Alrezej.
--- drivers/net/dsa/realtek/Makefile | 1 + drivers/net/dsa/realtek/rtl8365mb_main.c | 248 ++++++++++ drivers/net/dsa/realtek/rtl8365mb_vlan.c | 824 +++++++++++++++++++++++++++++++ drivers/net/dsa/realtek/rtl8365mb_vlan.h | 25 + 4 files changed, 1098 insertions(+)
drivers/net/dsa/realtek/Makefile +1 -0
@@ -18,3 +18,4 @@ endif obj-$(CONFIG_NET_DSA_REALTEK_RTL8365MB) += rtl8365mb.o rtl8365mb-objs := rtl8365mb_main.o \ rtl8365mb_table.o \ + rtl8365mb_vlan.o \
drivers/net/dsa/realtek/rtl8365mb_main.c +248 -0
278 lines not on this page · raw message
drivers/net/dsa/realtek/rtl8365mb_vlan.c new file +824 -0
824 lines not on this page · raw message
drivers/net/dsa/realtek/rtl8365mb_vlan.h new file +25 -0
@@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* VLAN configuration interface for the rtl8365mb switch family +* +* Copyright (C) 2022 Alvin Šipraga <[email protected]> +* +*/ + +#ifndef _REALTEK_RTL8365MB_VLAN_H +#define _REALTEK_RTL8365MB_VLAN_H + +#include <linux/types.h> + +#include "realtek.h" + +int rtl8365mb_vlan_4k_port_add (struct dsa_switch *ds,int port, +const struct switchdev_obj_port_vlan *vlan, +struct netlink_ext_ack *extack); +int rtl8365mb_vlan_4k_port_del (struct dsa_switch *ds,int port, +const struct switchdev_obj_port_vlan *vlan); +int rtl8365mb_vlan_pvid_port_add (struct dsa_switch *ds,int port, +const struct switchdev_obj_port_vlan *vlan, +struct netlink_ext_ack *extack); +int rtl8365mb_vlan_pvid_port_del (struct dsa_switch *ds,int port, +const struct switchdev_obj_port_vlan *vlan); +#endif /* _REALTEK_RTL8365MB_VLAN_H */
Signature · 1 line
2.53.0
Re: [net-next PATCH v2 5/8] net: dsa: realtek: rtl8365mb: add VLAN support
Quoted 40 lines · Luiz Angelo Daros de Luca
From: Alvin Šipraga <[email protected]>
Realtek RTL8365MB switches (a.k.a. RTL8367C family) use two different structures for VLANs:
- VLAN4K: A full table with 4096 entries defining port membership and tagging.
- VLANMC: A smaller table with 32 entries used primarily for PVID assignment.In this hardware, a port's PVID must point to an index in the VLANMC table rather than a VID directly. Since the VLANMC table is limited to 32 entries, the driver implements a dynamic allocation scheme to maximize resource usage:
- VLAN4K is treated by the driver as the source of truth for membership.
- A VLANMC entry is only allocated when a port is configured to use a specific VID as its PVID.
- VLANMC entries are deleted when no longer needed as a PVID by any port.Although VLANMC has a members field, the switch only checks membership in the VLAN4K table. However, when a corresponding VLAN entry also exists in VLANMC, this driver keeps both membership configurations in sync.
VLANMC index 0, although a valid entry, is reserved in this driver as a neutral PVID value for ports not using a specific PVID.
In the subsequent RTL8367D switch family, VLANMC table was removed and PVID assignment was delegated to a dedicated set of registers.
All ports start isolated, forwarding exclusively to CPU ports, and with VLAN transparent, ignoring VLAN membership. Once a member in a bridge, the port isolation is expanded to include the bridge members. When that bridge enables VLAN filtering, the VLAN transparent feature is disabled, letting the switch filter based on VLAN setup.
The use of
FIELD_PREPfor reconstructing LO/HI values was suggested by Yury Norov.
Quoted 8 lines
Fix for
vlan_setupandvlan_filteringwas suggested by Abdulkader Alrezej.Suggested-by Yury Norov <[email protected]>Suggested-by Abdulkader Alrezej <[email protected]>Co-developed-by Alvin Šipraga <[email protected]>Signed-off-by Alvin Šipraga <[email protected]>Signed-off-by Luiz Angelo Daros de Luca <[email protected]>
Allright go ahead like this. Mental not to move the RTL8366RB VLAN handling down into the driver.
Yours,
Linus Walleij
Luiz Angelo Daros de Luca
maintainerPATCH v2 6/8 net: dsa: realtek: rtl8365mb: add port_bridge_{join,leave}
In reply to Luiz Angelo Daros de LucaFrom: Alvin Šipraga <[email protected]>
Implement hardware offloading of bridge functionality. This is achieved by using the per-port isolation registers, which contain a forwarding port mask. The switch will refuse to forward packets ingressed on a given port to a port which is not in its forwarding mask.
For each bridge that is offloaded, use the DSA-provided bridge number for the Extended Filtering ID (EFID). When using Independent VLAN Learning (IVL), the forwarding database is keyed with the tuple {VID, MAC, EFID}. There are 8 EFIDs available (0~7), but we reserve the default EFID 0 for standalone ports where learning is disabled. This fits nicely because DSA indexes the bridge number starting from 1.
Because of the limited number of EFIDs, we have to set the max_num_bridges property of our switch to 7: we can't offload more than that or we will fail to offer IVL as at least two bridges would end up having to share an EFID.
--- drivers/net/dsa/realtek/realtek.h | 5 ++ drivers/net/dsa/realtek/rtl8365mb_main.c | 57 +++++++++++++++- drivers/net/dsa/realtek/rtl83xx.c | 114 +++++++++++++++++++++++++++++++ drivers/net/dsa/realtek/rtl83xx.h | 7 ++ 4 files changed, 182 insertions(+), 1 deletion(-)
drivers/net/dsa/realtek/realtek.h +5 -0
@@ -107,6 +107,11 @@ struct realtek_ops {int (*enable_vlan)(struct realtek_priv *priv,bool enable);int (*enable_vlan4k)(struct realtek_priv *priv,bool enable);int (*enable_port)(struct realtek_priv *priv,int port,bool enable); +int (*port_add_isolation)(struct realtek_priv *priv,int port, +u32 mask); +int (*port_remove_isolation)(struct realtek_priv *priv,int port, +u32 mask); +int (*port_set_efid)(struct realtek_priv *priv,int port,u32 efid);int (*phy_read)(struct realtek_priv *priv,int phy,int regnum);int (*phy_write)(struct realtek_priv *priv,int phy,int regnum,u16 val);
drivers/net/dsa/realtek/rtl8365mb_main.c +56 -1
96 lines not on this page · raw message
drivers/net/dsa/realtek/rtl83xx.c +114 -0
120 lines not on this page · raw message
drivers/net/dsa/realtek/rtl83xx.h +7 -0
@@ -21,4 +21,11 @@ void rtl83xx_remove(struct realtek_priv *priv);void rtl83xx_reset_assert (struct realtek_priv *priv);void rtl83xx_reset_deassert (struct realtek_priv *priv); +int rtl83xx_port_bridge_join (struct dsa_switch *ds,int port, +struct dsa_bridge bridge, +bool *tx_forward_offload, +struct netlink_ext_ack *extack); +void rtl83xx_port_bridge_leave (struct dsa_switch *ds,int port, +struct dsa_bridge bridge); +#endif /* _RTL83XX_H */
Signature · 1 line
2.53.0
Re: [net-next PATCH v2 6/8] net: dsa: realtek: rtl8365mb: add port_bridge_{join,leave}
Quoted 14 lines · Luiz Angelo Daros de Luca
From: Alvin Šipraga <[email protected]>
Implement hardware offloading of bridge functionality. This is achieved by using the per-port isolation registers, which contain a forwarding port mask. The switch will refuse to forward packets ingressed on a given port to a port which is not in its forwarding mask.
For each bridge that is offloaded, use the DSA-provided bridge number for the Extended Filtering ID (EFID). When using Independent VLAN Learning (IVL), the forwarding database is keyed with the tuple {VID, MAC, EFID}. There are 8 EFIDs available (0~7), but we reserve the default EFID 0 for standalone ports where learning is disabled. This fits nicely because DSA indexes the bridge number starting from 1.
Quoted 8 lines
Because of the limited number of EFIDs, we have to set the
max_num_bridgesproperty of our switch to 7: we can't offload more than that or we will fail to offer IVL as at least two bridges would end up having to share an EFID.Co-developed-by Alvin Šipraga <[email protected]>Signed-off-by Alvin Šipraga <[email protected]>Signed-off-by Luiz Angelo Daros de Luca <[email protected]>
Sweet, exactly like this! Good work.
Yours,
Linus Walleij
Luiz Angelo Daros de Luca
maintainerPATCH v2 7/8 net: dsa: realtek: rtl8365mb: add FDB support
In reply to Luiz Angelo Daros de LucaFrom: Alvin Šipraga <[email protected]>
Implement support for FDB and MDB management for the RTL8365MB series switches.
The hardware supports IVL by keying the forwarding database with the {VID, MAC, EFID} tuple. The Extended Filtering ID (EFID) is 3 bits wide, providing 8 unique filtering domains. This driver reserves EFID 0 for standalone ports, effectively limiting the hardware offload to a maximum of 7 bridges.
Introduce a mutex lock (l2_lock) to protect concurrent L2 table updates.
Add support for forwarding database operations, including unicast and multicast entry handling as well as fast aging support.
--- drivers/net/dsa/realtek/Makefile | 1 + drivers/net/dsa/realtek/realtek.h | 29 ++ drivers/net/dsa/realtek/rtl8365mb_l2.c | 494 +++++++++++++++++++++++++++++++ drivers/net/dsa/realtek/rtl8365mb_l2.h | 32 ++ drivers/net/dsa/realtek/rtl8365mb_main.c | 21 +- drivers/net/dsa/realtek/rtl83xx.c | 268 +++++++++++++++++ drivers/net/dsa/realtek/rtl83xx.h | 16 + 7 files changed, 860 insertions(+), 1 deletion(-)
drivers/net/dsa/realtek/Makefile +1 -0
@@ -19,3 +19,4 @@ obj-$(CONFIG_NET_DSA_REALTEK_RTL8365MB) += rtl8365mb.o rtl8365mb-objs := rtl8365mb_main.o \ rtl8365mb_table.o \ rtl8365mb_vlan.o \ + rtl8365mb_l2.o \
drivers/net/dsa/realtek/realtek.h +29 -0
@@ -45,6 +45,12 @@ struct rtl8366_vlan_4k {u8 fid; }; +struct realtek_fdb_entry { +u8 mac_addr[ETH_ALEN ]; +u16 vid; +bool is_static; +}; +struct realtek_priv {struct device *dev;struct reset_control *reset_ctl;
@@ -54,6 +60,15 @@ struct realtek_priv {struct regmap *map;struct regmap *map_nolock;struct mutex map_lock; +/* l2_lock is used to prevent concurrent modifications of L2 table +* entries while another function is reading it. l2_(add,del)_mc +* is an example that first read current table entry and then +* create/update it. l2_(add|del)_uc uses a single table op and, +* internally, it might not need this lock. However, altering FDB +* may still collide, as well as l2_flush, with fdb_dump iterating +* over FDB. +*/ +struct mutex l2_lock;struct mii_bus *user_mii_bus;struct mii_bus *bus;int mdio_addr;
@@ -112,6 +127,19 @@ struct realtek_ops {int (*port_remove_isolation)(struct realtek_priv *priv,int port,u32 mask);int (*port_set_efid)(struct realtek_priv *priv,int port,u32 efid); +int (*l2_add_uc)(struct realtek_priv *priv,int port, +const unsigned char addr[ETH_ALEN ], +u16 efid,u16 vid); +int (*l2_del_uc)(struct realtek_priv *priv,int port, +const unsigned char addr[ETH_ALEN ], +u16 efid,u16 vid); +int (*l2_get_next_uc)(struct realtek_priv *priv,u16 *addr,int port, +struct realtek_fdb_entry *entry); +int (*l2_add_mc)(struct realtek_priv *priv,int port, +const unsigned char addr[ETH_ALEN ],u16 vid); +int (*l2_del_mc)(struct realtek_priv *priv,int port, +const unsigned char addr[ETH_ALEN ],u16 vid); +int (*l2_flush)(struct realtek_priv *priv,int port,u16 vid);int (*phy_read)(struct realtek_priv *priv,int phy,int regnum);int (*phy_write)(struct realtek_priv *priv,int phy,int regnum,u16 val);
@@ -124,6 +152,7 @@ struct realtek_variant {unsigned int clk_delay;u8 cmd_read;u8 cmd_write; +u16 l2_table_size;size_t chip_data_sz; };
drivers/net/dsa/realtek/rtl8365mb_l2.c new file +494 -0
494 lines not on this page · raw message
drivers/net/dsa/realtek/rtl8365mb_l2.h new file +32 -0
@@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Forwarding and multicast database interface for the rtl8365mb switch family +* +* Copyright (C) 2022 Alvin Šipraga <[email protected]> +*/ + +#ifndef _REALTEK_RTL8365MB_L2_H +#define _REALTEK_RTL8365MB_L2_H + +#include <linux/if_ether.h> +#include <linux/types.h> + +#include "realtek.h" + +int rtl8365mb_l2_get_next_uc (struct realtek_priv *priv,u16 *addr,int port, +struct realtek_fdb_entry *entry); +int rtl8365mb_l2_add_uc (struct realtek_priv *priv,int port, +const unsigned char addr[static ETH_ALEN ], +u16 efid,u16 vid); +int rtl8365mb_l2_del_uc (struct realtek_priv *priv,int port, +const unsigned char addr[static ETH_ALEN ], +u16 efid,u16 vid); +int rtl8365mb_l2_flush (struct realtek_priv *priv,int port,u16 vid); + +int rtl8365mb_l2_add_mc (struct realtek_priv *priv,int port, +const unsigned char mac_addr[static ETH_ALEN ], +u16 vid); +int rtl8365mb_l2_del_mc (struct realtek_priv *priv,int port, +const unsigned char mac_addr[static ETH_ALEN ], +u16 vid); + +#endif /* _REALTEK_RTL8365MB_L2_H */
drivers/net/dsa/realtek/rtl8365mb_main.c +20 -1
@@ -104,6 +104,7 @@#include "realtek-smi.h" #include "realtek-mdio.h" #include "rtl83xx.h" +#include "rtl8365mb_l2.h" #include "rtl8365mb_vlan.h" /* Family-specific data and limits */
@@ -111,8 +112,9 @@#define RTL8365MB_NUM_PHYREGS 32#define RTL8365MB_PHYREGMAX (RTL8365MB_NUM_PHYREGS - 1)#define RTL8365MB_MAX_NUM_PORTS 11 -#define RTL8365MB_MAX_NUM_EXTINTS 3 +/* Valid for the whole family except RTL8370B, which has 4160 entries. */ #define RTL8365MB_LEARN_LIMIT_MAX 2112 +#define RTL8365MB_MAX_NUM_EXTINTS 3/* Chip identification registers */ #define RTL8365MB_CHIP_ID_REG 0x1300
@@ -2229,6 +2231,8 @@ static int rtl8365mb_setup(struct dsa_switch *ds) mb = priv->chip_data; cpu = &mb->cpu; +mutex_init (&priv->l2_lock); + ret =rtl8365mb_reset_chip (priv);if (ret) { dev_err(priv->dev, "failed to reset chip: %pe\n",
@@ -2314,6 +2318,8 @@ static int rtl8365mb_setup(struct dsa_switch *ds)if (ret) goto out_teardown_irq; + ds->assisted_learning_on_cpu_port = true; + ds->fdb_isolation = true;/* The EFID is 3 bits, but EFID 0 is reserved for standalone ports */ ds->max_num_bridges =FIELD_MAX (RTL8365MB_EFID_MASK ); ds->configure_vlan_while_not_filtering = true;
@@ -2442,6 +2448,12 @@ static const struct dsa_switch_ops rtl8365mb_switch_ops = { .port_bridge_join = rtl83xx_port_bridge_join, .port_bridge_leave = rtl83xx_port_bridge_leave, .port_stp_state_set = rtl8365mb_port_stp_state_set, + .port_fast_age = rtl83xx_port_fast_age, + .port_fdb_add = rtl83xx_port_fdb_add, + .port_fdb_del = rtl83xx_port_fdb_del, + .port_fdb_dump = rtl83xx_port_fdb_dump, + .port_mdb_add = rtl83xx_port_mdb_add, + .port_mdb_del = rtl83xx_port_mdb_del, .port_vlan_add = rtl8365mb_port_vlan_add, .port_vlan_del = rtl8365mb_port_vlan_del, .port_vlan_filtering = rtl8365mb_port_vlan_filtering,
@@ -2463,6 +2475,12 @@ static const struct realtek_ops rtl8365mb_ops = { .port_add_isolation = rtl8365mb_port_add_isolation, .port_remove_isolation = rtl8365mb_port_remove_isolation, .port_set_efid = rtl8365mb_port_set_efid, + .l2_add_uc = rtl8365mb_l2_add_uc, + .l2_del_uc = rtl8365mb_l2_del_uc, + .l2_get_next_uc = rtl8365mb_l2_get_next_uc, + .l2_add_mc = rtl8365mb_l2_add_mc, + .l2_del_mc = rtl8365mb_l2_del_mc, + .l2_flush = rtl8365mb_l2_flush, .phy_read = rtl8365mb_phy_read, .phy_write = rtl8365mb_phy_write, };
@@ -2474,6 +2492,7 @@ const struct realtek_variant rtl8365mb_variant = { .clk_delay = 10, .cmd_read = 0xb9, .cmd_write = 0xb8, + .l2_table_size = RTL8365MB_LEARN_LIMIT_MAX, .chip_data_sz = sizeof(struct rtl8365mb), };
drivers/net/dsa/realtek/rtl83xx.c +268 -0
274 lines not on this page · raw message
drivers/net/dsa/realtek/rtl83xx.h +16 -0
@@ -28,4 +28,20 @@ int rtl83xx_port_bridge_join(struct dsa_switch *ds, int port,void rtl83xx_port_bridge_leave (struct dsa_switch *ds,int port,struct dsa_bridge bridge); +void rtl83xx_port_fast_age (struct dsa_switch *ds,int port); +int rtl83xx_port_fdb_add (struct dsa_switch *ds,int port, +const unsigned char *addr,u16 vid, +struct dsa_db db); +int rtl83xx_port_fdb_del (struct dsa_switch *ds,int port, +const unsigned char *addr,u16 vid, +struct dsa_db db); +int rtl83xx_port_fdb_dump (struct dsa_switch *ds,int port, +dsa_fdb_dump_cb_t *cb,void *data); +int rtl83xx_port_mdb_add (struct dsa_switch *ds,int port, +const struct switchdev_obj_port_mdb *mdb, +struct dsa_db db); +int rtl83xx_port_mdb_del (struct dsa_switch *ds,int port, +const struct switchdev_obj_port_mdb *mdb, +struct dsa_db db); +#endif /* _RTL83XX_H */
Signature · 1 line
2.53.0
Re: [net-next PATCH v2 7/8] net: dsa: realtek: rtl8365mb: add FDB support
Quoted 11 lines · Luiz Angelo Daros de Luca
From: Alvin Šipraga <[email protected]>
Implement support for FDB and MDB management for the RTL8365MB series switches.
The hardware supports IVL by keying the forwarding database with the {VID, MAC, EFID} tuple. The Extended Filtering ID (EFID) is 3 bits wide, providing 8 unique filtering domains. This driver reserves EFID 0 for standalone ports, effectively limiting the hardware offload to a maximum of 7 bridges.
Quoted 8 lines
Introduce a mutex lock (
l2_lock) to protect concurrent L2 table updates.Add support for forwarding database operations, including unicast and multicast entry handling as well as fast aging support.
Co-developed-by Alvin Šipraga <[email protected]>Signed-off-by Alvin Šipraga <[email protected]>Signed-off-by Luiz Angelo Daros de Luca <[email protected]>
Excellent, thanks!
Yours,
Linus Walleij
Jakub Kicinski
maintainerRe: [net-next PATCH v2 7/8] net: dsa: realtek: rtl8365mb: add FDB support
In reply to Luiz Angelo Daros de LucaQuoted 11 lines · On Sun, 03 May 2026 03:18:27 -0300 Luiz Angelo Daros de Luca wrote:
From: Alvin Šipraga <[email protected]>
Implement support for FDB and MDB management for the RTL8365MB series switches.
The hardware supports IVL by keying the forwarding database with the {VID, MAC, EFID} tuple. The Extended Filtering ID (EFID) is 3 bits wide, providing 8 unique filtering domains. This driver reserves EFID 0 for standalone ports, effectively limiting the hardware offload to a maximum of 7 bridges.
Quoted 4 lines
Introduce a mutex lock (
l2_lock) to protect concurrent L2 table updates.Add support for forwarding database operations, including unicast and multicast entry handling as well as fast aging support.
Warning: ../drivers/net/dsa/realtek/rtl8365mb_l2.c:243 function parameter 'entry' not described in 'rtl8365mb_l2_get_next_uc'
Warning: ../drivers/net/dsa/realtek/rtl8365mb_l2.c:243 function parameter 'entry' not described in 'rtl8365mb_l2_get_next_uc'
Signature · 1 line
pw-bot: cr
Luiz Angelo Daros de Luca
maintainerRe: [net-next PATCH v2 7/8] net: dsa: realtek: rtl8365mb: add FDB support
Quoted 2 lines
Warning:
../drivers/net/dsa/realtek/rtl8365mb_l2.c:243function parameter 'entry' not described in 'rtl8365mb_l2_get_next_uc'
Warning:../drivers/net/dsa/realtek/rtl8365mb_l2.c:243function parameter 'entry' not described in 'rtl8365mb_l2_get_next_uc'
Thanks Jakub, sorry for that. I missed the kernel-doc check before submitting.
Regards,
Luiz
Luiz Angelo Daros de Luca
maintainerPATCH v2 8/8 net: dsa: realtek: rtl8365mb: add bridge port flags
In reply to Luiz Angelo Daros de LucaFrom: Alvin Šipraga <[email protected]>
Implement support for bridge port flags to control learning and flooding behavior. This patch maps hardware functionalities to the following bridge flags:
- BR_LEARNING
- BR_FLOOD
- BR_MCAST_FLOOD
- BR_BCAST_FLOOD
By default, all flooding types are enabled during port setup to ensure standard bridge behavior.
--- drivers/net/dsa/realtek/realtek.h | 8 +++ drivers/net/dsa/realtek/rtl8365mb_main.c | 69 +++++++++++++++++++++ drivers/net/dsa/realtek/rtl83xx.c | 100 +++++++++++++++++++++++++++++++ drivers/net/dsa/realtek/rtl83xx.h | 4 ++ 4 files changed, 181 insertions(+)
drivers/net/dsa/realtek/realtek.h +8 -0
@@ -140,6 +140,14 @@ struct realtek_ops {int (*l2_del_mc)(struct realtek_priv *priv,int port,const unsigned char addr[ETH_ALEN ],u16 vid);int (*l2_flush)(struct realtek_priv *priv,int port,u16 vid); +int (*port_set_learning)(struct realtek_priv *priv,int port, +bool enable); +int (*port_set_ucast_flood)(struct realtek_priv *priv,int port, +bool enable); +int (*port_set_mcast_flood)(struct realtek_priv *priv,int port, +bool enable); +int (*port_set_bcast_flood)(struct realtek_priv *priv,int port, +bool enable);int (*phy_read)(struct realtek_priv *priv,int phy,int regnum);int (*phy_write)(struct realtek_priv *priv,int phy,int regnum,u16 val);
drivers/net/dsa/realtek/rtl8365mb_main.c +69 -0
99 lines not on this page · raw message
drivers/net/dsa/realtek/rtl83xx.c +100 -0
112 lines not on this page · raw message
drivers/net/dsa/realtek/rtl83xx.h +4 -0
@@ -27,6 +27,10 @@ int rtl83xx_port_bridge_join(struct dsa_switch *ds, int port, struct netlink_ext_ack *extack);void rtl83xx_port_bridge_leave (struct dsa_switch *ds,int port,struct dsa_bridge bridge); +int rtl83xx_port_bridge_flags (struct dsa_switch *ds,int port, +struct switchdev_brport_flags flags, +struct netlink_ext_ack *extack); +int rtl83xx_setup_port_flood_control (struct realtek_priv *priv,int port);void rtl83xx_port_fast_age (struct dsa_switch *ds,int port); int rtl83xx_port_fdb_add(struct dsa_switch *ds, int port,
Signature · 1 line
2.53.0
Re: [net-next PATCH v2 8/8] net: dsa: realtek: rtl8365mb: add bridge port flags
Quoted 11 lines · Luiz Angelo Daros de Luca
From: Alvin Šipraga <[email protected]>
Implement support for bridge port flags to control learning and flooding behavior. This patch maps hardware functionalities to the following bridge flags:
-
BR_LEARNING
-BR_FLOOD
-BR_MCAST_FLOOD
-BR_BCAST_FLOOD
Quoted 6 lines
By default, all flooding types are enabled during port setup to ensure standard bridge behavior.
Co-developed-by Alvin Šipraga <[email protected]>Signed-off-by Alvin Šipraga <[email protected]>Signed-off-by Luiz Angelo Daros de Luca <[email protected]>
Excellent again, thanks.
Yours,
Linus Walleij
Luiz Angelo Daros de Luca
maintainerRe: [net-next PATCH v2 8/8] net: dsa: realtek: rtl8365mb: add bridge port flags
Quoted 1 line
Excellent again, thanks.
Thank you, Linus. The code does look nicer. I hope it will ease our task of making these Realtek switches feature-complete.
Regards,
Luiz
Simon Horman
reviewerQuoted 7 lines · Luiz Angelo Daros de Luca
This series introduces bridge offloading, FDB management, and VLAN support for the Realtek rtl8365mb DSA switch driver. The primary goal is to enable hardware frame forwarding between bridge ports, reducing CPU overhead and providing advanced features like VLAN and FDB isolation.
Some of these patches are based on original work by Alvin Šipraga, subsequently adapted and updated for the current net-next state.
Hi,
There is somewhat overlapping AI-generated review of this patchset available at https://netdev-ai.bots.linux.dev/sashiko/ and
https://sashiko.dev/
I would appreciate it if you could look over that and address any issues which represent new bugs or regressions. While I think that, in general, any pre-existing problems that are flagged can be left as possible follow-up.
Luiz Angelo Daros de Luca
maintainerHi Simon,
Quoted 8 lines
There is somewhat overlapping AI-generated review of this patchset available at https://netdev-ai.bots.linux.dev/sashiko/ and
https://sashiko.dev/I would appreciate it if you could look over that and address any issues which represent new bugs or regressions. While I think that, in general, any pre-existing problems that are flagged can be left as possible follow-up.
Thanks for the suggestion. However, it will take me some time to fix all the issues. Most of them are real.
Regards,
Luiz
Simon Horman
reviewerQuoted 6 lines · Luiz Angelo Daros de Luca
Hi Simon,
Quoted 4 lines
There is somewhat overlapping AI-generated review of this patchset available at https://netdev-ai.bots.linux.dev/sashiko/ and
https://sashiko.dev/
Quoted 7 lines
Quoted 4 lines
I would appreciate it if you could look over that and address any issues which represent new bugs or regressions. While I think that, in general, any pre-existing problems that are flagged can be left as possible follow-up.
Thanks for the suggestion. However, it will take me some time to fix all the issues. Most of them are real.
Thanks, much appreciated.