Lines Matching refs:mid
887 struct mlxsw_sp_mid *mid; in mlxsw_sp_bridge_mrouter_update_mdb() local
889 list_for_each_entry(mid, &bridge_device->mids_list, list) in mlxsw_sp_bridge_mrouter_update_mdb()
890 mlxsw_sp_smid_router_port_set(mlxsw_sp, mid->mid, add); in mlxsw_sp_bridge_mrouter_update_mdb()
1529 struct mlxsw_sp_mid *mid; in __mlxsw_sp_mc_get() local
1531 list_for_each_entry(mid, &bridge_device->mids_list, list) { in __mlxsw_sp_mc_get()
1532 if (ether_addr_equal(mid->addr, addr) && mid->fid == fid) in __mlxsw_sp_mc_get()
1533 return mid; in __mlxsw_sp_mc_get()
1581 struct mlxsw_sp_mid *mid, in mlxsw_sp_mc_write_mdb_entry() argument
1599 bitmap_copy(flood_bitmap, mid->ports_in_mid, num_of_ports); in mlxsw_sp_mc_write_mdb_entry()
1602 mid->mid = mid_idx; in mlxsw_sp_mc_write_mdb_entry()
1609 err = mlxsw_sp_port_mdb_op(mlxsw_sp, mid->addr, mid->fid, mid_idx, in mlxsw_sp_mc_write_mdb_entry()
1615 mid->in_hw = true; in mlxsw_sp_mc_write_mdb_entry()
1620 struct mlxsw_sp_mid *mid) in mlxsw_sp_mc_remove_mdb_entry() argument
1622 if (!mid->in_hw) in mlxsw_sp_mc_remove_mdb_entry()
1625 clear_bit(mid->mid, mlxsw_sp->bridge->mids_bitmap); in mlxsw_sp_mc_remove_mdb_entry()
1626 mid->in_hw = false; in mlxsw_sp_mc_remove_mdb_entry()
1627 return mlxsw_sp_port_mdb_op(mlxsw_sp, mid->addr, mid->fid, mid->mid, in mlxsw_sp_mc_remove_mdb_entry()
1637 struct mlxsw_sp_mid *mid; in __mlxsw_sp_mc_alloc() local
1639 mid = kzalloc(sizeof(*mid), GFP_KERNEL); in __mlxsw_sp_mc_alloc()
1640 if (!mid) in __mlxsw_sp_mc_alloc()
1643 mid->ports_in_mid = bitmap_zalloc(mlxsw_core_max_ports(mlxsw_sp->core), in __mlxsw_sp_mc_alloc()
1645 if (!mid->ports_in_mid) in __mlxsw_sp_mc_alloc()
1648 ether_addr_copy(mid->addr, addr); in __mlxsw_sp_mc_alloc()
1649 mid->fid = fid; in __mlxsw_sp_mc_alloc()
1650 mid->in_hw = false; in __mlxsw_sp_mc_alloc()
1655 if (!mlxsw_sp_mc_write_mdb_entry(mlxsw_sp, mid, bridge_device)) in __mlxsw_sp_mc_alloc()
1659 list_add_tail(&mid->list, &bridge_device->mids_list); in __mlxsw_sp_mc_alloc()
1660 return mid; in __mlxsw_sp_mc_alloc()
1663 bitmap_free(mid->ports_in_mid); in __mlxsw_sp_mc_alloc()
1665 kfree(mid); in __mlxsw_sp_mc_alloc()
1670 struct mlxsw_sp_mid *mid) in mlxsw_sp_port_remove_from_mid() argument
1675 clear_bit(mlxsw_sp_port->local_port, mid->ports_in_mid); in mlxsw_sp_port_remove_from_mid()
1676 if (bitmap_empty(mid->ports_in_mid, in mlxsw_sp_port_remove_from_mid()
1678 err = mlxsw_sp_mc_remove_mdb_entry(mlxsw_sp, mid); in mlxsw_sp_port_remove_from_mid()
1679 list_del(&mid->list); in mlxsw_sp_port_remove_from_mid()
1680 bitmap_free(mid->ports_in_mid); in mlxsw_sp_port_remove_from_mid()
1681 kfree(mid); in mlxsw_sp_port_remove_from_mid()
1695 struct mlxsw_sp_mid *mid; in mlxsw_sp_port_mdb_add() local
1712 mid = __mlxsw_sp_mc_get(bridge_device, mdb->addr, fid_index); in mlxsw_sp_port_mdb_add()
1713 if (!mid) { in mlxsw_sp_port_mdb_add()
1714 mid = __mlxsw_sp_mc_alloc(mlxsw_sp, bridge_device, mdb->addr, in mlxsw_sp_port_mdb_add()
1716 if (!mid) { in mlxsw_sp_port_mdb_add()
1721 set_bit(mlxsw_sp_port->local_port, mid->ports_in_mid); in mlxsw_sp_port_mdb_add()
1729 err = mlxsw_sp_port_smid_set(mlxsw_sp_port, mid->mid, true); in mlxsw_sp_port_mdb_add()
1738 mlxsw_sp_port_remove_from_mid(mlxsw_sp_port, mid); in mlxsw_sp_port_mdb_add()
1748 struct mlxsw_sp_mid *mid; in mlxsw_sp_bridge_mdb_mc_enable_sync() local
1753 list_for_each_entry(mid, &bridge_device->mids_list, list) { in mlxsw_sp_bridge_mdb_mc_enable_sync()
1755 mlxsw_sp_mc_write_mdb_entry(mlxsw_sp, mid, in mlxsw_sp_bridge_mdb_mc_enable_sync()
1758 mlxsw_sp_mc_remove_mdb_entry(mlxsw_sp, mid); in mlxsw_sp_bridge_mdb_mc_enable_sync()
1768 struct mlxsw_sp_mid *mid; in mlxsw_sp_port_mrouter_update_mdb() local
1772 list_for_each_entry(mid, &bridge_device->mids_list, list) { in mlxsw_sp_port_mrouter_update_mdb()
1773 if (!test_bit(mlxsw_sp_port->local_port, mid->ports_in_mid)) in mlxsw_sp_port_mrouter_update_mdb()
1774 mlxsw_sp_port_smid_set(mlxsw_sp_port, mid->mid, add); in mlxsw_sp_port_mrouter_update_mdb()
1855 struct mlxsw_sp_mid *mid) in __mlxsw_sp_port_mdb_del() argument
1862 err = mlxsw_sp_port_smid_set(mlxsw_sp_port, mid->mid, false); in __mlxsw_sp_port_mdb_del()
1867 err = mlxsw_sp_port_remove_from_mid(mlxsw_sp_port, mid); in __mlxsw_sp_port_mdb_del()
1883 struct mlxsw_sp_mid *mid; in mlxsw_sp_port_mdb_del() local
1899 mid = __mlxsw_sp_mc_get(bridge_device, mdb->addr, fid_index); in mlxsw_sp_port_mdb_del()
1900 if (!mid) { in mlxsw_sp_port_mdb_del()
1905 return __mlxsw_sp_port_mdb_del(mlxsw_sp_port, bridge_port, mid); in mlxsw_sp_port_mdb_del()
1913 struct mlxsw_sp_mid *mid, *tmp; in mlxsw_sp_bridge_port_mdb_flush() local
1917 list_for_each_entry_safe(mid, tmp, &bridge_device->mids_list, list) { in mlxsw_sp_bridge_port_mdb_flush()
1918 if (test_bit(mlxsw_sp_port->local_port, mid->ports_in_mid)) { in mlxsw_sp_bridge_port_mdb_flush()
1920 mid); in mlxsw_sp_bridge_port_mdb_flush()
1923 mlxsw_sp_port_smid_set(mlxsw_sp_port, mid->mid, false); in mlxsw_sp_bridge_port_mdb_flush()