Lines Matching full:region

51 	/* Use 1:1 mapping between ACL region and TCAM region */  in mlxsw_sp_acl_tcam_init()
168 struct mutex lock; /* guards region list updates */
205 struct mutex lock; /* Protects consistency of region, region2 pointers
208 struct mlxsw_sp_acl_tcam_region *region; member
228 struct mlxsw_sp_acl_tcam_region *region; member
269 struct mlxsw_sp_acl_tcam_region *region; in mlxsw_sp_acl_tcam_group_update() local
274 list_for_each_entry(region, &group->region_list, list) { in mlxsw_sp_acl_tcam_group_update()
278 if (region->list.next != &group->region_list && in mlxsw_sp_acl_tcam_group_update()
279 list_next_entry(region, list)->vregion == region->vregion) in mlxsw_sp_acl_tcam_group_update()
282 region->id, multi); in mlxsw_sp_acl_tcam_group_update()
444 struct mlxsw_sp_acl_tcam_region *region, in mlxsw_sp_acl_tcam_group_region_attach() argument
459 /* If the next region is defined, place the new one in mlxsw_sp_acl_tcam_group_region_attach()
464 /* Position the region inside the list according to priority */ in mlxsw_sp_acl_tcam_group_region_attach()
472 list_add_tail(&region->list, pos); in mlxsw_sp_acl_tcam_group_region_attach()
473 region->group = group; in mlxsw_sp_acl_tcam_group_region_attach()
484 list_del(&region->list); in mlxsw_sp_acl_tcam_group_region_attach()
492 struct mlxsw_sp_acl_tcam_region *region) in mlxsw_sp_acl_tcam_group_region_detach() argument
494 struct mlxsw_sp_acl_tcam_group *group = region->group; in mlxsw_sp_acl_tcam_group_region_detach()
497 list_del(&region->list); in mlxsw_sp_acl_tcam_group_region_detach()
522 vregion->region, in mlxsw_sp_acl_tcam_vgroup_vregion_attach()
542 mlxsw_sp_acl_tcam_group_region_detach(mlxsw_sp, vregion->region); in mlxsw_sp_acl_tcam_vgroup_vregion_detach()
574 * use this region, so return NULL to indicate new vregion has in mlxsw_sp_acl_tcam_vgroup_vregion_find()
630 struct mlxsw_sp_acl_tcam_region *region) in mlxsw_sp_acl_tcam_region_alloc() argument
632 struct mlxsw_afk_key_info *key_info = region->key_info; in mlxsw_sp_acl_tcam_region_alloc()
639 region->key_type, in mlxsw_sp_acl_tcam_region_alloc()
641 region->id, region->tcam_region_info); in mlxsw_sp_acl_tcam_region_alloc()
652 mlxsw_reg_ptar_unpack(ptar_pl, region->tcam_region_info); in mlxsw_sp_acl_tcam_region_alloc()
658 struct mlxsw_sp_acl_tcam_region *region) in mlxsw_sp_acl_tcam_region_free() argument
663 region->key_type, 0, region->id, in mlxsw_sp_acl_tcam_region_free()
664 region->tcam_region_info); in mlxsw_sp_acl_tcam_region_free()
670 struct mlxsw_sp_acl_tcam_region *region) in mlxsw_sp_acl_tcam_region_enable() argument
674 mlxsw_reg_pacl_pack(pacl_pl, region->id, true, in mlxsw_sp_acl_tcam_region_enable()
675 region->tcam_region_info); in mlxsw_sp_acl_tcam_region_enable()
681 struct mlxsw_sp_acl_tcam_region *region) in mlxsw_sp_acl_tcam_region_disable() argument
685 mlxsw_reg_pacl_pack(pacl_pl, region->id, false, in mlxsw_sp_acl_tcam_region_disable()
686 region->tcam_region_info); in mlxsw_sp_acl_tcam_region_disable()
697 struct mlxsw_sp_acl_tcam_region *region; in mlxsw_sp_acl_tcam_region_create() local
700 region = kzalloc(sizeof(*region) + ops->region_priv_size, GFP_KERNEL); in mlxsw_sp_acl_tcam_region_create()
701 if (!region) in mlxsw_sp_acl_tcam_region_create()
703 region->mlxsw_sp = mlxsw_sp; in mlxsw_sp_acl_tcam_region_create()
704 region->vregion = vregion; in mlxsw_sp_acl_tcam_region_create()
705 region->key_info = vregion->key_info; in mlxsw_sp_acl_tcam_region_create()
707 err = mlxsw_sp_acl_tcam_region_id_get(tcam, &region->id); in mlxsw_sp_acl_tcam_region_create()
711 err = ops->region_associate(mlxsw_sp, region); in mlxsw_sp_acl_tcam_region_create()
715 region->key_type = ops->key_type; in mlxsw_sp_acl_tcam_region_create()
716 err = mlxsw_sp_acl_tcam_region_alloc(mlxsw_sp, region); in mlxsw_sp_acl_tcam_region_create()
720 err = mlxsw_sp_acl_tcam_region_enable(mlxsw_sp, region); in mlxsw_sp_acl_tcam_region_create()
724 err = ops->region_init(mlxsw_sp, region->priv, tcam->priv, in mlxsw_sp_acl_tcam_region_create()
725 region, hints_priv); in mlxsw_sp_acl_tcam_region_create()
729 return region; in mlxsw_sp_acl_tcam_region_create()
732 mlxsw_sp_acl_tcam_region_disable(mlxsw_sp, region); in mlxsw_sp_acl_tcam_region_create()
734 mlxsw_sp_acl_tcam_region_free(mlxsw_sp, region); in mlxsw_sp_acl_tcam_region_create()
737 mlxsw_sp_acl_tcam_region_id_put(tcam, region->id); in mlxsw_sp_acl_tcam_region_create()
739 kfree(region); in mlxsw_sp_acl_tcam_region_create()
745 struct mlxsw_sp_acl_tcam_region *region) in mlxsw_sp_acl_tcam_region_destroy() argument
749 ops->region_fini(mlxsw_sp, region->priv); in mlxsw_sp_acl_tcam_region_destroy()
750 mlxsw_sp_acl_tcam_region_disable(mlxsw_sp, region); in mlxsw_sp_acl_tcam_region_destroy()
751 mlxsw_sp_acl_tcam_region_free(mlxsw_sp, region); in mlxsw_sp_acl_tcam_region_destroy()
752 mlxsw_sp_acl_tcam_region_id_put(region->group->tcam, in mlxsw_sp_acl_tcam_region_destroy()
753 region->id); in mlxsw_sp_acl_tcam_region_destroy()
754 kfree(region); in mlxsw_sp_acl_tcam_region_destroy()
843 vregion->region = mlxsw_sp_acl_tcam_region_create(mlxsw_sp, tcam, in mlxsw_sp_acl_tcam_vregion_create()
845 if (IS_ERR(vregion->region)) { in mlxsw_sp_acl_tcam_vregion_create()
846 err = PTR_ERR(vregion->region); in mlxsw_sp_acl_tcam_vregion_create()
868 mlxsw_sp_acl_tcam_region_destroy(mlxsw_sp, vregion->region); in mlxsw_sp_acl_tcam_vregion_create()
893 mlxsw_sp_acl_tcam_region_destroy(mlxsw_sp, vregion->region); in mlxsw_sp_acl_tcam_vregion_destroy()
980 struct mlxsw_sp_acl_tcam_region *region) in mlxsw_sp_acl_tcam_chunk_create() argument
989 chunk->region = region; in mlxsw_sp_acl_tcam_chunk_create()
991 ops->chunk_init(region->priv, chunk->priv, vchunk->priority); in mlxsw_sp_acl_tcam_chunk_create()
1043 vchunk->vregion->region); in mlxsw_sp_acl_tcam_vchunk_create()
1140 err = ops->entry_add(mlxsw_sp, chunk->region->priv, chunk->priv, in mlxsw_sp_acl_tcam_entry_create()
1157 ops->entry_del(mlxsw_sp, entry->chunk->region->priv, in mlxsw_sp_acl_tcam_entry_destroy()
1164 struct mlxsw_sp_acl_tcam_region *region, in mlxsw_sp_acl_tcam_entry_action_replace() argument
1170 return ops->entry_action_replace(mlxsw_sp, region->priv, in mlxsw_sp_acl_tcam_entry_action_replace()
1181 return ops->entry_activity_get(mlxsw_sp, entry->chunk->region->priv, in mlxsw_sp_acl_tcam_entry_activity_get()
1245 vchunk->vregion->region, in mlxsw_sp_acl_tcam_ventry_action_replace()
1284 struct mlxsw_sp_acl_tcam_region *region, in mlxsw_sp_acl_tcam_vchunk_migrate_start() argument
1289 new_chunk = mlxsw_sp_acl_tcam_chunk_create(mlxsw_sp, vchunk, region); in mlxsw_sp_acl_tcam_vchunk_migrate_start()
1313 struct mlxsw_sp_acl_tcam_region *region, in mlxsw_sp_acl_tcam_vchunk_migrate_one() argument
1320 if (vchunk->chunk->region != region) { in mlxsw_sp_acl_tcam_vchunk_migrate_one()
1322 region, ctx); in mlxsw_sp_acl_tcam_vchunk_migrate_one()
1403 vregion->region, in mlxsw_sp_acl_tcam_vchunk_migrate_all()
1425 * so the original region pointer is assigned again in mlxsw_sp_acl_tcam_vregion_migrate()
1426 * to vregion->region. in mlxsw_sp_acl_tcam_vregion_migrate()
1428 swap(vregion->region, vregion->region2); in mlxsw_sp_acl_tcam_vregion_migrate()
1464 hints_priv = ops->region_rehash_hints_get(vregion->region->priv); in mlxsw_sp_acl_tcam_vregion_rehash_start()
1475 /* vregion->region contains the pointer to the new region in mlxsw_sp_acl_tcam_vregion_rehash_start()
1478 vregion->region2 = vregion->region; in mlxsw_sp_acl_tcam_vregion_rehash_start()
1479 vregion->region = new_region; in mlxsw_sp_acl_tcam_vregion_rehash_start()
1493 vregion->region = vregion->region2; in mlxsw_sp_acl_tcam_vregion_rehash_start()