From patchwork Tue Jul 24 14:29:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 10542295 X-Patchwork-Delegate: jiri@resnulli.us Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA2CF180E for ; Tue, 24 Jul 2018 14:43:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B851028708 for ; Tue, 24 Jul 2018 14:43:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC93428AF4; Tue, 24 Jul 2018 14:43:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D303428803 for ; Tue, 24 Jul 2018 14:43:01 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41Zh100lptzF07t for ; Wed, 25 Jul 2018 00:43:00 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="ntMAP6Lm"; dkim-atps=neutral X-Original-To: linux-mlxsw@lists.ozlabs.org Delivered-To: linux-mlxsw@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=104.47.0.68; helo=eur01-he1-obe.outbound.protection.outlook.com; envelope-from=idosch@mellanox.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="ntMAP6Lm"; dkim-atps=neutral Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0068.outbound.protection.outlook.com [104.47.0.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41ZgkM4BmtzF0tm for ; Wed, 25 Jul 2018 00:30:19 +1000 (AEST) 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=9Gv7BYjcsjWOCCFhdSoIlMvgpmi62T1Yd5fKW9JKD/A=; b=ntMAP6LmdubUJ14D9ThHVWoMckLShhxyhfB9eu8SkoDhlZ62oqhhP5+UMhf4LBWzJhBKT/CjR2sXpZg7kbkOj6wx/NXt/6q+F0b3R6ELPJEhKK8LHTqe94ozjqw0r3C4dKiRum8z0/Dy9q0TwVD22NkYuKLyBDTaLRjxtZUOcvk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; Received: from splinter.mtl.com (193.47.165.251) by AM4PR0501MB2322.eurprd05.prod.outlook.com (2603:10a6:200:53::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.16; Tue, 24 Jul 2018 14:30:05 +0000 From: Ido Schimmel To: linux-internal@mellanox.com Subject: [PATCH net-next mlxsw v4 12/18] mlxsw: spectrum_acl: Encapsulate C-TCAM region in A-TCAM region Date: Tue, 24 Jul 2018 17:29:20 +0300 Message-Id: <20180724142926.13033-13-idosch@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180724142926.13033-1-idosch@mellanox.com> References: <20180724142926.13033-1-idosch@mellanox.com> MIME-Version: 1.0 X-Originating-IP: [193.47.165.251] X-ClientProxiedBy: VI1P189CA0018.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::31) To AM4PR0501MB2322.eurprd05.prod.outlook.com (2603:10a6:200:53::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7da98530-f56c-46b5-1130-08d5f171f36a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR0501MB2322; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2322; 3:g3CooTPP/06OMGRtXoWe26Bhy+Vz6xsT6RKAfC4dg44p1lIy44s6KmqE8ez09AVTpq3G5Y5DIb/BIb73CfZZvLkRU/T0ic1AHomR3JQY25OUCjVSZMxjVtpjIg1wQdIaSTxZEplwXrbnfJyRjhIkT85Eoof1+S/9B84/ok8jZYE71cBTt/ksAGvkL3xHAUnfnPDxxBhKVi8lR+Vxp4d0ujCsj8XRmFViAUCRsERxS0KX5f1Gte53FLeXcY/Yc6OT; 25:mDUuFGkYVEKs7bxWAnuZVrPRwscDe+NWkZKGezaAD76n5UnJdrpRnTpNvWzp5cGvm+v63GJZSB0WAUonAh1zfFUEwraBh6KVDkV9a0jqvjr/F07WHSyE4zHxGVR1ZC48pPRtdFvIIYoRP3afBoHlc9ftF0HDB6RPNpxuPRdUS8s05xhRaaIJaGZSnEUnQXF3KuuoCSGdTtqZzU5oDTkR0slVE5sNFTVyvbkOdB/8MYYhSVaBZXiF226OPF5BkTwsjF5+yc7vY9/wImtEDSGIYQS2MPqSLLio5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eAu9xleugcqIxpSihB/rNZSm7mHGn1jjXduekVdP/gSLV4oNMRe2+Xs9abGnpT5Wbu5KG95IxzzIlp9sy9968kg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM4PR0501MB2322; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2322; X-Forefront-PRVS: 0743E8D0A6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(346002)(396003)(376002)(39860400002)(366004)(136003)(199004)(189003)(53936002)(97736004)(7736002)(305945005)(446003)(34206002)(107886003)(6512007)(486006)(4326008)(25786009)(26005)(478600001)(6486002)(11346002)(16526019)(6116002)(105586002)(2616005)(956004)(16586007)(53416004)(316002)(3846002)(66066001)(1076002)(47776003)(2361001)(5660300001)(68736007)(51416003)(50226002)(2906002)(76176011)(8936002)(37006003)(106356001)(81156014)(86362001)(8676002)(386003)(36756003)(81166006)(6636002)(48376002)(2351001)(52116002)(6666003)(476003)(50466002)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2322; H:splinter.mtl.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-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR0501MB2322; 23:Z8DZUOQuvzaX0QN04bq70hIDce3g8NF+SCf4e9j?= FY93ONKLBkd7gS2oMO7xwaXYoYQKrFIr3Dkkguk/tTxXbQF4oDKxYsrSO2HXd8DBi3Y2UnmU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45bb94uR4qdNQFRmMP5NwUUComObRszktB57MsAML6E/bE9qWPKOYWhxAoZUs3fSwBs54u4CJg7u8xm9gJoOBAtQRbIaL1nsaGBrc4PImTAN1hfaTJwDnggexeNTss1gSN9biLBCYYxbzcypQr6Y= X-Microsoft-Antispam-Message-Info: AYT5xXUF25uqrkbjrFBpC+aZvigLwd7ZshDYuo+LzEi7BNBulItC9fK36z1ha4hjJE72EojuDTk8E1Ew8Xacadl2gygdSY+cN13dpQqmcnB09/g1U2YvfuHJbnCsRYSm4QzCP5MGKqyvbQveahU/78zuBEcBIelF59wFXaL3byDMkyiBs1RapDU41Z3Z/558XWYGifxmUCJvqGs5zophv2E3ldqPLHqXQtuCA9s8J0ojOf9YfNRFrrc1YNuIvYkFbXHq1PNUw9bE0pQEosa550LSMvPqiHp7kTOa2nFukhxERQR0pF9rl/JkFeLJXwA94rvFLgsMuNEVSApLtqgYaN9tXsU7cGNWBV0PEKpG3mQ= X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2322; 6:vf3KYkSKOqmt4B6YmmoHTuvZs5WR1OPGhvBn9XZcMSgqPr0s4aRAvReg7YyKwmpV/vEciuFIiDwIxUaQyYPBDKz+IFpqEvDZLCAYG3V/OgldymYDFQbOLfQFo5ubZDRf+28TBhnXimc/uWArdfgg9Fkq2gyw/wiHoSAm64HjWByF+yAMSyeY1l+0Ppf2dFIXsPbraYRLERqXWXL9hROJmobdPX09RHOcYhh3oQG5UgeronHPhGHxwApm+EYmvMj16CLhKM3xnuHGQou+eO4PTQVibEp59iMiIkepLcJopeX8uVeQOjVees9Ek80N54NgFkJWVqALCvNFPAUd9aojzjzfh1A5CGdw/p86NmbXZchCsyjZpPR7xjL/0PwIvzRJl5yvFQda5VqR5aPVI7EcMTi0NZrslRn/vMhWJoMX+d/zp0GprDhxsbd3OIGtY1G7Qxtf6GyIomoR1s6n5S0PaA==; 5:fWyb5W3QS46M7igbfWiA1eET2nnglhaFWP9Y2WdEF1rP6+INwKszqw/yakON7/N3Scf4+qwnUxzHqpNrf0D4M1JKFo5qq4YOr+RSxupznKYfn3Q+/TLY+B42OmozoZJiegIRuOKsVJejIiSpXkdGt4vy9gNjpM8oOo3eh/5TCoA=; 7:bJH6+Y2Ohx+U1Kig/8DEwYyjxqX8j2PRld2Xmy8OMU03SpKaDnEDQXwvqYCzUvdQn3EdUhPOIuYtOoSxtM0g0XOHSlUuzmcqwbL0s1PlsTm49rMEAThfWMG0XGoN1rwZw6w9xjxfUOTXbgu8IKnXCiXERAfk0YTJfWKb/JgbCpjoIb9r3Sb8AxnTctpfSCE/fruV5Qz89cC6t8nf+kdceColrIt/RDfn5vJ91kHL4xjZZBXir+PwjUBGSbXZU0pT SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2018 14:30:05.3643 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7da98530-f56c-46b5-1130-08d5f171f36a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2322 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: mlxsw driver development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org X-Virus-Scanned: ClamAV using ClamSMTP In Spectrum-2 the C-TCAM is only used for rules that can't fit in the A-TCAM due to a limited number of masks per A-TCAM region. In addition, rules inserted into the C-TCAM may affect rules residing in the A-TCAM, by clearing their C-TCAM prune bit. The two regions are thus closely related and can be thought of as if the C-TCAM region is encapsulated in the A-TCAM one. Change the data structures to reflect that before introducing A-TCAM support and make C-TCAM region initialization part of the A-TCAM region initialization sequence. Signed-off-by: Ido Schimmel --- Notes: v4: * Directly return in mlxsw_sp_acl_atcam_region_init() instead of returning 'err' v3: * Add forgotten error checking in mlxsw_sp_acl_atcam_region_init() v2: * Move C-TCAM region init to be part of A-TCAM region init .../ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c | 16 ++++++---------- .../ethernet/mellanox/mlxsw/spectrum_acl_atcam.c | 8 +++++++- .../ethernet/mellanox/mlxsw/spectrum_acl_tcam.h | 3 +++ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c index 2442decd0652..7e392529a896 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c @@ -45,7 +45,7 @@ struct mlxsw_sp2_acl_tcam { }; struct mlxsw_sp2_acl_tcam_region { - struct mlxsw_sp_acl_ctcam_region cregion; + struct mlxsw_sp_acl_atcam_region aregion; struct mlxsw_sp_acl_tcam_region *region; }; @@ -133,14 +133,10 @@ mlxsw_sp2_acl_tcam_region_init(struct mlxsw_sp *mlxsw_sp, void *region_priv, struct mlxsw_sp_acl_tcam_region *_region) { struct mlxsw_sp2_acl_tcam_region *region = region_priv; - int err; region->region = _region; - err = mlxsw_sp_acl_atcam_region_init(mlxsw_sp, _region); - if (err) - return err; - return mlxsw_sp_acl_ctcam_region_init(mlxsw_sp, ®ion->cregion, + return mlxsw_sp_acl_atcam_region_init(mlxsw_sp, ®ion->aregion, _region); } @@ -149,7 +145,7 @@ mlxsw_sp2_acl_tcam_region_fini(struct mlxsw_sp *mlxsw_sp, void *region_priv) { struct mlxsw_sp2_acl_tcam_region *region = region_priv; - mlxsw_sp_acl_ctcam_region_fini(®ion->cregion); + mlxsw_sp_acl_atcam_region_fini(®ion->aregion); } static int @@ -165,7 +161,7 @@ static void mlxsw_sp2_acl_tcam_chunk_init(void *region_priv, void *chunk_priv, struct mlxsw_sp2_acl_tcam_region *region = region_priv; struct mlxsw_sp2_acl_tcam_chunk *chunk = chunk_priv; - mlxsw_sp_acl_ctcam_chunk_init(®ion->cregion, &chunk->cchunk, + mlxsw_sp_acl_ctcam_chunk_init(®ion->aregion.cregion, &chunk->cchunk, priority); } @@ -186,7 +182,7 @@ static int mlxsw_sp2_acl_tcam_entry_add(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp2_acl_tcam_entry *entry = entry_priv; entry->act_block = rulei->act_block; - return mlxsw_sp_acl_ctcam_entry_add(mlxsw_sp, ®ion->cregion, + return mlxsw_sp_acl_ctcam_entry_add(mlxsw_sp, ®ion->aregion.cregion, &chunk->cchunk, &entry->centry, rulei, true); } @@ -199,7 +195,7 @@ static void mlxsw_sp2_acl_tcam_entry_del(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp2_acl_tcam_chunk *chunk = chunk_priv; struct mlxsw_sp2_acl_tcam_entry *entry = entry_priv; - mlxsw_sp_acl_ctcam_entry_del(mlxsw_sp, ®ion->cregion, + mlxsw_sp_acl_ctcam_entry_del(mlxsw_sp, ®ion->aregion.cregion, &chunk->cchunk, &entry->centry); } diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c index 89c78c62e7e5..e45172850ed3 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c @@ -77,6 +77,7 @@ mlxsw_sp_acl_atcam_region_erp_init(struct mlxsw_sp *mlxsw_sp, } int mlxsw_sp_acl_atcam_region_init(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_atcam_region *aregion, struct mlxsw_sp_acl_tcam_region *region) { int err; @@ -90,8 +91,13 @@ int mlxsw_sp_acl_atcam_region_init(struct mlxsw_sp *mlxsw_sp, err = mlxsw_sp_acl_atcam_region_erp_init(mlxsw_sp, region->id); if (err) return err; + return mlxsw_sp_acl_ctcam_region_init(mlxsw_sp, &aregion->cregion, + region); +} - return 0; +void mlxsw_sp_acl_atcam_region_fini(struct mlxsw_sp_acl_atcam_region *aregion) +{ + mlxsw_sp_acl_ctcam_region_fini(&aregion->cregion); } int mlxsw_sp_acl_atcam_init(struct mlxsw_sp *mlxsw_sp, diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h index ac6bdffd99a7..17187e5fc3f2 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h @@ -163,6 +163,7 @@ struct mlxsw_sp_acl_atcam { }; struct mlxsw_sp_acl_atcam_region { + struct mlxsw_sp_acl_ctcam_region cregion; struct mlxsw_sp_acl_tcam_region *region; struct mlxsw_sp_acl_atcam *atcam; enum mlxsw_sp_acl_atcam_region_type type; @@ -172,7 +173,9 @@ struct mlxsw_sp_acl_atcam_region { int mlxsw_sp_acl_atcam_region_associate(struct mlxsw_sp *mlxsw_sp, u16 region_id); int mlxsw_sp_acl_atcam_region_init(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_atcam_region *aregion, struct mlxsw_sp_acl_tcam_region *region); +void mlxsw_sp_acl_atcam_region_fini(struct mlxsw_sp_acl_atcam_region *aregion); int mlxsw_sp_acl_atcam_init(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_acl_atcam *atcam); void mlxsw_sp_acl_atcam_fini(struct mlxsw_sp *mlxsw_sp,