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,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 63D40C43381 for ; Thu, 28 Feb 2019 06:59:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 27A4521850 for ; Thu, 28 Feb 2019 06:59:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="RD1kDGzt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731240AbfB1G7c (ORCPT ); Thu, 28 Feb 2019 01:59:32 -0500 Received: from mail-eopbgr130081.outbound.protection.outlook.com ([40.107.13.81]:53176 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731219AbfB1G73 (ORCPT ); Thu, 28 Feb 2019 01:59:29 -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=i9lInr4CJZhi+P0/98SyCkbIjOLglFMMODDpdSHL2Hg=; b=RD1kDGztsdYMb5YgdBoe2/8P7YB/SyN5OzOUTyIgIMUUiT8+Mk7AG8UG2ka4LZHa/XxzWiAZjXdKyEcgF7Sqsngm7FRHMbI9PtjGVaj1K1eq/sSjiHtwzk6lJmHL72oHcUPAJusJjAoPbFgsatKray7L+0mBlFdTmrVHB2li/BQ= Received: from AM6PR05MB5240.eurprd05.prod.outlook.com (20.177.196.214) by AM6PR05MB5411.eurprd05.prod.outlook.com (20.177.189.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.16; Thu, 28 Feb 2019 06:59:23 +0000 Received: from AM6PR05MB5240.eurprd05.prod.outlook.com ([fe80::458c:8deb:ca54:1327]) by AM6PR05MB5240.eurprd05.prod.outlook.com ([fe80::458c:8deb:ca54:1327%2]) with mapi id 15.20.1665.015; Thu, 28 Feb 2019 06:59:23 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , mlxsw , Ido Schimmel Subject: [PATCH net-next 09/14] mlxsw: spectrum_acl: Put this_is_rollback to rehash context struct Thread-Topic: [PATCH net-next 09/14] mlxsw: spectrum_acl: Put this_is_rollback to rehash context struct Thread-Index: AQHUzzMidTYm33GtREqG7beM63zUCQ== Date: Thu, 28 Feb 2019 06:59:23 +0000 Message-ID: <20190228065850.7471-10-idosch@mellanox.com> References: <20190228065850.7471-1-idosch@mellanox.com> In-Reply-To: <20190228065850.7471-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR08CA0025.eurprd08.prod.outlook.com (2603:10a6:20b:c0::13) 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-ms-office365-filtering-correlation-id: 853c3fee-7b56-4eaf-134d-08d69d4a44fd x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR05MB5411; x-ms-traffictypediagnostic: AM6PR05MB5411: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1;AM6PR05MB5411;23:uImd+Z9pG5f+u/baeJoxvSTAQrS9EmZ3sjzvp/p?= =?iso-8859-1?Q?U9uVkcwvXBzpswXp3VHwpz9B1h4VYHhEt4RyF4nA0kJGJPtXeT1IlpdniX?= =?iso-8859-1?Q?5RBRpXeMlAr12DQYDX0ux4+jothBdAqiCgRXXYRtoNe2lZ3eu1+iF+OxAS?= =?iso-8859-1?Q?Z61ohbbId8u9zc2ztRcpRbKds7y8FaNHOXOupY32oVdQ9UdXd6Sbb1Y1gx?= =?iso-8859-1?Q?VzLCSnIycpPXaOARYJB16QtT2mLfOOQs+DbvSqFPVYLXAt2oTYZEuDHQHD?= =?iso-8859-1?Q?bbSvvlHFOCy7YJTCLJYYkW66vDAPazscZbO+4t9NlMy3lpBnpml+1FIme2?= =?iso-8859-1?Q?eBJ+D5F5NWMu+zeATpsRST3errGtCsdR0IWDgVJj2rL8nfZjU9JLwXCfGo?= =?iso-8859-1?Q?pdAGN/VORVFsyMTxwWFC7gQYp/IHuu5oMcNPfkXwkvhV9LXjzDNY7J2G+/?= =?iso-8859-1?Q?SX3RkCwYdWpgoBQSbWslm4E4xH5+lIztxUn8qWy9B49lTiRkKi46JGzEup?= =?iso-8859-1?Q?O5LqbAqz+zsfwxT+bD7xP29B/eWz7yLCc+7z69cAFAJMOXJ66euws7HH/v?= =?iso-8859-1?Q?AZBodBuE3XvnoLn9KJ3MomDpwyEDpAqTMIwqWlEVLKaUN7pA7MrUsHkR/i?= =?iso-8859-1?Q?jl0wmREO+dODRa4aDpRxc9f+3wSmFpCCtSlEVWDD/aXlNm3prvMTtUrGt/?= =?iso-8859-1?Q?OLr3vbWKpcBBSjRFux4h6kfZf22A5/cBOaDKyWvZ1tOle8o9+KEcNnm6YJ?= =?iso-8859-1?Q?rPN9dGEl9cwGPLQbghCWAzv2TpJBltSu5kKF1fV/AUvrm0bgc2TRAXfW9O?= =?iso-8859-1?Q?xtnV50AKQuPbZX2BZIMO5VgKCCDd20Ar3CLZFcdFbRg1aeNOgnPct0Ermi?= =?iso-8859-1?Q?zMfQSbtu6DtKSYA4R9HRjy7XBGWAazVkFi2oXgHRlWhff45KX0KaVzcAeN?= =?iso-8859-1?Q?SNF13ZtMUKCMBCIeHxHFs1C6z3MspTGFUUnQYyQuDKeXmVWCgvf6uGDXNE?= =?iso-8859-1?Q?oSK4ohgJXnGwZVpHCoXqTVaGqegJQttyHv0BJ+nfkzEbYnbPe8TGauMbs6?= =?iso-8859-1?Q?d+YB7nejbhEKklUWy6Urv0Fvv9RJBVuWbd8Ej/Bg/SZkgubALvZ48cqRNu?= =?iso-8859-1?Q?KeGN1xab60GbnXtUpw8lrwyOL8TVZDuBGFy/YigQBtalHbSBGyZytjGWdY?= =?iso-8859-1?Q?6Rjh6iUI/7rwCtbYUZ1Pzro2i1Z0aob785EJvVnlvevMXOXiPwIu4CremW?= =?iso-8859-1?Q?8PFTfOq/iffEvdH7Te8t+KcL8zCFjKzYbKJKSxl7F/UXr6Yu9Pr4jRo4aL?= =?iso-8859-1?Q?g6nd5GV3ZRDshC9aw4cBGekRRD6I6LiB2JmYMziI0OAPRk7nZVoKbO8ZsM?= =?iso-8859-1?Q?+JAZ9mGE5hK6w6i18ZuSYDUALAeLaaNvZ3yYasRn9a26iYsD6cQ=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 0962D394D2 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(366004)(39860400002)(136003)(396003)(346002)(199004)(189003)(5640700003)(6486002)(6436002)(14454004)(478600001)(2351001)(107886003)(4326008)(68736007)(25786009)(97736004)(386003)(6506007)(11346002)(446003)(2616005)(26005)(102836004)(486006)(476003)(186003)(2501003)(14444005)(256004)(5024004)(5660300002)(1076003)(71190400001)(71200400001)(76176011)(52116002)(8936002)(1730700003)(8676002)(81156014)(81166006)(50226002)(6916009)(99286004)(36756003)(6512007)(86362001)(6116002)(3846002)(105586002)(106356001)(54906003)(53936002)(66066001)(7736002)(316002)(305945005)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB5411;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) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: qCpEkxqbufwB27NYfT3XXXrEnqeAk2cPUfZAHV6w5PU0WCQOPZy+EImSUNrCGAyNNkE5atCIa2F4tV+jkyPF4iwJ/NDDfJuSGWGzbNpIHp28S6NXnKUjSB0kbstoyYrGXvgaJKhN7zvEnv9mIEJPp08TugjAejwIjSI8RmQreScbWSYC5IG5lMFy44//P89n2B0rlV5it0ZdLvZGOrwh7FuzL0E/W71q5ycv7kKjGHTU81KOrb6Jbrx3PFMkWtwp9TJU2fGD1nhu383j2dcETu42TqKzBYYYfCepHNp5ZwL+j8rhnfvpeiULQR9935HAIywHuJbaGChFmp5yME5wZSxNjXdTvjP80gnR5G+w4UdY6l+D4Z6oFPk7XrUbfDBNKEY+aMObWzLfnmHq23Lqm2s85/lAT4lGkog5MJpXa+4= 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: 853c3fee-7b56-4eaf-134d-08d69d4a44fd X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Feb 2019 06:59:23.2822 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5411 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jiri Pirko Put the this_is_rollback flag into rehash context struct in preparations for interrupt/continue of rehash work. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../mellanox/mlxsw/spectrum_acl_tcam.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 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 0bc04016c6d0..db80b20e4a13 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c @@ -182,6 +182,7 @@ struct mlxsw_sp_acl_tcam_vgroup { =20 struct mlxsw_sp_acl_tcam_rehash_ctx { void *hints_priv; + bool this_is_rollback; }; =20 struct mlxsw_sp_acl_tcam_vregion { @@ -1195,7 +1196,7 @@ static int mlxsw_sp_acl_tcam_vchunk_migrate_one(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_acl_tcam_vchunk *vchunk, struct mlxsw_sp_acl_tcam_region *region, - bool this_is_rollback) + struct mlxsw_sp_acl_tcam_rehash_ctx *ctx) { struct mlxsw_sp_acl_tcam_chunk *new_chunk; struct mlxsw_sp_acl_tcam_ventry *ventry; @@ -1204,7 +1205,7 @@ mlxsw_sp_acl_tcam_vchunk_migrate_one(struct mlxsw_sp = *mlxsw_sp, =20 new_chunk =3D mlxsw_sp_acl_tcam_chunk_create(mlxsw_sp, vchunk, region); if (IS_ERR(new_chunk)) { - if (this_is_rollback) + if (ctx->this_is_rollback) vchunk->vregion->failed_rollback =3D true; return PTR_ERR(new_chunk); } @@ -1215,7 +1216,7 @@ mlxsw_sp_acl_tcam_vchunk_migrate_one(struct mlxsw_sp = *mlxsw_sp, err =3D mlxsw_sp_acl_tcam_ventry_migrate(mlxsw_sp, ventry, vchunk->chunk); if (err) { - if (this_is_rollback) { + if (ctx->this_is_rollback) { vchunk->vregion->failed_rollback =3D true; return err; } @@ -1251,7 +1252,8 @@ mlxsw_sp_acl_tcam_vchunk_migrate_one(struct mlxsw_sp = *mlxsw_sp, =20 static int mlxsw_sp_acl_tcam_vchunk_migrate_all(struct mlxsw_sp *mlxsw_sp, - struct mlxsw_sp_acl_tcam_vregion *vregion) + struct mlxsw_sp_acl_tcam_vregion *vregion, + struct mlxsw_sp_acl_tcam_rehash_ctx *ctx) { struct mlxsw_sp_acl_tcam_vchunk *vchunk; int err; @@ -1259,7 +1261,7 @@ mlxsw_sp_acl_tcam_vchunk_migrate_all(struct mlxsw_sp = *mlxsw_sp, list_for_each_entry(vchunk, &vregion->vchunk_list, list) { err =3D mlxsw_sp_acl_tcam_vchunk_migrate_one(mlxsw_sp, vchunk, vregion->region, - false); + ctx); if (err) goto rollback; } @@ -1270,10 +1272,12 @@ mlxsw_sp_acl_tcam_vchunk_migrate_all(struct mlxsw_s= p *mlxsw_sp, * so the original region pointer is assigned again to vregion->region. */ swap(vregion->region, vregion->region2); + ctx->this_is_rollback =3D true; list_for_each_entry_continue_reverse(vchunk, &vregion->vchunk_list, list) { mlxsw_sp_acl_tcam_vchunk_migrate_one(mlxsw_sp, vchunk, - vregion->region, true); + vregion->region, + ctx); } return err; } @@ -1287,7 +1291,7 @@ mlxsw_sp_acl_tcam_vregion_migrate(struct mlxsw_sp *ml= xsw_sp, =20 trace_mlxsw_sp_acl_tcam_vregion_migrate(mlxsw_sp, vregion); mutex_lock(&vregion->lock); - err =3D mlxsw_sp_acl_tcam_vchunk_migrate_all(mlxsw_sp, vregion); + err =3D mlxsw_sp_acl_tcam_vchunk_migrate_all(mlxsw_sp, vregion, ctx); mutex_unlock(&vregion->lock); trace_mlxsw_sp_acl_tcam_vregion_migrate_end(mlxsw_sp, vregion); return err; @@ -1332,6 +1336,7 @@ mlxsw_sp_acl_tcam_vregion_rehash_start(struct mlxsw_s= p *mlxsw_sp, goto err_group_region_attach; =20 ctx->hints_priv =3D hints_priv; + ctx->this_is_rollback =3D false; =20 return 0; =20 --=20 2.20.1