Lines Matching refs:aregion
33 int (*init)(struct mlxsw_sp_acl_atcam_region *aregion);
34 void (*fini)(struct mlxsw_sp_acl_atcam_region *aregion);
36 (*lkey_id_get)(struct mlxsw_sp_acl_atcam_region *aregion,
38 void (*lkey_id_put)(struct mlxsw_sp_acl_atcam_region *aregion,
71 mlxsw_sp_acl_atcam_region_generic_init(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_region_generic_init() argument
80 aregion->priv = region_generic; in mlxsw_sp_acl_atcam_region_generic_init()
86 mlxsw_sp_acl_atcam_region_generic_fini(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_region_generic_fini() argument
88 kfree(aregion->priv); in mlxsw_sp_acl_atcam_region_generic_fini()
92 mlxsw_sp_acl_atcam_generic_lkey_id_get(struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_generic_lkey_id_get() argument
98 region_generic = aregion->priv; in mlxsw_sp_acl_atcam_generic_lkey_id_get()
103 mlxsw_sp_acl_atcam_generic_lkey_id_put(struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_generic_lkey_id_put() argument
117 mlxsw_sp_acl_atcam_region_12kb_init(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_region_12kb_init() argument
119 struct mlxsw_sp *mlxsw_sp = aregion->region->mlxsw_sp; in mlxsw_sp_acl_atcam_region_12kb_init()
146 aregion->priv = region_12kb; in mlxsw_sp_acl_atcam_region_12kb_init()
158 mlxsw_sp_acl_atcam_region_12kb_fini(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_region_12kb_fini() argument
160 struct mlxsw_sp_acl_atcam_region_12kb *region_12kb = aregion->priv; in mlxsw_sp_acl_atcam_region_12kb_fini()
168 mlxsw_sp_acl_atcam_lkey_id_create(struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_lkey_id_create() argument
171 struct mlxsw_sp_acl_atcam_region_12kb *region_12kb = aregion->priv; in mlxsw_sp_acl_atcam_lkey_id_create()
209 mlxsw_sp_acl_atcam_lkey_id_destroy(struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_lkey_id_destroy() argument
212 struct mlxsw_sp_acl_atcam_region_12kb *region_12kb = aregion->priv; in mlxsw_sp_acl_atcam_lkey_id_destroy()
222 mlxsw_sp_acl_atcam_12kb_lkey_id_get(struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_12kb_lkey_id_get() argument
226 struct mlxsw_sp_acl_atcam_region_12kb *region_12kb = aregion->priv; in mlxsw_sp_acl_atcam_12kb_lkey_id_get()
227 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in mlxsw_sp_acl_atcam_12kb_lkey_id_get()
244 return mlxsw_sp_acl_atcam_lkey_id_create(aregion, &ht_key); in mlxsw_sp_acl_atcam_12kb_lkey_id_get()
248 mlxsw_sp_acl_atcam_12kb_lkey_id_put(struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_12kb_lkey_id_put() argument
252 mlxsw_sp_acl_atcam_lkey_id_destroy(aregion, lkey_id); in mlxsw_sp_acl_atcam_12kb_lkey_id_put()
292 mlxsw_sp_acl_atcam_region_type_init(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_region_type_init() argument
294 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in mlxsw_sp_acl_atcam_region_type_init()
311 aregion->type = region_type; in mlxsw_sp_acl_atcam_region_type_init()
312 aregion->ops = mlxsw_sp_acl_atcam_region_ops_arr[region_type]; in mlxsw_sp_acl_atcam_region_type_init()
318 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_region_init() argument
324 aregion->region = region; in mlxsw_sp_acl_atcam_region_init()
325 aregion->atcam = atcam; in mlxsw_sp_acl_atcam_region_init()
326 mlxsw_sp_acl_atcam_region_type_init(aregion); in mlxsw_sp_acl_atcam_region_init()
328 err = rhashtable_init(&aregion->entries_ht, in mlxsw_sp_acl_atcam_region_init()
332 err = aregion->ops->init(aregion); in mlxsw_sp_acl_atcam_region_init()
335 err = mlxsw_sp_acl_erp_region_init(aregion); in mlxsw_sp_acl_atcam_region_init()
338 err = mlxsw_sp_acl_ctcam_region_init(mlxsw_sp, &aregion->cregion, in mlxsw_sp_acl_atcam_region_init()
346 mlxsw_sp_acl_erp_region_fini(aregion); in mlxsw_sp_acl_atcam_region_init()
348 aregion->ops->fini(aregion); in mlxsw_sp_acl_atcam_region_init()
350 rhashtable_destroy(&aregion->entries_ht); in mlxsw_sp_acl_atcam_region_init()
354 void mlxsw_sp_acl_atcam_region_fini(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_region_fini() argument
356 mlxsw_sp_acl_ctcam_region_fini(&aregion->cregion); in mlxsw_sp_acl_atcam_region_fini()
357 mlxsw_sp_acl_erp_region_fini(aregion); in mlxsw_sp_acl_atcam_region_fini()
358 aregion->ops->fini(aregion); in mlxsw_sp_acl_atcam_region_fini()
359 rhashtable_destroy(&aregion->entries_ht); in mlxsw_sp_acl_atcam_region_fini()
362 void mlxsw_sp_acl_atcam_chunk_init(struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_chunk_init() argument
366 mlxsw_sp_acl_ctcam_chunk_init(&aregion->cregion, &achunk->cchunk, in mlxsw_sp_acl_atcam_chunk_init()
377 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_region_entry_insert() argument
381 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in mlxsw_sp_acl_atcam_region_entry_insert()
392 lkey_id = aregion->ops->lkey_id_get(aregion, rulei, erp_id); in mlxsw_sp_acl_atcam_region_entry_insert()
410 aregion->ops->lkey_id_put(aregion, lkey_id); in mlxsw_sp_acl_atcam_region_entry_insert()
416 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_region_entry_remove() argument
420 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in mlxsw_sp_acl_atcam_region_entry_remove()
429 aregion->ops->lkey_id_put(aregion, lkey_id); in mlxsw_sp_acl_atcam_region_entry_remove()
434 struct mlxsw_sp_acl_atcam_region *aregion, in __mlxsw_sp_acl_atcam_entry_add() argument
438 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in __mlxsw_sp_acl_atcam_entry_add()
449 erp = mlxsw_sp_acl_erp_get(aregion, mask, false); in __mlxsw_sp_acl_atcam_entry_add()
458 err = rhashtable_lookup_insert_fast(&aregion->entries_ht, in __mlxsw_sp_acl_atcam_entry_add()
464 err = mlxsw_sp_acl_atcam_region_entry_insert(mlxsw_sp, aregion, aentry, in __mlxsw_sp_acl_atcam_entry_add()
472 rhashtable_remove_fast(&aregion->entries_ht, &aentry->ht_node, in __mlxsw_sp_acl_atcam_entry_add()
475 mlxsw_sp_acl_erp_put(aregion, erp); in __mlxsw_sp_acl_atcam_entry_add()
481 struct mlxsw_sp_acl_atcam_region *aregion, in __mlxsw_sp_acl_atcam_entry_del() argument
484 mlxsw_sp_acl_atcam_region_entry_remove(mlxsw_sp, aregion, aentry); in __mlxsw_sp_acl_atcam_entry_del()
485 rhashtable_remove_fast(&aregion->entries_ht, &aentry->ht_node, in __mlxsw_sp_acl_atcam_entry_del()
487 mlxsw_sp_acl_erp_put(aregion, aentry->erp); in __mlxsw_sp_acl_atcam_entry_del()
491 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_entry_add() argument
498 err = __mlxsw_sp_acl_atcam_entry_add(mlxsw_sp, aregion, aentry, rulei); in mlxsw_sp_acl_atcam_entry_add()
505 err = mlxsw_sp_acl_ctcam_entry_add(mlxsw_sp, &aregion->cregion, in mlxsw_sp_acl_atcam_entry_add()
515 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_entry_del() argument
520 mlxsw_sp_acl_ctcam_entry_del(mlxsw_sp, &aregion->cregion, in mlxsw_sp_acl_atcam_entry_del()
523 __mlxsw_sp_acl_atcam_entry_del(mlxsw_sp, aregion, aentry); in mlxsw_sp_acl_atcam_entry_del()