diff options
author | Amit Cohen <amcohen@nvidia.com> | 2022-06-29 12:40:00 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-06-29 13:35:46 +0100 |
commit | eaa0791aed8bf95ac50c8e3c79f14c7879235623 (patch) | |
tree | 575762ab317c99e195eecd5145023067fe31ad26 /drivers | |
parent | eede53a49b3c52a95a9f11145ff0e3d86f192f39 (diff) | |
download | linux-stable-eaa0791aed8bf95ac50c8e3c79f14c7879235623.tar.gz linux-stable-eaa0791aed8bf95ac50c8e3c79f14c7879235623.tar.bz2 linux-stable-eaa0791aed8bf95ac50c8e3c79f14c7879235623.zip |
mlxsw: spectrum_switchdev: Rename MIDs list
Currently, the list which stores the MDB entries for a given bridge
instance is called 'mids_list'.
This name is not accurate as a MID entry stores a bitmap of ports to
which a packet needs to be replicated and a MDB entry stores the mapping
from {MAC, FID} to PGT index (MID)
Rename it to 'mdb_list'.
Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c index 70b48b922520..bd182736f44d 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c @@ -48,7 +48,7 @@ struct mlxsw_sp_bridge_device { struct net_device *dev; struct list_head list; struct list_head ports_list; - struct list_head mids_list; + struct list_head mdb_list; u8 vlan_enabled:1, multicast_enabled:1, mrouter:1; @@ -263,7 +263,8 @@ mlxsw_sp_bridge_device_create(struct mlxsw_sp_bridge *bridge, } else { bridge_device->ops = bridge->bridge_8021d_ops; } - INIT_LIST_HEAD(&bridge_device->mids_list); + INIT_LIST_HEAD(&bridge_device->mdb_list); + if (list_empty(&bridge->bridges_list)) mlxsw_sp_fdb_notify_work_schedule(bridge->mlxsw_sp, false); list_add(&bridge_device->list, &bridge->bridges_list); @@ -299,7 +300,7 @@ mlxsw_sp_bridge_device_destroy(struct mlxsw_sp_bridge *bridge, if (bridge_device->vlan_enabled) bridge->vlan_enabled_exists = false; WARN_ON(!list_empty(&bridge_device->ports_list)); - WARN_ON(!list_empty(&bridge_device->mids_list)); + WARN_ON(!list_empty(&bridge_device->mdb_list)); kfree(bridge_device); } @@ -982,7 +983,7 @@ mlxsw_sp_bridge_mrouter_update_mdb(struct mlxsw_sp *mlxsw_sp, { struct mlxsw_sp_mdb_entry *mdb_entry; - list_for_each_entry(mdb_entry, &bridge_device->mids_list, list) + list_for_each_entry(mdb_entry, &bridge_device->mdb_list, list) mlxsw_sp_smid_router_port_set(mlxsw_sp, mdb_entry->mid, add); } @@ -1711,7 +1712,7 @@ __mlxsw_sp_mc_get(struct mlxsw_sp_bridge_device *bridge_device, { struct mlxsw_sp_mdb_entry *mdb_entry; - list_for_each_entry(mdb_entry, &bridge_device->mids_list, list) { + list_for_each_entry(mdb_entry, &bridge_device->mdb_list, list) { if (ether_addr_equal(mdb_entry->addr, addr) && mdb_entry->fid == fid) return mdb_entry; @@ -1840,7 +1841,7 @@ __mlxsw_sp_mc_alloc(struct mlxsw_sp *mlxsw_sp, goto err_write_mdb_entry; out: - list_add_tail(&mdb_entry->list, &bridge_device->mids_list); + list_add_tail(&mdb_entry->list, &bridge_device->mdb_list); return mdb_entry; err_write_mdb_entry: @@ -1931,7 +1932,7 @@ mlxsw_sp_bridge_mdb_mc_enable_sync(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_mdb_entry *mdb_entry; int err; - list_for_each_entry(mdb_entry, &bridge_device->mids_list, list) { + list_for_each_entry(mdb_entry, &bridge_device->mdb_list, list) { if (mc_enabled) err = mlxsw_sp_mc_write_mdb_entry(mlxsw_sp, mdb_entry, bridge_device); @@ -1946,7 +1947,7 @@ mlxsw_sp_bridge_mdb_mc_enable_sync(struct mlxsw_sp *mlxsw_sp, err_mdb_entry_update: list_for_each_entry_continue_reverse(mdb_entry, - &bridge_device->mids_list, list) { + &bridge_device->mdb_list, list) { if (mc_enabled) mlxsw_sp_mc_remove_mdb_entry(mlxsw_sp, mdb_entry); else @@ -1966,7 +1967,7 @@ mlxsw_sp_port_mrouter_update_mdb(struct mlxsw_sp_port *mlxsw_sp_port, bridge_device = bridge_port->bridge_device; - list_for_each_entry(mdb_entry, &bridge_device->mids_list, list) { + list_for_each_entry(mdb_entry, &bridge_device->mdb_list, list) { if (!test_bit(mlxsw_sp_port->local_port, mdb_entry->ports_in_mid)) mlxsw_sp_port_smid_set(mlxsw_sp_port, mdb_entry->mid, @@ -2115,7 +2116,7 @@ mlxsw_sp_bridge_port_mdb_flush(struct mlxsw_sp_port *mlxsw_sp_port, bridge_device = bridge_port->bridge_device; - list_for_each_entry_safe(mdb_entry, tmp, &bridge_device->mids_list, + list_for_each_entry_safe(mdb_entry, tmp, &bridge_device->mdb_list, list) { if (test_bit(local_port, mdb_entry->ports_in_mid)) { __mlxsw_sp_port_mdb_del(mlxsw_sp_port, bridge_port, |