@@ -2016,7 +2016,6 @@ static int dpaa2_switch_port_bridge_join(struct net_device *netdev,
goto err_egress_flood;
err = switchdev_bridge_port_offload(netdev, netdev, NULL,
- &dpaa2_switch_port_switchdev_nb,
&dpaa2_switch_port_switchdev_blocking_nb,
false, extack);
if (err)
@@ -2053,7 +2052,6 @@ static int dpaa2_switch_port_restore_rxvlan(struct net_device *vdev, int vid, vo
static void dpaa2_switch_port_pre_bridge_leave(struct net_device *netdev)
{
switchdev_bridge_port_unoffload(netdev, NULL,
- &dpaa2_switch_port_switchdev_nb,
&dpaa2_switch_port_switchdev_blocking_nb);
}
@@ -502,7 +502,7 @@ int prestera_bridge_port_join(struct net_device *br_dev,
}
err = switchdev_bridge_port_offload(br_port->dev, port->dev, NULL,
- NULL, NULL, false, extack);
+ NULL, false, extack);
if (err)
goto err_switchdev_offload;
@@ -516,7 +516,7 @@ int prestera_bridge_port_join(struct net_device *br_dev,
return 0;
err_port_join:
- switchdev_bridge_port_unoffload(br_port->dev, NULL, NULL, NULL);
+ switchdev_bridge_port_unoffload(br_port->dev, NULL, NULL);
err_switchdev_offload:
prestera_bridge_port_put(br_port);
err_brport_create:
@@ -592,7 +592,7 @@ void prestera_bridge_port_leave(struct net_device *br_dev,
else
prestera_bridge_1d_port_leave(br_port);
- switchdev_bridge_port_unoffload(br_port->dev, NULL, NULL, NULL);
+ switchdev_bridge_port_unoffload(br_port->dev, NULL, NULL);
prestera_hw_port_learning_set(port, false);
prestera_hw_port_flood_set(port, BR_FLOOD | BR_MCAST_FLOOD, 0);
@@ -362,7 +362,7 @@ mlxsw_sp_bridge_port_create(struct mlxsw_sp_bridge_device *bridge_device,
bridge_port->ref_count = 1;
err = switchdev_bridge_port_offload(brport_dev, mlxsw_sp_port->dev,
- NULL, NULL, NULL, false, extack);
+ NULL, NULL, false, extack);
if (err)
goto err_switchdev_offload;
@@ -377,7 +377,7 @@ mlxsw_sp_bridge_port_create(struct mlxsw_sp_bridge_device *bridge_device,
static void
mlxsw_sp_bridge_port_destroy(struct mlxsw_sp_bridge_port *bridge_port)
{
- switchdev_bridge_port_unoffload(bridge_port->dev, NULL, NULL, NULL);
+ switchdev_bridge_port_unoffload(bridge_port->dev, NULL, NULL);
list_del(&bridge_port->list);
WARN_ON(!list_empty(&bridge_port->vlans_list));
kfree(bridge_port);
@@ -112,7 +112,7 @@ static int sparx5_port_bridge_join(struct sparx5_port *port,
set_bit(port->portno, sparx5->bridge_mask);
- err = switchdev_bridge_port_offload(ndev, ndev, NULL, NULL, NULL,
+ err = switchdev_bridge_port_offload(ndev, ndev, NULL, NULL,
false, extack);
if (err)
goto err_switchdev_offload;
@@ -134,7 +134,7 @@ static void sparx5_port_bridge_leave(struct sparx5_port *port,
{
struct sparx5 *sparx5 = port->sparx5;
- switchdev_bridge_port_unoffload(port->ndev, NULL, NULL, NULL);
+ switchdev_bridge_port_unoffload(port->ndev, NULL, NULL);
clear_bit(port->portno, sparx5->bridge_mask);
if (bitmap_empty(sparx5->bridge_mask, SPX5_PORTS))
@@ -1162,7 +1162,6 @@ static int ocelot_netdevice_bridge_join(struct net_device *dev,
ocelot_port_bridge_join(ocelot, port, bridge);
err = switchdev_bridge_port_offload(brport_dev, dev, priv,
- &ocelot_netdevice_nb,
&ocelot_switchdev_blocking_nb,
false, extack);
if (err)
@@ -1176,7 +1175,6 @@ static int ocelot_netdevice_bridge_join(struct net_device *dev,
err_switchdev_sync:
switchdev_bridge_port_unoffload(brport_dev, priv,
- &ocelot_netdevice_nb,
&ocelot_switchdev_blocking_nb);
err_switchdev_offload:
ocelot_port_bridge_leave(ocelot, port, bridge);
@@ -1189,7 +1187,6 @@ static void ocelot_netdevice_pre_bridge_leave(struct net_device *dev,
struct ocelot_port_private *priv = netdev_priv(dev);
switchdev_bridge_port_unoffload(brport_dev, priv,
- &ocelot_netdevice_nb,
&ocelot_switchdev_blocking_nb);
}
@@ -2598,7 +2598,7 @@ static int ofdpa_port_bridge_join(struct ofdpa_port *ofdpa_port,
if (err)
return err;
- return switchdev_bridge_port_offload(dev, dev, NULL, NULL, NULL,
+ return switchdev_bridge_port_offload(dev, dev, NULL, NULL,
false, extack);
}
@@ -2607,7 +2607,7 @@ static int ofdpa_port_bridge_leave(struct ofdpa_port *ofdpa_port)
struct net_device *dev = ofdpa_port->dev;
int err;
- switchdev_bridge_port_unoffload(dev, NULL, NULL, NULL);
+ switchdev_bridge_port_unoffload(dev, NULL, NULL);
err = ofdpa_port_vlan_del(ofdpa_port, OFDPA_UNTAGGED_VID, 0);
if (err)
@@ -2109,7 +2109,7 @@ static int am65_cpsw_netdevice_port_link(struct net_device *ndev,
return -EOPNOTSUPP;
}
- err = switchdev_bridge_port_offload(ndev, ndev, NULL, NULL, NULL,
+ err = switchdev_bridge_port_offload(ndev, ndev, NULL, NULL,
false, extack);
if (err)
return err;
@@ -2126,7 +2126,7 @@ static void am65_cpsw_netdevice_port_unlink(struct net_device *ndev)
struct am65_cpsw_common *common = am65_ndev_to_common(ndev);
struct am65_cpsw_ndev_priv *priv = am65_ndev_to_priv(ndev);
- switchdev_bridge_port_unoffload(ndev, NULL, NULL, NULL);
+ switchdev_bridge_port_unoffload(ndev, NULL, NULL);
common->br_members &= ~BIT(priv->port->port_id);
@@ -1518,7 +1518,7 @@ static int cpsw_netdevice_port_link(struct net_device *ndev,
return -EOPNOTSUPP;
}
- err = switchdev_bridge_port_offload(ndev, ndev, NULL, NULL, NULL,
+ err = switchdev_bridge_port_offload(ndev, ndev, NULL, NULL,
false, extack);
if (err)
return err;
@@ -1535,7 +1535,7 @@ static void cpsw_netdevice_port_unlink(struct net_device *ndev)
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_common *cpsw = priv->cpsw;
- switchdev_bridge_port_unoffload(ndev, NULL, NULL, NULL);
+ switchdev_bridge_port_unoffload(ndev, NULL, NULL);
cpsw->br_members &= ~BIT(priv->emac_port);
@@ -183,7 +183,6 @@ typedef int switchdev_obj_dump_cb_t(struct switchdev_obj *obj);
struct switchdev_brport {
struct net_device *dev;
const void *ctx;
- struct notifier_block *atomic_nb;
struct notifier_block *blocking_nb;
bool tx_fwd_offload;
};
@@ -265,13 +264,11 @@ switchdev_fdb_is_dynamically_learned(const struct switchdev_notifier_fdb_info *f
int switchdev_bridge_port_offload(struct net_device *brport_dev,
struct net_device *dev, const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb,
bool tx_fwd_offload,
struct netlink_ext_ack *extack);
void switchdev_bridge_port_unoffload(struct net_device *brport_dev,
const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb);
void switchdev_deferred_process(void);
@@ -354,7 +351,6 @@ int switchdev_handle_port_attr_set(struct net_device *dev,
static inline int
switchdev_bridge_port_offload(struct net_device *brport_dev,
struct net_device *dev, const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb,
bool tx_fwd_offload,
struct netlink_ext_ack *extack)
@@ -365,7 +361,6 @@ switchdev_bridge_port_offload(struct net_device *brport_dev,
static inline void
switchdev_bridge_port_unoffload(struct net_device *brport_dev,
const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb)
{
}
@@ -222,7 +222,7 @@ static int br_switchdev_blocking_event(struct notifier_block *nb,
b = &brport_info->brport;
err = br_switchdev_port_offload(p, b->dev, b->ctx,
- b->atomic_nb, b->blocking_nb,
+ b->blocking_nb,
b->tx_fwd_offload, extack);
err = notifier_from_errno(err);
break;
@@ -230,8 +230,7 @@ static int br_switchdev_blocking_event(struct notifier_block *nb,
brport_info = ptr;
b = &brport_info->brport;
- br_switchdev_port_unoffload(p, b->ctx, b->atomic_nb,
- b->blocking_nb);
+ br_switchdev_port_unoffload(p, b->ctx, b->blocking_nb);
break;
}
@@ -1946,13 +1946,11 @@ static inline void br_sysfs_delbr(struct net_device *dev) { return; }
#ifdef CONFIG_NET_SWITCHDEV
int br_switchdev_port_offload(struct net_bridge_port *p,
struct net_device *dev, const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb,
bool tx_fwd_offload,
struct netlink_ext_ack *extack);
void br_switchdev_port_unoffload(struct net_bridge_port *p, const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb);
bool br_switchdev_frame_uses_tx_fwd_offload(struct sk_buff *skb);
@@ -1986,7 +1984,6 @@ static inline void br_switchdev_frame_unmark(struct sk_buff *skb)
static inline int
br_switchdev_port_offload(struct net_bridge_port *p,
struct net_device *dev, const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb,
bool tx_fwd_offload,
struct netlink_ext_ack *extack)
@@ -1996,7 +1993,6 @@ br_switchdev_port_offload(struct net_bridge_port *p,
static inline void
br_switchdev_port_unoffload(struct net_bridge_port *p, const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb)
{
}
@@ -361,7 +361,6 @@ static int br_fdb_replay(const struct net_device *br_dev, const void *ctx,
}
static int nbp_switchdev_sync_objs(struct net_bridge_port *p, const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb,
struct netlink_ext_ack *extack)
{
@@ -386,7 +385,6 @@ static int nbp_switchdev_sync_objs(struct net_bridge_port *p, const void *ctx,
static void nbp_switchdev_unsync_objs(struct net_bridge_port *p,
const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb)
{
struct net_device *br_dev = p->br->dev;
@@ -404,7 +402,6 @@ static void nbp_switchdev_unsync_objs(struct net_bridge_port *p,
*/
int br_switchdev_port_offload(struct net_bridge_port *p,
struct net_device *dev, const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb,
bool tx_fwd_offload,
struct netlink_ext_ack *extack)
@@ -420,7 +417,7 @@ int br_switchdev_port_offload(struct net_bridge_port *p,
if (err)
return err;
- err = nbp_switchdev_sync_objs(p, ctx, atomic_nb, blocking_nb, extack);
+ err = nbp_switchdev_sync_objs(p, ctx, blocking_nb, extack);
if (err)
goto out_switchdev_del;
@@ -433,10 +430,9 @@ int br_switchdev_port_offload(struct net_bridge_port *p,
}
void br_switchdev_port_unoffload(struct net_bridge_port *p, const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb)
{
- nbp_switchdev_unsync_objs(p, ctx, atomic_nb, blocking_nb);
+ nbp_switchdev_unsync_objs(p, ctx, blocking_nb);
nbp_switchdev_del(p);
}
@@ -375,7 +375,6 @@ int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br,
tx_fwd_offload = dsa_port_bridge_tx_fwd_offload(dp, br);
err = switchdev_bridge_port_offload(brport_dev, dev, dp,
- &dsa_slave_switchdev_notifier,
&dsa_slave_switchdev_blocking_notifier,
tx_fwd_offload, extack);
if (err)
@@ -389,7 +388,6 @@ int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br,
out_rollback_unoffload:
switchdev_bridge_port_unoffload(brport_dev, dp,
- &dsa_slave_switchdev_notifier,
&dsa_slave_switchdev_blocking_notifier);
out_rollback_unbridge:
dsa_broadcast(DSA_NOTIFIER_BRIDGE_LEAVE, &info);
@@ -403,7 +401,6 @@ void dsa_port_pre_bridge_leave(struct dsa_port *dp, struct net_device *br)
struct net_device *brport_dev = dsa_port_to_bridge_port(dp);
switchdev_bridge_port_unoffload(brport_dev, dp,
- &dsa_slave_switchdev_notifier,
&dsa_slave_switchdev_blocking_notifier);
}
@@ -859,7 +859,6 @@ EXPORT_SYMBOL_GPL(switchdev_handle_port_attr_set);
int switchdev_bridge_port_offload(struct net_device *brport_dev,
struct net_device *dev, const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb,
bool tx_fwd_offload,
struct netlink_ext_ack *extack)
@@ -868,7 +867,6 @@ int switchdev_bridge_port_offload(struct net_device *brport_dev,
.brport = {
.dev = dev,
.ctx = ctx,
- .atomic_nb = atomic_nb,
.blocking_nb = blocking_nb,
.tx_fwd_offload = tx_fwd_offload,
},
@@ -886,13 +884,11 @@ EXPORT_SYMBOL_GPL(switchdev_bridge_port_offload);
void switchdev_bridge_port_unoffload(struct net_device *brport_dev,
const void *ctx,
- struct notifier_block *atomic_nb,
struct notifier_block *blocking_nb)
{
struct switchdev_notifier_brport_info brport_info = {
.brport = {
.ctx = ctx,
- .atomic_nb = atomic_nb,
.blocking_nb = blocking_nb,
},
};
Now that br_fdb_replay() uses the blocking_nb, there is no point in passing the atomic nb anymore. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> --- v2->v3: none drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 2 -- .../net/ethernet/marvell/prestera/prestera_switchdev.c | 6 +++--- drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 4 ++-- drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c | 4 ++-- drivers/net/ethernet/mscc/ocelot_net.c | 3 --- drivers/net/ethernet/rocker/rocker_ofdpa.c | 4 ++-- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 4 ++-- drivers/net/ethernet/ti/cpsw_new.c | 4 ++-- include/net/switchdev.h | 5 ----- net/bridge/br.c | 5 ++--- net/bridge/br_private.h | 4 ---- net/bridge/br_switchdev.c | 8 ++------ net/dsa/port.c | 3 --- net/switchdev/switchdev.c | 4 ---- 14 files changed, 17 insertions(+), 43 deletions(-)