From patchwork Tue Jul 24 14:29:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 10542297 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 D4324112E for ; Tue, 24 Jul 2018 14:43:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C35A1212D6 for ; Tue, 24 Jul 2018 14:43:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7F0828803; Tue, 24 Jul 2018 14:43:06 +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 0817928708 for ; Tue, 24 Jul 2018 14:43:06 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41Zh1432qfzF0BT for ; Wed, 25 Jul 2018 00:43:04 +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="l8BwpSH3"; 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.88; 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="l8BwpSH3"; dkim-atps=neutral Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0088.outbound.protection.outlook.com [104.47.0.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41ZgkM3hKVzDsMm 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=LHx1p71VS6BYesFqRRcMSoG+lSvTbb4BXpFs3VfSloU=; b=l8BwpSH3JgZ3Ye5UP98N+NHmZn35GgSPvJml5DQgHTwJrHyc25SuUTQdiBCsp8zC8IEJuRbigRBbmcjGGxoVFyp1FyFKvtcOn3/loucbwgC2/DyKSRUNox/6wNZ7UaPWRBnZ+UcNmE4iYtnxlwzgSnb9TOxm1HVu/N2a1nnqACY= 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:04 +0000 From: Ido Schimmel To: linux-internal@mellanox.com Subject: [PATCH net-next mlxsw v4 11/18] mlxsw: spectrum_acl: Add A-TCAM initialization Date: Tue, 24 Jul 2018 17:29:19 +0300 Message-Id: <20180724142926.13033-12-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: becd861a-8333-40df-5387-08d5f171f2ca 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:q6KQrGK95JydEfcU+300o7inVv1VXBQ+GVXUbi/38WcnzwZidGkTBwKPMJZsE6pzysRuFeK4/JtFdacKtbaXrvKPvimXMcP829L671TgO8JAYpvnMRLIokznohVgSVCl1SSd5jyeSVVY7E2zHcA65OoT/GK1yyC4oekfQJzUFdLPtEwNy0PGlpqPC5CM9dyNzaSvdk1iSMw1Pz2YJinnjla9NukDhAY2qN0jXaq0oWaF7/cJVRYtlntKWz5zxex5; 25:9EGlSmKpS7lkPBiF43PAGpKDD3A4NKUXILI4ukc7fo4mpIpbtRh1zipXgVl0jq9KKjjseqgmXpjaqPLnUes9+EG5zMn0csGYddQs55RXMGy7+yhHi2EtgOAxO4OlCL5JcsU7c/Am7NE3GdksLSM01pTVDr3fr+/hj3a9eoeT31DI0CTlSUfEwT5iK8pRl2jRn1eV71U4UuyAwCxyA8emYZFGrXj4/nzxx2zZmvIP6aa5by1Fb04Zv7HaiEVMyatNpWvilNAX3fO9c+boU/HQnhmhFjCbrF1x4g1vDh4IM3yQwM587UhEPVogy2wUkfIWcbO1EtY3AJX30TVnIOOSRA==; 31:eY2gSUISmCBJVOVGSYgm1J20VU4x5mZk6/tbiUPX7pZAi81psRo54+tyMPJqae7n0UMBWqqLsjQSNoemHStkkaYSZiqSD+iARP43MwHL5xERyvLQ9fAm5UtT2HksUtstE4LEBdfp7SZiejnC6oKNksa6bEl1/DZU0upHvfGhmm4QaTMiPJoFPfcQr0j8zieUvV4IsWEXZeRjhDXfjrOHmn2B3bvcuDXD5hUYDTheUgU= X-MS-TrafficTypeDiagnostic: AM4PR0501MB2322: X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2322; 20:V4WLvVUz04P4uU+8HezN2ceo0UPHT13RelQ7kPWxiw6xnwc9LEsA3vDfeIlC0HvBCQS5YH6AeYiCr/bRaFVMedPRDcIXmEz53aQXldrUmorKgqcb20EnbhjlgPW5tHViLQ0yfPUXPmGs7kdZfV/vJEHVCdWGw4LGKCfs3k7bWwavSee+k251yBaqUZd89RtaDxrM17Y7ME2Y5g2BNCaCgktPcldqqDFWWTqtSbgLjomoFFUNaB+qh0UITY/VEb2wb9IHaKlNf6xAzZ9JUk5On/I5iGYGZAPz8uc35YLs3Hj2bLLEme5sal5GgB50X/mmYgocBa2ghbwX+KyHXpzWfBMsYnRa7LeKObmfnuT1Sn1PuyN6Tg4URsEVSg4dGeojL+PwE7js1t8q1JmO4YdsKX5edw+AL9clEIfCgFxypajRwbPUa47mexPvoUw910RZePAv/n6JdR8Bb8djQw8DOFDK3QUalwKHKyVLRDskwzm6Baxr8LfS1FF18bpmQWT5; 4:pjI9dTI0XDq9vEQRGHzw0LCm4d03RINmIDT1jdG/EgleQKikBiTjI+TXsPcKPG23kfEoRnn5HDbBU2v4KXPWqiXbKqaOGD2h3sf/ek/EFLHwkjzblcYHL8jr/7mRYAax8c8H61TEL99KWO43XvN3a19MY5sNZ//Nz7THLmHIZpdGYa1NB9nAoBcmXVWTSThnZ651SarbPder+NRMz3364ZDIXfXCinws2gGsLBxca1HJAjXUE4lmVNnI+DFSkemv33J673/1dhWB1nMeG1l5OA== 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)(575784001)(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:rcOZObQFWoP5bOZ8vQqp7FxzeQh24XtexqmozW/?= p7Y9xUsYmIQv35IocXMvOMSmHOsQJ+uzBvr3RYTHDKwfomNLAHSXtmocnNg7+QdztTIgPzkx7lX3m2Sa6QIgZiwAdx3loco17C0CXm9sYbgClKW6t2QG9TYueMSezvbU0R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KUDABIWsB5squlDLATmQHJCDgnSgFYh9yOtj4bB/NbyP8VHb6nu6oCpq6hdMfLedxYqGS0D3XwSJAIHAF+YXpa5zp9vPuisOiQk=; 7:RA0E6TyzfaPL2WFJqcYv/eMDxo6OFpCcY1i+u8gmgMbDxLNhXOWeTE7Zp+DU4wWtb6OL7ZdBjec/LhDnuFfOQlVN64PS3ElVxYG5LDNFAa0ENfNgImLREI4h5jeOY/+N8nJAmngVap5OJ1ZzDK8nodykzMvub676sDklWCFvV+QdxhPEEvp0FCDsnv1BMOn1z3qzmmEcTwMzslOuv8ss0CklAi1fSQ0mMAMxwdPuLYjFAOe9vNzm4i1Was7BeB0P SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2018 14:30:04.3643 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: becd861a-8333-40df-5387-08d5f171f2ca 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 Initialize the A-TCAM as part of the driver's initialization routine. Specifically, initialize the eRP tables so that A-TCAM regions will be able to perform allocations of eRP tables upon rule insertion in subsequent patches. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- .../net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c | 7 +++++++ .../net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c | 12 ++++++++++++ .../net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c index 33787b154e74..2442decd0652 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum2_acl_tcam.c @@ -39,6 +39,7 @@ #include "core_acl_flex_actions.h" struct mlxsw_sp2_acl_tcam { + struct mlxsw_sp_acl_atcam atcam; u32 kvdl_index; unsigned int kvdl_count; }; @@ -100,9 +101,14 @@ static int mlxsw_sp2_acl_tcam_init(struct mlxsw_sp *mlxsw_sp, void *priv, if (err) goto err_pgcr_write; + err = mlxsw_sp_acl_atcam_init(mlxsw_sp, &tcam->atcam); + if (err) + goto err_atcam_init; + mlxsw_afa_block_destroy(afa_block); return 0; +err_atcam_init: err_pgcr_write: err_pefa_write: err_afa_block_continue: @@ -117,6 +123,7 @@ static void mlxsw_sp2_acl_tcam_fini(struct mlxsw_sp *mlxsw_sp, void *priv) { struct mlxsw_sp2_acl_tcam *tcam = priv; + mlxsw_sp_acl_atcam_fini(mlxsw_sp, &tcam->atcam); mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, tcam->kvdl_count, tcam->kvdl_index); } diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c index a27d3b0f9fcb..89c78c62e7e5 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_atcam.c @@ -93,3 +93,15 @@ int mlxsw_sp_acl_atcam_region_init(struct mlxsw_sp *mlxsw_sp, return 0; } + +int mlxsw_sp_acl_atcam_init(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_atcam *atcam) +{ + return mlxsw_sp_acl_erps_init(mlxsw_sp, atcam); +} + +void mlxsw_sp_acl_atcam_fini(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_acl_atcam *atcam) +{ + mlxsw_sp_acl_erps_fini(mlxsw_sp, atcam); +} diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h index 70094936ca43..ac6bdffd99a7 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h @@ -173,6 +173,10 @@ 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_tcam_region *region); +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, + struct mlxsw_sp_acl_atcam *atcam); struct mlxsw_sp_acl_erp;