Lines Matching refs:aregion

35 	int (*init)(struct mlxsw_sp_acl_atcam_region *aregion);
36 void (*fini)(struct mlxsw_sp_acl_atcam_region *aregion);
38 (*lkey_id_get)(struct mlxsw_sp_acl_atcam_region *aregion,
40 void (*lkey_id_put)(struct mlxsw_sp_acl_atcam_region *aregion,
73 mlxsw_sp_acl_atcam_region_generic_init(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_region_generic_init() argument
82 aregion->priv = region_generic; in mlxsw_sp_acl_atcam_region_generic_init()
88 mlxsw_sp_acl_atcam_region_generic_fini(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_region_generic_fini() argument
90 kfree(aregion->priv); in mlxsw_sp_acl_atcam_region_generic_fini()
94 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
99 region_generic = aregion->priv; in mlxsw_sp_acl_atcam_generic_lkey_id_get()
104 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
118 mlxsw_sp_acl_atcam_region_12kb_init(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_region_12kb_init() argument
120 struct mlxsw_sp *mlxsw_sp = aregion->region->mlxsw_sp; in mlxsw_sp_acl_atcam_region_12kb_init()
145 aregion->priv = region_12kb; in mlxsw_sp_acl_atcam_region_12kb_init()
157 mlxsw_sp_acl_atcam_region_12kb_fini(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_region_12kb_fini() argument
159 struct mlxsw_sp_acl_atcam_region_12kb *region_12kb = aregion->priv; in mlxsw_sp_acl_atcam_region_12kb_fini()
167 mlxsw_sp_acl_atcam_lkey_id_create(struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_lkey_id_create() argument
170 struct mlxsw_sp_acl_atcam_region_12kb *region_12kb = aregion->priv; in mlxsw_sp_acl_atcam_lkey_id_create()
208 mlxsw_sp_acl_atcam_lkey_id_destroy(struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_lkey_id_destroy() argument
211 struct mlxsw_sp_acl_atcam_region_12kb *region_12kb = aregion->priv; in mlxsw_sp_acl_atcam_lkey_id_destroy()
221 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
224 struct mlxsw_sp_acl_atcam_region_12kb *region_12kb = aregion->priv; in mlxsw_sp_acl_atcam_12kb_lkey_id_get()
225 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in mlxsw_sp_acl_atcam_12kb_lkey_id_get()
243 return mlxsw_sp_acl_atcam_lkey_id_create(aregion, &ht_key); in mlxsw_sp_acl_atcam_12kb_lkey_id_get()
247 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
251 mlxsw_sp_acl_atcam_lkey_id_destroy(aregion, lkey_id); in mlxsw_sp_acl_atcam_12kb_lkey_id_put()
291 mlxsw_sp_acl_atcam_region_type_init(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_region_type_init() argument
293 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in mlxsw_sp_acl_atcam_region_type_init()
310 aregion->type = region_type; in mlxsw_sp_acl_atcam_region_type_init()
311 aregion->ops = mlxsw_sp_acl_atcam_region_ops_arr[region_type]; in mlxsw_sp_acl_atcam_region_type_init()
317 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()
327 INIT_LIST_HEAD(&aregion->entries_list); in mlxsw_sp_acl_atcam_region_init()
329 err = rhashtable_init(&aregion->entries_ht, in mlxsw_sp_acl_atcam_region_init()
333 err = aregion->ops->init(aregion); in mlxsw_sp_acl_atcam_region_init()
336 err = mlxsw_sp_acl_erp_region_init(aregion, hints_priv); in mlxsw_sp_acl_atcam_region_init()
339 err = mlxsw_sp_acl_ctcam_region_init(mlxsw_sp, &aregion->cregion, in mlxsw_sp_acl_atcam_region_init()
347 mlxsw_sp_acl_erp_region_fini(aregion); in mlxsw_sp_acl_atcam_region_init()
349 aregion->ops->fini(aregion); in mlxsw_sp_acl_atcam_region_init()
351 rhashtable_destroy(&aregion->entries_ht); in mlxsw_sp_acl_atcam_region_init()
355 void mlxsw_sp_acl_atcam_region_fini(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_region_fini() argument
357 mlxsw_sp_acl_ctcam_region_fini(&aregion->cregion); in mlxsw_sp_acl_atcam_region_fini()
358 mlxsw_sp_acl_erp_region_fini(aregion); in mlxsw_sp_acl_atcam_region_fini()
359 aregion->ops->fini(aregion); in mlxsw_sp_acl_atcam_region_fini()
360 rhashtable_destroy(&aregion->entries_ht); in mlxsw_sp_acl_atcam_region_fini()
361 WARN_ON(!list_empty(&aregion->entries_list)); in mlxsw_sp_acl_atcam_region_fini()
364 void mlxsw_sp_acl_atcam_chunk_init(struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_chunk_init() argument
368 mlxsw_sp_acl_ctcam_chunk_init(&aregion->cregion, &achunk->cchunk, in mlxsw_sp_acl_atcam_chunk_init()
379 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_region_entry_insert() argument
383 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in mlxsw_sp_acl_atcam_region_entry_insert()
394 lkey_id = aregion->ops->lkey_id_get(aregion, aentry->ht_key.enc_key, in mlxsw_sp_acl_atcam_region_entry_insert()
416 aregion->ops->lkey_id_put(aregion, lkey_id); in mlxsw_sp_acl_atcam_region_entry_insert()
422 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_region_entry_remove() argument
426 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in mlxsw_sp_acl_atcam_region_entry_remove()
439 aregion->ops->lkey_id_put(aregion, lkey_id); in mlxsw_sp_acl_atcam_region_entry_remove()
444 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_region_entry_action_replace() argument
450 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in mlxsw_sp_acl_atcam_region_entry_action_replace()
472 struct mlxsw_sp_acl_atcam_region *aregion, in __mlxsw_sp_acl_atcam_entry_add() argument
476 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in __mlxsw_sp_acl_atcam_entry_add()
486 erp_mask = mlxsw_sp_acl_erp_mask_get(aregion, mask, false); in __mlxsw_sp_acl_atcam_entry_add()
506 list_add(&aentry->list, &aregion->entries_list); in __mlxsw_sp_acl_atcam_entry_add()
511 err = rhashtable_lookup_insert_fast(&aregion->entries_ht, in __mlxsw_sp_acl_atcam_entry_add()
520 err = mlxsw_sp_acl_erp_bf_insert(mlxsw_sp, aregion, erp_mask, aentry); in __mlxsw_sp_acl_atcam_entry_add()
524 err = mlxsw_sp_acl_atcam_region_entry_insert(mlxsw_sp, aregion, aentry, in __mlxsw_sp_acl_atcam_entry_add()
532 mlxsw_sp_acl_erp_bf_remove(mlxsw_sp, aregion, erp_mask, aentry); in __mlxsw_sp_acl_atcam_entry_add()
534 rhashtable_remove_fast(&aregion->entries_ht, &aentry->ht_node, in __mlxsw_sp_acl_atcam_entry_add()
538 mlxsw_sp_acl_erp_mask_put(aregion, erp_mask); in __mlxsw_sp_acl_atcam_entry_add()
544 struct mlxsw_sp_acl_atcam_region *aregion, in __mlxsw_sp_acl_atcam_entry_del() argument
547 mlxsw_sp_acl_atcam_region_entry_remove(mlxsw_sp, aregion, aentry); in __mlxsw_sp_acl_atcam_entry_del()
548 mlxsw_sp_acl_erp_bf_remove(mlxsw_sp, aregion, aentry->erp_mask, aentry); in __mlxsw_sp_acl_atcam_entry_del()
549 rhashtable_remove_fast(&aregion->entries_ht, &aentry->ht_node, in __mlxsw_sp_acl_atcam_entry_del()
552 mlxsw_sp_acl_erp_mask_put(aregion, aentry->erp_mask); in __mlxsw_sp_acl_atcam_entry_del()
557 struct mlxsw_sp_acl_atcam_region *aregion, in __mlxsw_sp_acl_atcam_entry_action_replace() argument
561 return mlxsw_sp_acl_atcam_region_entry_action_replace(mlxsw_sp, aregion, in __mlxsw_sp_acl_atcam_entry_action_replace()
566 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_entry_add() argument
573 err = __mlxsw_sp_acl_atcam_entry_add(mlxsw_sp, aregion, aentry, rulei); in mlxsw_sp_acl_atcam_entry_add()
580 trace_mlxsw_sp_acl_atcam_entry_add_ctcam_spill(mlxsw_sp, aregion); in mlxsw_sp_acl_atcam_entry_add()
581 err = mlxsw_sp_acl_ctcam_entry_add(mlxsw_sp, &aregion->cregion, in mlxsw_sp_acl_atcam_entry_add()
591 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_entry_del() argument
596 mlxsw_sp_acl_ctcam_entry_del(mlxsw_sp, &aregion->cregion, in mlxsw_sp_acl_atcam_entry_del()
599 __mlxsw_sp_acl_atcam_entry_del(mlxsw_sp, aregion, aentry); in mlxsw_sp_acl_atcam_entry_del()
604 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_entry_action_replace() argument
612 &aregion->cregion, in mlxsw_sp_acl_atcam_entry_action_replace()
617 aregion, aentry, in mlxsw_sp_acl_atcam_entry_action_replace()
636 mlxsw_sp_acl_atcam_rehash_hints_get(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_rehash_hints_get() argument
638 return mlxsw_sp_acl_erp_rehash_hints_get(aregion); in mlxsw_sp_acl_atcam_rehash_hints_get()