FDB entries on DSA LAG interfaces
Subsystems (7)
Vladimir Oltean
maintainerv5 cover FDB entries on DSA LAG interfaces
v4->v5:
- resent v4, which was marked as non applicable in patchwork (due to other patches getting accepted in the meanwhile, the offsets of some hunks changed a little, no other changes)v3->v4:
- avoid NULL pointer dereference in dsa_port_lag_leave() when the LAG is not offloaded (thanks to Alvin Šipraga)
- remove the "void *ctx" left over in struct dsa_switchdev_event_work
- make sure the dp->lag assignment is last in dsa_port_lag_create() v2->v3:
- Move the complexity of iterating over DSA slave interfaces that are members of the LAG bridge port from dsa_slave_fdb_event() to switchdev_handle_fdb_event_to_device().
This work permits having static and local FDB entries on LAG interfaces that are offloaded by DSA ports. New API needs to be introduced in drivers. To maintain consistency with the bridging offload code, I've taken the liberty to reorganize the data structures added by Tobias in the DSA core a little bit.
Tested on NXP LS1028A (felix switch). Would appreciate feedback/testing on other platforms too. Testing procedure was the one described here:
https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/
with this script:
ip link del bond0
ip link add bond0 type bond mode 802.3ad
ip link set swp1 down && ip link set swp1 master bond0 && ip link set swp1 up ip link set swp2 down && ip link set swp2 master bond0 && ip link set swp2 up ip link del br0
ip link add br0 type bridge && ip link set br0 up
ip link set br0 arp off
ip link set bond0 master br0 && ip link set bond0 up
ip link set swp0 master br0 && ip link set swp0 up
ip link set dev bond0 type bridge_slave flood off learning off bridge fdb add dev bond0 <mac address of other eno0> master static
I'm noticing a problem in 'bridge fdb dump' with the 'self' entries, and I didn't solve this. On Ocelot, an entry learned on a LAG is reported as being on the first member port of it (so instead of saying 'self bond0', it says 'self swp1'). This is better than not seeing the entry at all, but when DSA queries for the FDBs on a port via ds->ops->port_fdb_dump, it never queries for FDBs on a LAG. Not clear what we should do there, we aren't in control of the ->ndo_fdb_dump of the bonding/team drivers. Alternatively, we could just consider the 'self' entries reported via ndo_fdb_dump as "better than nothing", and concentrate on the 'master' entries that are in sync with the bridge when packets are flooded to software.
Vladimir Oltean (11):
net: dsa: rename references to "lag" as "lag_dev"
net: dsa: mv88e6xxx: rename references to "lag" as "lag_dev"
net: dsa: qca8k: rename references to "lag" as "lag_dev"
net: dsa: make LAG IDs one-based
net: dsa: mv88e6xxx: use dsa_switch_for_each_port in
mv88e6xxx_lag_sync_masks
net: dsa: create a dsa_lag structure
net: switchdev: remove lag_mod_cb from
switchdev_handle_fdb_event_to_device
net: dsa: remove "ds" and "port" from struct dsa_switchdev_event_work
net: dsa: call SWITCHDEV_FDB_OFFLOADED for the orig_dev
net: dsa: support FDB events on offloaded LAG interfaces
net: dsa: felix: support FDB entries on offloaded LAG interfaces
drivers/net/dsa/mv88e6xxx/chip.c | 46 ++++--- drivers/net/dsa/ocelot/felix.c | 26 +++- drivers/net/dsa/qca8k.c | 32 ++--- .../microchip/lan966x/lan966x_switchdev.c | 12 +- drivers/net/ethernet/mscc/ocelot.c | 128 +++++++++++++++++- include/net/dsa.h | 66 ++++++--- include/net/switchdev.h | 10 +- include/soc/mscc/ocelot.h | 12 ++ net/dsa/dsa2.c | 45 +++--- net/dsa/dsa_priv.h | 24 +++- net/dsa/port.c | 97 ++++++++++--- net/dsa/slave.c | 64 +++++---- net/dsa/switch.c | 109 +++++++++++++++ net/dsa/tag_dsa.c | 4 +- net/switchdev/switchdev.c | 80 ++++------- 15 files changed, 560 insertions(+), 195 deletions(-)
Signature · 1 line
2.25.1
Vladimir Oltean
maintainerPATCH v5 1/11 net: dsa: rename references to "lag" as "lag_dev"
In preparation of converting struct net_device *dp->lag_dev into a struct dsa_lag *dp->lag, we need to rename, for consistency purposes, all occurrences of the "lag" variable in the DSA core to "lag_dev".
---v1->v5: none
include/net/dsa.h | 12 ++++++------ net/dsa/dsa2.c | 16 ++++++++-------- net/dsa/dsa_priv.h | 6 +++--- net/dsa/port.c | 20 ++++++++++---------- net/dsa/switch.c | 8 ++++---- 5 files changed, 31 insertions(+), 31 deletions(-)
include/net/dsa.h +6 -6
@@ -182,12 +182,12 @@ static inline struct net_device *dsa_lag_dev(struct dsa_switch_tree *dst, }static inline int dsa_lag_id (struct dsa_switch_tree *dst, -struct net_device *lag) +struct net_device *lag_dev) {unsigned int id; dsa_lags_foreach_id(id, dst) { -if (dsa_lag_dev (dst, id) == lag) +if (dsa_lag_dev (dst, id) == lag_dev)return id; }
@@ -966,10 +966,10 @@ struct dsa_switch_ops {int (*crosschip_lag_change)(struct dsa_switch *ds,int sw_index,int port);int (*crosschip_lag_join)(struct dsa_switch *ds,int sw_index, -int port,struct net_device *lag, +int port,struct net_device *lag_dev,struct netdev_lag_upper_info *info);int (*crosschip_lag_leave)(struct dsa_switch *ds,int sw_index, -int port,struct net_device *lag); +int port,struct net_device *lag_dev);/* * PTP functionality
@@ -1041,10 +1041,10 @@ struct dsa_switch_ops {*/ int (*port_lag_change)(struct dsa_switch *ds,int port);int (*port_lag_join)(struct dsa_switch *ds,int port, -struct net_device *lag, +struct net_device *lag_dev,struct netdev_lag_upper_info *info);int (*port_lag_leave)(struct dsa_switch *ds,int port, -struct net_device *lag); +struct net_device *lag_dev);/* * HSR integration
net/dsa/dsa2.c +8 -8
@@ -74,7 +74,7 @@ int dsa_broadcast(unsigned long e, void *v)/** * dsa_lag_map() - Map LAG netdev to a linear LAG ID * @dst: Tree in which to record the mapping. -* @lag: Netdev that is to be mapped to an ID. +* @lag_dev: Netdev that is to be mapped to an ID. * * dsa_lag_id/dsa_lag_dev can then be used to translate between the * two spaces. The size of the mapping space is determined by the
@@ -82,17 +82,17 @@ int dsa_broadcast(unsigned long e, void *v)* it unset if it is not needed, in which case these functions become * no-ops. */ -void dsa_lag_map (struct dsa_switch_tree *dst,struct net_device *lag) +void dsa_lag_map (struct dsa_switch_tree *dst,struct net_device *lag_dev) {unsigned int id; -if (dsa_lag_id (dst, lag) >=0 ) +if (dsa_lag_id (dst, lag_dev) >=0 )/* Already mapped */ return ;for (id =0 ; id < dst->lags_len; id++) {if (!dsa_lag_dev (dst, id)) { - dst->lags[id] = lag; + dst->lags[id] = lag_dev;return ; } }
@@ -108,22 +108,22 @@ void dsa_lag_map(struct dsa_switch_tree *dst, struct net_device *lag)/** * dsa_lag_unmap() - Remove a LAG ID mapping * @dst: Tree in which the mapping is recorded. -* @lag: Netdev that was mapped. +* @lag_dev: Netdev that was mapped. * * As there may be multiple users of the mapping, it is only removed * if there are no other references to it. */ -void dsa_lag_unmap (struct dsa_switch_tree *dst,struct net_device *lag) +void dsa_lag_unmap (struct dsa_switch_tree *dst,struct net_device *lag_dev) {struct dsa_port *dp;unsigned int id; -dsa_lag_foreach_port (dp, dst, lag) +dsa_lag_foreach_port (dp, dst, lag_dev)/* There are remaining users of this mapping */ return; dsa_lags_foreach_id(id, dst) { -if (dsa_lag_dev (dst, id) == lag) { +if (dsa_lag_dev (dst, id) == lag_dev) { dst->lags[id] =NULL ;break ; }
net/dsa/dsa_priv.h +3 -3
@@ -76,7 +76,7 @@ struct dsa_notifier_mdb_info {/* DSA_NOTIFIER_LAG_* */ struct dsa_notifier_lag_info { -struct net_device *lag; +struct net_device *lag_dev;int sw_index;int port;
@@ -487,8 +487,8 @@ int dsa_switch_register_notifier(struct dsa_switch *ds);void dsa_switch_unregister_notifier (struct dsa_switch *ds);/* dsa2.c */ -void dsa_lag_map (struct dsa_switch_tree *dst,struct net_device *lag); -void dsa_lag_unmap (struct dsa_switch_tree *dst,struct net_device *lag); +void dsa_lag_map (struct dsa_switch_tree *dst,struct net_device *lag_dev); +void dsa_lag_unmap (struct dsa_switch_tree *dst,struct net_device *lag_dev);int dsa_tree_notify (struct dsa_switch_tree *dst,unsigned long e,void *v);int dsa_broadcast (unsigned long e,void *v); int dsa_tree_change_tag_proto(struct dsa_switch_tree *dst,
net/dsa/port.c +10 -10
@@ -440,27 +440,27 @@ int dsa_port_lag_change(struct dsa_port *dp,return dsa_port_notify (dp,DSA_NOTIFIER_LAG_CHANGE , &info); } -int dsa_port_lag_join (struct dsa_port *dp,struct net_device *lag, +int dsa_port_lag_join (struct dsa_port *dp,struct net_device *lag_dev,struct netdev_lag_upper_info *uinfo,struct netlink_ext_ack *extack) {struct dsa_notifier_lag_info info = { .sw_index = dp->ds->index, .port = dp->index, - .lag = lag, + .lag_dev = lag_dev, .info = uinfo, };struct net_device *bridge_dev;int err; -dsa_lag_map (dp->ds->dst, lag); - dp->lag_dev = lag; +dsa_lag_map (dp->ds->dst, lag_dev); + dp->lag_dev = lag_dev; err =dsa_port_notify (dp,DSA_NOTIFIER_LAG_JOIN , &info);if (err) goto err_lag_join; - bridge_dev =netdev_master_upper_dev_get (lag); + bridge_dev =netdev_master_upper_dev_get (lag_dev);if (!bridge_dev || !netif_is_bridge_master (bridge_dev))return 0 ;
@@ -474,11 +474,11 @@ int dsa_port_lag_join(struct dsa_port *dp, struct net_device *lag,dsa_port_notify (dp,DSA_NOTIFIER_LAG_LEAVE , &info); err_lag_join: dp->lag_dev =NULL ; -dsa_lag_unmap (dp->ds->dst, lag); +dsa_lag_unmap (dp->ds->dst, lag_dev);return err; } -void dsa_port_pre_lag_leave (struct dsa_port *dp,struct net_device *lag) +void dsa_port_pre_lag_leave (struct dsa_port *dp,struct net_device *lag_dev) {struct net_device *br =dsa_port_bridge_dev_get (dp);
@@ -486,13 +486,13 @@ void dsa_port_pre_lag_leave(struct dsa_port *dp, struct net_device *lag)dsa_port_pre_bridge_leave (dp, br); } -void dsa_port_lag_leave (struct dsa_port *dp,struct net_device *lag) +void dsa_port_lag_leave (struct dsa_port *dp,struct net_device *lag_dev) {struct net_device *br =dsa_port_bridge_dev_get (dp);struct dsa_notifier_lag_info info = { .sw_index = dp->ds->index, .port = dp->index, - .lag = lag, + .lag_dev = lag_dev, };int err;
@@ -514,7 +514,7 @@ void dsa_port_lag_leave(struct dsa_port *dp, struct net_device *lag)"port %d failed to notify DSA_NOTIFIER_LAG_LEAVE: %pe\n" , dp->index, ERR_PTR(err)); -dsa_lag_unmap (dp->ds->dst, lag); +dsa_lag_unmap (dp->ds->dst, lag_dev); }/* Must be called under rcu_read_lock() */
net/dsa/switch.c +4 -4
@@ -468,12 +468,12 @@ static int dsa_switch_lag_join(struct dsa_switch *ds, struct dsa_notifier_lag_info *info) {if (ds->index == info->sw_index && ds->ops->port_lag_join) -return ds->ops->port_lag_join (ds, info->port, info->lag, +return ds->ops->port_lag_join (ds, info->port, info->lag_dev, info->info);if (ds->index != info->sw_index && ds->ops->crosschip_lag_join)return ds->ops->crosschip_lag_join (ds, info->sw_index, - info->port, info->lag, + info->port, info->lag_dev, info->info);return -EOPNOTSUPP ;
@@ -483,11 +483,11 @@ static int dsa_switch_lag_leave(struct dsa_switch *ds, struct dsa_notifier_lag_info *info) {if (ds->index == info->sw_index && ds->ops->port_lag_leave) -return ds->ops->port_lag_leave (ds, info->port, info->lag); +return ds->ops->port_lag_leave (ds, info->port, info->lag_dev);if (ds->index != info->sw_index && ds->ops->crosschip_lag_leave)return ds->ops->crosschip_lag_leave (ds, info->sw_index, - info->port, info->lag); + info->port, info->lag_dev);return -EOPNOTSUPP ; }
Signature · 1 line
2.25.1
Vladimir Oltean
maintainerPATCH v5 2/11 net: dsa: mv88e6xxx: rename references to "lag" as "lag_dev"
In reply to Vladimir OlteanIn preparation of converting struct net_device *dp->lag_dev into a struct dsa_lag *dp->lag, we need to rename, for consistency purposes, all occurrences of the "lag" variable in mv88e6xxx to "lag_dev".
---v1->v5: none
drivers/net/dsa/mv88e6xxx/chip.c | 49 ++++++++++++++++---------------- 1 file changed, 25 insertions(+), 24 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.c +25 -24
@@ -6175,7 +6175,7 @@ static int mv88e6xxx_port_bridge_flags(struct dsa_switch *ds, int port, }static bool mv88e6xxx_lag_can_offload (struct dsa_switch *ds, -struct net_device *lag, +struct net_device *lag_dev,struct netdev_lag_upper_info *info) {struct mv88e6xxx_chip *chip = ds->priv;
@@ -6185,11 +6185,11 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,if (!mv88e6xxx_has_lag (chip))return false; - id =dsa_lag_id (ds->dst, lag); + id =dsa_lag_id (ds->dst, lag_dev);if (id <0 || id >= ds->num_lag_ids)return false; -dsa_lag_foreach_port (dp, ds->dst, lag) +dsa_lag_foreach_port (dp, ds->dst, lag_dev)/* Includes the port joining the LAG */ members++;
@@ -6209,20 +6209,21 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,return true; } -static int mv88e6xxx_lag_sync_map (struct dsa_switch *ds,struct net_device *lag) +static int mv88e6xxx_lag_sync_map (struct dsa_switch *ds, +struct net_device *lag_dev) {struct mv88e6xxx_chip *chip = ds->priv;struct dsa_port *dp;u16 map =0 ;int id; - id =dsa_lag_id (ds->dst, lag); + id =dsa_lag_id (ds->dst, lag_dev);/* Build the map of all ports to distribute flows destined for * this LAG. This can be either a local user port, or a DSA * port if the LAG port is on a remote chip. */ -dsa_lag_foreach_port (dp, ds->dst, lag) +dsa_lag_foreach_port (dp, ds->dst, lag_dev) map |= BIT(dsa_towards_port(ds, dp->ds->index, dp->index));return mv88e6xxx_g2_trunk_mapping_write (chip, id, map);
@@ -6266,8 +6267,8 @@ static void mv88e6xxx_lag_set_port_mask(u16 *mask, int port,static int mv88e6xxx_lag_sync_masks (struct dsa_switch *ds) {struct mv88e6xxx_chip *chip = ds->priv; +struct net_device *lag_dev;unsigned int id, num_tx; -struct net_device *lag;struct dsa_port *dp;int i, err, nth;u16 mask[8 ];
@@ -6291,12 +6292,12 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)* are in the Tx set. */ dsa_lags_foreach_id(id, ds->dst) { - lag =dsa_lag_dev (ds->dst, id); -if (!lag) + lag_dev =dsa_lag_dev (ds->dst, id); +if (!lag_dev)continue ; num_tx =0 ; - dsa_lag_foreach_port(dp, ds->dst, lag) { + dsa_lag_foreach_port(dp, ds->dst, lag_dev) {if (dp->lag_tx_enabled) num_tx++; }
@@ -6305,7 +6306,7 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)continue ; nth =0 ; - dsa_lag_foreach_port(dp, ds->dst, lag) { + dsa_lag_foreach_port(dp, ds->dst, lag_dev) {if (!dp->lag_tx_enabled)continue ;
@@ -6327,14 +6328,14 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds) }static int mv88e6xxx_lag_sync_masks_map (struct dsa_switch *ds, -struct net_device *lag) +struct net_device *lag_dev) {int err; err =mv88e6xxx_lag_sync_masks (ds);if (!err) - err =mv88e6xxx_lag_sync_map (ds, lag); + err =mv88e6xxx_lag_sync_map (ds, lag_dev);return err; }
@@ -6351,16 +6352,16 @@ static int mv88e6xxx_port_lag_change(struct dsa_switch *ds, int port) }static int mv88e6xxx_port_lag_join (struct dsa_switch *ds,int port, -struct net_device *lag, +struct net_device *lag_dev,struct netdev_lag_upper_info *info) {struct mv88e6xxx_chip *chip = ds->priv;int err, id; -if (!mv88e6xxx_lag_can_offload (ds, lag, info)) +if (!mv88e6xxx_lag_can_offload (ds, lag_dev, info))return -EOPNOTSUPP ; - id =dsa_lag_id (ds->dst, lag); + id =dsa_lag_id (ds->dst, lag_dev);mv88e6xxx_reg_lock (chip);
@@ -6368,7 +6369,7 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port,if (err) goto err_unlock; - err =mv88e6xxx_lag_sync_masks_map (ds, lag); + err =mv88e6xxx_lag_sync_masks_map (ds, lag_dev);if (err) goto err_clear_trunk;
@@ -6383,13 +6384,13 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port, }static int mv88e6xxx_port_lag_leave (struct dsa_switch *ds,int port, -struct net_device *lag) +struct net_device *lag_dev) {struct mv88e6xxx_chip *chip = ds->priv;int err_sync, err_trunk;mv88e6xxx_reg_lock (chip); - err_sync =mv88e6xxx_lag_sync_masks_map (ds, lag); + err_sync =mv88e6xxx_lag_sync_masks_map (ds, lag_dev); err_trunk =mv88e6xxx_port_set_trunk (chip, port, false,0 );mv88e6xxx_reg_unlock (chip);return err_sync ? : err_trunk;
@@ -6408,18 +6409,18 @@ static int mv88e6xxx_crosschip_lag_change(struct dsa_switch *ds, int sw_index, }static int mv88e6xxx_crosschip_lag_join (struct dsa_switch *ds,int sw_index, -int port,struct net_device *lag, +int port,struct net_device *lag_dev,struct netdev_lag_upper_info *info) {struct mv88e6xxx_chip *chip = ds->priv;int err; -if (!mv88e6xxx_lag_can_offload (ds, lag, info)) +if (!mv88e6xxx_lag_can_offload (ds, lag_dev, info))return -EOPNOTSUPP ;mv88e6xxx_reg_lock (chip); - err =mv88e6xxx_lag_sync_masks_map (ds, lag); + err =mv88e6xxx_lag_sync_masks_map (ds, lag_dev);if (err) goto unlock;
@@ -6431,13 +6432,13 @@ static int mv88e6xxx_crosschip_lag_join(struct dsa_switch *ds, int sw_index, }static int mv88e6xxx_crosschip_lag_leave (struct dsa_switch *ds,int sw_index, -int port,struct net_device *lag) +int port,struct net_device *lag_dev) {struct mv88e6xxx_chip *chip = ds->priv;int err_sync, err_pvt;mv88e6xxx_reg_lock (chip); - err_sync =mv88e6xxx_lag_sync_masks_map (ds, lag); + err_sync =mv88e6xxx_lag_sync_masks_map (ds, lag_dev); err_pvt =mv88e6xxx_pvt_map (chip, sw_index, port);mv88e6xxx_reg_unlock (chip);return err_sync ? : err_pvt;
Signature · 1 line
2.25.1
Vladimir Oltean
maintainerPATCH v5 3/11 net: dsa: qca8k: rename references to "lag" as "lag_dev"
In reply to Vladimir OlteanIn preparation of converting struct net_device *dp->lag_dev into a struct dsa_lag *dp->lag, we need to rename, for consistency purposes, all occurrences of the "lag" variable in qca8k to "lag_dev".
---v1->v5: none
drivers/net/dsa/qca8k.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/net/dsa/qca8k.c +14 -14
@@ -2647,17 +2647,17 @@ qca8k_get_tag_protocol(struct dsa_switch *ds, int port,static bool qca8k_lag_can_offload (struct dsa_switch *ds, -struct net_device *lag, +struct net_device *lag_dev,struct netdev_lag_upper_info *info) {struct dsa_port *dp;int id, members =0 ; - id =dsa_lag_id (ds->dst, lag); + id =dsa_lag_id (ds->dst, lag_dev);if (id <0 || id >= ds->num_lag_ids)return false; -dsa_lag_foreach_port (dp, ds->dst, lag) +dsa_lag_foreach_port (dp, ds->dst, lag_dev)/* Includes the port joining the LAG */ members++;
@@ -2676,7 +2676,7 @@ qca8k_lag_can_offload(struct dsa_switch *ds,static int qca8k_lag_setup_hash (struct dsa_switch *ds, -struct net_device *lag, +struct net_device *lag_dev,struct netdev_lag_upper_info *info) {struct qca8k_priv *priv = ds->priv;
@@ -2684,7 +2684,7 @@ qca8k_lag_setup_hash(struct dsa_switch *ds,u32 hash =0 ;int i, id; - id =dsa_lag_id (ds->dst, lag); + id =dsa_lag_id (ds->dst, lag_dev);switch (info->hash_type) {case NETDEV_LAG_HASH_L23 :
@@ -2716,7 +2716,7 @@ qca8k_lag_setup_hash(struct dsa_switch *ds,if (unique_lag) { priv->lag_hash_mode = hash; }else if (priv->lag_hash_mode != hash) { -netdev_err (lag,"Error: Mismatched Hash Mode across different lag is not supported\n" ); +netdev_err (lag_dev,"Error: Mismatched Hash Mode across different lag is not supported\n" );return -EOPNOTSUPP ; }
@@ -2726,13 +2726,13 @@ qca8k_lag_setup_hash(struct dsa_switch *ds,static int qca8k_lag_refresh_portmap (struct dsa_switch *ds,int port, -struct net_device *lag,bool delete) +struct net_device *lag_dev,bool delete) {struct qca8k_priv *priv = ds->priv;int ret, id, i;u32 val; - id =dsa_lag_id (ds->dst, lag); + id =dsa_lag_id (ds->dst, lag_dev);/* Read current port member */ ret =regmap_read (priv->regmap,QCA8K_REG_GOL_TRUNK_CTRL0 , &val);
@@ -2795,26 +2795,26 @@ qca8k_lag_refresh_portmap(struct dsa_switch *ds, int port,static int qca8k_port_lag_join (struct dsa_switch *ds,int port, -struct net_device *lag, +struct net_device *lag_dev,struct netdev_lag_upper_info *info) {int ret; -if (!qca8k_lag_can_offload (ds, lag, info)) +if (!qca8k_lag_can_offload (ds, lag_dev, info))return -EOPNOTSUPP ; - ret =qca8k_lag_setup_hash (ds, lag, info); + ret =qca8k_lag_setup_hash (ds, lag_dev, info);if (ret)return ret; -return qca8k_lag_refresh_portmap (ds, port, lag, false); +return qca8k_lag_refresh_portmap (ds, port, lag_dev, false); }static int qca8k_port_lag_leave (struct dsa_switch *ds,int port, -struct net_device *lag) +struct net_device *lag_dev) { -return qca8k_lag_refresh_portmap (ds, port, lag, true); +return qca8k_lag_refresh_portmap (ds, port, lag_dev, true); } static void
Signature · 1 line
2.25.1
Vladimir Oltean
maintainerPATCH v5 4/11 net: dsa: make LAG IDs one-based
In reply to Vladimir OlteanThe DSA LAG API will be changed to become more similar with the bridge data structures, where struct dsa_bridge holds an unsigned int num, which is generated by DSA and is one-based. We have a similar thing going with the DSA LAG, except that isn't stored anywhere, it is calculated dynamically by dsa_lag_id() by iterating through dst->lags.
The idea of encoding an invalid (or not requested) LAG ID as zero for the purpose of simplifying checks in drivers means that the LAG IDs passed by DSA to drivers need to be one-based too. So back-and-forth conversion is needed when indexing the dst->lags array, as well as in drivers which assume a zero-based index.
---v1->v5: none
drivers/net/dsa/mv88e6xxx/chip.c | 13 ++++++++----- drivers/net/dsa/qca8k.c | 5 +++-- include/net/dsa.h | 8 +++++--- net/dsa/dsa2.c | 8 ++++---- net/dsa/tag_dsa.c | 2 +- 5 files changed, 21 insertions(+), 15 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.c +8 -5
@@ -1630,10 +1630,11 @@ static int mv88e6xxx_pvt_map(struct mv88e6xxx_chip *chip, int dev, int port)* FORWARD frames, which use the LAG ID as the * source port, we must translate dev/port to * the special "LAG device" in the PVT, using -* the LAG ID as the port number. +* the LAG ID (one-based) as the port number +* (zero-based). */ dev =MV88E6XXX_G2_PVT_ADDR_DEV_TRUNK ; - port =dsa_lag_id (dst, dp->lag_dev); + port =dsa_lag_id (dst, dp->lag_dev) -1 ; } }
@@ -6186,7 +6187,7 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,return false; id =dsa_lag_id (ds->dst, lag_dev); -if (id <0 || id >= ds->num_lag_ids) +if (id <=0 || id > ds->num_lag_ids)return false;dsa_lag_foreach_port (dp, ds->dst, lag_dev)
@@ -6217,7 +6218,8 @@ static int mv88e6xxx_lag_sync_map(struct dsa_switch *ds,u16 map =0 ;int id; - id =dsa_lag_id (ds->dst, lag_dev); +/* DSA LAG IDs are one-based, hardware is zero-based */ + id =dsa_lag_id (ds->dst, lag_dev) -1 ;/* Build the map of all ports to distribute flows destined for * this LAG. This can be either a local user port, or a DSA
@@ -6361,7 +6363,8 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port,if (!mv88e6xxx_lag_can_offload (ds, lag_dev, info))return -EOPNOTSUPP ; - id =dsa_lag_id (ds->dst, lag_dev); +/* DSA LAG IDs are one-based */ + id =dsa_lag_id (ds->dst, lag_dev) -1 ;mv88e6xxx_reg_lock (chip);
drivers/net/dsa/qca8k.c +3 -2
@@ -2654,7 +2654,7 @@ qca8k_lag_can_offload(struct dsa_switch *ds,int id, members =0 ; id =dsa_lag_id (ds->dst, lag_dev); -if (id <0 || id >= ds->num_lag_ids) +if (id <=0 || id > ds->num_lag_ids)return false;dsa_lag_foreach_port (dp, ds->dst, lag_dev)
@@ -2732,7 +2732,8 @@ qca8k_lag_refresh_portmap(struct dsa_switch *ds, int port,int ret, id, i;u32 val; - id =dsa_lag_id (ds->dst, lag_dev); +/* DSA LAG IDs are one-based, hardware is zero-based */ + id =dsa_lag_id (ds->dst, lag_dev) -1 ;/* Read current port member */ ret =regmap_read (priv->regmap,QCA8K_REG_GOL_TRUNK_CTRL0 , &val);
include/net/dsa.h +5 -3
@@ -163,9 +163,10 @@ struct dsa_switch_tree {unsigned int last_switch; }; +/* LAG IDs are one-based, the dst->lags array is zero-based */ #define dsa_lags_foreach_id (_id, _dst) \ - for ((_id) = 0; (_id) < (_dst)->lags_len; (_id)++) \ - if ((_dst)->lags[(_id)]) + for ((_id) = 1; (_id) <= (_dst)->lags_len; (_id)++) \ + if ((_dst)->lags[(_id) - 1])#define dsa_lag_foreach_port (_dp, _dst, _lag) \ list_for_each_entry((_dp), &(_dst)->ports, list) \
@@ -178,7 +179,8 @@ struct dsa_switch_tree {static inline struct net_device *dsa_lag_dev (struct dsa_switch_tree *dst,unsigned int id) { -return dst->lags[id]; +/* DSA LAG IDs are one-based, dst->lags is zero-based */ +return dst->lags[id -1 ]; } static inline int dsa_lag_id(struct dsa_switch_tree *dst,
net/dsa/dsa2.c +4 -4
@@ -86,13 +86,13 @@ void dsa_lag_map(struct dsa_switch_tree *dst, struct net_device *lag_dev) {unsigned int id; -if (dsa_lag_id (dst, lag_dev) >=0 ) +if (dsa_lag_id (dst, lag_dev) >0 )/* Already mapped */ return ; -for (id =0 ; id < dst->lags_len; id++) { +for (id =1 ; id <= dst->lags_len; id++) {if (!dsa_lag_dev (dst, id)) { - dst->lags[id] = lag_dev; + dst->lags[id -1 ] = lag_dev;return ; } }
@@ -124,7 +124,7 @@ void dsa_lag_unmap(struct dsa_switch_tree *dst, struct net_device *lag_dev) dsa_lags_foreach_id(id, dst) {if (dsa_lag_dev (dst, id) == lag_dev) { - dst->lags[id] =NULL ; + dst->lags[id -1 ] =NULL ;break ; } }
net/dsa/tag_dsa.c +1 -1
@@ -251,7 +251,7 @@ static struct sk_buff *dsa_rcv_ll(struct sk_buff *skb, struct net_device *dev,* so we inject the frame directly on the upper * team/bond. */ - skb->dev =dsa_lag_dev (cpu_dp->dst, source_port); + skb->dev =dsa_lag_dev (cpu_dp->dst, source_port +1 ); }else { skb->dev =dsa_master_find_slave (dev, source_device, source_port);
Signature · 1 line
2.25.1
Vladimir Oltean
maintainerPATCH v5 5/11 net: dsa: mv88e6xxx: use dsa_switch_for_each_port in mv88e6xxx_lag_sync_masks
In reply to Vladimir OlteanMake the intent of the code more clear by using the dedicated helper for iterating over the ports of a switch.
---v1->v5: none
drivers/net/dsa/mv88e6xxx/chip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.c +2 -2
@@ -6280,8 +6280,8 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds) ivec =BIT (mv88e6xxx_num_ports (chip)) -1 ;/* Disable all masks for ports that _are_ members of a LAG. */ -list_for_each_entry (dp, &ds->dst->ports, list) { -if (!dp->lag_dev || dp->ds != ds) +dsa_switch_for_each_port (dp, ds) { +if (!dp->lag_dev)continue ; ivec &= ~BIT (dp->index);
Signature · 1 line
2.25.1
Vladimir Oltean
maintainerPATCH v5 6/11 net: dsa: create a dsa_lag structure
In reply to Vladimir OlteanThe main purpose of this change is to create a data structure for a LAG as seen by DSA. This is similar to what we have for bridging - we pass a copy of this structure by value to ->port_lag_join and ->port_lag_leave. For now we keep the lag_dev, id and a reference count in it. Future patches will add a list of FDB entries for the LAG (these also need to be refcounted to work properly).
The LAG structure is created using dsa_port_lag_create() and destroyed using dsa_port_lag_destroy(), just like we have for bridging.
Because now, the dsa_lag itself is refcounted, we can simplify dsa_lag_map() and dsa_lag_unmap(). These functions need to keep a LAG in the dst->lags array only as long as at least one port uses it. The refcounting logic inside those functions can be removed now - they are called only when we should perform the operation.
dsa_lag_dev() is renamed to dsa_lag_by_id() and now returns the dsa_lag structure instead of the lag_dev net_device.
dsa_lag_foreach_port() now takes the dsa_lag structure as argument.
dst->lags holds an array of dsa_lag structures.
dsa_lag_map() now also saves the dsa_lag->id value, so that linear walking of dst->lags in drivers using dsa_lag_id() is no longer necessary. They can just look at lag.id.
dsa_port_lag_id_get() is a helper, similar to dsa_port_bridge_num_get(), which can be used by drivers to get the LAG ID assigned by DSA to a given port.
---v4->v5: nonev3->v4: avoid NULL pointer dereference in dsa_port_lag_leave() when the
LAG is not offloaded (thanks to Alvin Šipraga)v1->v3: none
drivers/net/dsa/mv88e6xxx/chip.c | 60 +++++++++++++++---------------- drivers/net/dsa/ocelot/felix.c | 8 ++--- drivers/net/dsa/qca8k.c | 37 +++++++++---------- include/net/dsa.h | 50 +++++++++++++++++++------- net/dsa/dsa2.c | 41 +++++++++++---------- net/dsa/dsa_priv.h | 8 +++-- net/dsa/port.c | 62 +++++++++++++++++++++++++------- net/dsa/slave.c | 4 +-- net/dsa/switch.c | 8 ++--- net/dsa/tag_dsa.c | 4 ++- 10 files changed, 173 insertions(+), 109 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.c +29 -31
@@ -1625,7 +1625,7 @@ static int mv88e6xxx_pvt_map(struct mv88e6xxx_chip *chip, int dev, int port) ds =dsa_switch_find (dst->index, dev); dp = ds ?dsa_to_port (ds, port) :NULL ; -if (dp && dp->lag_dev) { +if (dp && dp->lag) {/* As the PVT is used to limit flooding of * FORWARD frames, which use the LAG ID as the * source port, we must translate dev/port to
@@ -1634,7 +1634,7 @@ static int mv88e6xxx_pvt_map(struct mv88e6xxx_chip *chip, int dev, int port)* (zero-based). */ dev =MV88E6XXX_G2_PVT_ADDR_DEV_TRUNK ; - port =dsa_lag_id (dst, dp->lag_dev) -1 ; + port =dsa_port_lag_id_get (dp) -1 ; } }
@@ -1672,7 +1672,7 @@ static void mv88e6xxx_port_fast_age(struct dsa_switch *ds, int port)struct mv88e6xxx_chip *chip = ds->priv;int err; -if (dsa_to_port (ds, port)->lag_dev) +if (dsa_to_port (ds, port)->lag)/* Hardware is incapable of fast-aging a LAG through a * regular ATU move operation. Until we have something * more fancy in place this is a no-op.
@@ -6176,21 +6176,20 @@ static int mv88e6xxx_port_bridge_flags(struct dsa_switch *ds, int port, }static bool mv88e6xxx_lag_can_offload (struct dsa_switch *ds, -struct net_device *lag_dev, +struct dsa_lag lag,struct netdev_lag_upper_info *info) {struct mv88e6xxx_chip *chip = ds->priv;struct dsa_port *dp; -int id, members =0 ; +int members =0 ;if (!mv88e6xxx_has_lag (chip))return false; - id =dsa_lag_id (ds->dst, lag_dev); -if (id <=0 || id > ds->num_lag_ids) +if (!lag.id)return false; -dsa_lag_foreach_port (dp, ds->dst, lag_dev) +dsa_lag_foreach_port (dp, ds->dst, &lag)/* Includes the port joining the LAG */ members++;
@@ -6210,8 +6209,7 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,return true; } -static int mv88e6xxx_lag_sync_map (struct dsa_switch *ds, -struct net_device *lag_dev) +static int mv88e6xxx_lag_sync_map (struct dsa_switch *ds,struct dsa_lag lag) {struct mv88e6xxx_chip *chip = ds->priv;struct dsa_port *dp;
@@ -6219,13 +6217,13 @@ static int mv88e6xxx_lag_sync_map(struct dsa_switch *ds,int id;/* DSA LAG IDs are one-based, hardware is zero-based */ - id =dsa_lag_id (ds->dst, lag_dev) -1 ; + id = lag.id -1 ;/* Build the map of all ports to distribute flows destined for * this LAG. This can be either a local user port, or a DSA * port if the LAG port is on a remote chip. */ -dsa_lag_foreach_port (dp, ds->dst, lag_dev) +dsa_lag_foreach_port (dp, ds->dst, &lag) map |= BIT(dsa_towards_port(ds, dp->ds->index, dp->index));return mv88e6xxx_g2_trunk_mapping_write (chip, id, map);
@@ -6269,9 +6267,9 @@ static void mv88e6xxx_lag_set_port_mask(u16 *mask, int port,static int mv88e6xxx_lag_sync_masks (struct dsa_switch *ds) {struct mv88e6xxx_chip *chip = ds->priv; -struct net_device *lag_dev;unsigned int id, num_tx;struct dsa_port *dp; +struct dsa_lag *lag;int i, err, nth;u16 mask[8 ];u16 ivec;
@@ -6281,7 +6279,7 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)/* Disable all masks for ports that _are_ members of a LAG. */ dsa_switch_for_each_port (dp, ds) { -if (!dp->lag_dev) +if (!dp->lag)continue ; ivec &= ~BIT (dp->index);
@@ -6294,12 +6292,12 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)* are in the Tx set. */ dsa_lags_foreach_id(id, ds->dst) { - lag_dev =dsa_lag_dev (ds->dst, id); -if (!lag_dev) + lag =dsa_lag_by_id (ds->dst, id); +if (!lag)continue ; num_tx =0 ; - dsa_lag_foreach_port(dp, ds->dst, lag_dev) { + dsa_lag_foreach_port(dp, ds->dst, lag) {if (dp->lag_tx_enabled) num_tx++; }
@@ -6308,7 +6306,7 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)continue ; nth =0 ; - dsa_lag_foreach_port(dp, ds->dst, lag_dev) { + dsa_lag_foreach_port(dp, ds->dst, lag) {if (!dp->lag_tx_enabled)continue ;
@@ -6330,14 +6328,14 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds) }static int mv88e6xxx_lag_sync_masks_map (struct dsa_switch *ds, -struct net_device *lag_dev) +struct dsa_lag lag) {int err; err =mv88e6xxx_lag_sync_masks (ds);if (!err) - err =mv88e6xxx_lag_sync_map (ds, lag_dev); + err =mv88e6xxx_lag_sync_map (ds, lag);return err; }
@@ -6354,17 +6352,17 @@ static int mv88e6xxx_port_lag_change(struct dsa_switch *ds, int port) }static int mv88e6xxx_port_lag_join (struct dsa_switch *ds,int port, -struct net_device *lag_dev, +struct dsa_lag lag,struct netdev_lag_upper_info *info) {struct mv88e6xxx_chip *chip = ds->priv;int err, id; -if (!mv88e6xxx_lag_can_offload (ds, lag_dev, info)) +if (!mv88e6xxx_lag_can_offload (ds, lag, info))return -EOPNOTSUPP ;/* DSA LAG IDs are one-based */ - id =dsa_lag_id (ds->dst, lag_dev) -1 ; + id = lag.id -1 ;mv88e6xxx_reg_lock (chip);
@@ -6372,7 +6370,7 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port,if (err) goto err_unlock; - err =mv88e6xxx_lag_sync_masks_map (ds, lag_dev); + err =mv88e6xxx_lag_sync_masks_map (ds, lag);if (err) goto err_clear_trunk;
@@ -6387,13 +6385,13 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port, }static int mv88e6xxx_port_lag_leave (struct dsa_switch *ds,int port, -struct net_device *lag_dev) +struct dsa_lag lag) {struct mv88e6xxx_chip *chip = ds->priv;int err_sync, err_trunk;mv88e6xxx_reg_lock (chip); - err_sync =mv88e6xxx_lag_sync_masks_map (ds, lag_dev); + err_sync =mv88e6xxx_lag_sync_masks_map (ds, lag); err_trunk =mv88e6xxx_port_set_trunk (chip, port, false,0 );mv88e6xxx_reg_unlock (chip);return err_sync ? : err_trunk;
@@ -6412,18 +6410,18 @@ static int mv88e6xxx_crosschip_lag_change(struct dsa_switch *ds, int sw_index, }static int mv88e6xxx_crosschip_lag_join (struct dsa_switch *ds,int sw_index, -int port,struct net_device *lag_dev, +int port,struct dsa_lag lag,struct netdev_lag_upper_info *info) {struct mv88e6xxx_chip *chip = ds->priv;int err; -if (!mv88e6xxx_lag_can_offload (ds, lag_dev, info)) +if (!mv88e6xxx_lag_can_offload (ds, lag, info))return -EOPNOTSUPP ;mv88e6xxx_reg_lock (chip); - err =mv88e6xxx_lag_sync_masks_map (ds, lag_dev); + err =mv88e6xxx_lag_sync_masks_map (ds, lag);if (err) goto unlock;
@@ -6435,13 +6433,13 @@ static int mv88e6xxx_crosschip_lag_join(struct dsa_switch *ds, int sw_index, }static int mv88e6xxx_crosschip_lag_leave (struct dsa_switch *ds,int sw_index, -int port,struct net_device *lag_dev) +int port,struct dsa_lag lag) {struct mv88e6xxx_chip *chip = ds->priv;int err_sync, err_pvt;mv88e6xxx_reg_lock (chip); - err_sync =mv88e6xxx_lag_sync_masks_map (ds, lag_dev); + err_sync =mv88e6xxx_lag_sync_masks_map (ds, lag); err_pvt =mv88e6xxx_pvt_map (chip, sw_index, port);mv88e6xxx_reg_unlock (chip);return err_sync ? : err_pvt;
drivers/net/dsa/ocelot/felix.c +4 -4
@@ -677,20 +677,20 @@ static void felix_bridge_leave(struct dsa_switch *ds, int port, }static int felix_lag_join (struct dsa_switch *ds,int port, -struct net_device *bond, +struct dsa_lag lag,struct netdev_lag_upper_info *info) {struct ocelot *ocelot = ds->priv; -return ocelot_port_lag_join (ocelot, port, bond, info); +return ocelot_port_lag_join (ocelot, port, lag.dev, info); }static int felix_lag_leave (struct dsa_switch *ds,int port, -struct net_device *bond) +struct dsa_lag lag) {struct ocelot *ocelot = ds->priv; -ocelot_port_lag_leave (ocelot, port, bond); +ocelot_port_lag_leave (ocelot, port, lag.dev);return 0 ; }
drivers/net/dsa/qca8k.c +16 -21
@@ -2646,18 +2646,16 @@ qca8k_get_tag_protocol(struct dsa_switch *ds, int port, }static bool -qca8k_lag_can_offload (struct dsa_switch *ds, -struct net_device *lag_dev, +qca8k_lag_can_offload (struct dsa_switch *ds,struct dsa_lag lag,struct netdev_lag_upper_info *info) {struct dsa_port *dp; -int id, members =0 ; +int members =0 ; - id =dsa_lag_id (ds->dst, lag_dev); -if (id <=0 || id > ds->num_lag_ids) +if (!lag.id)return false; -dsa_lag_foreach_port (dp, ds->dst, lag_dev) +dsa_lag_foreach_port (dp, ds->dst, &lag)/* Includes the port joining the LAG */ members++;
@@ -2675,16 +2673,14 @@ qca8k_lag_can_offload(struct dsa_switch *ds, }static int -qca8k_lag_setup_hash (struct dsa_switch *ds, -struct net_device *lag_dev, +qca8k_lag_setup_hash (struct dsa_switch *ds,struct dsa_lag lag,struct netdev_lag_upper_info *info) { +struct net_device *lag_dev = lag.dev;struct qca8k_priv *priv = ds->priv;bool unique_lag = true; +unsigned int i;u32 hash =0 ; -int i, id; - - id =dsa_lag_id (ds->dst, lag_dev);switch (info->hash_type) {case NETDEV_LAG_HASH_L23 :
@@ -2701,7 +2697,7 @@ qca8k_lag_setup_hash(struct dsa_switch *ds,/* Check if we are the unique configured LAG */ dsa_lags_foreach_id(i, ds->dst) -if (i != id &&dsa_lag_dev (ds->dst, i)) { +if (i != lag.id &&dsa_lag_by_id (ds->dst, i)) { unique_lag = false;break ; }
@@ -2726,14 +2722,14 @@ qca8k_lag_setup_hash(struct dsa_switch *ds,static int qca8k_lag_refresh_portmap (struct dsa_switch *ds,int port, -struct net_device *lag_dev,bool delete) +struct dsa_lag lag,bool delete) {struct qca8k_priv *priv = ds->priv;int ret, id, i;u32 val;/* DSA LAG IDs are one-based, hardware is zero-based */ - id =dsa_lag_id (ds->dst, lag_dev) -1 ; + id = lag.id -1 ;/* Read current port member */ ret =regmap_read (priv->regmap,QCA8K_REG_GOL_TRUNK_CTRL0 , &val);
@@ -2795,27 +2791,26 @@ qca8k_lag_refresh_portmap(struct dsa_switch *ds, int port, }static int -qca8k_port_lag_join (struct dsa_switch *ds,int port, -struct net_device *lag_dev, +qca8k_port_lag_join (struct dsa_switch *ds,int port,struct dsa_lag lag,struct netdev_lag_upper_info *info) {int ret; -if (!qca8k_lag_can_offload (ds, lag_dev, info)) +if (!qca8k_lag_can_offload (ds, lag, info))return -EOPNOTSUPP ; - ret =qca8k_lag_setup_hash (ds, lag_dev, info); + ret =qca8k_lag_setup_hash (ds, lag, info);if (ret)return ret; -return qca8k_lag_refresh_portmap (ds, port, lag_dev, false); +return qca8k_lag_refresh_portmap (ds, port, lag, false); }static int qca8k_port_lag_leave (struct dsa_switch *ds,int port, -struct net_device *lag_dev) +struct dsa_lag lag) { -return qca8k_lag_refresh_portmap (ds, port, lag_dev, true); +return qca8k_lag_refresh_portmap (ds, port, lag, true); } static void
include/net/dsa.h +37 -13
113 lines not on this page · raw message
net/dsa/dsa2.c +23 -18
78 lines not on this page · raw message
net/dsa/dsa_priv.h +5 -3
@@ -76,7 +76,7 @@ struct dsa_notifier_mdb_info {/* DSA_NOTIFIER_LAG_* */ struct dsa_notifier_lag_info { -struct net_device *lag_dev; +struct dsa_lag lag;int sw_index;int port;
@@ -487,8 +487,10 @@ int dsa_switch_register_notifier(struct dsa_switch *ds);void dsa_switch_unregister_notifier (struct dsa_switch *ds);/* dsa2.c */ -void dsa_lag_map (struct dsa_switch_tree *dst,struct net_device *lag_dev); -void dsa_lag_unmap (struct dsa_switch_tree *dst,struct net_device *lag_dev); +void dsa_lag_map (struct dsa_switch_tree *dst,struct dsa_lag *lag); +void dsa_lag_unmap (struct dsa_switch_tree *dst,struct dsa_lag *lag); +struct dsa_lag *dsa_tree_lag_find (struct dsa_switch_tree *dst, +const struct net_device *lag_dev);int dsa_tree_notify (struct dsa_switch_tree *dst,unsigned long e,void *v);int dsa_broadcast (unsigned long e,void *v); int dsa_tree_change_tag_proto(struct dsa_switch_tree *dst,
net/dsa/port.c +50 -12
113 lines not on this page · raw message
net/dsa/slave.c +2 -2
@@ -2134,7 +2134,7 @@ dsa_slave_lag_changeupper(struct net_device *dev,continue ; dp =dsa_slave_to_port (lower); -if (!dp->lag_dev) +if (!dp->lag)/* Software LAG */ continue ;
@@ -2163,7 +2163,7 @@ dsa_slave_lag_prechangeupper(struct net_device *dev,continue ; dp =dsa_slave_to_port (lower); -if (!dp->lag_dev) +if (!dp->lag)/* Software LAG */ continue ;
net/dsa/switch.c +4 -4
@@ -468,12 +468,12 @@ static int dsa_switch_lag_join(struct dsa_switch *ds, struct dsa_notifier_lag_info *info) {if (ds->index == info->sw_index && ds->ops->port_lag_join) -return ds->ops->port_lag_join (ds, info->port, info->lag_dev, +return ds->ops->port_lag_join (ds, info->port, info->lag, info->info);if (ds->index != info->sw_index && ds->ops->crosschip_lag_join)return ds->ops->crosschip_lag_join (ds, info->sw_index, - info->port, info->lag_dev, + info->port, info->lag, info->info);return -EOPNOTSUPP ;
@@ -483,11 +483,11 @@ static int dsa_switch_lag_leave(struct dsa_switch *ds, struct dsa_notifier_lag_info *info) {if (ds->index == info->sw_index && ds->ops->port_lag_leave) -return ds->ops->port_lag_leave (ds, info->port, info->lag_dev); +return ds->ops->port_lag_leave (ds, info->port, info->lag);if (ds->index != info->sw_index && ds->ops->crosschip_lag_leave)return ds->ops->crosschip_lag_leave (ds, info->sw_index, - info->port, info->lag_dev); + info->port, info->lag);return -EOPNOTSUPP ; }
net/dsa/tag_dsa.c +3 -1
@@ -246,12 +246,14 @@ static struct sk_buff *dsa_rcv_ll(struct sk_buff *skb, struct net_device *dev,if (trunk) {struct dsa_port *cpu_dp = dev->dsa_ptr; +struct dsa_lag *lag;/* The exact source port is not available in the tag, * so we inject the frame directly on the upper * team/bond. */ - skb->dev =dsa_lag_dev (cpu_dp->dst, source_port +1 ); + lag =dsa_lag_by_id (cpu_dp->dst, source_port +1 ); + skb->dev = lag ? lag->dev :NULL ; }else { skb->dev =dsa_master_find_slave (dev, source_device, source_port);
Signature · 1 line
2.25.1
Vladimir Oltean
maintainerPATCH v5 7/11 net: switchdev: remove lag_mod_cb from switchdev_handle_fdb_event_to_device
In reply to Vladimir OlteanWhen the switchdev_handle_fdb_event_to_device() event replication helper was created, my original thought was that FDB events on LAG interfaces should most likely be special-cased, not just replicated towards all switchdev ports beneath that LAG. So this replication helper currently does not recurse through switchdev lower interfaces of LAG bridge ports, but rather calls the lag_mod_cb() if that was provided.
No switchdev driver uses this helper for FDB events on LAG interfaces yet, so that was an assumption which was yet to be tested. It is certainly usable for that purpose, as my RFC series shows:
https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/
however this approach is slightly convoluted because:
- the switchdev driver gets a "dev" that isn't its own net device, but rather the LAG net device. It must call switchdev_lower_dev_find(dev) in order to get a handle of any of its own net devices (the ones that pass check_cb).
- in order for FDB entries on LAG ports to be correctly refcounted per the number of switchdev ports beneath that LAG, we haven't escaped the need to iterate through the LAG's lower interfaces. Except that is now the responsibility of the switchdev driver, because the replication helper just stopped half-way.
So, even though yes, FDB events on LAG bridge ports must be special-cased, in the end it's simpler to let switchdev_handle_fdb_* just iterate through the LAG port's switchdev lowers, and let the switchdev driver figure out that those physical ports are under a LAG.
The switchdev_handle_fdb_event_to_device() helper takes a "foreign_dev_check" callback so it can figure out whether @dev can autonomously forward to @foreign_dev. DSA fills this method properly:
if the LAG is offloaded by another port in the same tree as @dev, then it isn't foreign. If it is a software LAG, it is foreign - forwarding happens in software.
Whether an interface is foreign or not decides whether the replication helper will go through the LAG's switchdev lowers or not. Since the lan966x doesn't properly fill this out, FDB events on software LAG uppers will get called. By changing lan966x_foreign_dev_check(), we can suppress them.
Whereas DSA will now start receiving FDB events for its offloaded LAG uppers, so we need to return -EOPNOTSUPP, since we currently don't do the right thing for them.
---v3->v5: nonev2->v3: patch is new, logically replaces previous patch "net: switchdev:
export switchdev_lower_dev_find"
.../microchip/lan966x/lan966x_switchdev.c | 12 +-- include/net/switchdev.h | 10 +-- net/dsa/slave.c | 6 +- net/switchdev/switchdev.c | 80 +++++++------------ 4 files changed, 42 insertions(+), 66 deletions(-)
drivers/net/ethernet/microchip/lan966x/lan966x_switchdev.c +7 -5
@@ -419,6 +419,9 @@ static int lan966x_netdevice_event(struct notifier_block *nb,return notifier_from_errno (ret); } +/* We don't offload uppers such as LAG as bridge ports, so every device except +* the bridge itself is foreign. +*/ static bool lan966x_foreign_dev_check (const struct net_device *dev,const struct net_device *foreign_dev) {
@@ -426,10 +429,10 @@ static bool lan966x_foreign_dev_check(const struct net_device *dev,struct lan966x *lan966x = port->lan966x;if (netif_is_bridge_master (foreign_dev)) -if (lan966x->bridge != foreign_dev) -return true; +if (lan966x->bridge == foreign_dev) +return false; -return false; +return true; } static int lan966x_switchdev_event(struct notifier_block *nb,
@@ -449,8 +452,7 @@ static int lan966x_switchdev_event(struct notifier_block *nb, err =switchdev_handle_fdb_event_to_device (dev, event, ptr, lan966x_netdevice_check, lan966x_foreign_dev_check, - lan966x_handle_fdb, -NULL ); + lan966x_handle_fdb);return notifier_from_errno (err); }
include/net/switchdev.h +2 -8
@@ -313,10 +313,7 @@ int switchdev_handle_fdb_event_to_device(struct net_device *dev, unsigned long e const struct net_device *foreign_dev), int (*mod_cb)(struct net_device *dev, struct net_device *orig_dev,unsigned long event,const void *ctx, -const struct switchdev_notifier_fdb_info *fdb_info), - int (*lag_mod_cb)(struct net_device *dev, struct net_device *orig_dev, -unsigned long event,const void *ctx, - const struct switchdev_notifier_fdb_info *fdb_info)); + const struct switchdev_notifier_fdb_info *fdb_info)); int switchdev_handle_port_obj_add(struct net_device *dev, struct switchdev_notifier_port_obj_info *port_obj_info,
@@ -443,10 +440,7 @@ switchdev_handle_fdb_event_to_device(struct net_device *dev, unsigned long event const struct net_device *foreign_dev), int (*mod_cb)(struct net_device *dev, struct net_device *orig_dev,unsigned long event,const void *ctx, -const struct switchdev_notifier_fdb_info *fdb_info), - int (*lag_mod_cb)(struct net_device *dev, struct net_device *orig_dev, -unsigned long event,const void *ctx, - const struct switchdev_notifier_fdb_info *fdb_info)) + const struct switchdev_notifier_fdb_info *fdb_info)) { return 0; }
net/dsa/slave.c +4 -2
@@ -2461,6 +2461,9 @@ static int dsa_slave_fdb_event(struct net_device *dev,bool host_addr = fdb_info->is_local;struct dsa_switch *ds = dp->ds; +if (dp->lag) +return -EOPNOTSUPP ; +if (ctx && ctx != dp)return 0 ;
@@ -2526,8 +2529,7 @@ static int dsa_slave_switchdev_event(struct notifier_block *unused, err =switchdev_handle_fdb_event_to_device (dev, event, ptr, dsa_slave_dev_check, dsa_foreign_dev_check, - dsa_slave_fdb_event, -NULL ); + dsa_slave_fdb_event);return notifier_from_errno (err);default :return NOTIFY_DONE ;
net/switchdev/switchdev.c +29 -51
120 lines not on this page · raw message
Signature · 1 line
2.25.1
Vladimir Oltean
maintainerPATCH v5 8/11 net: dsa: remove "ds" and "port" from struct dsa_switchdev_event_work
In reply to Vladimir OlteanBy construction, the struct net_device *dev passed to dsa_slave_switchdev_event_work() via struct dsa_switchdev_event_work is always a DSA slave device.
Therefore, it is redundant to pass struct dsa_switch and int port information in the deferred work structure. This can be retrieved at all times from the provided struct net_device via dsa_slave_to_port().
For the same reason, we can drop the dsa_is_user_port() check in dsa_fdb_offload_notify().
---v1->v5: none
net/dsa/dsa_priv.h | 2 -- net/dsa/slave.c | 16 +++++----------- 2 files changed, 5 insertions(+), 13 deletions(-)
net/dsa/dsa_priv.h +0 -2
@@ -119,8 +119,6 @@ struct dsa_notifier_master_state_info { };struct dsa_switchdev_event_work { -struct dsa_switch *ds; -int port;struct net_device *dev;struct work_struct work;unsigned long event;
net/dsa/slave.c +5 -11
@@ -2373,29 +2373,25 @@ static void dsa_fdb_offload_notify(struct dsa_switchdev_event_work *switchdev_work) {struct switchdev_notifier_fdb_info info = {}; -struct dsa_switch *ds = switchdev_work->ds; -struct dsa_port *dp; - -if (!dsa_is_user_port (ds, switchdev_work->port)) -return ; info.addr = switchdev_work->addr; info.vid = switchdev_work->vid; info.offloaded = true; - dp =dsa_to_port (ds, switchdev_work->port);call_switchdev_notifiers (SWITCHDEV_FDB_OFFLOADED , - dp->slave, &info.info,NULL ); + switchdev_work->dev, &info.info,NULL ); }static void dsa_slave_switchdev_event_work (struct work_struct *work) {struct dsa_switchdev_event_work *switchdev_work = container_of(work, struct dsa_switchdev_event_work, work); -struct dsa_switch *ds = switchdev_work->ds; +struct net_device *dev = switchdev_work->dev; +struct dsa_switch *ds;struct dsa_port *dp;int err; - dp =dsa_to_port (ds, switchdev_work->port); + dp =dsa_slave_to_port (dev); + ds = dp->ds;switch (switchdev_work->event) {case SWITCHDEV_FDB_ADD_TO_DEVICE :
@@ -2497,8 +2493,6 @@ static int dsa_slave_fdb_event(struct net_device *dev, host_addr ? " as host address" : "");INIT_WORK (&switchdev_work->work, dsa_slave_switchdev_event_work); - switchdev_work->ds = ds; - switchdev_work->port = dp->index; switchdev_work->event = event; switchdev_work->dev = dev;
Signature · 1 line
2.25.1
Vladimir Oltean
maintainerPATCH v5 9/11 net: dsa: call SWITCHDEV_FDB_OFFLOADED for the orig_dev
In reply to Vladimir OlteanWhen switchdev_handle_fdb_event_to_device() replicates a FDB event emitted for the bridge or for a LAG port and DSA offloads that, we should notify back to switchdev that the FDB entry on the original device is what was offloaded, not on the DSA slave devices that the event is replicated on.
---v2->v5: none
net/dsa/dsa_priv.h | 1 + net/dsa/slave.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
net/dsa/dsa_priv.h +1 -0
@@ -120,6 +120,7 @@ struct dsa_notifier_master_state_info {struct dsa_switchdev_event_work {struct net_device *dev; +struct net_device *orig_dev;struct work_struct work;unsigned long event;/* Specific for SWITCHDEV_FDB_ADD_TO_DEVICE and
net/dsa/slave.c +2 -1
@@ -2378,7 +2378,7 @@ dsa_fdb_offload_notify(struct dsa_switchdev_event_work *switchdev_work) info.vid = switchdev_work->vid; info.offloaded = true;call_switchdev_notifiers (SWITCHDEV_FDB_OFFLOADED , - switchdev_work->dev, &info.info,NULL ); + switchdev_work->orig_dev, &info.info,NULL ); }static void dsa_slave_switchdev_event_work (struct work_struct *work)
@@ -2495,6 +2495,7 @@ static int dsa_slave_fdb_event(struct net_device *dev,INIT_WORK (&switchdev_work->work, dsa_slave_switchdev_event_work); switchdev_work->event = event; switchdev_work->dev = dev; + switchdev_work->orig_dev = orig_dev;ether_addr_copy (switchdev_work->addr, fdb_info->addr); switchdev_work->vid = fdb_info->vid;
Signature · 1 line
2.25.1
Vladimir Oltean
maintainerPATCH v5 10/11 net: dsa: support FDB events on offloaded LAG interfaces
In reply to Vladimir OlteanThis change introduces support for installing static FDB entries towards a bridge port that is a LAG of multiple DSA switch ports, as well as support for filtering towards the CPU local FDB entries emitted for LAG interfaces that are bridge ports.
Conceptually, host addresses on LAG ports are identical to what we do for plain bridge ports. Whereas FDB entries _towards_ a LAG can't simply be replicated towards all member ports like we do for multicast, or VLAN. Instead we need new driver API. Hardware usually considers a LAG to be a "logical port", and sets the entire LAG as the forwarding destination. The physical egress port selection within the LAG is made by hashing policy, as usual.
To represent the logical port corresponding to the LAG, we pass by value a copy of the dsa_lag structure to all switches in the tree that have at least one port in that LAG.
To illustrate why a refcounted list of FDB entries is needed in struct dsa_lag, it is enough to say that:
- a LAG may be a bridge port and may therefore receive FDB events even while it isn't yet offloaded by any DSA interface
- DSA interfaces may be removed from a LAG while that is a bridge port; we don't want FDB entries lingering around, but we don't want to remove entries that are still in use, either
For all the cases below to work, the idea is to always keep an FDB entry on a LAG with a reference count equal to the DSA member ports. So:
- if a port joins a LAG, it requests the bridge to replay the FDB, and the FDB entries get created, or their refcount gets bumped by one
- if a port leaves a LAG, the FDB replay deletes or decrements refcount by one
- if an FDB is installed towards a LAG with ports already present, that entry is created (if it doesn't exist) and its refcount is bumped by the amount of ports already present in the LAG
echo "Adding FDB entry to bond with existing ports"
ip link del bond0
ip link add bond0 type bond mode 802.3ad
ip link set swp1 down && ip link set swp1 master bond0 && ip link set swp1 up ip link set swp2 down && ip link set swp2 master bond0 && ip link set swp2 up ip link del br0
ip link add br0 type bridge
ip link set bond0 master br0
bridge fdb add dev bond0 00:01:02:03:04:05 master static
ip link del br0
ip link del bond0
echo "Adding FDB entry to empty bond"
ip link del bond0
ip link add bond0 type bond mode 802.3ad
ip link del br0
ip link add br0 type bridge
ip link set bond0 master br0
bridge fdb add dev bond0 00:01:02:03:04:05 master static
ip link set swp1 down && ip link set swp1 master bond0 && ip link set swp1 up ip link set swp2 down && ip link set swp2 master bond0 && ip link set swp2 up
ip link del br0
ip link del bond0
echo "Adding FDB entry to empty bond, then removing ports one by one" ip link del bond0
ip link add bond0 type bond mode 802.3ad
ip link del br0
ip link add br0 type bridge
ip link set bond0 master br0
bridge fdb add dev bond0 00:01:02:03:04:05 master static
ip link set swp1 down && ip link set swp1 master bond0 && ip link set swp1 up ip link set swp2 down && ip link set swp2 master bond0 && ip link set swp2 up
ip link set swp1 nomaster
ip link set swp2 nomaster
ip link del br0
ip link del bond0
---v4->v5:
- nonev3->v4:
- remove the "void *ctx" left over in struct dsa_switchdev_event_work
- make sure the dp->lag assignment is last in dsa_port_lag_create() v2->v3:
- leave iteration among DSA slave interfaces that are members of the LAG bridge port to switchdev_handle_fdb_event_to_device()
- reorder some checks that previously resulted in the access of an uninitialized "ds" pointer
include/net/dsa.h | 6 +++ net/dsa/dsa_priv.h | 13 ++++++ net/dsa/port.c | 27 +++++++++++ net/dsa/slave.c | 43 +++++++++++------- net/dsa/switch.c | 109 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 183 insertions(+), 15 deletions(-)
include/net/dsa.h +6 -0
@@ -119,6 +119,8 @@ struct dsa_netdevice_ops {struct dsa_lag {struct net_device *dev;unsigned int id; +struct mutex fdb_lock; +struct list_head fdbs;refcount_t refcount; };
@@ -944,6 +946,10 @@ struct dsa_switch_ops { const unsigned char *addr, u16 vid);int (*port_fdb_dump)(struct dsa_switch *ds,int port,dsa_fdb_dump_cb_t *cb,void *data); +int (*lag_fdb_add)(struct dsa_switch *ds,struct dsa_lag lag, +const unsigned char *addr,u16 vid); +int (*lag_fdb_del)(struct dsa_switch *ds,struct dsa_lag lag, +const unsigned char *addr,u16 vid);/* * Multicast database
net/dsa/dsa_priv.h +13 -0
@@ -25,6 +25,8 @@ enum {DSA_NOTIFIER_FDB_DEL ,DSA_NOTIFIER_HOST_FDB_ADD ,DSA_NOTIFIER_HOST_FDB_DEL , +DSA_NOTIFIER_LAG_FDB_ADD , +DSA_NOTIFIER_LAG_FDB_DEL ,DSA_NOTIFIER_LAG_CHANGE ,DSA_NOTIFIER_LAG_JOIN , DSA_NOTIFIER_LAG_LEAVE,
@@ -67,6 +69,13 @@ struct dsa_notifier_fdb_info {u16 vid; }; +/* DSA_NOTIFIER_LAG_FDB_* */ +struct dsa_notifier_lag_fdb_info { +struct dsa_lag *lag; +const unsigned char *addr; +u16 vid; +}; +/* DSA_NOTIFIER_MDB_* */ struct dsa_notifier_mdb_info {const struct switchdev_obj_port_mdb *mdb;
@@ -214,6 +223,10 @@ int dsa_port_host_fdb_add(struct dsa_port *dp, const unsigned char *addr, u16 vid);int dsa_port_host_fdb_del (struct dsa_port *dp,const unsigned char *addr,u16 vid); +int dsa_port_lag_fdb_add (struct dsa_port *dp,const unsigned char *addr, +u16 vid); +int dsa_port_lag_fdb_del (struct dsa_port *dp,const unsigned char *addr, +u16 vid);int dsa_port_fdb_dump (struct dsa_port *dp,dsa_fdb_dump_cb_t *cb,void *data);int dsa_port_mdb_add (const struct dsa_port *dp,const struct switchdev_obj_port_mdb *mdb);
net/dsa/port.c +27 -0
@@ -458,6 +458,8 @@ static int dsa_port_lag_create(struct dsa_port *dp,return -ENOMEM ;refcount_set (&lag->refcount,1 ); +mutex_init (&lag->fdb_lock); +INIT_LIST_HEAD (&lag->fdbs); lag->dev = lag_dev;dsa_lag_map (ds->dst, lag); dp->lag = lag;
@@ -475,6 +477,7 @@ static void dsa_port_lag_destroy(struct dsa_port *dp)if (!refcount_dec_and_test (&lag->refcount))return ; +WARN_ON (!list_empty (&lag->fdbs));dsa_lag_unmap (dp->ds->dst, lag);kfree (lag); }
@@ -845,6 +848,30 @@ int dsa_port_host_fdb_del(struct dsa_port *dp, const unsigned char *addr,return dsa_port_notify (dp,DSA_NOTIFIER_HOST_FDB_DEL , &info); } +int dsa_port_lag_fdb_add (struct dsa_port *dp,const unsigned char *addr, +u16 vid) +{ +struct dsa_notifier_lag_fdb_info info = { + .lag = dp->lag, + .addr = addr, + .vid = vid, + }; + +return dsa_port_notify (dp,DSA_NOTIFIER_LAG_FDB_ADD , &info); +} + +int dsa_port_lag_fdb_del (struct dsa_port *dp,const unsigned char *addr, +u16 vid) +{ +struct dsa_notifier_lag_fdb_info info = { + .lag = dp->lag, + .addr = addr, + .vid = vid, + }; + +return dsa_port_notify (dp,DSA_NOTIFIER_LAG_FDB_DEL , &info); +} +int dsa_port_fdb_dump (struct dsa_port *dp,dsa_fdb_dump_cb_t *cb,void *data) {struct dsa_switch *ds = dp->ds;
net/dsa/slave.c +28 -15
71 lines not on this page · raw message
net/dsa/switch.c +109 -0
127 lines not on this page · raw message
Signature · 1 line
2.25.1
Vladimir Oltean
maintainerPATCH v5 11/11 net: dsa: felix: support FDB entries on offloaded LAG interfaces
In reply to Vladimir OlteanThis adds the logic in the Felix DSA driver and Ocelot switch library. For Ocelot switches, the DEST_IDX that is the output of the MAC table lookup is a logical port (equal to physical port, if no LAG is used, or a dynamically allocated number otherwise). The allocation we have in place for LAG IDs is different from DSA's, so we can't use that:
- DSA allocates a continuous range of LAG IDs starting from 1
- Ocelot appears to require that physical ports and LAG IDs are in the same space of [0, num_phys_ports), and additionally, ports that aren't in a LAG must have physical port id == logical port id
The implication is that an FDB entry towards a LAG might need to be deleted and reinstalled when the LAG ID changes.
---v1->v5: none
drivers/net/dsa/ocelot/felix.c | 18 ++++ drivers/net/ethernet/mscc/ocelot.c | 128 ++++++++++++++++++++++++++++- include/soc/mscc/ocelot.h | 12 +++ 3 files changed, 157 insertions(+), 1 deletion(-)
drivers/net/dsa/ocelot/felix.c +18 -0
@@ -614,6 +614,22 @@ static int felix_fdb_del(struct dsa_switch *ds, int port,return ocelot_fdb_del (ocelot, port, addr, vid); } +static int felix_lag_fdb_add (struct dsa_switch *ds,struct dsa_lag lag, +const unsigned char *addr,u16 vid) +{ +struct ocelot *ocelot = ds->priv; + +return ocelot_lag_fdb_add (ocelot, lag.dev, addr, vid); +} + +static int felix_lag_fdb_del (struct dsa_switch *ds,struct dsa_lag lag, +const unsigned char *addr,u16 vid) +{ +struct ocelot *ocelot = ds->priv; + +return ocelot_lag_fdb_del (ocelot, lag.dev, addr, vid); +} +static int felix_mdb_add (struct dsa_switch *ds,int port,const struct switchdev_obj_port_mdb *mdb) {
@@ -1579,6 +1595,8 @@ const struct dsa_switch_ops felix_switch_ops = { .port_fdb_dump = felix_fdb_dump, .port_fdb_add = felix_fdb_add, .port_fdb_del = felix_fdb_del, + .lag_fdb_add = felix_lag_fdb_add, + .lag_fdb_del = felix_lag_fdb_del, .port_mdb_add = felix_mdb_add, .port_mdb_del = felix_mdb_del, .port_pre_bridge_flags = felix_pre_bridge_flags,
drivers/net/ethernet/mscc/ocelot.c +127 -1
185 lines not on this page · raw message
include/soc/mscc/ocelot.h +12 -0
@@ -635,6 +635,13 @@ enum macaccess_entry_type {#define OCELOT_QUIRK_PCS_PERFORMS_RATE_ADAPTATION BIT(0)#define OCELOT_QUIRK_QSGMII_PORTS_MUST_BE_UP BIT(1) +struct ocelot_lag_fdb { +unsigned char addr[ETH_ALEN ]; +u16 vid; +struct net_device *bond; +struct list_head list; +}; +struct ocelot_port {struct ocelot *ocelot;
@@ -690,6 +697,7 @@ struct ocelot {struct list_head vlans;struct list_head traps; +struct list_head lag_fdbs;/* Switches like VSC9959 have flooding per traffic class */ int num_flooding_pgids;
@@ -866,6 +874,10 @@ int ocelot_fdb_add(struct ocelot *ocelot, int port, const unsigned char *addr, u16 vid);int ocelot_fdb_del (struct ocelot *ocelot,int port,const unsigned char *addr,u16 vid); +int ocelot_lag_fdb_add (struct ocelot *ocelot,struct net_device *bond, +const unsigned char *addr,u16 vid); +int ocelot_lag_fdb_del (struct ocelot *ocelot,struct net_device *bond, +const unsigned char *addr,u16 vid);int ocelot_vlan_prepare (struct ocelot *ocelot,int port,u16 vid,bool pvid,bool untagged,struct netlink_ext_ack *extack); int ocelot_vlan_add(struct ocelot *ocelot, int port, u16 vid, bool pvid,
Signature · 1 line
2.25.1
This series was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 14 lines · On Wed, 23 Feb 2022 16:00:43 +0200 you wrote:
v4->v5:
- resent v4, which was marked as non applicable in patchwork (due to other patches getting accepted in the meanwhile, the offsets of some hunks changed a little, no other changes)v3->v4:
- avoid NULL pointer dereference indsa_port_lag_leave()when the LAG is not offloaded (thanks to Alvin Šipraga)
- remove the "void *ctx" left over in structdsa_switchdev_event_work
- make sure thedp->lagassignment is last indsa_port_lag_create()v2->v3:
- Move the complexity of iterating over DSA slave interfaces that are members of the LAG bridge port fromdsa_slave_fdb_event()toswitchdev_handle_fdb_event_to_device().
Quoted 1 line
[...]
Here is the summary with links:
- [v5,net-next,01/11] net: dsa: rename references to "lag" as "lag_dev"
https://git.kernel.org/netdev/net-next/c/46a76724e4c9 - [v5,net-next,02/11] net: dsa: mv88e6xxx: rename references to "lag" as "lag_dev" https://git.kernel.org/netdev/net-next/c/e23eba722861 - [v5,net-next,03/11] net: dsa: qca8k: rename references to "lag" as "lag_dev" https://git.kernel.org/netdev/net-next/c/066ce9779c7a - [v5,net-next,04/11] net: dsa: make LAG IDs one-based https://git.kernel.org/netdev/net-next/c/3d4a0a2a46ab - [v5,net-next,05/11] net: dsa: mv88e6xxx: use dsa_switch_for_each_port in mv88e6xxx_lag_sync_masks https://git.kernel.org/netdev/net-next/c/b99dbdf00bc1 - [v5,net-next,06/11] net: dsa: create a dsa_lag structure https://git.kernel.org/netdev/net-next/c/dedd6a009f41 - [v5,net-next,07/11] net: switchdev: remove lag_mod_cb from switchdev_handle_fdb_event_to_device https://git.kernel.org/netdev/net-next/c/ec638740fce9 - [v5,net-next,08/11] net: dsa: remove "ds" and "port" from struct dsa_switchdev_event_work https://git.kernel.org/netdev/net-next/c/e35f12e993d4 - [v5,net-next,09/11] net: dsa: call SWITCHDEV_FDB_OFFLOADED for the orig_dev https://git.kernel.org/netdev/net-next/c/93c798230af5 - [v5,net-next,10/11] net: dsa: support FDB events on offloaded LAG interfaces https://git.kernel.org/netdev/net-next/c/e212fa7c5418 - [v5,net-next,11/11] net: dsa: felix: support FDB entries on offloaded LAG interfaces https://git.kernel.org/netdev/net-next/c/961d8b699070
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html