From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 155B8C10F19 for ; Sun, 24 Feb 2019 06:46:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8CC820663 for ; Sun, 24 Feb 2019 06:46:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="tKqJqy4O" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728118AbfBXGqr (ORCPT ); Sun, 24 Feb 2019 01:46:47 -0500 Received: from mail-eopbgr40071.outbound.protection.outlook.com ([40.107.4.71]:39872 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726767AbfBXGqq (ORCPT ); Sun, 24 Feb 2019 01:46:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OLmjCAwt9/PqMdL9Gu0PLFvf0CK+jOb+ou3OXbFU3f8=; b=tKqJqy4Onkt1wMCkmCUJh+CmMdudoKETKipRcx/8K5d6O5qd0GZ5TyjDdnNbb2OlFK3h1a5pf1GoX0br/dYvztca/u/qQmB/Vd8vc/AH8mMHbajS+dAe05zhqno3+Hx4fWLMsPWdcvDPE9SERot3d9nU5YMVK4IAviJ/tRki+eM= Received: from AM6PR05MB5240.eurprd05.prod.outlook.com (20.177.196.214) by AM6PR05MB4343.eurprd05.prod.outlook.com (52.135.162.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.18; Sun, 24 Feb 2019 06:46:25 +0000 Received: from AM6PR05MB5240.eurprd05.prod.outlook.com ([fe80::3542:889c:3a85:3866]) by AM6PR05MB5240.eurprd05.prod.outlook.com ([fe80::3542:889c:3a85:3866%5]) with mapi id 15.20.1643.019; Sun, 24 Feb 2019 06:46:25 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , mlxsw , Ido Schimmel Subject: [PATCH net-next 04/15] mlxsw: spectrum_acl: Refactor vregion association code Thread-Topic: [PATCH net-next 04/15] mlxsw: spectrum_acl: Refactor vregion association code Thread-Index: AQHUzAyp9ATtdcIktUiNNb8k5N9npA== Date: Sun, 24 Feb 2019 06:46:25 +0000 Message-ID: <20190224064525.14913-5-idosch@mellanox.com> References: <20190224064525.14913-1-idosch@mellanox.com> In-Reply-To: <20190224064525.14913-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0033.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:90::46) To AM6PR05MB5240.eurprd05.prod.outlook.com (2603:10a6:20b:64::22) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 595b63cd-8ea0-4836-49ac-08d69a23cba0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600110)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:AM6PR05MB4343; x-ms-traffictypediagnostic: AM6PR05MB4343: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1;AM6PR05MB4343;23:hzkZ5Hq4LVml4JW4N0qlwItdQaUe5QU5HCGqmA5?= =?iso-8859-1?Q?4sqxGfxcZuASzq2/hMLmECW9x5m0Cvq6zWWzGB742R54vazG7tMX2lcxnp?= =?iso-8859-1?Q?n/1fM2LXW0a1L3oTexts71f+SPkwMq15GZ6YMrld1yu9ZHfM6sK/60V33x?= =?iso-8859-1?Q?InJV6g9m5Dg7SwEqA9mYMp9dMNv8ulDald448VoIZfqz09S5hyFPtAYEXH?= =?iso-8859-1?Q?woXoG5lnpweC9Ls5oNpgqoCwder2TC+NJc6pMwOVEsz3FBs/wbZdTTP8Y4?= =?iso-8859-1?Q?lPodrZLVYRJ0HD1tJhz/J9D1fBqYL4vCR8CrCxTHrAEK2TQhL8OquDd61F?= =?iso-8859-1?Q?lKm9PyOeI2mdmR8JUi8wdRivr+Z2OqI1Wr9ymS0Z93M3o345MgSx5hYoM2?= =?iso-8859-1?Q?l7XTGXqM9T2RUFDWNgfnfEGlDlncBL3EnEEVJrZMxzMt10VgvQri6TTa/0?= =?iso-8859-1?Q?WE1bTtakURkA8oz0oXgdF99QgZui9Xd7LSxkm/PSkIOhDrfnX9cYvc8W6b?= =?iso-8859-1?Q?q4Mkspvz2PhfAcDL3qG78CTj8t298ymUtko5LFjgghCj/ojs2i1fj8yqNH?= =?iso-8859-1?Q?Fkq/nhjzYR15J5TEvFV1iGJM5iZGzGcY7AV6pXVLCAv6780m6+AnzKORkK?= =?iso-8859-1?Q?eGg1HBnXACq478su4yOXg82OIWYExdKxU/mQuroRen4fUqc6KrrjSfWjW2?= =?iso-8859-1?Q?lZItJAr+/GYBBok7mlmPHIbsdfBh00UH2FW+rGE7a9d6PC3j1oXGdLYUJx?= =?iso-8859-1?Q?wFCiFQAB4Zc0x9lNl44uG9qPMmjZvhnj5hvjFjSMehDN3qYGaKHxOOuFWY?= =?iso-8859-1?Q?IFI/T+Y+InNw8FNNGTJ8YntonnVkbrrah3nH9FGR7TmfdyfLxG/LyDI1yN?= =?iso-8859-1?Q?l8+T9YG4w9rI9tiqILx1UABZULqBNPGn1K/t2LbAiB0PrFEwryfTmfooIG?= =?iso-8859-1?Q?7xhMrD1AVtIa18us/f/n1uokOsfcLNGaaM/LrpYwESYxDwKpT2ceJcoeBC?= =?iso-8859-1?Q?eqyAryjAQKBI1nnASubbfLca+4gQh/48yiLxP87Xs5BQ3mbt/3NEIsyXvT?= =?iso-8859-1?Q?EYOsOASsErb0p9CoTAt7vVkdwIKL3uMQSUApv0++PfjjncLxHN3qgWPLMW?= =?iso-8859-1?Q?PpvvGk9dktDEVyPYm/87Kom8AYeJRFwhQcZiUESpm/SnNJ+ZGjvfIQSquW?= =?iso-8859-1?Q?PAtLy5JgrGwSvvBfXgykkJ+qyhBfMNGOMOOilP9Q4unO+6i008uXYky/lA?= =?iso-8859-1?Q?8sc4Z/wj7lVZKJD7wX5EnLQaL0VXmfscsLKqH1bsOqamDIBnw8Rkw+llJs?= =?iso-8859-1?Q?sOmC4rJEwU4UZ3zpZBoMponAEPiJX4kdNBwg4Px58tZtCOBjMEe/vRcX5v?= =?iso-8859-1?Q?oCPFIsI1Lle5MpTypvvWZMUt9oUnOVEqniKvS6S5B55YAO/Orjg=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09583628E0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(396003)(136003)(376002)(346002)(39850400004)(199004)(189003)(102836004)(5660300002)(3846002)(8936002)(6116002)(5640700003)(256004)(6506007)(386003)(1076003)(71200400001)(71190400001)(14454004)(6512007)(6436002)(81166006)(2351001)(81156014)(1730700003)(6346003)(50226002)(26005)(6916009)(5024004)(107886003)(2906002)(99286004)(86362001)(2501003)(486006)(2616005)(4326008)(11346002)(54906003)(66066001)(316002)(476003)(446003)(53936002)(68736007)(52116002)(7736002)(6486002)(8676002)(478600001)(106356001)(305945005)(105586002)(25786009)(186003)(36756003)(76176011)(97736004);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB4343;H:AM6PR05MB5240.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: wrqsymYEEVC2vhmako6qgG1AkdPrcgbdxtY5M0Y9Wu3Yvrosoc9/Xsfzy1rr97kvEZlW84wFC4pmvqd3QNyZlGxd+m4IA1Lixi8EG7WNF/6jwZzpSdxN2TJUiSM3eZ9GKYWrvtBkA/uNtUiZ1/zU0PRXnJsDPPObDTlA1Kt5TGlxRZjO8LHLyAyUtHhnxVL4/vHZHdnW6Jaqg1FIzxBFcet/g7oPK2Suiso03MRzNRsaYhzPC22jt3mhgscn6fmIEJv+DSE5i6HhpnVSsQIbASLHBefmqlLXApIEEWKfus6B7AYh9gFVVDmRe5ZirjN0dPupz3BKm+/rNJ1xsIdwAy61f9jYIgkvNqbmhUJNbvDmP4De+7UWZ8i0/GsFji8jh4w4aR/MAtEYKl4tcX8Z29ZVRWj2aJmXkjyfVcW+mfM= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 595b63cd-8ea0-4836-49ac-08d69a23cba0 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Feb 2019 06:46:24.5762 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4343 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jiri Pirko Refactor existing _vchunk_assoc/_vchunk_deassoc() functions into _vregion_get()/_vregion_put() to make the code simpler and prepared for vregion locking. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../mellanox/mlxsw/spectrum_acl_tcam.c | 133 +++++++++--------- 1 file changed, 66 insertions(+), 67 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c b/driv= ers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c index 21ebda19a2ad..e100b14b4815 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c @@ -188,6 +188,7 @@ struct mlxsw_sp_acl_tcam_vregion { struct delayed_work rehash_dw; struct mlxsw_sp *mlxsw_sp; bool failed_rollback; /* Indicates failed rollback during migration */ + unsigned int ref_count; }; =20 struct mlxsw_sp_acl_tcam_vchunk; @@ -388,6 +389,7 @@ static int mlxsw_sp_acl_tcam_group_region_attach(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_acl_tcam_group *group, struct mlxsw_sp_acl_tcam_region *region, + unsigned int priority, struct mlxsw_sp_acl_tcam_region *next_region) { struct mlxsw_sp_acl_tcam_region *region2; @@ -410,7 +412,7 @@ mlxsw_sp_acl_tcam_group_region_attach(struct mlxsw_sp *= mlxsw_sp, list_for_each(pos, &group->region_list) { region2 =3D list_entry(pos, typeof(*region2), list); if (mlxsw_sp_acl_tcam_vregion_prio(region2->vregion) > - mlxsw_sp_acl_tcam_vregion_prio(region->vregion)) + priority) break; } } @@ -448,7 +450,8 @@ mlxsw_sp_acl_tcam_group_region_detach(struct mlxsw_sp *= mlxsw_sp, static int mlxsw_sp_acl_tcam_vgroup_vregion_attach(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_acl_tcam_vgroup *vgroup, - struct mlxsw_sp_acl_tcam_vregion *vregion) + struct mlxsw_sp_acl_tcam_vregion *vregion, + unsigned int priority) { struct mlxsw_sp_acl_tcam_vregion *vregion2; struct list_head *pos; @@ -457,15 +460,14 @@ mlxsw_sp_acl_tcam_vgroup_vregion_attach(struct mlxsw_= sp *mlxsw_sp, /* Position the vregion inside the list according to priority */ list_for_each(pos, &vgroup->vregion_list) { vregion2 =3D list_entry(pos, typeof(*vregion2), list); - if (mlxsw_sp_acl_tcam_vregion_prio(vregion2) > - mlxsw_sp_acl_tcam_vregion_prio(vregion)) { + if (mlxsw_sp_acl_tcam_vregion_prio(vregion2) > priority) break; - } } list_add_tail(&vregion->list, pos); =20 err =3D mlxsw_sp_acl_tcam_group_region_attach(mlxsw_sp, &vgroup->group, - vregion->region, NULL); + vregion->region, + priority, NULL); if (err) goto err_region_attach; =20 @@ -731,11 +733,13 @@ static void mlxsw_sp_acl_tcam_vregion_rehash_work(str= uct work_struct *work) =20 static struct mlxsw_sp_acl_tcam_vregion * mlxsw_sp_acl_tcam_vregion_create(struct mlxsw_sp *mlxsw_sp, - struct mlxsw_sp_acl_tcam *tcam, + struct mlxsw_sp_acl_tcam_vgroup *vgroup, + unsigned int priority, struct mlxsw_afk_element_usage *elusage) { const struct mlxsw_sp_acl_tcam_ops *ops =3D mlxsw_sp->acl_tcam_ops; struct mlxsw_afk *afk =3D mlxsw_sp_acl_afk(mlxsw_sp->acl); + struct mlxsw_sp_acl_tcam *tcam =3D vgroup->group.tcam; struct mlxsw_sp_acl_tcam_vregion *vregion; int err; =20 @@ -745,6 +749,7 @@ mlxsw_sp_acl_tcam_vregion_create(struct mlxsw_sp *mlxsw= _sp, INIT_LIST_HEAD(&vregion->vchunk_list); vregion->tcam =3D tcam; vregion->mlxsw_sp =3D mlxsw_sp; + vregion->ref_count =3D 1; =20 vregion->key_info =3D mlxsw_afk_key_info_get(afk, elusage); if (IS_ERR(vregion->key_info)) { @@ -759,6 +764,11 @@ mlxsw_sp_acl_tcam_vregion_create(struct mlxsw_sp *mlxs= w_sp, goto err_region_create; } =20 + err =3D mlxsw_sp_acl_tcam_vgroup_vregion_attach(mlxsw_sp, vgroup, vregion= , + priority); + if (err) + goto err_vgroup_vregion_attach; + list_add_tail(&vregion->tlist, &tcam->vregion_list); =20 if (ops->region_rehash_hints_get) { @@ -770,6 +780,8 @@ mlxsw_sp_acl_tcam_vregion_create(struct mlxsw_sp *mlxsw= _sp, =20 return vregion; =20 +err_vgroup_vregion_attach: + mlxsw_sp_acl_tcam_region_destroy(mlxsw_sp, vregion->region); err_region_create: mlxsw_afk_key_info_put(vregion->key_info); err_key_info_get: @@ -786,6 +798,7 @@ mlxsw_sp_acl_tcam_vregion_destroy(struct mlxsw_sp *mlxs= w_sp, if (ops->region_rehash_hints_get) cancel_delayed_work_sync(&vregion->rehash_dw); list_del(&vregion->tlist); + mlxsw_sp_acl_tcam_vgroup_vregion_detach(mlxsw_sp, vregion); if (vregion->region2) mlxsw_sp_acl_tcam_region_destroy(mlxsw_sp, vregion->region2); mlxsw_sp_acl_tcam_region_destroy(mlxsw_sp, vregion->region); @@ -828,71 +841,47 @@ int mlxsw_sp_acl_tcam_vregion_rehash_intrvl_set(struc= t mlxsw_sp *mlxsw_sp, return 0; } =20 -static int -mlxsw_sp_acl_tcam_vchunk_assoc(struct mlxsw_sp *mlxsw_sp, - struct mlxsw_sp_acl_tcam_vgroup *vgroup, - unsigned int priority, - struct mlxsw_afk_element_usage *elusage, - struct mlxsw_sp_acl_tcam_vchunk *vchunk) +static struct mlxsw_sp_acl_tcam_vregion * +mlxsw_sp_acl_tcam_vregion_get(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_tcam_vgroup *vgroup, + unsigned int priority, + struct mlxsw_afk_element_usage *elusage) { + struct mlxsw_afk_element_usage vregion_elusage; struct mlxsw_sp_acl_tcam_vregion *vregion; - bool vregion_created =3D false; bool need_split; - int err; =20 vregion =3D mlxsw_sp_acl_tcam_vgroup_vregion_find(vgroup, priority, elusage, &need_split); - if (vregion && need_split) { - /* According to priority, the vchunk should belong to an - * existing vregion. However, this vchunk needs elements - * that vregion does not contain. We need to split the existing - * vregion into two and create a new vregion for this vchunk - * in between. This is not supported now. - */ - return -EOPNOTSUPP; - } - if (!vregion) { - struct mlxsw_afk_element_usage vregion_elusage; - - mlxsw_sp_acl_tcam_vgroup_use_patterns(vgroup, elusage, - &vregion_elusage); - vregion =3D mlxsw_sp_acl_tcam_vregion_create(mlxsw_sp, - vgroup->group.tcam, - &vregion_elusage); - if (IS_ERR(vregion)) - return PTR_ERR(vregion); - vregion_created =3D true; + if (vregion) { + if (need_split) { + /* According to priority, new vchunk should belong to + * an existing vregion. However, this vchunk needs + * elements that vregion does not contain. We need + * to split the existing vregion into two and create + * a new vregion for the new vchunk in between. + * This is not supported now. + */ + return ERR_PTR(-EOPNOTSUPP); + } + vregion->ref_count++; + return vregion; } =20 - vchunk->vregion =3D vregion; - list_add_tail(&vchunk->list, &vregion->vchunk_list); - - if (!vregion_created) - return 0; + mlxsw_sp_acl_tcam_vgroup_use_patterns(vgroup, elusage, + &vregion_elusage); =20 - err =3D mlxsw_sp_acl_tcam_vgroup_vregion_attach(mlxsw_sp, vgroup, - vregion); - if (err) - goto err_vgroup_vregion_attach; - - return 0; - -err_vgroup_vregion_attach: - mlxsw_sp_acl_tcam_vregion_destroy(mlxsw_sp, vregion); - return err; + return mlxsw_sp_acl_tcam_vregion_create(mlxsw_sp, vgroup, priority, + &vregion_elusage); } =20 static void -mlxsw_sp_acl_tcam_vchunk_deassoc(struct mlxsw_sp *mlxsw_sp, - struct mlxsw_sp_acl_tcam_vchunk *vchunk) +mlxsw_sp_acl_tcam_vregion_put(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_tcam_vregion *vregion) { - struct mlxsw_sp_acl_tcam_vregion *vregion =3D vchunk->vregion; - - list_del(&vchunk->list); - if (list_empty(&vregion->vchunk_list)) { - mlxsw_sp_acl_tcam_vgroup_vregion_detach(mlxsw_sp, vregion); - mlxsw_sp_acl_tcam_vregion_destroy(mlxsw_sp, vregion); - } + if (--vregion->ref_count) + return; + mlxsw_sp_acl_tcam_vregion_destroy(mlxsw_sp, vregion); } =20 static struct mlxsw_sp_acl_tcam_chunk * @@ -929,6 +918,7 @@ mlxsw_sp_acl_tcam_vchunk_create(struct mlxsw_sp *mlxsw_= sp, unsigned int priority, struct mlxsw_afk_element_usage *elusage) { + struct mlxsw_sp_acl_tcam_vregion *vregion; struct mlxsw_sp_acl_tcam_vchunk *vchunk; int err; =20 @@ -943,10 +933,14 @@ mlxsw_sp_acl_tcam_vchunk_create(struct mlxsw_sp *mlxs= w_sp, vchunk->vgroup =3D vgroup; vchunk->ref_count =3D 1; =20 - err =3D mlxsw_sp_acl_tcam_vchunk_assoc(mlxsw_sp, vgroup, priority, - elusage, vchunk); - if (err) - goto err_vchunk_assoc; + vregion =3D mlxsw_sp_acl_tcam_vregion_get(mlxsw_sp, vgroup, + priority, elusage); + if (IS_ERR(vregion)) { + err =3D PTR_ERR(vregion); + goto err_vregion_get; + } + + vchunk->vregion =3D vregion; =20 err =3D rhashtable_insert_fast(&vgroup->vchunk_ht, &vchunk->ht_node, mlxsw_sp_acl_tcam_vchunk_ht_params); @@ -960,14 +954,16 @@ mlxsw_sp_acl_tcam_vchunk_create(struct mlxsw_sp *mlxs= w_sp, goto err_chunk_create; } =20 + list_add_tail(&vchunk->list, &vregion->vchunk_list); + return vchunk; =20 err_chunk_create: rhashtable_remove_fast(&vgroup->vchunk_ht, &vchunk->ht_node, mlxsw_sp_acl_tcam_vchunk_ht_params); err_rhashtable_insert: - mlxsw_sp_acl_tcam_vchunk_deassoc(mlxsw_sp, vchunk); -err_vchunk_assoc: + mlxsw_sp_acl_tcam_vregion_put(mlxsw_sp, vregion); +err_vregion_get: kfree(vchunk); return ERR_PTR(err); } @@ -978,12 +974,13 @@ mlxsw_sp_acl_tcam_vchunk_destroy(struct mlxsw_sp *mlx= sw_sp, { struct mlxsw_sp_acl_tcam_vgroup *vgroup =3D vchunk->vgroup; =20 + list_del(&vchunk->list); if (vchunk->chunk2) mlxsw_sp_acl_tcam_chunk_destroy(mlxsw_sp, vchunk->chunk2); mlxsw_sp_acl_tcam_chunk_destroy(mlxsw_sp, vchunk->chunk); rhashtable_remove_fast(&vgroup->vchunk_ht, &vchunk->ht_node, mlxsw_sp_acl_tcam_vchunk_ht_params); - mlxsw_sp_acl_tcam_vchunk_deassoc(mlxsw_sp, vchunk); + mlxsw_sp_acl_tcam_vregion_put(mlxsw_sp, vchunk->vregion); kfree(vchunk); } =20 @@ -1240,6 +1237,7 @@ mlxsw_sp_acl_tcam_vregion_migrate(struct mlxsw_sp *ml= xsw_sp, struct mlxsw_sp_acl_tcam_vregion *vregion, void *hints_priv) { + unsigned int priority =3D mlxsw_sp_acl_tcam_vregion_prio(vregion); struct mlxsw_sp_acl_tcam_region *region2, *unused_region; int err; =20 @@ -1253,7 +1251,8 @@ mlxsw_sp_acl_tcam_vregion_migrate(struct mlxsw_sp *ml= xsw_sp, vregion->region2 =3D region2; err =3D mlxsw_sp_acl_tcam_group_region_attach(mlxsw_sp, vregion->region->group, - region2, vregion->region); + region2, priority, + vregion->region); if (err) goto err_group_region_attach; =20 --=20 2.20.1