Netdev List
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] dpaa2-switch: reject VLAN uppers while bridged
@ 2026-06-18  9:28 Ioana Ciornei
  2026-06-18  9:28 ` [PATCH net v2 1/2] dpaa2-switch: do not accept " Ioana Ciornei
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ioana Ciornei @ 2026-06-18  9:28 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, netdev
  Cc: f.fainelli, vladimir.oltean, linux-kernel

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(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net v2 1/2] dpaa2-switch: do not accept VLAN uppers while bridged
  2026-06-18  9:28 [PATCH net v2 0/2] dpaa2-switch: reject VLAN uppers while bridged Ioana Ciornei
@ 2026-06-18  9:28 ` Ioana Ciornei
  2026-06-18  9:28 ` [PATCH net v2 2/2] dpaa2-switch: fix VLAN upper check not rejecting bridge join Ioana Ciornei
  2026-06-19  1:00 ` [PATCH net v2 0/2] dpaa2-switch: reject VLAN uppers while bridged patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Ioana Ciornei @ 2026-06-18  9:28 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, netdev
  Cc: f.fainelli, vladimir.oltean, linux-kernel

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.

Fixes: f48298d3fbfa ("staging: dpaa2-switch: move the driver out of staging")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
Changes in v2:
- patch is new

 drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
index 45f276c2c3ec..83ccefdac59f 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
@@ -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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net v2 2/2] dpaa2-switch: fix VLAN upper check not rejecting bridge join
  2026-06-18  9:28 [PATCH net v2 0/2] dpaa2-switch: reject VLAN uppers while bridged Ioana Ciornei
  2026-06-18  9:28 ` [PATCH net v2 1/2] dpaa2-switch: do not accept " Ioana Ciornei
@ 2026-06-18  9:28 ` Ioana Ciornei
  2026-06-19  1:00 ` [PATCH net v2 0/2] dpaa2-switch: reject VLAN uppers while bridged patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Ioana Ciornei @ 2026-06-18  9:28 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, netdev
  Cc: f.fainelli, vladimir.oltean, linux-kernel

The 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.

Fixes: 45035febc495 ("net: dpaa2-switch: refactor prechangeupper sanity checks")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
Changes in v2:
- none

 drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
index 83ccefdac59f..858ba844ac51 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
@@ -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) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2 0/2] dpaa2-switch: reject VLAN uppers while bridged
  2026-06-18  9:28 [PATCH net v2 0/2] dpaa2-switch: reject VLAN uppers while bridged Ioana Ciornei
  2026-06-18  9:28 ` [PATCH net v2 1/2] dpaa2-switch: do not accept " Ioana Ciornei
  2026-06-18  9:28 ` [PATCH net v2 2/2] dpaa2-switch: fix VLAN upper check not rejecting bridge join Ioana Ciornei
@ 2026-06-19  1:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-06-19  1:00 UTC (permalink / raw)
  To: Ioana Ciornei
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev, f.fainelli,
	vladimir.oltean, linux-kernel

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-19  1:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-18  9:28 [PATCH net v2 0/2] dpaa2-switch: reject VLAN uppers while bridged Ioana Ciornei
2026-06-18  9:28 ` [PATCH net v2 1/2] dpaa2-switch: do not accept " Ioana Ciornei
2026-06-18  9:28 ` [PATCH net v2 2/2] dpaa2-switch: fix VLAN upper check not rejecting bridge join Ioana Ciornei
2026-06-19  1:00 ` [PATCH net v2 0/2] dpaa2-switch: reject VLAN uppers while bridged patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox