Lines Matching refs:fid_family
37 struct mlxsw_sp_fid_family *fid_family; member
143 struct mlxsw_sp_fid_family *fid_family; in mlxsw_sp_fid_is_dummy() local
145 fid_family = mlxsw_sp->fid_core->fid_family_arr[fid_type]; in mlxsw_sp_fid_is_dummy()
147 return fid_family->start_index == fid_index; in mlxsw_sp_fid_is_dummy()
210 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_nve_flood_index_set() local
211 const struct mlxsw_sp_fid_ops *ops = fid_family->ops; in mlxsw_sp_fid_nve_flood_index_set()
232 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_nve_flood_index_clear() local
233 const struct mlxsw_sp_fid_ops *ops = fid_family->ops; in mlxsw_sp_fid_nve_flood_index_clear()
250 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_vni_set() local
251 const struct mlxsw_sp_fid_ops *ops = fid_family->ops; in mlxsw_sp_fid_vni_set()
252 struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; in mlxsw_sp_fid_vni_set()
283 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_vni_clear() local
284 const struct mlxsw_sp_fid_ops *ops = fid_family->ops; in mlxsw_sp_fid_vni_clear()
285 struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; in mlxsw_sp_fid_vni_clear()
304 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_fdb_clear_offload() local
305 const struct mlxsw_sp_fid_ops *ops = fid_family->ops; in mlxsw_sp_fid_fdb_clear_offload()
315 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_flood_table_lookup() local
318 for (i = 0; i < fid_family->nr_flood_tables; i++) { in mlxsw_sp_fid_flood_table_lookup()
319 if (fid_family->flood_tables[i].packet_type != packet_type) in mlxsw_sp_fid_flood_table_lookup()
321 return &fid_family->flood_tables[i]; in mlxsw_sp_fid_flood_table_lookup()
328 mlxsw_sp_fid_family_num_fids(const struct mlxsw_sp_fid_family *fid_family) in mlxsw_sp_fid_family_num_fids() argument
330 return fid_family->end_index - fid_family->start_index + 1; in mlxsw_sp_fid_family_num_fids()
334 mlxsw_sp_fid_flood_table_mid(const struct mlxsw_sp_fid_family *fid_family, in mlxsw_sp_fid_flood_table_mid() argument
340 num_fids = mlxsw_sp_fid_family_num_fids(fid_family); in mlxsw_sp_fid_flood_table_mid()
341 return fid_family->pgt_base + num_fids * flood_table->table_index + in mlxsw_sp_fid_flood_table_mid()
349 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_flood_set() local
353 if (WARN_ON(!fid_family->flood_tables)) in mlxsw_sp_fid_flood_set()
360 mid_index = mlxsw_sp_fid_flood_table_mid(fid_family, flood_table, in mlxsw_sp_fid_flood_set()
362 return mlxsw_sp_pgt_entry_port_set(fid_family->mlxsw_sp, mid_index, in mlxsw_sp_fid_flood_set()
369 if (WARN_ON(!fid->fid_family->ops->port_vid_map)) in mlxsw_sp_fid_port_vid_map()
371 return fid->fid_family->ops->port_vid_map(fid, mlxsw_sp_port, vid); in mlxsw_sp_fid_port_vid_map()
377 fid->fid_family->ops->port_vid_unmap(fid, mlxsw_sp_port, vid); in mlxsw_sp_fid_port_vid_unmap()
387 return fid->fid_family->type; in mlxsw_sp_fid_type()
420 fid->fid_offset = fid->fid_index - fid->fid_family->start_index; in mlxsw_sp_fid_8021q_setup()
431 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_op()
435 smpe = fid->fid_family->smpe_index_valid ? fid->fid_index : 0; in mlxsw_sp_fid_op()
438 fid->fid_offset, fid->fid_family->flood_rsp, in mlxsw_sp_fid_op()
439 fid->fid_family->bridge_type, in mlxsw_sp_fid_op()
440 fid->fid_family->smpe_index_valid, smpe); in mlxsw_sp_fid_op()
447 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_edit_op()
451 smpe = fid->fid_family->smpe_index_valid ? fid->fid_index : 0; in mlxsw_sp_fid_edit_op()
455 fid->fid_family->flood_rsp, in mlxsw_sp_fid_edit_op()
456 fid->fid_family->bridge_type, in mlxsw_sp_fid_edit_op()
457 fid->fid_family->smpe_index_valid, smpe); in mlxsw_sp_fid_edit_op()
475 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_vni_to_fid_map()
507 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_vid_to_fid_map()
537 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_port_vid_to_fid_rif_update_one()
550 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_vid_to_fid_rif_set()
555 err = fid->fid_family->ops->vid_to_fid_rif_update(fid, rif); in mlxsw_sp_fid_vid_to_fid_rif_set()
586 fid->fid_family->ops->vid_to_fid_rif_update(fid, NULL); in mlxsw_sp_fid_vid_to_fid_rif_set()
592 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_vid_to_fid_rif_unset()
605 fid->fid_family->ops->vid_to_fid_rif_update(fid, NULL); in mlxsw_sp_fid_vid_to_fid_rif_unset()
613 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_reiv_handle()
660 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_erif_eport_to_vid_map()
752 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in __mlxsw_sp_fid_port_vid_map()
778 fid->fid_offset = fid->fid_index - fid->fid_family->start_index; in mlxsw_sp_fid_8021d_setup()
789 mlxsw_sp_nve_fid_disable(fid->fid_family->mlxsw_sp, fid); in mlxsw_sp_fid_8021d_deconfigure()
796 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_8021d_index_alloc() local
799 nr_fids = fid_family->end_index - fid_family->start_index + 1; in mlxsw_sp_fid_8021d_index_alloc()
800 fid_index = find_first_zero_bit(fid_family->fids_bitmap, nr_fids); in mlxsw_sp_fid_8021d_index_alloc()
803 *p_fid_index = fid_family->start_index + fid_index; in mlxsw_sp_fid_8021d_index_alloc()
919 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_mpe_table_map()
933 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_erif_eport_to_vid_map_one()
1137 *p_fid_index = fid->fid_family->start_index + rif_index; in mlxsw_sp_fid_rfid_index_alloc()
1147 return fid->fid_index == rif_index + fid->fid_family->start_index; in mlxsw_sp_fid_rfid_compare()
1278 *p_fid_index = fid->fid_family->start_index; in mlxsw_sp_fid_dummy_index_alloc()
1346 mlxsw_sp_nve_fid_disable(fid->fid_family->mlxsw_sp, fid); in mlxsw_sp_fid_8021q_deconfigure()
1541 struct mlxsw_sp_fid_family *fid_family; in mlxsw_sp_fid_lookup() local
1544 fid_family = mlxsw_sp->fid_core->fid_family_arr[type]; in mlxsw_sp_fid_lookup()
1545 list_for_each_entry(fid, &fid_family->fids_list, list) { in mlxsw_sp_fid_lookup()
1546 if (!fid->fid_family->ops->compare(fid, arg)) in mlxsw_sp_fid_lookup()
1559 struct mlxsw_sp_fid_family *fid_family; in mlxsw_sp_fid_get() local
1568 fid_family = mlxsw_sp->fid_core->fid_family_arr[type]; in mlxsw_sp_fid_get()
1569 fid = kzalloc(fid_family->fid_size, GFP_KERNEL); in mlxsw_sp_fid_get()
1574 fid->fid_family = fid_family; in mlxsw_sp_fid_get()
1576 err = fid->fid_family->ops->index_alloc(fid, arg, &fid_index); in mlxsw_sp_fid_get()
1580 __set_bit(fid_index - fid_family->start_index, fid_family->fids_bitmap); in mlxsw_sp_fid_get()
1582 fid->fid_family->ops->setup(fid, arg); in mlxsw_sp_fid_get()
1584 err = fid->fid_family->ops->configure(fid); in mlxsw_sp_fid_get()
1593 list_add(&fid->list, &fid_family->fids_list); in mlxsw_sp_fid_get()
1598 fid->fid_family->ops->deconfigure(fid); in mlxsw_sp_fid_get()
1600 __clear_bit(fid_index - fid_family->start_index, in mlxsw_sp_fid_get()
1601 fid_family->fids_bitmap); in mlxsw_sp_fid_get()
1609 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_put() local
1610 struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; in mlxsw_sp_fid_put()
1618 fid->fid_family->ops->deconfigure(fid); in mlxsw_sp_fid_put()
1619 __clear_bit(fid->fid_index - fid_family->start_index, in mlxsw_sp_fid_put()
1620 fid_family->fids_bitmap); in mlxsw_sp_fid_put()
1661 mlxsw_sp_fid_flood_table_init(struct mlxsw_sp_fid_family *fid_family, in mlxsw_sp_fid_flood_table_init() argument
1665 struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; in mlxsw_sp_fid_flood_table_init()
1670 mid_base = mlxsw_sp_fid_flood_table_mid(fid_family, flood_table, 0); in mlxsw_sp_fid_flood_table_init()
1671 num_fids = mlxsw_sp_fid_family_num_fids(fid_family); in mlxsw_sp_fid_flood_table_init()
1683 mlxsw_reg_sfgc_pack(sfgc_pl, i, fid_family->bridge_type, in mlxsw_sp_fid_flood_table_init()
1699 mlxsw_sp_fid_flood_table_fini(struct mlxsw_sp_fid_family *fid_family, in mlxsw_sp_fid_flood_table_fini() argument
1702 struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; in mlxsw_sp_fid_flood_table_fini()
1705 mid_base = mlxsw_sp_fid_flood_table_mid(fid_family, flood_table, 0); in mlxsw_sp_fid_flood_table_fini()
1706 num_fids = mlxsw_sp_fid_family_num_fids(fid_family); in mlxsw_sp_fid_flood_table_fini()
1711 mlxsw_sp_fid_flood_tables_init(struct mlxsw_sp_fid_family *fid_family) in mlxsw_sp_fid_flood_tables_init() argument
1715 for (i = 0; i < fid_family->nr_flood_tables; i++) { in mlxsw_sp_fid_flood_tables_init()
1719 flood_table = &fid_family->flood_tables[i]; in mlxsw_sp_fid_flood_tables_init()
1720 err = mlxsw_sp_fid_flood_table_init(fid_family, flood_table); in mlxsw_sp_fid_flood_tables_init()
1729 mlxsw_sp_fid_flood_tables_fini(struct mlxsw_sp_fid_family *fid_family) in mlxsw_sp_fid_flood_tables_fini() argument
1733 for (i = 0; i < fid_family->nr_flood_tables; i++) { in mlxsw_sp_fid_flood_tables_fini()
1736 flood_table = &fid_family->flood_tables[i]; in mlxsw_sp_fid_flood_tables_fini()
1737 mlxsw_sp_fid_flood_table_fini(fid_family, flood_table); in mlxsw_sp_fid_flood_tables_fini()
1745 struct mlxsw_sp_fid_family *fid_family; in mlxsw_sp_fid_family_register() local
1748 fid_family = kmemdup(tmpl, sizeof(*fid_family), GFP_KERNEL); in mlxsw_sp_fid_family_register()
1749 if (!fid_family) in mlxsw_sp_fid_family_register()
1752 fid_family->mlxsw_sp = mlxsw_sp; in mlxsw_sp_fid_family_register()
1753 INIT_LIST_HEAD(&fid_family->fids_list); in mlxsw_sp_fid_family_register()
1754 fid_family->fids_bitmap = bitmap_zalloc(nr_fids, GFP_KERNEL); in mlxsw_sp_fid_family_register()
1755 if (!fid_family->fids_bitmap) { in mlxsw_sp_fid_family_register()
1760 if (fid_family->flood_tables) { in mlxsw_sp_fid_family_register()
1761 err = mlxsw_sp_fid_flood_tables_init(fid_family); in mlxsw_sp_fid_family_register()
1766 mlxsw_sp->fid_core->fid_family_arr[tmpl->type] = fid_family; in mlxsw_sp_fid_family_register()
1771 bitmap_free(fid_family->fids_bitmap); in mlxsw_sp_fid_family_register()
1773 kfree(fid_family); in mlxsw_sp_fid_family_register()
1779 struct mlxsw_sp_fid_family *fid_family) in mlxsw_sp_fid_family_unregister() argument
1781 mlxsw_sp->fid_core->fid_family_arr[fid_family->type] = NULL; in mlxsw_sp_fid_family_unregister()
1783 if (fid_family->flood_tables) in mlxsw_sp_fid_family_unregister()
1784 mlxsw_sp_fid_flood_tables_fini(fid_family); in mlxsw_sp_fid_family_unregister()
1786 bitmap_free(fid_family->fids_bitmap); in mlxsw_sp_fid_family_unregister()
1787 WARN_ON_ONCE(!list_empty(&fid_family->fids_list)); in mlxsw_sp_fid_family_unregister()
1788 kfree(fid_family); in mlxsw_sp_fid_family_unregister()
1849 struct mlxsw_sp_fid_family *fid_family; in mlxsw_sp_fids_init() local
1851 fid_family = fid_core->fid_family_arr[i]; in mlxsw_sp_fids_init()
1852 mlxsw_sp_fid_family_unregister(mlxsw_sp, fid_family); in mlxsw_sp_fids_init()