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()
370 const struct mlxsw_sp_acl_erp *erp, in mlxsw_sp_acl_erp_table_locate() argument
377 *p_erpt_bank = erp->index % erp_core->num_erp_banks; in mlxsw_sp_acl_erp_table_locate()
378 row = erp->index / erp_core->num_erp_banks; in mlxsw_sp_acl_erp_table_locate()
384 struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_table_erp_add() argument
391 mlxsw_sp_acl_erp_table_locate(erp_table, erp, &erpt_bank, &erpt_index); in mlxsw_sp_acl_erp_table_erp_add()
393 mlxsw_reg_perpt_pack(perpt_pl, erpt_bank, erpt_index, key_size, erp->id, in mlxsw_sp_acl_erp_table_erp_add()
394 0, erp_table->base_index, erp->index, in mlxsw_sp_acl_erp_table_erp_add()
395 erp->key.mask); in mlxsw_sp_acl_erp_table_erp_add()
398 mlxsw_reg_perpt_erp_vector_set(perpt_pl, erp->index, true); in mlxsw_sp_acl_erp_table_erp_add()
402 static void mlxsw_sp_acl_erp_table_erp_del(struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_table_erp_del() argument
405 struct mlxsw_sp_acl_erp_table *erp_table = erp->erp_table; in mlxsw_sp_acl_erp_table_erp_del()
411 mlxsw_sp_acl_erp_table_locate(erp_table, erp, &erpt_bank, &erpt_index); in mlxsw_sp_acl_erp_table_erp_del()
413 mlxsw_reg_perpt_pack(perpt_pl, erpt_bank, erpt_index, key_size, erp->id, in mlxsw_sp_acl_erp_table_erp_del()
414 0, erp_table->base_index, erp->index, empty_mask); in mlxsw_sp_acl_erp_table_erp_del()
417 mlxsw_reg_perpt_erp_vector_set(perpt_pl, erp->index, false); in mlxsw_sp_acl_erp_table_erp_del()
458 struct mlxsw_sp_acl_erp *erp; in mlxsw_sp_acl_erp_table_relocate() local
461 list_for_each_entry(erp, &erp_table->atcam_erps_list, list) { in mlxsw_sp_acl_erp_table_relocate()
462 err = mlxsw_sp_acl_erp_table_erp_add(erp_table, erp); in mlxsw_sp_acl_erp_table_relocate()
470 list_for_each_entry_continue_reverse(erp, &erp_table->atcam_erps_list, in mlxsw_sp_acl_erp_table_relocate()
472 mlxsw_sp_acl_erp_table_erp_del(erp); in mlxsw_sp_acl_erp_table_relocate()
524 struct mlxsw_sp_acl_erp *erp) in mlxsw_acl_erp_table_bf_add() argument
527 unsigned int erp_bank = mlxsw_sp_acl_erp_bank_get(erp); in mlxsw_acl_erp_table_bf_add()
552 struct mlxsw_sp_acl_erp *erp) in mlxsw_acl_erp_table_bf_del() argument
555 unsigned int erp_bank = mlxsw_sp_acl_erp_bank_get(erp); in mlxsw_acl_erp_table_bf_del()
645 struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_region_erp_add() argument
656 mlxsw_reg_pererp_erpt_vector_set(pererp_pl, erp->index, true); in mlxsw_sp_acl_erp_region_erp_add()
661 static void mlxsw_sp_acl_erp_region_erp_del(struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_region_erp_del() argument
663 struct mlxsw_sp_acl_erp_table *erp_table = erp->erp_table; in mlxsw_sp_acl_erp_region_erp_del()
673 mlxsw_reg_pererp_erpt_vector_set(pererp_pl, erp->index, false); in mlxsw_sp_acl_erp_region_erp_del()
796 struct mlxsw_sp_acl_erp *erp; in mlxsw_sp_acl_erp_ctcam_mask_create() local
799 erp = kzalloc(sizeof(*erp), GFP_KERNEL); in mlxsw_sp_acl_erp_ctcam_mask_create()
800 if (!erp) in mlxsw_sp_acl_erp_ctcam_mask_create()
803 memcpy(&erp->key, key, sizeof(*key)); in mlxsw_sp_acl_erp_ctcam_mask_create()
804 bitmap_from_arr32(erp->mask_bitmap, (u32 *) key->mask, in mlxsw_sp_acl_erp_ctcam_mask_create()
811 erp->erp_table = erp_table; in mlxsw_sp_acl_erp_ctcam_mask_create()
813 err = mlxsw_sp_acl_erp_master_mask_set(erp_table, &erp->key); in mlxsw_sp_acl_erp_ctcam_mask_create()
821 return erp; in mlxsw_sp_acl_erp_ctcam_mask_create()
824 mlxsw_sp_acl_erp_master_mask_clear(erp_table, &erp->key); in mlxsw_sp_acl_erp_ctcam_mask_create()
828 kfree(erp); in mlxsw_sp_acl_erp_ctcam_mask_create()
833 mlxsw_sp_acl_erp_ctcam_mask_destroy(struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_ctcam_mask_destroy() argument
835 struct mlxsw_sp_acl_erp_table *erp_table = erp->erp_table; in mlxsw_sp_acl_erp_ctcam_mask_destroy()
838 mlxsw_sp_acl_erp_master_mask_clear(erp_table, &erp->key); in mlxsw_sp_acl_erp_ctcam_mask_destroy()
840 kfree(erp); in mlxsw_sp_acl_erp_ctcam_mask_destroy()
847 struct mlxsw_sp_acl_erp *erp; in mlxsw_sp_acl_erp_mask_create() local
858 erp = mlxsw_sp_acl_erp_generic_create(erp_table, key); in mlxsw_sp_acl_erp_mask_create()
859 if (IS_ERR(erp)) in mlxsw_sp_acl_erp_mask_create()
860 return erp; in mlxsw_sp_acl_erp_mask_create()
862 err = mlxsw_sp_acl_erp_index_get(erp_table, &erp->index); in mlxsw_sp_acl_erp_mask_create()
866 err = mlxsw_sp_acl_erp_table_erp_add(erp_table, erp); in mlxsw_sp_acl_erp_mask_create()
870 err = mlxsw_sp_acl_erp_region_erp_add(erp_table, erp); in mlxsw_sp_acl_erp_mask_create()
876 return erp; in mlxsw_sp_acl_erp_mask_create()
879 mlxsw_sp_acl_erp_table_erp_del(erp); in mlxsw_sp_acl_erp_mask_create()
881 mlxsw_sp_acl_erp_index_put(erp_table, erp->index); in mlxsw_sp_acl_erp_mask_create()
883 mlxsw_sp_acl_erp_generic_destroy(erp); in mlxsw_sp_acl_erp_mask_create()
889 struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_mask_destroy() argument
891 if (erp->key.ctcam) in mlxsw_sp_acl_erp_mask_destroy()
892 return mlxsw_sp_acl_erp_ctcam_mask_destroy(erp); in mlxsw_sp_acl_erp_mask_destroy()
894 mlxsw_sp_acl_erp_region_erp_del(erp); in mlxsw_sp_acl_erp_mask_destroy()
895 mlxsw_sp_acl_erp_table_erp_del(erp); in mlxsw_sp_acl_erp_mask_destroy()
896 mlxsw_sp_acl_erp_index_put(erp_table, erp->index); in mlxsw_sp_acl_erp_mask_destroy()
897 mlxsw_sp_acl_erp_generic_destroy(erp); in mlxsw_sp_acl_erp_mask_destroy()
908 struct mlxsw_sp_acl_erp *erp; in mlxsw_sp_acl_erp_second_mask_create() local
919 erp = mlxsw_sp_acl_erp_generic_create(erp_table, key); in mlxsw_sp_acl_erp_second_mask_create()
920 if (IS_ERR(erp)) { in mlxsw_sp_acl_erp_second_mask_create()
921 err = PTR_ERR(erp); in mlxsw_sp_acl_erp_second_mask_create()
925 err = mlxsw_sp_acl_erp_index_get(erp_table, &erp->index); in mlxsw_sp_acl_erp_second_mask_create()
929 err = mlxsw_sp_acl_erp_table_erp_add(erp_table, erp); in mlxsw_sp_acl_erp_second_mask_create()
933 err = mlxsw_sp_acl_erp_region_erp_add(erp_table, erp); in mlxsw_sp_acl_erp_second_mask_create()
939 return erp; in mlxsw_sp_acl_erp_second_mask_create()
942 mlxsw_sp_acl_erp_table_erp_del(erp); in mlxsw_sp_acl_erp_second_mask_create()
944 mlxsw_sp_acl_erp_index_put(erp_table, erp->index); in mlxsw_sp_acl_erp_second_mask_create()
946 mlxsw_sp_acl_erp_generic_destroy(erp); in mlxsw_sp_acl_erp_second_mask_create()
954 struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_second_mask_destroy() argument
956 if (erp->key.ctcam) in mlxsw_sp_acl_erp_second_mask_destroy()
957 return mlxsw_sp_acl_erp_ctcam_mask_destroy(erp); in mlxsw_sp_acl_erp_second_mask_destroy()
959 mlxsw_sp_acl_erp_region_erp_del(erp); in mlxsw_sp_acl_erp_second_mask_destroy()
960 mlxsw_sp_acl_erp_table_erp_del(erp); in mlxsw_sp_acl_erp_second_mask_destroy()
961 mlxsw_sp_acl_erp_index_put(erp_table, erp->index); in mlxsw_sp_acl_erp_second_mask_destroy()
962 mlxsw_sp_acl_erp_generic_destroy(erp); in mlxsw_sp_acl_erp_second_mask_destroy()
973 struct mlxsw_sp_acl_erp *erp; in mlxsw_sp_acl_erp_first_mask_create() local
978 erp = mlxsw_sp_acl_erp_generic_create(erp_table, key); in mlxsw_sp_acl_erp_first_mask_create()
979 if (IS_ERR(erp)) in mlxsw_sp_acl_erp_first_mask_create()
980 return erp; in mlxsw_sp_acl_erp_first_mask_create()
984 return erp; in mlxsw_sp_acl_erp_first_mask_create()
989 struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_first_mask_destroy() argument
991 mlxsw_sp_acl_erp_generic_destroy(erp); in mlxsw_sp_acl_erp_first_mask_destroy()
997 struct mlxsw_sp_acl_erp *erp) in mlxsw_sp_acl_erp_no_mask_destroy() argument
1037 const struct mlxsw_sp_acl_erp *erp = objagg_obj_root_priv(objagg_obj); in mlxsw_sp_acl_erp_bf_insert() local
1040 if (!mlxsw_sp_acl_erp_table_is_used(erp->erp_table)) in mlxsw_sp_acl_erp_bf_insert()
1043 erp_bank = mlxsw_sp_acl_erp_bank_get(erp); in mlxsw_sp_acl_erp_bf_insert()
1045 erp->erp_table->erp_core->bf, in mlxsw_sp_acl_erp_bf_insert()
1055 const struct mlxsw_sp_acl_erp *erp = objagg_obj_root_priv(objagg_obj); in mlxsw_sp_acl_erp_bf_remove() local
1058 if (!mlxsw_sp_acl_erp_table_is_used(erp->erp_table)) in mlxsw_sp_acl_erp_bf_remove()
1061 erp_bank = mlxsw_sp_acl_erp_bank_get(erp); in mlxsw_sp_acl_erp_bf_remove()
1063 erp->erp_table->erp_core->bf, in mlxsw_sp_acl_erp_bf_remove()
1079 const struct mlxsw_sp_acl_erp *erp = objagg_obj_root_priv(objagg_obj); in mlxsw_sp_acl_erp_mask_erp_id() local
1081 return erp->id; in mlxsw_sp_acl_erp_mask_erp_id()