From patchwork Tue Jul 24 12:26:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 10542071 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 905F213BB for ; Tue, 24 Jul 2018 12:27:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EB9D285F2 for ; Tue, 24 Jul 2018 12:27:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7356828691; Tue, 24 Jul 2018 12:27:43 +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 B2827285F2 for ; Tue, 24 Jul 2018 12:27:42 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41Zd0r4nQNzDrD2 for ; Tue, 24 Jul 2018 22:27:40 +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="Rocja8ao"; 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=40.107.0.44; helo=eur02-am5-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="Rocja8ao"; dkim-atps=neutral Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00044.outbound.protection.outlook.com [40.107.0.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41Zd081t5YzDrGC for ; Tue, 24 Jul 2018 22:27:04 +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=fY3G9aOVnvL1LZGgK2yvRfI2y/Vk5oeNo5wuj9vd2eo=; b=Rocja8aoDbWhzUf0g1tg2dsWq/XI6qBfyijO2e8nRYaO2QZfP6vAd3MzubRHmV9nupey9d+/w5n6p/iSknMdooz/yvuCqYc/NNQCtyiXCrT3pqFu2x5ZK5BXoVGBRXstWAPtDt2ds784aNqfer5jLEfqqJ4MDFY8u2wkLENcG9U= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; Received: from splinter.mtl.com (193.47.165.251) by VI1PR0501MB2333.eurprd05.prod.outlook.com (2603:10a6:800:2c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Tue, 24 Jul 2018 12:26:51 +0000 From: Ido Schimmel To: linux-internal@mellanox.com Subject: [PATCH net-next mlxsw v3 15/18] mlxsw: spectrum_acl: Pass C-TCAM region and entry to insert function Date: Tue, 24 Jul 2018 15:26:08 +0300 Message-Id: <20180724122611.13150-16-idosch@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180724122611.13150-1-idosch@mellanox.com> References: <20180724122611.13150-1-idosch@mellanox.com> MIME-Version: 1.0 X-Originating-IP: [193.47.165.251] X-ClientProxiedBy: AM4PR0101CA0050.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::18) To VI1PR0501MB2333.eurprd05.prod.outlook.com (2603:10a6:800:2c::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8fb2bf94-6ef8-4e87-25e3-08d5f160bc49 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2333; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2333; 3:wOMS4fL7mAa3SAziAH6ThKPsADBbZr0VhA88gsJWwidQAScpcOWef6Kj/sXuYBlyejlu08ahNjIkstYwBZHdhXo/i9Jl+MoYlDkfekIcforVSEHJJMHbgOaAJ70GIesjjQdwSzUu8T41e5CsfuN1nz3fRuuByiAdhWbbDtdIYAmB84MgGusfwIX6NzzV6/yoTtBZ24GYKSzn5IxGmxsHJhhwkKigrEgKXsuv9dBrlE9Cf4qNaJfw8J1fLKliAvZU; 25:PAxNJD3Qay1EZK327/C4MiKPutNbv3byNf7TY/MAIHUfpHjq1/lpvBQ6VKYBplbA01E/SPYnz027HnOlSeCT8BATyTBydYFzKd6eRsMt3OxHFJM26urG3BqzPhaRMV8cWE46VirxIkUkdOqn3JvA1s4LqmXD6z6k2A13Gv9X41xz+hHZlrW3+IWp0CRqeIVLVElc+xU8R9Pzkv2SZXJTKqSvB2lbhqDI7SNCMPHA55t2qmf+O8BnnU/qq0TQWWJXIETSC01Lcu79cbcsEJhErYR9rgKh+4N/dOIN/HX2uJ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tVwLxc9n7/2VlQJEFeHIvgk87mo+jpsIej1Dm+q1xurprsvnkAe8tseol6y7u8CLbapWLaE1hxmI0yYw== 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)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:VI1PR0501MB2333; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2333; X-Forefront-PRVS: 0743E8D0A6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(39860400002)(346002)(376002)(366004)(136003)(396003)(199004)(189003)(446003)(8936002)(6512007)(48376002)(81166006)(50466002)(97736004)(1076002)(47776003)(66066001)(2361001)(2351001)(50226002)(34206002)(16526019)(7736002)(107886003)(14444005)(6486002)(53936002)(5660300001)(6636002)(6666003)(305945005)(68736007)(11346002)(53416004)(6506007)(386003)(6116002)(8676002)(81156014)(36756003)(105586002)(106356001)(956004)(76176011)(486006)(3846002)(51416003)(2616005)(26005)(476003)(4326008)(478600001)(37006003)(86362001)(316002)(25786009)(16586007)(52116002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2333; 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; VI1PR0501MB2333; 23:1taDLVYB08rpjqBs+LuS88h1GEDbXr3Eau8KKvf?= bWRI4vQh516Z9NLF9JolTIL46alw8moH9HLFvR8+wQMKD28ncw/9YfBrB59RPRMBp6ecloTTJNt1JwylLBS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ny8/vCS5zZeXdb76oW+AOPbz+5WSq+6wVjUDfR1DXx7QNexaxObjs14Y8oH30LKd6FpCLdfbFe5qLddakDRNawbxkAscw+AqmsreEaXaIIMc2SxuqJHAslhMzeEnrHXqBsQ=; 7:i6JF+XzMKHZwCQwxVfIzF/RM1OO8yMBoHKNOuizTqqb0cCtDcftnb+bEprwgBfCjSRLW/AWgtXAik/gox7CT9kvlYsglkl5jSmMg9wHZtlSn7l5cb3+8MusviHhk+3keyJEqMCtiZLHduSB3/r2vFUSMIk0wDrzG0E7nRwZS9raD2z09q9eYtBrgfVrZXmpFCLWi70JAwUD+N4jk3wZh5FRzY6fk59ORmAp8j2VeP8tVg1XK2lULVwTXj4JE3J+S SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2018 12:26:51.5613 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8fb2bf94-6ef8-4e87-25e3-08d5f160bc49 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2333 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 When A-TCAM will be used together with C-TCAM, the C-TCAM code will need to call into the eRP core in order to get an eRP for an inserted entry. The eRP core takes an A-TCAM region as one of its arguments, so pass the C-TCAM region to the insertion function which will later allow us to derive the A-TCAM region, given it contains the C-TCAM one. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- .../mellanox/mlxsw/spectrum_acl_ctcam.c | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c index 11b19272ab13..7ff31247cac7 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c @@ -69,11 +69,12 @@ mlxsw_sp_acl_ctcam_region_move(struct mlxsw_sp *mlxsw_sp, static int mlxsw_sp_acl_ctcam_region_entry_insert(struct mlxsw_sp *mlxsw_sp, - struct mlxsw_sp_acl_tcam_region *region, - unsigned int offset, + struct mlxsw_sp_acl_ctcam_region *cregion, + struct mlxsw_sp_acl_ctcam_entry *centry, struct mlxsw_sp_acl_rule_info *rulei, bool fillup_priority) { + struct mlxsw_sp_acl_tcam_region *region = cregion->region; struct mlxsw_afk *afk = mlxsw_sp_acl_afk(mlxsw_sp->acl); char ptce2_pl[MLXSW_REG_PTCE2_LEN]; unsigned int blocks_count; @@ -89,7 +90,8 @@ mlxsw_sp_acl_ctcam_region_entry_insert(struct mlxsw_sp *mlxsw_sp, return err; mlxsw_reg_ptce2_pack(ptce2_pl, true, MLXSW_REG_PTCE2_OP_WRITE_WRITE, - region->tcam_region_info, offset, priority); + region->tcam_region_info, + centry->parman_item.index, priority); key = mlxsw_reg_ptce2_flex_key_blocks_data(ptce2_pl); mask = mlxsw_reg_ptce2_mask_data(ptce2_pl); blocks_count = mlxsw_afk_key_info_blocks_count_get(region->key_info); @@ -105,13 +107,14 @@ mlxsw_sp_acl_ctcam_region_entry_insert(struct mlxsw_sp *mlxsw_sp, static void mlxsw_sp_acl_ctcam_region_entry_remove(struct mlxsw_sp *mlxsw_sp, - struct mlxsw_sp_acl_tcam_region *region, - unsigned int offset) + struct mlxsw_sp_acl_ctcam_region *cregion, + struct mlxsw_sp_acl_ctcam_entry *centry) { char ptce2_pl[MLXSW_REG_PTCE2_LEN]; mlxsw_reg_ptce2_pack(ptce2_pl, false, MLXSW_REG_PTCE2_OP_WRITE_WRITE, - region->tcam_region_info, offset, 0); + cregion->region->tcam_region_info, + centry->parman_item.index, 0); mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl); } @@ -193,8 +196,7 @@ int mlxsw_sp_acl_ctcam_entry_add(struct mlxsw_sp *mlxsw_sp, if (err) return err; - err = mlxsw_sp_acl_ctcam_region_entry_insert(mlxsw_sp, cregion->region, - centry->parman_item.index, + err = mlxsw_sp_acl_ctcam_region_entry_insert(mlxsw_sp, cregion, centry, rulei, fillup_priority); if (err) goto err_rule_insert; @@ -211,8 +213,7 @@ void mlxsw_sp_acl_ctcam_entry_del(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_acl_ctcam_chunk *cchunk, struct mlxsw_sp_acl_ctcam_entry *centry) { - mlxsw_sp_acl_ctcam_region_entry_remove(mlxsw_sp, cregion->region, - centry->parman_item.index); + mlxsw_sp_acl_ctcam_region_entry_remove(mlxsw_sp, cregion, centry); parman_item_remove(cregion->parman, &cchunk->parman_prio, ¢ry->parman_item); }