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 4D040C282C4 for ; Thu, 7 Feb 2019 11:23:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0761521905 for ; Thu, 7 Feb 2019 11:23:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="djMg1IVP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727103AbfBGLXX (ORCPT ); Thu, 7 Feb 2019 06:23:23 -0500 Received: from mail-eopbgr30058.outbound.protection.outlook.com ([40.107.3.58]:15520 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727076AbfBGLXX (ORCPT ); Thu, 7 Feb 2019 06:23:23 -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=IBmxJ4pFNK/7+Tk8rgkjvgIJVZfMRPNLcCsXQ0+/VSw=; b=djMg1IVPA2ewMqyomyMTtOXI/gmQ2cUlTrsJj3f1hKlGTsDbt0aGh+K8HAl5opj5/hdwbE/gGvImXNImXUB4GoMviGAyvK3VXeU9Dyf9DqSkhcbdG1F0yVv+C/56lX4aI/jGFB9UNWPcxa9MG9ABmDkY41Wj6sdkZbhHrn/XS8s= Received: from AM6PR05MB5240.eurprd05.prod.outlook.com (20.177.196.214) by AM6PR05MB5624.eurprd05.prod.outlook.com (20.178.86.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.21; Thu, 7 Feb 2019 11:22:50 +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.1601.016; Thu, 7 Feb 2019 11:22:50 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , mlxsw , Ido Schimmel Subject: [PATCH net-next 07/14] mlxsw: spectrum_acl: Split entry struct into entry and ventry Thread-Topic: [PATCH net-next 07/14] mlxsw: spectrum_acl: Split entry struct into entry and ventry Thread-Index: AQHUvtd16YWgzM5dPkS6z1fnhRTPSw== Date: Thu, 7 Feb 2019 11:22:50 +0000 Message-ID: <20190207112211.10375-8-idosch@mellanox.com> References: <20190207112211.10375-1-idosch@mellanox.com> In-Reply-To: <20190207112211.10375-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0032.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:90::45) To AM6PR05MB5240.eurprd05.prod.outlook.com (2603:10a6:20b:64::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; 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-microsoft-exchange-diagnostics: 1;AM6PR05MB5624;6:+yWXeCal2CE71v00vdoG9cp34HUffURZ0YrT9xgcAv3JBXu4ct1xD8hecsP2ludOokQdINEP262YunCqdypcI5nnup0wz4uoq3PnCavgifytjig8dxlS8H4RG/oX1t3TynGg/Jx3SILZMXS8F5ZyVqh4XhHYxSGXv/mnhBt7CIZc20+is1CV5nbvvz6RLnxu5RbH/hANTHT9OgWXja4YgSv36yJNrK/CWt8lDm0FaWHRjtToa2rXgRvUXdt3plE5QqkBpmFfA7mVce0vS0pJGFsCO9CZbYWTzmaEa2xH1AbLeuWO0/jv88sq2Nzl7xVBccY2Mrac/SFPFgyArFQPr9mf/YxJTAUOuyOycdYHrCHqV1fTSw2xqeNQJ5u7SErpzIR+X7kOy+V4dwyxPLOeGS70mx42cX023JA6aODjFko3HgxV04gJrXnw0oVxqgeDkyj7/BDOeCiGCjFmUoMfew==;5:am8Iubuq/+NBUZOyehimlVrfjgOMsqoBwglkTUPr0lv/WgLxnCVBp9/ktnLqhwEnvN092/63NDkCoLyNag2xcNATfvCXTdHfx+U9C0svkQPicMrXjz22Zz/bR7jUgFvbidE33O6pptbFhkyYcKS3SQlCTmgZBt9Wy1Bw9rA75zNBz89+pkR1Rnd9Qm5z3GtRgHjBIaUFULAD5vlXlvefjA==;7:IAY8Yxlnmfc2sKQNmcte2emv/y0J9pjVtq5ut3H+nTUijl4dN7OVNVuY/fBVoNri6qDM1h5K5dUnTCW8G1HJTOhCA6pBpw/ynEVna3gaBtHKy5cA893RqjRNO+Atw4vScjD8f43N7Mv10ykA3xJE4Q== x-ms-office365-filtering-correlation-id: d960bbc0-c761-44be-a6d7-08d68cee9847 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR05MB5624; x-ms-traffictypediagnostic: AM6PR05MB5624: x-microsoft-antispam-prvs: x-forefront-prvs: 0941B96580 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(81166006)(81156014)(8676002)(68736007)(8936002)(66066001)(6916009)(105586002)(3846002)(6116002)(71200400001)(71190400001)(6506007)(386003)(1076003)(102836004)(2351001)(478600001)(36756003)(52116002)(30864003)(2501003)(14454004)(76176011)(106356001)(26005)(1730700003)(50226002)(305945005)(186003)(54906003)(4326008)(2616005)(6512007)(6486002)(7736002)(446003)(53936002)(107886003)(6436002)(256004)(99286004)(11346002)(5640700003)(316002)(86362001)(476003)(2906002)(486006)(97736004)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB5624;H:AM6PR05MB5240.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: W7wnCgcY35ENvFLw43d6BEjShBeIuvrwZWERgKQW7hXV7+GZAbBlW4EG0QfAbGl5HuWuYhb85rea7Nth7W1bFcylapwF15xq553lqtwX1DC7NvZ6gBSaSJ/qOLGSHog4A5L+hv7rNw2UUIwP/hoSuhtgULcChDFNv7IJPkTVSdm1A0TUNVhTCD65Hv5I9vCuIuV4pfaEcb68glifjKyWNGnrN1Y4yEeOgYV3uwjuAxeYJ0KzLWfDMTd41E5zIKsIdOSzao5R9tCVv27hLNLeeKXXj2eHeFcLWT2WUHkoGxiuioo8sXSFpm5k5sm2UlNSxuPU8vL7pJ94ZyHs3bhrbyEZrobKHB2JXsGD7qh0VbSz80Izy2L3ecNH6aodzhi+r+24X5CZSvyA4csHKPcfO/dnUvwMzhXD951qsSPDeEs= 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: d960bbc0-c761-44be-a6d7-08d68cee9847 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Feb 2019 11:22:49.9998 (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: AM6PR05MB5624 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jiri Pirko Do the split of entry struct so the new entry struct is related to the actual HW entry, whereas ventry struct is a SW abstration of that. This split prepares possibility for ventry to hold 2 HW entries which is needed for region ERP rehash flow. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/spectrum_acl.c | 2 +- .../mellanox/mlxsw/spectrum_acl_tcam.c | 170 +++++++++++------- .../mellanox/mlxsw/spectrum_acl_tcam.h | 2 +- 3 files changed, 108 insertions(+), 66 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c b/drivers/n= et/ethernet/mellanox/mlxsw/spectrum_acl.c index 2649d128a57c..38e027815393 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c @@ -640,7 +640,7 @@ mlxsw_sp_acl_rule_create(struct mlxsw_sp *mlxsw_sp, int err; =20 mlxsw_sp_acl_ruleset_ref_inc(ruleset); - rule =3D kzalloc(sizeof(*rule) + ops->rule_priv_size(mlxsw_sp), + rule =3D kzalloc(sizeof(*rule) + ops->rule_priv_size, GFP_KERNEL); if (!rule) { err =3D -ENOMEM; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c b/driv= ers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c index 091df6e0f805..36921ed1d2d5 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c @@ -190,11 +190,16 @@ struct mlxsw_sp_acl_tcam_vchunk { }; =20 struct mlxsw_sp_acl_tcam_entry { - struct mlxsw_sp_acl_tcam_vchunk *vchunk; + struct mlxsw_sp_acl_tcam_ventry *ventry; unsigned long priv[0]; /* priv has to be always the last item */ }; =20 +struct mlxsw_sp_acl_tcam_ventry { + struct mlxsw_sp_acl_tcam_entry *entry; + struct mlxsw_sp_acl_tcam_vchunk *vchunk; +}; + static const struct rhashtable_params mlxsw_sp_acl_tcam_vchunk_ht_params = =3D { .key_len =3D sizeof(unsigned int), .key_offset =3D offsetof(struct mlxsw_sp_acl_tcam_vchunk, priority), @@ -828,65 +833,52 @@ mlxsw_sp_acl_tcam_vchunk_put(struct mlxsw_sp *mlxsw_s= p, mlxsw_sp_acl_tcam_vchunk_destroy(mlxsw_sp, vchunk); } =20 -static size_t mlxsw_sp_acl_tcam_entry_priv_size(struct mlxsw_sp *mlxsw_sp) -{ - const struct mlxsw_sp_acl_tcam_ops *ops =3D mlxsw_sp->acl_tcam_ops; - - return ops->entry_priv_size; -} - -static int mlxsw_sp_acl_tcam_entry_add(struct mlxsw_sp *mlxsw_sp, - struct mlxsw_sp_acl_tcam_group *group, - struct mlxsw_sp_acl_tcam_entry *entry, - struct mlxsw_sp_acl_rule_info *rulei) +static struct mlxsw_sp_acl_tcam_entry * +mlxsw_sp_acl_tcam_entry_create(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_tcam_ventry *ventry, + struct mlxsw_sp_acl_tcam_region *region, + struct mlxsw_sp_acl_tcam_chunk *chunk, + struct mlxsw_sp_acl_rule_info *rulei) { const struct mlxsw_sp_acl_tcam_ops *ops =3D mlxsw_sp->acl_tcam_ops; - struct mlxsw_sp_acl_tcam_vchunk *vchunk; - struct mlxsw_sp_acl_tcam_region *region; - struct mlxsw_sp_acl_tcam_chunk *chunk; + struct mlxsw_sp_acl_tcam_entry *entry; int err; =20 - vchunk =3D mlxsw_sp_acl_tcam_vchunk_get(mlxsw_sp, group, rulei->priority, - &rulei->values.elusage); - if (IS_ERR(vchunk)) - return PTR_ERR(vchunk); - - chunk =3D vchunk->chunk; - region =3D vchunk->vregion->region; + entry =3D kzalloc(sizeof(*entry) + ops->entry_priv_size, GFP_KERNEL); + if (!entry) + return ERR_PTR(-ENOMEM); + entry->ventry =3D ventry; =20 err =3D ops->entry_add(mlxsw_sp, region->priv, chunk->priv, entry->priv, rulei); if (err) goto err_entry_add; - entry->vchunk =3D vchunk; =20 - return 0; + return entry; =20 err_entry_add: - mlxsw_sp_acl_tcam_vchunk_put(mlxsw_sp, vchunk); - return err; + kfree(entry); + return ERR_PTR(err); } =20 -static void mlxsw_sp_acl_tcam_entry_del(struct mlxsw_sp *mlxsw_sp, - struct mlxsw_sp_acl_tcam_entry *entry) +static void mlxsw_sp_acl_tcam_entry_destroy(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_tcam_region *region, + struct mlxsw_sp_acl_tcam_chunk *chunk, + struct mlxsw_sp_acl_tcam_entry *entry) { const struct mlxsw_sp_acl_tcam_ops *ops =3D mlxsw_sp->acl_tcam_ops; - struct mlxsw_sp_acl_tcam_vchunk *vchunk =3D entry->vchunk; - struct mlxsw_sp_acl_tcam_chunk *chunk =3D vchunk->chunk; - struct mlxsw_sp_acl_tcam_region *region =3D vchunk->vregion->region; =20 ops->entry_del(mlxsw_sp, region->priv, chunk->priv, entry->priv); - mlxsw_sp_acl_tcam_vchunk_put(mlxsw_sp, vchunk); + kfree(entry); } =20 static int mlxsw_sp_acl_tcam_entry_action_replace(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_tcam_region *region, struct mlxsw_sp_acl_tcam_entry *entry, struct mlxsw_sp_acl_rule_info *rulei) { const struct mlxsw_sp_acl_tcam_ops *ops =3D mlxsw_sp->acl_tcam_ops; - struct mlxsw_sp_acl_tcam_vchunk *vchunk =3D entry->vchunk; - struct mlxsw_sp_acl_tcam_region *region =3D vchunk->vregion->region; =20 return ops->entry_action_replace(mlxsw_sp, region->priv, entry->priv, rulei); @@ -894,17 +886,79 @@ mlxsw_sp_acl_tcam_entry_action_replace(struct mlxsw_s= p *mlxsw_sp, =20 static int mlxsw_sp_acl_tcam_entry_activity_get(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_tcam_region *region, struct mlxsw_sp_acl_tcam_entry *entry, bool *activity) { const struct mlxsw_sp_acl_tcam_ops *ops =3D mlxsw_sp->acl_tcam_ops; - struct mlxsw_sp_acl_tcam_vchunk *vchunk =3D entry->vchunk; - struct mlxsw_sp_acl_tcam_region *region =3D vchunk->vregion->region; =20 return ops->entry_activity_get(mlxsw_sp, region->priv, entry->priv, activity); } =20 +static int mlxsw_sp_acl_tcam_ventry_add(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_tcam_group *group, + struct mlxsw_sp_acl_tcam_ventry *ventry, + struct mlxsw_sp_acl_rule_info *rulei) +{ + struct mlxsw_sp_acl_tcam_vchunk *vchunk; + int err; + + vchunk =3D mlxsw_sp_acl_tcam_vchunk_get(mlxsw_sp, group, rulei->priority, + &rulei->values.elusage); + if (IS_ERR(vchunk)) + return PTR_ERR(vchunk); + + ventry->vchunk =3D vchunk; + ventry->entry =3D mlxsw_sp_acl_tcam_entry_create(mlxsw_sp, ventry, + vchunk->vregion->region, + vchunk->chunk, rulei); + if (IS_ERR(ventry->entry)) { + err =3D PTR_ERR(ventry->entry); + goto err_entry_create; + } + + return 0; + +err_entry_create: + mlxsw_sp_acl_tcam_vchunk_put(mlxsw_sp, vchunk); + return err; +} + +static void mlxsw_sp_acl_tcam_ventry_del(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_tcam_ventry *ventry) +{ + struct mlxsw_sp_acl_tcam_vchunk *vchunk =3D ventry->vchunk; + + mlxsw_sp_acl_tcam_entry_destroy(mlxsw_sp, vchunk->vregion->region, + vchunk->chunk, ventry->entry); + mlxsw_sp_acl_tcam_vchunk_put(mlxsw_sp, vchunk); +} + +static int +mlxsw_sp_acl_tcam_ventry_action_replace(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_tcam_ventry *ventry, + struct mlxsw_sp_acl_rule_info *rulei) +{ + struct mlxsw_sp_acl_tcam_vchunk *vchunk =3D ventry->vchunk; + + return mlxsw_sp_acl_tcam_entry_action_replace(mlxsw_sp, + vchunk->vregion->region, + ventry->entry, rulei); +} + +static int +mlxsw_sp_acl_tcam_ventry_activity_get(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_tcam_ventry *ventry, + bool *activity) +{ + struct mlxsw_sp_acl_tcam_vchunk *vchunk =3D ventry->vchunk; + + return mlxsw_sp_acl_tcam_entry_activity_get(mlxsw_sp, + vchunk->vregion->region, + ventry->entry, activity); +} + static const enum mlxsw_afk_element mlxsw_sp_acl_tcam_pattern_ipv4[] =3D { MLXSW_AFK_ELEMENT_SRC_SYS_PORT, MLXSW_AFK_ELEMENT_DMAC_32_47, @@ -959,7 +1013,7 @@ struct mlxsw_sp_acl_tcam_flower_ruleset { }; =20 struct mlxsw_sp_acl_tcam_flower_rule { - struct mlxsw_sp_acl_tcam_entry entry; + struct mlxsw_sp_acl_tcam_ventry ventry; }; =20 static int @@ -1017,12 +1071,6 @@ mlxsw_sp_acl_tcam_flower_ruleset_group_id(void *rule= set_priv) return mlxsw_sp_acl_tcam_group_id(&ruleset->group); } =20 -static size_t mlxsw_sp_acl_tcam_flower_rule_priv_size(struct mlxsw_sp *mlx= sw_sp) -{ - return sizeof(struct mlxsw_sp_acl_tcam_flower_rule) + - mlxsw_sp_acl_tcam_entry_priv_size(mlxsw_sp); -} - static int mlxsw_sp_acl_tcam_flower_rule_add(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv, void *rule_priv, @@ -1031,8 +1079,8 @@ mlxsw_sp_acl_tcam_flower_rule_add(struct mlxsw_sp *ml= xsw_sp, struct mlxsw_sp_acl_tcam_flower_ruleset *ruleset =3D ruleset_priv; struct mlxsw_sp_acl_tcam_flower_rule *rule =3D rule_priv; =20 - return mlxsw_sp_acl_tcam_entry_add(mlxsw_sp, &ruleset->group, - &rule->entry, rulei); + return mlxsw_sp_acl_tcam_ventry_add(mlxsw_sp, &ruleset->group, + &rule->ventry, rulei); } =20 static void @@ -1040,7 +1088,7 @@ mlxsw_sp_acl_tcam_flower_rule_del(struct mlxsw_sp *ml= xsw_sp, void *rule_priv) { struct mlxsw_sp_acl_tcam_flower_rule *rule =3D rule_priv; =20 - mlxsw_sp_acl_tcam_entry_del(mlxsw_sp, &rule->entry); + mlxsw_sp_acl_tcam_ventry_del(mlxsw_sp, &rule->ventry); } =20 static int @@ -1057,8 +1105,8 @@ mlxsw_sp_acl_tcam_flower_rule_activity_get(struct mlx= sw_sp *mlxsw_sp, { struct mlxsw_sp_acl_tcam_flower_rule *rule =3D rule_priv; =20 - return mlxsw_sp_acl_tcam_entry_activity_get(mlxsw_sp, &rule->entry, - activity); + return mlxsw_sp_acl_tcam_ventry_activity_get(mlxsw_sp, &rule->ventry, + activity); } =20 static const struct mlxsw_sp_acl_profile_ops mlxsw_sp_acl_tcam_flower_ops = =3D { @@ -1068,7 +1116,7 @@ static const struct mlxsw_sp_acl_profile_ops mlxsw_sp= _acl_tcam_flower_ops =3D { .ruleset_bind =3D mlxsw_sp_acl_tcam_flower_ruleset_bind, .ruleset_unbind =3D mlxsw_sp_acl_tcam_flower_ruleset_unbind, .ruleset_group_id =3D mlxsw_sp_acl_tcam_flower_ruleset_group_id, - .rule_priv_size =3D mlxsw_sp_acl_tcam_flower_rule_priv_size, + .rule_priv_size =3D sizeof(struct mlxsw_sp_acl_tcam_flower_rule), .rule_add =3D mlxsw_sp_acl_tcam_flower_rule_add, .rule_del =3D mlxsw_sp_acl_tcam_flower_rule_del, .rule_action_replace =3D mlxsw_sp_acl_tcam_flower_rule_action_replace, @@ -1081,7 +1129,7 @@ struct mlxsw_sp_acl_tcam_mr_ruleset { }; =20 struct mlxsw_sp_acl_tcam_mr_rule { - struct mlxsw_sp_acl_tcam_entry entry; + struct mlxsw_sp_acl_tcam_ventry ventry; }; =20 static int @@ -1155,12 +1203,6 @@ mlxsw_sp_acl_tcam_mr_ruleset_group_id(void *ruleset_= priv) return mlxsw_sp_acl_tcam_group_id(&ruleset->group); } =20 -static size_t mlxsw_sp_acl_tcam_mr_rule_priv_size(struct mlxsw_sp *mlxsw_s= p) -{ - return sizeof(struct mlxsw_sp_acl_tcam_mr_rule) + - mlxsw_sp_acl_tcam_entry_priv_size(mlxsw_sp); -} - static int mlxsw_sp_acl_tcam_mr_rule_add(struct mlxsw_sp *mlxsw_sp, void *ruleset_pri= v, void *rule_priv, @@ -1169,8 +1211,8 @@ mlxsw_sp_acl_tcam_mr_rule_add(struct mlxsw_sp *mlxsw_= sp, void *ruleset_priv, struct mlxsw_sp_acl_tcam_mr_ruleset *ruleset =3D ruleset_priv; struct mlxsw_sp_acl_tcam_mr_rule *rule =3D rule_priv; =20 - return mlxsw_sp_acl_tcam_entry_add(mlxsw_sp, &ruleset->group, - &rule->entry, rulei); + return mlxsw_sp_acl_tcam_ventry_add(mlxsw_sp, &ruleset->group, + &rule->ventry, rulei); } =20 static void @@ -1178,7 +1220,7 @@ mlxsw_sp_acl_tcam_mr_rule_del(struct mlxsw_sp *mlxsw_= sp, void *rule_priv) { struct mlxsw_sp_acl_tcam_mr_rule *rule =3D rule_priv; =20 - mlxsw_sp_acl_tcam_entry_del(mlxsw_sp, &rule->entry); + mlxsw_sp_acl_tcam_ventry_del(mlxsw_sp, &rule->ventry); } =20 static int @@ -1188,8 +1230,8 @@ mlxsw_sp_acl_tcam_mr_rule_action_replace(struct mlxsw= _sp *mlxsw_sp, { struct mlxsw_sp_acl_tcam_mr_rule *rule =3D rule_priv; =20 - return mlxsw_sp_acl_tcam_entry_action_replace(mlxsw_sp, &rule->entry, - rulei); + return mlxsw_sp_acl_tcam_ventry_action_replace(mlxsw_sp, &rule->ventry, + rulei); } =20 static int @@ -1198,8 +1240,8 @@ mlxsw_sp_acl_tcam_mr_rule_activity_get(struct mlxsw_s= p *mlxsw_sp, { struct mlxsw_sp_acl_tcam_mr_rule *rule =3D rule_priv; =20 - return mlxsw_sp_acl_tcam_entry_activity_get(mlxsw_sp, &rule->entry, - activity); + return mlxsw_sp_acl_tcam_ventry_activity_get(mlxsw_sp, &rule->ventry, + activity); } =20 static const struct mlxsw_sp_acl_profile_ops mlxsw_sp_acl_tcam_mr_ops =3D = { @@ -1209,7 +1251,7 @@ static const struct mlxsw_sp_acl_profile_ops mlxsw_sp= _acl_tcam_mr_ops =3D { .ruleset_bind =3D mlxsw_sp_acl_tcam_mr_ruleset_bind, .ruleset_unbind =3D mlxsw_sp_acl_tcam_mr_ruleset_unbind, .ruleset_group_id =3D mlxsw_sp_acl_tcam_mr_ruleset_group_id, - .rule_priv_size =3D mlxsw_sp_acl_tcam_mr_rule_priv_size, + .rule_priv_size =3D sizeof(struct mlxsw_sp_acl_tcam_mr_rule), .rule_add =3D mlxsw_sp_acl_tcam_mr_rule_add, .rule_del =3D mlxsw_sp_acl_tcam_mr_rule_del, .rule_action_replace =3D mlxsw_sp_acl_tcam_mr_rule_action_replace, diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h b/driv= ers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h index 7e961a64eeaf..c6d4aac82ddb 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h @@ -43,7 +43,7 @@ struct mlxsw_sp_acl_profile_ops { struct mlxsw_sp_port *mlxsw_sp_port, bool ingress); u16 (*ruleset_group_id)(void *ruleset_priv); - size_t (*rule_priv_size)(struct mlxsw_sp *mlxsw_sp); + size_t rule_priv_size; int (*rule_add)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv, void *rule_priv, struct mlxsw_sp_acl_rule_info *rulei); --=20 2.20.1