Commit 3095f512 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'bridge-replay-helpers'



Vladimir Oltean says:

====================
Cleanup for the bridge replay helpers

This patch series brings some improvements to the logic added to the
bridge and DSA to handle LAG interfaces sandwiched between a bridge and
a DSA switch port.

        br0
        /  \
       /    \
     bond0  swp2
     /  \
    /    \
  swp0  swp1

In particular, it ensures that the switchdev object additions and
deletions are well balanced per physical port. This is important for
future work in the area of offloading local bridge FDB entries to
hardware in the context of DSA requesting a replay of those entries at
bridge join time (this will be submitted in a future patch series).
Due to some difficulty ensuring that the deletion of local FDB entries
pointing towards the bridge device itself is notified to switchdev in
time (before the switchdev port disconnects from the bridge), this is
potentially still not the final form in which the replay helpers will
exist. I'm thinking about moving from the pull mode (in which DSA
requests the replay) to a push mode (in which the bridge initiates the
replay). Nonetheless, these preliminary changes are needed either way.

The patch series also addresses some feedback from Nikolai which is long
overdue by now (sorry).

Switchdev driver maintainers were deliberately omitted due to the
trivial nature of the driver changes (just a function prototype).

Changes in v2:
- fix build issue in patch 4 (function prototype mismatch)
- move switchdev object unsync to the NETDEV_PRECHANGEUPPER code path
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a1b05634 74918945
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1625,7 +1625,7 @@ static int dpaa2_switch_port_bridge_flags(struct net_device *netdev,
	return 0;
}

static int dpaa2_switch_port_attr_set(struct net_device *netdev,
static int dpaa2_switch_port_attr_set(struct net_device *netdev, const void *ctx,
				      const struct switchdev_attr *attr,
				      struct netlink_ext_ack *extack)
{
+3 −3
Original line number Diff line number Diff line
@@ -708,7 +708,7 @@ static int prestera_port_attr_stp_state_set(struct prestera_port *port,
	return err;
}

static int prestera_port_obj_attr_set(struct net_device *dev,
static int prestera_port_obj_attr_set(struct net_device *dev, const void *ctx,
				      const struct switchdev_attr *attr,
				      struct netlink_ext_ack *extack)
{
@@ -1040,7 +1040,7 @@ static int prestera_port_vlans_add(struct prestera_port *port,
					     flag_pvid, extack);
}

static int prestera_port_obj_add(struct net_device *dev,
static int prestera_port_obj_add(struct net_device *dev, const void *ctx,
				 const struct switchdev_obj *obj,
				 struct netlink_ext_ack *extack)
{
@@ -1078,7 +1078,7 @@ static int prestera_port_vlans_del(struct prestera_port *port,
	return 0;
}

static int prestera_port_obj_del(struct net_device *dev,
static int prestera_port_obj_del(struct net_device *dev, const void *ctx,
				 const struct switchdev_obj *obj)
{
	struct prestera_port *port = netdev_priv(dev);
+3 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ static int mlx5_esw_bridge_switchdev_port_event(struct notifier_block *nb,
}

static int mlx5_esw_bridge_port_obj_add(struct net_device *dev,
					const void *ctx,
					const struct switchdev_obj *obj,
					struct netlink_ext_ack *extack)
{
@@ -107,6 +108,7 @@ static int mlx5_esw_bridge_port_obj_add(struct net_device *dev,
}

static int mlx5_esw_bridge_port_obj_del(struct net_device *dev,
					const void *ctx,
					const struct switchdev_obj *obj)
{
	const struct switchdev_obj_port_vlan *vlan;
@@ -136,6 +138,7 @@ static int mlx5_esw_bridge_port_obj_del(struct net_device *dev,
}

static int mlx5_esw_bridge_port_obj_attr_set(struct net_device *dev,
					     const void *ctx,
					     const struct switchdev_attr *attr,
					     struct netlink_ext_ack *extack)
{
+3 −3
Original line number Diff line number Diff line
@@ -898,7 +898,7 @@ mlxsw_sp_port_attr_br_mrouter_set(struct mlxsw_sp_port *mlxsw_sp_port,
	return 0;
}

static int mlxsw_sp_port_attr_set(struct net_device *dev,
static int mlxsw_sp_port_attr_set(struct net_device *dev, const void *ctx,
				  const struct switchdev_attr *attr,
				  struct netlink_ext_ack *extack)
{
@@ -1766,7 +1766,7 @@ mlxsw_sp_port_mrouter_update_mdb(struct mlxsw_sp_port *mlxsw_sp_port,
	}
}

static int mlxsw_sp_port_obj_add(struct net_device *dev,
static int mlxsw_sp_port_obj_add(struct net_device *dev, const void *ctx,
				 const struct switchdev_obj *obj,
				 struct netlink_ext_ack *extack)
{
@@ -1916,7 +1916,7 @@ mlxsw_sp_bridge_port_mdb_flush(struct mlxsw_sp_port *mlxsw_sp_port,
	}
}

static int mlxsw_sp_port_obj_del(struct net_device *dev,
static int mlxsw_sp_port_obj_del(struct net_device *dev, const void *ctx,
				 const struct switchdev_obj *obj)
{
	struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev);
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ static void sparx5_port_attr_ageing_set(struct sparx5_port *port,
	sparx5_set_ageing(port->sparx5, ageing_time);
}

static int sparx5_port_attr_set(struct net_device *dev,
static int sparx5_port_attr_set(struct net_device *dev, const void *ctx,
				const struct switchdev_attr *attr,
				struct netlink_ext_ack *extack)
{
Loading