Commit d54f16c7 authored by David S. Miller's avatar David S. Miller

Merge branch 'switchdev-BRENTRY'

Vladimir Oltean says:

====================
kRemove BRENTRY checks from switchdev drivers

As discussed here:
https://patchwork.kernel.org/project/netdevbpf/patch/20220214233111.1586715-2-vladimir.oltean@nxp.com/#24738869

no switchdev driver makes use of VLAN port objects that lack the
BRIDGE_VLAN_INFO_BRENTRY flag. Notifying them in the first place rather
seems like an omission of commit 9c86ce2c ("net: bridge: Notify
about bridge VLANs").

Since commit 3116ad06 ("net: bridge: vlan: don't notify to switchdev
master VLANs without BRENTRY flag") that was just merged, the bridge no
longer notifies switchdev upon creation of these VLANs, so we can remove
the checks from drivers.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 5da1033b 5edb65ea
...@@ -269,9 +269,7 @@ mlxsw_sp_span_entry_bridge_8021q(const struct net_device *br_dev, ...@@ -269,9 +269,7 @@ mlxsw_sp_span_entry_bridge_8021q(const struct net_device *br_dev,
if (!vid && WARN_ON(br_vlan_get_pvid(br_dev, &vid))) if (!vid && WARN_ON(br_vlan_get_pvid(br_dev, &vid)))
return NULL; return NULL;
if (!vid || if (!vid || br_vlan_get_info(br_dev, vid, &vinfo))
br_vlan_get_info(br_dev, vid, &vinfo) ||
!(vinfo.flags & BRIDGE_VLAN_INFO_BRENTRY))
return NULL; return NULL;
edev = br_fdb_find_port(br_dev, dmac, vid); edev = br_fdb_find_port(br_dev, dmac, vid);
......
...@@ -1234,8 +1234,7 @@ static int mlxsw_sp_port_vlans_add(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -1234,8 +1234,7 @@ static int mlxsw_sp_port_vlans_add(struct mlxsw_sp_port *mlxsw_sp_port,
if (netif_is_bridge_master(orig_dev)) { if (netif_is_bridge_master(orig_dev)) {
int err = 0; int err = 0;
if ((vlan->flags & BRIDGE_VLAN_INFO_BRENTRY) && if (br_vlan_enabled(orig_dev))
br_vlan_enabled(orig_dev))
err = mlxsw_sp_br_ban_rif_pvid_change(mlxsw_sp, err = mlxsw_sp_br_ban_rif_pvid_change(mlxsw_sp,
orig_dev, vlan); orig_dev, vlan);
if (!err) if (!err)
......
...@@ -463,18 +463,6 @@ static int lan966x_handle_port_vlan_add(struct lan966x_port *port, ...@@ -463,18 +463,6 @@ static int lan966x_handle_port_vlan_add(struct lan966x_port *port,
const struct switchdev_obj_port_vlan *v = SWITCHDEV_OBJ_PORT_VLAN(obj); const struct switchdev_obj_port_vlan *v = SWITCHDEV_OBJ_PORT_VLAN(obj);
struct lan966x *lan966x = port->lan966x; struct lan966x *lan966x = port->lan966x;
/* When adding a port to a vlan, we get a callback for the port but
* also for the bridge. When get the callback for the bridge just bail
* out. Then when the bridge is added to the vlan, then we get a
* callback here but in this case the flags has set:
* BRIDGE_VLAN_INFO_BRENTRY. In this case it means that the CPU
* port is added to the vlan, so the broadcast frames and unicast frames
* with dmac of the bridge should be foward to CPU.
*/
if (netif_is_bridge_master(obj->orig_dev) &&
!(v->flags & BRIDGE_VLAN_INFO_BRENTRY))
return 0;
if (!netif_is_bridge_master(obj->orig_dev)) if (!netif_is_bridge_master(obj->orig_dev))
lan966x_vlan_port_add_vlan(port, v->vid, lan966x_vlan_port_add_vlan(port, v->vid,
v->flags & BRIDGE_VLAN_INFO_PVID, v->flags & BRIDGE_VLAN_INFO_PVID,
......
...@@ -369,13 +369,11 @@ static int sparx5_handle_port_vlan_add(struct net_device *dev, ...@@ -369,13 +369,11 @@ static int sparx5_handle_port_vlan_add(struct net_device *dev,
struct sparx5_port *port = netdev_priv(dev); struct sparx5_port *port = netdev_priv(dev);
if (netif_is_bridge_master(dev)) { if (netif_is_bridge_master(dev)) {
if (v->flags & BRIDGE_VLAN_INFO_BRENTRY) {
struct sparx5 *sparx5 = struct sparx5 *sparx5 =
container_of(nb, struct sparx5, container_of(nb, struct sparx5,
switchdev_blocking_nb); switchdev_blocking_nb);
sparx5_sync_bridge_dev_addr(dev, sparx5, v->vid, true); sparx5_sync_bridge_dev_addr(dev, sparx5, v->vid, true);
}
return 0; return 0;
} }
......
...@@ -237,15 +237,11 @@ static int am65_cpsw_port_vlans_add(struct am65_cpsw_port *port, ...@@ -237,15 +237,11 @@ static int am65_cpsw_port_vlans_add(struct am65_cpsw_port *port,
{ {
bool untag = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; bool untag = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
struct net_device *orig_dev = vlan->obj.orig_dev; struct net_device *orig_dev = vlan->obj.orig_dev;
bool cpu_port = netif_is_bridge_master(orig_dev);
bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID; bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID;
netdev_dbg(port->ndev, "VID add: %s: vid:%u flags:%X\n", netdev_dbg(port->ndev, "VID add: %s: vid:%u flags:%X\n",
port->ndev->name, vlan->vid, vlan->flags); port->ndev->name, vlan->vid, vlan->flags);
if (cpu_port && !(vlan->flags & BRIDGE_VLAN_INFO_BRENTRY))
return 0;
return am65_cpsw_port_vlan_add(port, untag, pvid, vlan->vid, orig_dev); return am65_cpsw_port_vlan_add(port, untag, pvid, vlan->vid, orig_dev);
} }
......
...@@ -252,15 +252,11 @@ static int cpsw_port_vlans_add(struct cpsw_priv *priv, ...@@ -252,15 +252,11 @@ static int cpsw_port_vlans_add(struct cpsw_priv *priv,
{ {
bool untag = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; bool untag = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
struct net_device *orig_dev = vlan->obj.orig_dev; struct net_device *orig_dev = vlan->obj.orig_dev;
bool cpu_port = netif_is_bridge_master(orig_dev);
bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID; bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID;
dev_dbg(priv->dev, "VID add: %s: vid:%u flags:%X\n", dev_dbg(priv->dev, "VID add: %s: vid:%u flags:%X\n",
priv->ndev->name, vlan->vid, vlan->flags); priv->ndev->name, vlan->vid, vlan->flags);
if (cpu_port && !(vlan->flags & BRIDGE_VLAN_INFO_BRENTRY))
return 0;
return cpsw_port_vlan_add(priv, untag, pvid, vlan->vid, orig_dev); return cpsw_port_vlan_add(priv, untag, pvid, vlan->vid, orig_dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment