Lines Matching refs:fid_family
38 struct mlxsw_sp_fid_family *fid_family; member
99 int (*flood_table_init)(struct mlxsw_sp_fid_family *fid_family,
101 int (*pgt_size)(const struct mlxsw_sp_fid_family *fid_family,
111 int (*fid_port_init)(const struct mlxsw_sp_fid_family *fid_family,
113 void (*fid_port_fini)(const struct mlxsw_sp_fid_family *fid_family,
249 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_nve_flood_index_set() local
250 const struct mlxsw_sp_fid_ops *ops = fid_family->ops; in mlxsw_sp_fid_nve_flood_index_set()
271 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_nve_flood_index_clear() local
272 const struct mlxsw_sp_fid_ops *ops = fid_family->ops; in mlxsw_sp_fid_nve_flood_index_clear()
289 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_vni_set() local
290 const struct mlxsw_sp_fid_ops *ops = fid_family->ops; in mlxsw_sp_fid_vni_set()
291 struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; in mlxsw_sp_fid_vni_set()
322 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_vni_clear() local
323 const struct mlxsw_sp_fid_ops *ops = fid_family->ops; in mlxsw_sp_fid_vni_clear()
324 struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; in mlxsw_sp_fid_vni_clear()
343 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_fdb_clear_offload() local
344 const struct mlxsw_sp_fid_ops *ops = fid_family->ops; in mlxsw_sp_fid_fdb_clear_offload()
354 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_flood_table_lookup() local
357 for (i = 0; i < fid_family->flood_profile->nr_flood_tables; i++) { in mlxsw_sp_fid_flood_table_lookup()
360 flood_table = &fid_family->flood_profile->flood_tables[i]; in mlxsw_sp_fid_flood_table_lookup()
370 mlxsw_sp_fid_family_num_fids(const struct mlxsw_sp_fid_family *fid_family) in mlxsw_sp_fid_family_num_fids() argument
372 return fid_family->end_index - fid_family->start_index + 1; in mlxsw_sp_fid_family_num_fids()
376 mlxsw_sp_fid_8021d_pgt_size(const struct mlxsw_sp_fid_family *fid_family, in mlxsw_sp_fid_8021d_pgt_size() argument
379 u16 num_fids = mlxsw_sp_fid_family_num_fids(fid_family); in mlxsw_sp_fid_8021d_pgt_size()
381 *p_pgt_size = num_fids * fid_family->flood_profile->nr_flood_tables; in mlxsw_sp_fid_8021d_pgt_size()
394 mlxsw_sp_fid_rfid_pgt_size_cff(const struct mlxsw_sp_fid_family *fid_family, in mlxsw_sp_fid_rfid_pgt_size_cff() argument
397 struct mlxsw_core *core = fid_family->mlxsw_sp->core; in mlxsw_sp_fid_rfid_pgt_size_cff()
410 fid_family->flood_profile->nr_flood_tables; in mlxsw_sp_fid_rfid_pgt_size_cff()
416 mlxsw_sp_fid_pgt_base_ctl(const struct mlxsw_sp_fid_family *fid_family, in mlxsw_sp_fid_pgt_base_ctl() argument
421 num_fids = mlxsw_sp_fid_family_num_fids(fid_family); in mlxsw_sp_fid_pgt_base_ctl()
422 return fid_family->pgt_base + num_fids * flood_table->table_index; in mlxsw_sp_fid_pgt_base_ctl()
429 return mlxsw_sp_fid_pgt_base_ctl(fid->fid_family, flood_table) + in mlxsw_sp_fid_fid_mid_ctl()
437 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_flood_set() local
441 if (WARN_ON(!fid_family->flood_profile)) in mlxsw_sp_fid_flood_set()
448 mid_index = fid_family->ops->fid_mid(fid, flood_table); in mlxsw_sp_fid_flood_set()
449 return mlxsw_sp_pgt_entry_port_set(fid_family->mlxsw_sp, mid_index, in mlxsw_sp_fid_flood_set()
456 if (WARN_ON(!fid->fid_family->ops->port_vid_map)) in mlxsw_sp_fid_port_vid_map()
458 return fid->fid_family->ops->port_vid_map(fid, mlxsw_sp_port, vid); in mlxsw_sp_fid_port_vid_map()
464 fid->fid_family->ops->port_vid_unmap(fid, mlxsw_sp_port, vid); in mlxsw_sp_fid_port_vid_unmap()
474 return fid->fid_family->type; in mlxsw_sp_fid_type()
507 fid->fid_offset = fid->fid_index - fid->fid_family->start_index; in mlxsw_sp_fid_8021q_setup()
523 smpe = fid->fid_family->smpe_index_valid ? fid->fid_index : 0; in mlxsw_sp_fid_pack()
526 fid->fid_family->smpe_index_valid, smpe); in mlxsw_sp_fid_pack()
535 mlxsw_reg_sfmr_flood_rsp_set(sfmr_pl, fid->fid_family->flood_rsp); in mlxsw_sp_fid_pack_ctl()
537 fid->fid_family->bridge_type); in mlxsw_sp_fid_pack_ctl()
541 mlxsw_sp_fid_off_pgt_base_cff(const struct mlxsw_sp_fid_family *fid_family, in mlxsw_sp_fid_off_pgt_base_cff() argument
544 return fid_family->pgt_base + in mlxsw_sp_fid_off_pgt_base_cff()
545 fid_offset * fid_family->flood_profile->nr_flood_tables; in mlxsw_sp_fid_off_pgt_base_cff()
550 return mlxsw_sp_fid_off_pgt_base_cff(fid->fid_family, fid->fid_offset); in mlxsw_sp_fid_pgt_base_cff()
557 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_fid_pack_cff() local
563 fid_family->flood_profile->profile_id); in mlxsw_sp_fid_fid_pack_cff()
582 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_op()
585 fid->fid_family->ops->fid_pack(sfmr_pl, fid, in mlxsw_sp_fid_op()
593 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_edit_op()
596 fid->fid_family->ops->fid_pack(sfmr_pl, fid, in mlxsw_sp_fid_edit_op()
616 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_vni_to_fid_map()
648 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_vid_to_fid_map()
678 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_port_vid_to_fid_rif_update_one()
691 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_vid_to_fid_rif_set()
696 err = fid->fid_family->ops->vid_to_fid_rif_update(fid, rif); in mlxsw_sp_fid_vid_to_fid_rif_set()
727 fid->fid_family->ops->vid_to_fid_rif_update(fid, NULL); in mlxsw_sp_fid_vid_to_fid_rif_set()
733 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_vid_to_fid_rif_unset()
746 fid->fid_family->ops->vid_to_fid_rif_update(fid, NULL); in mlxsw_sp_fid_vid_to_fid_rif_unset()
754 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_reiv_handle()
801 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_erif_eport_to_vid_map()
893 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in __mlxsw_sp_fid_port_vid_map()
919 fid->fid_offset = fid->fid_index - fid->fid_family->start_index; in mlxsw_sp_fid_8021d_setup()
931 mlxsw_sp_nve_fid_disable(fid->fid_family->mlxsw_sp, fid); in mlxsw_sp_fid_8021d_deconfigure()
938 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_8021d_index_alloc() local
941 nr_fids = fid_family->end_index - fid_family->start_index + 1; in mlxsw_sp_fid_8021d_index_alloc()
942 fid_index = find_first_zero_bit(fid_family->fids_bitmap, nr_fids); in mlxsw_sp_fid_8021d_index_alloc()
945 *p_fid_index = fid_family->start_index + fid_index; in mlxsw_sp_fid_8021d_index_alloc()
1061 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_mpe_table_map()
1075 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_erif_eport_to_vid_map_one()
1206 mlxsw_sp_fid_flood_table_init_ctl(struct mlxsw_sp_fid_family *fid_family, in mlxsw_sp_fid_flood_table_init_ctl() argument
1210 struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; in mlxsw_sp_fid_flood_table_init_ctl()
1215 mid_base = mlxsw_sp_fid_pgt_base_ctl(fid_family, flood_table); in mlxsw_sp_fid_flood_table_init_ctl()
1224 mlxsw_reg_sfgc_pack(sfgc_pl, i, fid_family->bridge_type, in mlxsw_sp_fid_flood_table_init_ctl()
1367 struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp; in mlxsw_sp_fid_rfid_setup_cff()
1402 *p_fid_index = fid->fid_family->start_index + rif_index; in mlxsw_sp_fid_rfid_index_alloc()
1412 return fid->fid_index == rif_index + fid->fid_family->start_index; in mlxsw_sp_fid_rfid_compare()
1571 mlxsw_sp_fid_rfid_port_memb_ft_cff(const struct mlxsw_sp_fid_family *fid_family, in mlxsw_sp_fid_rfid_port_memb_ft_cff() argument
1576 struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; in mlxsw_sp_fid_rfid_port_memb_ft_cff()
1590 fid_pgt_base = mlxsw_sp_fid_off_pgt_base_cff(fid_family, fid_offset); in mlxsw_sp_fid_rfid_port_memb_ft_cff()
1604 mlxsw_sp_fid_rfid_port_memb_cff(const struct mlxsw_sp_fid_family *fid_family, in mlxsw_sp_fid_rfid_port_memb_cff() argument
1610 for (i = 0; i < fid_family->flood_profile->nr_flood_tables; i++) { in mlxsw_sp_fid_rfid_port_memb_cff()
1612 &fid_family->flood_profile->flood_tables[i]; in mlxsw_sp_fid_rfid_port_memb_cff()
1615 err = mlxsw_sp_fid_rfid_port_memb_ft_cff(fid_family, in mlxsw_sp_fid_rfid_port_memb_cff()
1626 mlxsw_sp_fid_rfid_port_init_cff(const struct mlxsw_sp_fid_family *fid_family, in mlxsw_sp_fid_rfid_port_init_cff() argument
1629 return mlxsw_sp_fid_rfid_port_memb_cff(fid_family, mlxsw_sp_port, true); in mlxsw_sp_fid_rfid_port_init_cff()
1633 mlxsw_sp_fid_rfid_port_fini_cff(const struct mlxsw_sp_fid_family *fid_family, in mlxsw_sp_fid_rfid_port_fini_cff() argument
1636 mlxsw_sp_fid_rfid_port_memb_cff(fid_family, mlxsw_sp_port, false); in mlxsw_sp_fid_rfid_port_fini_cff()
1678 *p_fid_index = fid->fid_family->start_index; in mlxsw_sp_fid_dummy_index_alloc()
1747 mlxsw_sp_nve_fid_disable(fid->fid_family->mlxsw_sp, fid); in mlxsw_sp_fid_8021q_deconfigure()
1997 struct mlxsw_sp_fid_family *fid_family; in mlxsw_sp_fid_lookup() local
2000 fid_family = mlxsw_sp->fid_core->fid_family_arr[type]; in mlxsw_sp_fid_lookup()
2001 list_for_each_entry(fid, &fid_family->fids_list, list) { in mlxsw_sp_fid_lookup()
2002 if (!fid->fid_family->ops->compare(fid, arg)) in mlxsw_sp_fid_lookup()
2015 struct mlxsw_sp_fid_family *fid_family; in mlxsw_sp_fid_get() local
2024 fid_family = mlxsw_sp->fid_core->fid_family_arr[type]; in mlxsw_sp_fid_get()
2025 fid = kzalloc(fid_family->fid_size, GFP_KERNEL); in mlxsw_sp_fid_get()
2030 fid->fid_family = fid_family; in mlxsw_sp_fid_get()
2032 err = fid->fid_family->ops->index_alloc(fid, arg, &fid_index); in mlxsw_sp_fid_get()
2036 __set_bit(fid_index - fid_family->start_index, fid_family->fids_bitmap); in mlxsw_sp_fid_get()
2038 err = fid->fid_family->ops->setup(fid, arg); in mlxsw_sp_fid_get()
2042 err = fid->fid_family->ops->configure(fid); in mlxsw_sp_fid_get()
2051 list_add(&fid->list, &fid_family->fids_list); in mlxsw_sp_fid_get()
2056 fid->fid_family->ops->deconfigure(fid); in mlxsw_sp_fid_get()
2059 __clear_bit(fid_index - fid_family->start_index, in mlxsw_sp_fid_get()
2060 fid_family->fids_bitmap); in mlxsw_sp_fid_get()
2068 struct mlxsw_sp_fid_family *fid_family = fid->fid_family; in mlxsw_sp_fid_put() local
2069 struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; in mlxsw_sp_fid_put()
2077 fid->fid_family->ops->deconfigure(fid); in mlxsw_sp_fid_put()
2078 __clear_bit(fid->fid_index - fid_family->start_index, in mlxsw_sp_fid_put()
2079 fid_family->fids_bitmap); in mlxsw_sp_fid_put()
2120 mlxsw_sp_fid_flood_tables_init(struct mlxsw_sp_fid_family *fid_family) in mlxsw_sp_fid_flood_tables_init() argument
2122 struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; in mlxsw_sp_fid_flood_tables_init()
2127 err = fid_family->ops->pgt_size(fid_family, &pgt_size); in mlxsw_sp_fid_flood_tables_init()
2131 err = mlxsw_sp_pgt_mid_alloc_range(mlxsw_sp, &fid_family->pgt_base, in mlxsw_sp_fid_flood_tables_init()
2136 if (!fid_family->flood_profile) in mlxsw_sp_fid_flood_tables_init()
2139 for (i = 0; i < fid_family->flood_profile->nr_flood_tables; i++) { in mlxsw_sp_fid_flood_tables_init()
2142 flood_table = &fid_family->flood_profile->flood_tables[i]; in mlxsw_sp_fid_flood_tables_init()
2143 if (fid_family->ops->flood_table_init) { in mlxsw_sp_fid_flood_tables_init()
2144 err = fid_family->ops->flood_table_init(fid_family, in mlxsw_sp_fid_flood_tables_init()
2154 mlxsw_sp_pgt_mid_free_range(mlxsw_sp, fid_family->pgt_base, pgt_size); in mlxsw_sp_fid_flood_tables_init()
2159 mlxsw_sp_fid_flood_tables_fini(struct mlxsw_sp_fid_family *fid_family) in mlxsw_sp_fid_flood_tables_fini() argument
2161 struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp; in mlxsw_sp_fid_flood_tables_fini()
2165 err = fid_family->ops->pgt_size(fid_family, &pgt_size); in mlxsw_sp_fid_flood_tables_fini()
2169 mlxsw_sp_pgt_mid_free_range(mlxsw_sp, fid_family->pgt_base, pgt_size); in mlxsw_sp_fid_flood_tables_fini()
2176 struct mlxsw_sp_fid_family *fid_family; in mlxsw_sp_fid_family_register() local
2179 fid_family = kmemdup(tmpl, sizeof(*fid_family), GFP_KERNEL); in mlxsw_sp_fid_family_register()
2180 if (!fid_family) in mlxsw_sp_fid_family_register()
2183 fid_family->mlxsw_sp = mlxsw_sp; in mlxsw_sp_fid_family_register()
2184 INIT_LIST_HEAD(&fid_family->fids_list); in mlxsw_sp_fid_family_register()
2185 fid_family->fids_bitmap = bitmap_zalloc(nr_fids, GFP_KERNEL); in mlxsw_sp_fid_family_register()
2186 if (!fid_family->fids_bitmap) { in mlxsw_sp_fid_family_register()
2191 if (fid_family->flood_profile) { in mlxsw_sp_fid_family_register()
2192 err = mlxsw_sp_fid_flood_tables_init(fid_family); in mlxsw_sp_fid_family_register()
2197 mlxsw_sp->fid_core->fid_family_arr[tmpl->type] = fid_family; in mlxsw_sp_fid_family_register()
2202 bitmap_free(fid_family->fids_bitmap); in mlxsw_sp_fid_family_register()
2204 kfree(fid_family); in mlxsw_sp_fid_family_register()
2210 struct mlxsw_sp_fid_family *fid_family) in mlxsw_sp_fid_family_unregister() argument
2212 mlxsw_sp->fid_core->fid_family_arr[fid_family->type] = NULL; in mlxsw_sp_fid_family_unregister()
2214 if (fid_family->flood_profile) in mlxsw_sp_fid_family_unregister()
2215 mlxsw_sp_fid_flood_tables_fini(fid_family); in mlxsw_sp_fid_family_unregister()
2217 bitmap_free(fid_family->fids_bitmap); in mlxsw_sp_fid_family_unregister()
2218 WARN_ON_ONCE(!list_empty(&fid_family->fids_list)); in mlxsw_sp_fid_family_unregister()
2219 kfree(fid_family); in mlxsw_sp_fid_family_unregister()
2329 struct mlxsw_sp_fid_family *fid_family; in mlxsw_sp_fids_init() local
2331 fid_family = fid_core->fid_family_arr[i]; in mlxsw_sp_fids_init()
2332 mlxsw_sp_fid_family_unregister(mlxsw_sp, fid_family); in mlxsw_sp_fids_init()