Lines Matching refs:mid
795 struct mlxsw_sp_mid *mid; in mlxsw_sp_bridge_mrouter_update_mdb() local
797 list_for_each_entry(mid, &bridge_device->mids_list, list) in mlxsw_sp_bridge_mrouter_update_mdb()
798 mlxsw_sp_smid_router_port_set(mlxsw_sp, mid->mid, add); in mlxsw_sp_bridge_mrouter_update_mdb()
1457 struct mlxsw_sp_mid *mid; in __mlxsw_sp_mc_get() local
1459 list_for_each_entry(mid, &bridge_device->mids_list, list) { in __mlxsw_sp_mc_get()
1460 if (ether_addr_equal(mid->addr, addr) && mid->fid == fid) in __mlxsw_sp_mc_get()
1461 return mid; in __mlxsw_sp_mc_get()
1509 struct mlxsw_sp_mid *mid, in mlxsw_sp_mc_write_mdb_entry() argument
1529 bitmap_copy(flood_bitmap, mid->ports_in_mid, num_of_ports); in mlxsw_sp_mc_write_mdb_entry()
1532 mid->mid = mid_idx; in mlxsw_sp_mc_write_mdb_entry()
1539 err = mlxsw_sp_port_mdb_op(mlxsw_sp, mid->addr, mid->fid, mid_idx, in mlxsw_sp_mc_write_mdb_entry()
1545 mid->in_hw = true; in mlxsw_sp_mc_write_mdb_entry()
1550 struct mlxsw_sp_mid *mid) in mlxsw_sp_mc_remove_mdb_entry() argument
1552 if (!mid->in_hw) in mlxsw_sp_mc_remove_mdb_entry()
1555 clear_bit(mid->mid, mlxsw_sp->bridge->mids_bitmap); in mlxsw_sp_mc_remove_mdb_entry()
1556 mid->in_hw = false; in mlxsw_sp_mc_remove_mdb_entry()
1557 return mlxsw_sp_port_mdb_op(mlxsw_sp, mid->addr, mid->fid, mid->mid, in mlxsw_sp_mc_remove_mdb_entry()
1567 struct mlxsw_sp_mid *mid; in __mlxsw_sp_mc_alloc() local
1570 mid = kzalloc(sizeof(*mid), GFP_KERNEL); in __mlxsw_sp_mc_alloc()
1571 if (!mid) in __mlxsw_sp_mc_alloc()
1577 mid->ports_in_mid = kzalloc(alloc_size, GFP_KERNEL); in __mlxsw_sp_mc_alloc()
1578 if (!mid->ports_in_mid) in __mlxsw_sp_mc_alloc()
1581 ether_addr_copy(mid->addr, addr); in __mlxsw_sp_mc_alloc()
1582 mid->fid = fid; in __mlxsw_sp_mc_alloc()
1583 mid->in_hw = false; in __mlxsw_sp_mc_alloc()
1588 if (!mlxsw_sp_mc_write_mdb_entry(mlxsw_sp, mid, bridge_device)) in __mlxsw_sp_mc_alloc()
1592 list_add_tail(&mid->list, &bridge_device->mids_list); in __mlxsw_sp_mc_alloc()
1593 return mid; in __mlxsw_sp_mc_alloc()
1596 kfree(mid->ports_in_mid); in __mlxsw_sp_mc_alloc()
1598 kfree(mid); in __mlxsw_sp_mc_alloc()
1603 struct mlxsw_sp_mid *mid) in mlxsw_sp_port_remove_from_mid() argument
1608 clear_bit(mlxsw_sp_port->local_port, mid->ports_in_mid); in mlxsw_sp_port_remove_from_mid()
1609 if (bitmap_empty(mid->ports_in_mid, in mlxsw_sp_port_remove_from_mid()
1611 err = mlxsw_sp_mc_remove_mdb_entry(mlxsw_sp, mid); in mlxsw_sp_port_remove_from_mid()
1612 list_del(&mid->list); in mlxsw_sp_port_remove_from_mid()
1613 kfree(mid->ports_in_mid); in mlxsw_sp_port_remove_from_mid()
1614 kfree(mid); in mlxsw_sp_port_remove_from_mid()
1629 struct mlxsw_sp_mid *mid; in mlxsw_sp_port_mdb_add() local
1649 mid = __mlxsw_sp_mc_get(bridge_device, mdb->addr, fid_index); in mlxsw_sp_port_mdb_add()
1650 if (!mid) { in mlxsw_sp_port_mdb_add()
1651 mid = __mlxsw_sp_mc_alloc(mlxsw_sp, bridge_device, mdb->addr, in mlxsw_sp_port_mdb_add()
1653 if (!mid) { in mlxsw_sp_port_mdb_add()
1658 set_bit(mlxsw_sp_port->local_port, mid->ports_in_mid); in mlxsw_sp_port_mdb_add()
1666 err = mlxsw_sp_port_smid_set(mlxsw_sp_port, mid->mid, true); in mlxsw_sp_port_mdb_add()
1675 mlxsw_sp_port_remove_from_mid(mlxsw_sp_port, mid); in mlxsw_sp_port_mdb_add()
1685 struct mlxsw_sp_mid *mid; in mlxsw_sp_bridge_mdb_mc_enable_sync() local
1690 list_for_each_entry(mid, &bridge_device->mids_list, list) { in mlxsw_sp_bridge_mdb_mc_enable_sync()
1692 mlxsw_sp_mc_write_mdb_entry(mlxsw_sp, mid, in mlxsw_sp_bridge_mdb_mc_enable_sync()
1695 mlxsw_sp_mc_remove_mdb_entry(mlxsw_sp, mid); in mlxsw_sp_bridge_mdb_mc_enable_sync()
1705 struct mlxsw_sp_mid *mid; in mlxsw_sp_port_mrouter_update_mdb() local
1709 list_for_each_entry(mid, &bridge_device->mids_list, list) { in mlxsw_sp_port_mrouter_update_mdb()
1710 if (!test_bit(mlxsw_sp_port->local_port, mid->ports_in_mid)) in mlxsw_sp_port_mrouter_update_mdb()
1711 mlxsw_sp_port_smid_set(mlxsw_sp_port, mid->mid, add); in mlxsw_sp_port_mrouter_update_mdb()
1826 struct mlxsw_sp_mid *mid) in __mlxsw_sp_port_mdb_del() argument
1833 err = mlxsw_sp_port_smid_set(mlxsw_sp_port, mid->mid, false); in __mlxsw_sp_port_mdb_del()
1838 err = mlxsw_sp_port_remove_from_mid(mlxsw_sp_port, mid); in __mlxsw_sp_port_mdb_del()
1854 struct mlxsw_sp_mid *mid; in mlxsw_sp_port_mdb_del() local
1870 mid = __mlxsw_sp_mc_get(bridge_device, mdb->addr, fid_index); in mlxsw_sp_port_mdb_del()
1871 if (!mid) { in mlxsw_sp_port_mdb_del()
1876 return __mlxsw_sp_port_mdb_del(mlxsw_sp_port, bridge_port, mid); in mlxsw_sp_port_mdb_del()
1884 struct mlxsw_sp_mid *mid, *tmp; in mlxsw_sp_bridge_port_mdb_flush() local
1888 list_for_each_entry_safe(mid, tmp, &bridge_device->mids_list, list) { in mlxsw_sp_bridge_port_mdb_flush()
1889 if (test_bit(mlxsw_sp_port->local_port, mid->ports_in_mid)) { in mlxsw_sp_bridge_port_mdb_flush()
1891 mid); in mlxsw_sp_bridge_port_mdb_flush()
1894 mlxsw_sp_port_smid_set(mlxsw_sp_port, mid->mid, false); in mlxsw_sp_bridge_port_mdb_flush()