dpaa2-switch: reject VLAN uppers while bridged
Subsystems (3)
Ioana Ciornei
maintainerv2 cover dpaa2-switch: reject VLAN uppers while bridged
The dpaa2-switch driver does not support VLAN uppers on its ports while they are bridged. The check which should have prevented a port with a VLAN upper to join bridge was poorly refactored and didn't actually return an error. Patch 2/2 fixes that.
On the other hand, the driver didn't reject the addition of a VLAN upper while bridged. Patch 1/2 fixes that.
Changes in v2:
- added patch 1/2
Ioana Ciornei (2):
dpaa2-switch: do not accept VLAN uppers while bridged
dpaa2-switch: fix VLAN upper check not rejecting bridge join
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
Signature · 1 line
2.25.1
Ioana Ciornei
maintainerPATCH v2 1/2 dpaa2-switch: do not accept VLAN uppers while bridged
The dpaa2-switch driver does not support VLAN uppers while its ports are bridged. This scenario tried to be prevented by rejecting a bridge join while VLAN uppers exist but the reverse order was still possible.
This patches adds a check so that the dpaa2-switch also does not accept VLAN uppers while bridged.
---
Changes in v2:
- patch is new
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +8 -0
@@ -2233,6 +2233,7 @@ dpaa2_switch_prechangeupper_sanity_checks(struct net_device *netdev,static int dpaa2_switch_port_prechangeupper (struct net_device *netdev,struct netdev_notifier_changeupper_info *info) { +struct ethsw_port_priv *port_priv;struct netlink_ext_ack *extack;struct net_device *upper_dev;int err;
@@ -2251,6 +2252,13 @@ static int dpaa2_switch_port_prechangeupper(struct net_device *netdev,if (!info->linking)dpaa2_switch_port_pre_bridge_leave (netdev); + }else if (is_vlan_dev (upper_dev)) { + port_priv =netdev_priv (netdev); +if (port_priv->fdb->bridge_dev) { +NL_SET_ERR_MSG_MOD (extack, +"Cannot accept VLAN uppers while bridged" ); +return -EOPNOTSUPP ; + } }return 0 ;
Signature · 1 line
2.25.1
Ioana Ciornei
maintainerPATCH v2 2/2 dpaa2-switch: fix VLAN upper check not rejecting bridge join
In reply to Ioana CiorneiThe blamed commit refactored the prechangeupper event handling but failed to actually return an error in case dpaa2_switch_prevent_bridging_with_8021q_upper() detected a 802.1q upper on a port which tries to join a bridge. Fix this by returning err instead of 0.
---
Changes in v2:
- none
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +1 -1
@@ -2212,7 +2212,7 @@ dpaa2_switch_prechangeupper_sanity_checks(struct net_device *netdev,if (err) {NL_SET_ERR_MSG_MOD (extack,"Cannot join a bridge while VLAN uppers are present" ); -return 0 ; +return err; }netdev_for_each_lower_dev (upper_dev, other_dev, iter) {
Signature · 1 line
2.25.1
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Thu, 18 Jun 2026 12:28:11 +0300 you wrote:
The dpaa2-switch driver does not support VLAN uppers on its ports while they are bridged. The check which should have prevented a port with a VLAN upper to join bridge was poorly refactored and didn't actually return an error. Patch 2/2 fixes that.
On the other hand, the driver didn't reject the addition of a VLAN upper while bridged. Patch 1/2 fixes that.
[...]
Here is the summary with links:
- [net,v2,1/2] dpaa2-switch: do not accept VLAN uppers while bridged (no matching commit)
- [net,v2,2/2] dpaa2-switch: fix VLAN upper check not rejecting bridge join
https://git.kernel.org/netdev/net/c/ed2294f94e34
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Thu, 18 Jun 2026 12:28:11 +0300 you wrote:
The dpaa2-switch driver does not support VLAN uppers on its ports while they are bridged. The check which should have prevented a port with a VLAN upper to join bridge was poorly refactored and didn't actually return an error. Patch 2/2 fixes that.
On the other hand, the driver didn't reject the addition of a VLAN upper while bridged. Patch 1/2 fixes that.
[...]
Here is the summary with links:
- [net,v2,1/2] dpaa2-switch: do not accept VLAN uppers while bridged
https://git.kernel.org/netdev/net/c/d07d80b6a129
- [net,v2,2/2] dpaa2-switch: fix VLAN upper check not rejecting bridge join (no matching commit)
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html