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->enc_key, erp_id); in mlxsw_sp_acl_atcam_region_entry_insert()
415 aregion->ops->lkey_id_put(aregion, lkey_id); in mlxsw_sp_acl_atcam_region_entry_insert()
421 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_region_entry_remove() argument
425 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in mlxsw_sp_acl_atcam_region_entry_remove()
438 aregion->ops->lkey_id_put(aregion, lkey_id); in mlxsw_sp_acl_atcam_region_entry_remove()
443 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_region_entry_action_replace() argument
449 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in mlxsw_sp_acl_atcam_region_entry_action_replace()
471 struct mlxsw_sp_acl_atcam_region *aregion, in __mlxsw_sp_acl_atcam_entry_add() argument
475 struct mlxsw_sp_acl_tcam_region *region = aregion->region; in __mlxsw_sp_acl_atcam_entry_add()
485 erp_mask = mlxsw_sp_acl_erp_mask_get(aregion, mask, false); in __mlxsw_sp_acl_atcam_entry_add()
508 list_add(&aentry->list, &aregion->entries_list); in __mlxsw_sp_acl_atcam_entry_add()
513 err = rhashtable_lookup_insert_fast(&aregion->entries_ht, in __mlxsw_sp_acl_atcam_entry_add()
522 err = mlxsw_sp_acl_erp_bf_insert(mlxsw_sp, aregion, erp_mask, aentry); in __mlxsw_sp_acl_atcam_entry_add()
526 err = mlxsw_sp_acl_atcam_region_entry_insert(mlxsw_sp, aregion, aentry, in __mlxsw_sp_acl_atcam_entry_add()
534 mlxsw_sp_acl_erp_bf_remove(mlxsw_sp, aregion, erp_mask, aentry); in __mlxsw_sp_acl_atcam_entry_add()
536 rhashtable_remove_fast(&aregion->entries_ht, &aentry->ht_node, in __mlxsw_sp_acl_atcam_entry_add()
540 mlxsw_sp_acl_erp_mask_put(aregion, erp_mask); in __mlxsw_sp_acl_atcam_entry_add()
546 struct mlxsw_sp_acl_atcam_region *aregion, in __mlxsw_sp_acl_atcam_entry_del() argument
549 mlxsw_sp_acl_atcam_region_entry_remove(mlxsw_sp, aregion, aentry); in __mlxsw_sp_acl_atcam_entry_del()
550 mlxsw_sp_acl_erp_bf_remove(mlxsw_sp, aregion, aentry->erp_mask, aentry); in __mlxsw_sp_acl_atcam_entry_del()
551 rhashtable_remove_fast(&aregion->entries_ht, &aentry->ht_node, in __mlxsw_sp_acl_atcam_entry_del()
554 mlxsw_sp_acl_erp_mask_put(aregion, aentry->erp_mask); in __mlxsw_sp_acl_atcam_entry_del()
559 struct mlxsw_sp_acl_atcam_region *aregion, in __mlxsw_sp_acl_atcam_entry_action_replace() argument
563 return mlxsw_sp_acl_atcam_region_entry_action_replace(mlxsw_sp, aregion, in __mlxsw_sp_acl_atcam_entry_action_replace()
568 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_entry_add() argument
575 err = __mlxsw_sp_acl_atcam_entry_add(mlxsw_sp, aregion, aentry, rulei); in mlxsw_sp_acl_atcam_entry_add()
582 trace_mlxsw_sp_acl_atcam_entry_add_ctcam_spill(mlxsw_sp, aregion); in mlxsw_sp_acl_atcam_entry_add()
583 err = mlxsw_sp_acl_ctcam_entry_add(mlxsw_sp, &aregion->cregion, in mlxsw_sp_acl_atcam_entry_add()
593 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_entry_del() argument
598 mlxsw_sp_acl_ctcam_entry_del(mlxsw_sp, &aregion->cregion, in mlxsw_sp_acl_atcam_entry_del()
601 __mlxsw_sp_acl_atcam_entry_del(mlxsw_sp, aregion, aentry); in mlxsw_sp_acl_atcam_entry_del()
606 struct mlxsw_sp_acl_atcam_region *aregion, in mlxsw_sp_acl_atcam_entry_action_replace() argument
614 &aregion->cregion, in mlxsw_sp_acl_atcam_entry_action_replace()
619 aregion, aentry, in mlxsw_sp_acl_atcam_entry_action_replace()
638 mlxsw_sp_acl_atcam_rehash_hints_get(struct mlxsw_sp_acl_atcam_region *aregion) in mlxsw_sp_acl_atcam_rehash_hints_get() argument
640 return mlxsw_sp_acl_erp_rehash_hints_get(aregion); in mlxsw_sp_acl_atcam_rehash_hints_get()