Lines Matching refs:vgroup
156 struct mlxsw_sp_acl_tcam_vgroup *vgroup; member
181 struct mlxsw_sp_acl_tcam_vgroup *vgroup; member
259 struct mlxsw_sp_acl_tcam_vgroup *vgroup, in mlxsw_sp_acl_tcam_vgroup_add() argument
269 vgroup->patterns = patterns; in mlxsw_sp_acl_tcam_vgroup_add()
270 vgroup->patterns_count = patterns_count; in mlxsw_sp_acl_tcam_vgroup_add()
271 vgroup->vregion_rehash_enabled = vregion_rehash_enabled; in mlxsw_sp_acl_tcam_vgroup_add()
272 vgroup->p_min_prio = p_min_prio; in mlxsw_sp_acl_tcam_vgroup_add()
273 vgroup->p_max_prio = p_max_prio; in mlxsw_sp_acl_tcam_vgroup_add()
276 vgroup->tmplt_elusage_set = true; in mlxsw_sp_acl_tcam_vgroup_add()
277 memcpy(&vgroup->tmplt_elusage, tmplt_elusage, in mlxsw_sp_acl_tcam_vgroup_add()
278 sizeof(vgroup->tmplt_elusage)); in mlxsw_sp_acl_tcam_vgroup_add()
280 INIT_LIST_HEAD(&vgroup->vregion_list); in mlxsw_sp_acl_tcam_vgroup_add()
282 err = mlxsw_sp_acl_tcam_group_add(tcam, &vgroup->group); in mlxsw_sp_acl_tcam_vgroup_add()
286 err = rhashtable_init(&vgroup->vchunk_ht, in mlxsw_sp_acl_tcam_vgroup_add()
294 mlxsw_sp_acl_tcam_group_del(&vgroup->group); in mlxsw_sp_acl_tcam_vgroup_add()
299 mlxsw_sp_acl_tcam_vgroup_del(struct mlxsw_sp_acl_tcam_vgroup *vgroup) in mlxsw_sp_acl_tcam_vgroup_del() argument
301 rhashtable_destroy(&vgroup->vchunk_ht); in mlxsw_sp_acl_tcam_vgroup_del()
302 mlxsw_sp_acl_tcam_group_del(&vgroup->group); in mlxsw_sp_acl_tcam_vgroup_del()
303 WARN_ON(!list_empty(&vgroup->vregion_list)); in mlxsw_sp_acl_tcam_vgroup_del()
368 mlxsw_sp_acl_tcam_vgroup_prio_update(struct mlxsw_sp_acl_tcam_vgroup *vgroup) in mlxsw_sp_acl_tcam_vgroup_prio_update() argument
372 if (list_empty(&vgroup->vregion_list)) in mlxsw_sp_acl_tcam_vgroup_prio_update()
374 vregion = list_first_entry(&vgroup->vregion_list, in mlxsw_sp_acl_tcam_vgroup_prio_update()
376 *vgroup->p_min_prio = mlxsw_sp_acl_tcam_vregion_prio(vregion); in mlxsw_sp_acl_tcam_vgroup_prio_update()
377 vregion = list_last_entry(&vgroup->vregion_list, in mlxsw_sp_acl_tcam_vgroup_prio_update()
379 *vgroup->p_max_prio = mlxsw_sp_acl_tcam_vregion_max_prio(vregion); in mlxsw_sp_acl_tcam_vgroup_prio_update()
446 struct mlxsw_sp_acl_tcam_vgroup *vgroup, in mlxsw_sp_acl_tcam_vgroup_vregion_attach() argument
455 list_for_each(pos, &vgroup->vregion_list) { in mlxsw_sp_acl_tcam_vgroup_vregion_attach()
462 err = mlxsw_sp_acl_tcam_group_region_attach(mlxsw_sp, &vgroup->group, in mlxsw_sp_acl_tcam_vgroup_vregion_attach()
487 mlxsw_sp_acl_tcam_vgroup_vregion_find(struct mlxsw_sp_acl_tcam_vgroup *vgroup, in mlxsw_sp_acl_tcam_vgroup_vregion_find() argument
496 list_for_each(pos, &vgroup->vregion_list) { in mlxsw_sp_acl_tcam_vgroup_vregion_find()
502 if (pos->next != &vgroup->vregion_list) { /* not last */ in mlxsw_sp_acl_tcam_vgroup_vregion_find()
543 mlxsw_sp_acl_tcam_vgroup_use_patterns(struct mlxsw_sp_acl_tcam_vgroup *vgroup, in mlxsw_sp_acl_tcam_vgroup_use_patterns() argument
553 if (vgroup->tmplt_elusage_set) { in mlxsw_sp_acl_tcam_vgroup_use_patterns()
554 memcpy(out, &vgroup->tmplt_elusage, sizeof(*out)); in mlxsw_sp_acl_tcam_vgroup_use_patterns()
559 for (i = 0; i < vgroup->patterns_count; i++) { in mlxsw_sp_acl_tcam_vgroup_use_patterns()
560 pattern = &vgroup->patterns[i]; in mlxsw_sp_acl_tcam_vgroup_use_patterns()
771 struct mlxsw_sp_acl_tcam_vgroup *vgroup, in mlxsw_sp_acl_tcam_vregion_create() argument
777 struct mlxsw_sp_acl_tcam *tcam = vgroup->group.tcam; in mlxsw_sp_acl_tcam_vregion_create()
788 vregion->vgroup = vgroup; in mlxsw_sp_acl_tcam_vregion_create()
804 err = mlxsw_sp_acl_tcam_vgroup_vregion_attach(mlxsw_sp, vgroup, vregion, in mlxsw_sp_acl_tcam_vregion_create()
809 if (vgroup->vregion_rehash_enabled && ops->region_rehash_hints_get) { in mlxsw_sp_acl_tcam_vregion_create()
835 struct mlxsw_sp_acl_tcam_vgroup *vgroup = vregion->vgroup; in mlxsw_sp_acl_tcam_vregion_destroy() local
838 if (vgroup->vregion_rehash_enabled && ops->region_rehash_hints_get) { in mlxsw_sp_acl_tcam_vregion_destroy()
859 struct mlxsw_sp_acl_tcam_vgroup *vgroup, in mlxsw_sp_acl_tcam_vregion_get() argument
867 vregion = mlxsw_sp_acl_tcam_vgroup_vregion_find(vgroup, priority, in mlxsw_sp_acl_tcam_vregion_get()
884 mlxsw_sp_acl_tcam_vgroup_use_patterns(vgroup, elusage, in mlxsw_sp_acl_tcam_vregion_get()
887 return mlxsw_sp_acl_tcam_vregion_create(mlxsw_sp, vgroup, priority, in mlxsw_sp_acl_tcam_vregion_get()
930 struct mlxsw_sp_acl_tcam_vgroup *vgroup, in mlxsw_sp_acl_tcam_vchunk_create() argument
947 vchunk->vgroup = vgroup; in mlxsw_sp_acl_tcam_vchunk_create()
950 vregion = mlxsw_sp_acl_tcam_vregion_get(mlxsw_sp, vgroup, in mlxsw_sp_acl_tcam_vchunk_create()
959 err = rhashtable_insert_fast(&vgroup->vchunk_ht, &vchunk->ht_node, in mlxsw_sp_acl_tcam_vchunk_create()
983 mlxsw_sp_acl_tcam_vgroup_prio_update(vgroup); in mlxsw_sp_acl_tcam_vchunk_create()
988 rhashtable_remove_fast(&vgroup->vchunk_ht, &vchunk->ht_node, in mlxsw_sp_acl_tcam_vchunk_create()
1002 struct mlxsw_sp_acl_tcam_vgroup *vgroup = vchunk->vgroup; in mlxsw_sp_acl_tcam_vchunk_destroy() local
1011 rhashtable_remove_fast(&vgroup->vchunk_ht, &vchunk->ht_node, in mlxsw_sp_acl_tcam_vchunk_destroy()
1015 mlxsw_sp_acl_tcam_vgroup_prio_update(vgroup); in mlxsw_sp_acl_tcam_vchunk_destroy()
1020 struct mlxsw_sp_acl_tcam_vgroup *vgroup, in mlxsw_sp_acl_tcam_vchunk_get() argument
1026 vchunk = rhashtable_lookup_fast(&vgroup->vchunk_ht, &priority, in mlxsw_sp_acl_tcam_vchunk_get()
1035 return mlxsw_sp_acl_tcam_vchunk_create(mlxsw_sp, vgroup, in mlxsw_sp_acl_tcam_vchunk_get()
1109 struct mlxsw_sp_acl_tcam_vgroup *vgroup, in mlxsw_sp_acl_tcam_ventry_add() argument
1117 vchunk = mlxsw_sp_acl_tcam_vchunk_get(mlxsw_sp, vgroup, rulei->priority, in mlxsw_sp_acl_tcam_ventry_add()
1679 struct mlxsw_sp_acl_tcam_vgroup vgroup; member
1696 return mlxsw_sp_acl_tcam_vgroup_add(mlxsw_sp, tcam, &ruleset->vgroup, in mlxsw_sp_acl_tcam_flower_ruleset_add()
1709 mlxsw_sp_acl_tcam_vgroup_del(&ruleset->vgroup); in mlxsw_sp_acl_tcam_flower_ruleset_del()
1720 return mlxsw_sp_acl_tcam_group_bind(mlxsw_sp, &ruleset->vgroup.group, in mlxsw_sp_acl_tcam_flower_ruleset_bind()
1732 mlxsw_sp_acl_tcam_group_unbind(mlxsw_sp, &ruleset->vgroup.group, in mlxsw_sp_acl_tcam_flower_ruleset_unbind()
1741 return mlxsw_sp_acl_tcam_group_id(&ruleset->vgroup.group); in mlxsw_sp_acl_tcam_flower_ruleset_group_id()
1752 return mlxsw_sp_acl_tcam_ventry_add(mlxsw_sp, &ruleset->vgroup, in mlxsw_sp_acl_tcam_flower_rule_add()
1798 struct mlxsw_sp_acl_tcam_vgroup vgroup; member
1816 err = mlxsw_sp_acl_tcam_vgroup_add(mlxsw_sp, tcam, &ruleset->vgroup, in mlxsw_sp_acl_tcam_mr_ruleset_add()
1831 &ruleset->vgroup, 1, in mlxsw_sp_acl_tcam_mr_ruleset_add()
1841 mlxsw_sp_acl_tcam_vgroup_del(&ruleset->vgroup); in mlxsw_sp_acl_tcam_mr_ruleset_add()
1851 mlxsw_sp_acl_tcam_vgroup_del(&ruleset->vgroup); in mlxsw_sp_acl_tcam_mr_ruleset_del()
1876 return mlxsw_sp_acl_tcam_group_id(&ruleset->vgroup.group); in mlxsw_sp_acl_tcam_mr_ruleset_group_id()
1887 return mlxsw_sp_acl_tcam_ventry_add(mlxsw_sp, &ruleset->vgroup, in mlxsw_sp_acl_tcam_mr_rule_add()