Lines Matching refs:erp

75 			    struct mlxsw_sp_acl_erp *erp);
83 struct mlxsw_sp_acl_erp *erp);
89 struct mlxsw_sp_acl_erp *erp);
95 struct mlxsw_sp_acl_erp *erp);
98 struct mlxsw_sp_acl_erp *erp);
128 mlxsw_sp_acl_erp_bank_get(const struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_bank_get() argument
130 return erp->index % erp->erp_table->erp_core->num_erp_banks; in mlxsw_sp_acl_erp_bank_get()
254 struct mlxsw_sp_acl_erp *erp; in mlxsw_sp_acl_erp_generic_create() local
257 erp = kzalloc(sizeof(*erp), GFP_KERNEL); in mlxsw_sp_acl_erp_generic_create()
258 if (!erp) in mlxsw_sp_acl_erp_generic_create()
261 err = mlxsw_sp_acl_erp_id_get(erp_table, &erp->id); in mlxsw_sp_acl_erp_generic_create()
265 memcpy(&erp->key, key, sizeof(*key)); in mlxsw_sp_acl_erp_generic_create()
266 list_add(&erp->list, &erp_table->atcam_erps_list); in mlxsw_sp_acl_erp_generic_create()
268 erp->erp_table = erp_table; in mlxsw_sp_acl_erp_generic_create()
270 err = mlxsw_sp_acl_erp_master_mask_set(erp_table, &erp->key); in mlxsw_sp_acl_erp_generic_create()
274 return erp; in mlxsw_sp_acl_erp_generic_create()
278 list_del(&erp->list); in mlxsw_sp_acl_erp_generic_create()
279 mlxsw_sp_acl_erp_id_put(erp_table, erp->id); in mlxsw_sp_acl_erp_generic_create()
281 kfree(erp); in mlxsw_sp_acl_erp_generic_create()
286 mlxsw_sp_acl_erp_generic_destroy(struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_generic_destroy() argument
288 struct mlxsw_sp_acl_erp_table *erp_table = erp->erp_table; in mlxsw_sp_acl_erp_generic_destroy()
290 mlxsw_sp_acl_erp_master_mask_clear(erp_table, &erp->key); in mlxsw_sp_acl_erp_generic_destroy()
292 list_del(&erp->list); in mlxsw_sp_acl_erp_generic_destroy()
293 mlxsw_sp_acl_erp_id_put(erp_table, erp->id); in mlxsw_sp_acl_erp_generic_destroy()
294 kfree(erp); in mlxsw_sp_acl_erp_generic_destroy()
372 const struct mlxsw_sp_acl_erp *erp, in mlxsw_sp_acl_erp_table_locate() argument
379 *p_erpt_bank = erp->index % erp_core->num_erp_banks; in mlxsw_sp_acl_erp_table_locate()
380 row = erp->index / erp_core->num_erp_banks; in mlxsw_sp_acl_erp_table_locate()
386 struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_table_erp_add() argument
393 mlxsw_sp_acl_erp_table_locate(erp_table, erp, &erpt_bank, &erpt_index); in mlxsw_sp_acl_erp_table_erp_add()
395 mlxsw_reg_perpt_pack(perpt_pl, erpt_bank, erpt_index, key_size, erp->id, in mlxsw_sp_acl_erp_table_erp_add()
396 0, erp_table->base_index, erp->index, in mlxsw_sp_acl_erp_table_erp_add()
397 erp->key.mask); in mlxsw_sp_acl_erp_table_erp_add()
400 mlxsw_reg_perpt_erp_vector_set(perpt_pl, erp->index, true); in mlxsw_sp_acl_erp_table_erp_add()
404 static void mlxsw_sp_acl_erp_table_erp_del(struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_table_erp_del() argument
407 struct mlxsw_sp_acl_erp_table *erp_table = erp->erp_table; in mlxsw_sp_acl_erp_table_erp_del()
413 mlxsw_sp_acl_erp_table_locate(erp_table, erp, &erpt_bank, &erpt_index); in mlxsw_sp_acl_erp_table_erp_del()
415 mlxsw_reg_perpt_pack(perpt_pl, erpt_bank, erpt_index, key_size, erp->id, in mlxsw_sp_acl_erp_table_erp_del()
416 0, erp_table->base_index, erp->index, empty_mask); in mlxsw_sp_acl_erp_table_erp_del()
419 mlxsw_reg_perpt_erp_vector_set(perpt_pl, erp->index, false); in mlxsw_sp_acl_erp_table_erp_del()
460 struct mlxsw_sp_acl_erp *erp; in mlxsw_sp_acl_erp_table_relocate() local
463 list_for_each_entry(erp, &erp_table->atcam_erps_list, list) { in mlxsw_sp_acl_erp_table_relocate()
464 err = mlxsw_sp_acl_erp_table_erp_add(erp_table, erp); in mlxsw_sp_acl_erp_table_relocate()
472 list_for_each_entry_continue_reverse(erp, &erp_table->atcam_erps_list, in mlxsw_sp_acl_erp_table_relocate()
474 mlxsw_sp_acl_erp_table_erp_del(erp); in mlxsw_sp_acl_erp_table_relocate()
526 struct mlxsw_sp_acl_erp *erp) in mlxsw_acl_erp_table_bf_add() argument
529 unsigned int erp_bank = mlxsw_sp_acl_erp_bank_get(erp); in mlxsw_acl_erp_table_bf_add()
554 struct mlxsw_sp_acl_erp *erp) in mlxsw_acl_erp_table_bf_del() argument
557 unsigned int erp_bank = mlxsw_sp_acl_erp_bank_get(erp); in mlxsw_acl_erp_table_bf_del()
647 struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_region_erp_add() argument
658 mlxsw_reg_pererp_erpt_vector_set(pererp_pl, erp->index, true); in mlxsw_sp_acl_erp_region_erp_add()
663 static void mlxsw_sp_acl_erp_region_erp_del(struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_region_erp_del() argument
665 struct mlxsw_sp_acl_erp_table *erp_table = erp->erp_table; in mlxsw_sp_acl_erp_region_erp_del()
675 mlxsw_reg_pererp_erpt_vector_set(pererp_pl, erp->index, false); in mlxsw_sp_acl_erp_region_erp_del()
798 struct mlxsw_sp_acl_erp *erp; in mlxsw_sp_acl_erp_ctcam_mask_create() local
801 erp = kzalloc(sizeof(*erp), GFP_KERNEL); in mlxsw_sp_acl_erp_ctcam_mask_create()
802 if (!erp) in mlxsw_sp_acl_erp_ctcam_mask_create()
805 memcpy(&erp->key, key, sizeof(*key)); in mlxsw_sp_acl_erp_ctcam_mask_create()
806 bitmap_from_arr32(erp->mask_bitmap, (u32 *) key->mask, in mlxsw_sp_acl_erp_ctcam_mask_create()
813 erp->erp_table = erp_table; in mlxsw_sp_acl_erp_ctcam_mask_create()
815 err = mlxsw_sp_acl_erp_master_mask_set(erp_table, &erp->key); in mlxsw_sp_acl_erp_ctcam_mask_create()
823 return erp; in mlxsw_sp_acl_erp_ctcam_mask_create()
826 mlxsw_sp_acl_erp_master_mask_clear(erp_table, &erp->key); in mlxsw_sp_acl_erp_ctcam_mask_create()
830 kfree(erp); in mlxsw_sp_acl_erp_ctcam_mask_create()
835 mlxsw_sp_acl_erp_ctcam_mask_destroy(struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_ctcam_mask_destroy() argument
837 struct mlxsw_sp_acl_erp_table *erp_table = erp->erp_table; in mlxsw_sp_acl_erp_ctcam_mask_destroy()
840 mlxsw_sp_acl_erp_master_mask_clear(erp_table, &erp->key); in mlxsw_sp_acl_erp_ctcam_mask_destroy()
842 kfree(erp); in mlxsw_sp_acl_erp_ctcam_mask_destroy()
849 struct mlxsw_sp_acl_erp *erp; in mlxsw_sp_acl_erp_mask_create() local
860 erp = mlxsw_sp_acl_erp_generic_create(erp_table, key); in mlxsw_sp_acl_erp_mask_create()
861 if (IS_ERR(erp)) in mlxsw_sp_acl_erp_mask_create()
862 return erp; in mlxsw_sp_acl_erp_mask_create()
864 err = mlxsw_sp_acl_erp_index_get(erp_table, &erp->index); in mlxsw_sp_acl_erp_mask_create()
868 err = mlxsw_sp_acl_erp_table_erp_add(erp_table, erp); in mlxsw_sp_acl_erp_mask_create()
872 err = mlxsw_sp_acl_erp_region_erp_add(erp_table, erp); in mlxsw_sp_acl_erp_mask_create()
878 return erp; in mlxsw_sp_acl_erp_mask_create()
881 mlxsw_sp_acl_erp_table_erp_del(erp); in mlxsw_sp_acl_erp_mask_create()
883 mlxsw_sp_acl_erp_index_put(erp_table, erp->index); in mlxsw_sp_acl_erp_mask_create()
885 mlxsw_sp_acl_erp_generic_destroy(erp); in mlxsw_sp_acl_erp_mask_create()
891 struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_mask_destroy() argument
893 if (erp->key.ctcam) in mlxsw_sp_acl_erp_mask_destroy()
894 return mlxsw_sp_acl_erp_ctcam_mask_destroy(erp); in mlxsw_sp_acl_erp_mask_destroy()
896 mlxsw_sp_acl_erp_region_erp_del(erp); in mlxsw_sp_acl_erp_mask_destroy()
897 mlxsw_sp_acl_erp_table_erp_del(erp); in mlxsw_sp_acl_erp_mask_destroy()
898 mlxsw_sp_acl_erp_index_put(erp_table, erp->index); in mlxsw_sp_acl_erp_mask_destroy()
899 mlxsw_sp_acl_erp_generic_destroy(erp); in mlxsw_sp_acl_erp_mask_destroy()
910 struct mlxsw_sp_acl_erp *erp; in mlxsw_sp_acl_erp_second_mask_create() local
921 erp = mlxsw_sp_acl_erp_generic_create(erp_table, key); in mlxsw_sp_acl_erp_second_mask_create()
922 if (IS_ERR(erp)) { in mlxsw_sp_acl_erp_second_mask_create()
923 err = PTR_ERR(erp); in mlxsw_sp_acl_erp_second_mask_create()
927 err = mlxsw_sp_acl_erp_index_get(erp_table, &erp->index); in mlxsw_sp_acl_erp_second_mask_create()
931 err = mlxsw_sp_acl_erp_table_erp_add(erp_table, erp); in mlxsw_sp_acl_erp_second_mask_create()
935 err = mlxsw_sp_acl_erp_region_erp_add(erp_table, erp); in mlxsw_sp_acl_erp_second_mask_create()
941 return erp; in mlxsw_sp_acl_erp_second_mask_create()
944 mlxsw_sp_acl_erp_table_erp_del(erp); in mlxsw_sp_acl_erp_second_mask_create()
946 mlxsw_sp_acl_erp_index_put(erp_table, erp->index); in mlxsw_sp_acl_erp_second_mask_create()
948 mlxsw_sp_acl_erp_generic_destroy(erp); in mlxsw_sp_acl_erp_second_mask_create()
956 struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_second_mask_destroy() argument
958 if (erp->key.ctcam) in mlxsw_sp_acl_erp_second_mask_destroy()
959 return mlxsw_sp_acl_erp_ctcam_mask_destroy(erp); in mlxsw_sp_acl_erp_second_mask_destroy()
961 mlxsw_sp_acl_erp_region_erp_del(erp); in mlxsw_sp_acl_erp_second_mask_destroy()
962 mlxsw_sp_acl_erp_table_erp_del(erp); in mlxsw_sp_acl_erp_second_mask_destroy()
963 mlxsw_sp_acl_erp_index_put(erp_table, erp->index); in mlxsw_sp_acl_erp_second_mask_destroy()
964 mlxsw_sp_acl_erp_generic_destroy(erp); in mlxsw_sp_acl_erp_second_mask_destroy()
975 struct mlxsw_sp_acl_erp *erp; in mlxsw_sp_acl_erp_first_mask_create() local
980 erp = mlxsw_sp_acl_erp_generic_create(erp_table, key); in mlxsw_sp_acl_erp_first_mask_create()
981 if (IS_ERR(erp)) in mlxsw_sp_acl_erp_first_mask_create()
982 return erp; in mlxsw_sp_acl_erp_first_mask_create()
986 return erp; in mlxsw_sp_acl_erp_first_mask_create()
991 struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_first_mask_destroy() argument
993 mlxsw_sp_acl_erp_generic_destroy(erp); in mlxsw_sp_acl_erp_first_mask_destroy()
999 struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_no_mask_destroy() argument
1039 const struct mlxsw_sp_acl_erp *erp = objagg_obj_root_priv(objagg_obj); in mlxsw_sp_acl_erp_bf_insert() local
1042 if (!mlxsw_sp_acl_erp_table_is_used(erp->erp_table)) in mlxsw_sp_acl_erp_bf_insert()
1045 erp_bank = mlxsw_sp_acl_erp_bank_get(erp); in mlxsw_sp_acl_erp_bf_insert()
1047 erp->erp_table->erp_core->bf, in mlxsw_sp_acl_erp_bf_insert()
1057 const struct mlxsw_sp_acl_erp *erp = objagg_obj_root_priv(objagg_obj); in mlxsw_sp_acl_erp_bf_remove() local
1060 if (!mlxsw_sp_acl_erp_table_is_used(erp->erp_table)) in mlxsw_sp_acl_erp_bf_remove()
1063 erp_bank = mlxsw_sp_acl_erp_bank_get(erp); in mlxsw_sp_acl_erp_bf_remove()
1065 erp->erp_table->erp_core->bf, in mlxsw_sp_acl_erp_bf_remove()
1081 const struct mlxsw_sp_acl_erp *erp = objagg_obj_root_priv(objagg_obj); in mlxsw_sp_acl_erp_mask_erp_id() local
1083 return erp->id; in mlxsw_sp_acl_erp_mask_erp_id()