Lines Matching refs:vchunk
224 struct mlxsw_sp_acl_tcam_vchunk *vchunk; member
252 struct mlxsw_sp_acl_tcam_vchunk *vchunk; member
401 struct mlxsw_sp_acl_tcam_vchunk *vchunk; in mlxsw_sp_acl_tcam_vregion_prio() local
406 vchunk = list_first_entry(&vregion->vchunk_list, in mlxsw_sp_acl_tcam_vregion_prio()
407 typeof(*vchunk), list); in mlxsw_sp_acl_tcam_vregion_prio()
408 return vchunk->priority; in mlxsw_sp_acl_tcam_vregion_prio()
414 struct mlxsw_sp_acl_tcam_vchunk *vchunk; in mlxsw_sp_acl_tcam_vregion_max_prio() local
418 vchunk = list_last_entry(&vregion->vchunk_list, in mlxsw_sp_acl_tcam_vregion_max_prio()
419 typeof(*vchunk), list); in mlxsw_sp_acl_tcam_vregion_max_prio()
420 return vchunk->priority; in mlxsw_sp_acl_tcam_vregion_max_prio()
788 mlxsw_sp_acl_tcam_rehash_ctx_vchunk_changed(struct mlxsw_sp_acl_tcam_vchunk *vchunk) in mlxsw_sp_acl_tcam_rehash_ctx_vchunk_changed() argument
790 struct mlxsw_sp_acl_tcam_vregion *vregion = vchunk->vregion; in mlxsw_sp_acl_tcam_rehash_ctx_vchunk_changed()
796 if (vregion->rehash.ctx.current_vchunk == vchunk) { in mlxsw_sp_acl_tcam_rehash_ctx_vchunk_changed()
976 struct mlxsw_sp_acl_tcam_vchunk *vchunk, in mlxsw_sp_acl_tcam_chunk_create() argument
985 chunk->vchunk = vchunk; in mlxsw_sp_acl_tcam_chunk_create()
988 ops->chunk_init(region->priv, chunk->priv, vchunk->priority); in mlxsw_sp_acl_tcam_chunk_create()
1008 struct mlxsw_sp_acl_tcam_vchunk *vchunk, *vchunk2; in mlxsw_sp_acl_tcam_vchunk_create() local
1016 vchunk = kzalloc(sizeof(*vchunk), GFP_KERNEL); in mlxsw_sp_acl_tcam_vchunk_create()
1017 if (!vchunk) in mlxsw_sp_acl_tcam_vchunk_create()
1019 INIT_LIST_HEAD(&vchunk->ventry_list); in mlxsw_sp_acl_tcam_vchunk_create()
1020 vchunk->priority = priority; in mlxsw_sp_acl_tcam_vchunk_create()
1021 vchunk->vgroup = vgroup; in mlxsw_sp_acl_tcam_vchunk_create()
1022 vchunk->ref_count = 1; in mlxsw_sp_acl_tcam_vchunk_create()
1031 vchunk->vregion = vregion; in mlxsw_sp_acl_tcam_vchunk_create()
1033 err = rhashtable_insert_fast(&vgroup->vchunk_ht, &vchunk->ht_node, in mlxsw_sp_acl_tcam_vchunk_create()
1039 vchunk->chunk = mlxsw_sp_acl_tcam_chunk_create(mlxsw_sp, vchunk, in mlxsw_sp_acl_tcam_vchunk_create()
1040 vchunk->vregion->region); in mlxsw_sp_acl_tcam_vchunk_create()
1041 if (IS_ERR(vchunk->chunk)) { in mlxsw_sp_acl_tcam_vchunk_create()
1043 err = PTR_ERR(vchunk->chunk); in mlxsw_sp_acl_tcam_vchunk_create()
1055 list_add_tail(&vchunk->list, pos); in mlxsw_sp_acl_tcam_vchunk_create()
1059 return vchunk; in mlxsw_sp_acl_tcam_vchunk_create()
1062 rhashtable_remove_fast(&vgroup->vchunk_ht, &vchunk->ht_node, in mlxsw_sp_acl_tcam_vchunk_create()
1067 kfree(vchunk); in mlxsw_sp_acl_tcam_vchunk_create()
1073 struct mlxsw_sp_acl_tcam_vchunk *vchunk) in mlxsw_sp_acl_tcam_vchunk_destroy() argument
1075 struct mlxsw_sp_acl_tcam_vregion *vregion = vchunk->vregion; in mlxsw_sp_acl_tcam_vchunk_destroy()
1076 struct mlxsw_sp_acl_tcam_vgroup *vgroup = vchunk->vgroup; in mlxsw_sp_acl_tcam_vchunk_destroy()
1080 list_del(&vchunk->list); in mlxsw_sp_acl_tcam_vchunk_destroy()
1081 if (vchunk->chunk2) in mlxsw_sp_acl_tcam_vchunk_destroy()
1082 mlxsw_sp_acl_tcam_chunk_destroy(mlxsw_sp, vchunk->chunk2); in mlxsw_sp_acl_tcam_vchunk_destroy()
1083 mlxsw_sp_acl_tcam_chunk_destroy(mlxsw_sp, vchunk->chunk); in mlxsw_sp_acl_tcam_vchunk_destroy()
1085 rhashtable_remove_fast(&vgroup->vchunk_ht, &vchunk->ht_node, in mlxsw_sp_acl_tcam_vchunk_destroy()
1087 mlxsw_sp_acl_tcam_vregion_put(mlxsw_sp, vchunk->vregion); in mlxsw_sp_acl_tcam_vchunk_destroy()
1088 kfree(vchunk); in mlxsw_sp_acl_tcam_vchunk_destroy()
1098 struct mlxsw_sp_acl_tcam_vchunk *vchunk; in mlxsw_sp_acl_tcam_vchunk_get() local
1100 vchunk = rhashtable_lookup_fast(&vgroup->vchunk_ht, &priority, in mlxsw_sp_acl_tcam_vchunk_get()
1102 if (vchunk) { in mlxsw_sp_acl_tcam_vchunk_get()
1103 if (WARN_ON(!mlxsw_afk_key_info_subset(vchunk->vregion->key_info, in mlxsw_sp_acl_tcam_vchunk_get()
1106 vchunk->ref_count++; in mlxsw_sp_acl_tcam_vchunk_get()
1107 return vchunk; in mlxsw_sp_acl_tcam_vchunk_get()
1115 struct mlxsw_sp_acl_tcam_vchunk *vchunk) in mlxsw_sp_acl_tcam_vchunk_put() argument
1117 if (--vchunk->ref_count) in mlxsw_sp_acl_tcam_vchunk_put()
1119 mlxsw_sp_acl_tcam_vchunk_destroy(mlxsw_sp, vchunk); in mlxsw_sp_acl_tcam_vchunk_put()
1188 struct mlxsw_sp_acl_tcam_vchunk *vchunk; in mlxsw_sp_acl_tcam_ventry_add() local
1191 vchunk = mlxsw_sp_acl_tcam_vchunk_get(mlxsw_sp, vgroup, rulei->priority, in mlxsw_sp_acl_tcam_ventry_add()
1193 if (IS_ERR(vchunk)) in mlxsw_sp_acl_tcam_ventry_add()
1194 return PTR_ERR(vchunk); in mlxsw_sp_acl_tcam_ventry_add()
1196 ventry->vchunk = vchunk; in mlxsw_sp_acl_tcam_ventry_add()
1198 vregion = vchunk->vregion; in mlxsw_sp_acl_tcam_ventry_add()
1202 vchunk->chunk); in mlxsw_sp_acl_tcam_ventry_add()
1209 list_add_tail(&ventry->list, &vchunk->ventry_list); in mlxsw_sp_acl_tcam_ventry_add()
1210 mlxsw_sp_acl_tcam_rehash_ctx_vchunk_changed(vchunk); in mlxsw_sp_acl_tcam_ventry_add()
1216 mlxsw_sp_acl_tcam_vchunk_put(mlxsw_sp, vchunk); in mlxsw_sp_acl_tcam_ventry_add()
1223 struct mlxsw_sp_acl_tcam_vchunk *vchunk = ventry->vchunk; in mlxsw_sp_acl_tcam_ventry_del() local
1224 struct mlxsw_sp_acl_tcam_vregion *vregion = vchunk->vregion; in mlxsw_sp_acl_tcam_ventry_del()
1227 mlxsw_sp_acl_tcam_rehash_ctx_vchunk_changed(vchunk); in mlxsw_sp_acl_tcam_ventry_del()
1231 mlxsw_sp_acl_tcam_vchunk_put(mlxsw_sp, vchunk); in mlxsw_sp_acl_tcam_ventry_del()
1239 struct mlxsw_sp_acl_tcam_vchunk *vchunk = ventry->vchunk; in mlxsw_sp_acl_tcam_ventry_action_replace() local
1242 vchunk->vregion->region, in mlxsw_sp_acl_tcam_ventry_action_replace()
1280 struct mlxsw_sp_acl_tcam_vchunk *vchunk, in mlxsw_sp_acl_tcam_vchunk_migrate_start() argument
1286 new_chunk = mlxsw_sp_acl_tcam_chunk_create(mlxsw_sp, vchunk, region); in mlxsw_sp_acl_tcam_vchunk_migrate_start()
1289 vchunk->chunk2 = vchunk->chunk; in mlxsw_sp_acl_tcam_vchunk_migrate_start()
1290 vchunk->chunk = new_chunk; in mlxsw_sp_acl_tcam_vchunk_migrate_start()
1291 ctx->current_vchunk = vchunk; in mlxsw_sp_acl_tcam_vchunk_migrate_start()
1299 struct mlxsw_sp_acl_tcam_vchunk *vchunk, in mlxsw_sp_acl_tcam_vchunk_migrate_end() argument
1302 mlxsw_sp_acl_tcam_chunk_destroy(mlxsw_sp, vchunk->chunk2); in mlxsw_sp_acl_tcam_vchunk_migrate_end()
1303 vchunk->chunk2 = NULL; in mlxsw_sp_acl_tcam_vchunk_migrate_end()
1309 struct mlxsw_sp_acl_tcam_vchunk *vchunk, in mlxsw_sp_acl_tcam_vchunk_migrate_one() argument
1317 if (vchunk->chunk->region != region) { in mlxsw_sp_acl_tcam_vchunk_migrate_one()
1318 err = mlxsw_sp_acl_tcam_vchunk_migrate_start(mlxsw_sp, vchunk, in mlxsw_sp_acl_tcam_vchunk_migrate_one()
1322 } else if (!vchunk->chunk2) { in mlxsw_sp_acl_tcam_vchunk_migrate_one()
1333 ventry = list_first_entry(&vchunk->ventry_list, in mlxsw_sp_acl_tcam_vchunk_migrate_one()
1336 list_for_each_entry_from(ventry, &vchunk->ventry_list, list) { in mlxsw_sp_acl_tcam_vchunk_migrate_one()
1344 vchunk->chunk, credits); in mlxsw_sp_acl_tcam_vchunk_migrate_one()
1357 swap(vchunk->chunk, vchunk->chunk2); in mlxsw_sp_acl_tcam_vchunk_migrate_one()
1376 mlxsw_sp_acl_tcam_vchunk_migrate_end(mlxsw_sp, vchunk, ctx); in mlxsw_sp_acl_tcam_vchunk_migrate_one()
1386 struct mlxsw_sp_acl_tcam_vchunk *vchunk; in mlxsw_sp_acl_tcam_vchunk_migrate_all() local
1393 vchunk = ctx->current_vchunk; in mlxsw_sp_acl_tcam_vchunk_migrate_all()
1395 vchunk = list_first_entry(&vregion->vchunk_list, in mlxsw_sp_acl_tcam_vchunk_migrate_all()
1396 typeof(*vchunk), list); in mlxsw_sp_acl_tcam_vchunk_migrate_all()
1398 list_for_each_entry_from(vchunk, &vregion->vchunk_list, list) { in mlxsw_sp_acl_tcam_vchunk_migrate_all()
1399 err = mlxsw_sp_acl_tcam_vchunk_migrate_one(mlxsw_sp, vchunk, in mlxsw_sp_acl_tcam_vchunk_migrate_all()
1713 struct mlxsw_sp_acl_tcam_vchunk *vchunk; member
1746 ruleset->vchunk = mlxsw_sp_acl_tcam_vchunk_get(mlxsw_sp, in mlxsw_sp_acl_tcam_mr_ruleset_add()
1749 if (IS_ERR(ruleset->vchunk)) { in mlxsw_sp_acl_tcam_mr_ruleset_add()
1750 err = PTR_ERR(ruleset->vchunk); in mlxsw_sp_acl_tcam_mr_ruleset_add()
1766 mlxsw_sp_acl_tcam_vchunk_put(mlxsw_sp, ruleset->vchunk); in mlxsw_sp_acl_tcam_mr_ruleset_del()