From patchwork Sun Jul 22 13:17:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 10539307 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 35F8F96FA for ; Sun, 22 Jul 2018 13:18:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20F6A281F9 for ; Sun, 22 Jul 2018 13:18:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1560928384; Sun, 22 Jul 2018 13:18:40 +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 5F66128372 for ; Sun, 22 Jul 2018 13:18:39 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41YQDY5XnbzDrG3 for ; Sun, 22 Jul 2018 23:18:37 +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="UvCwR3rR"; 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.8.51; helo=eur04-vi1-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="UvCwR3rR"; dkim-atps=neutral Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80051.outbound.protection.outlook.com [40.107.8.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41YQD542LGzDqmF for ; Sun, 22 Jul 2018 23:18:13 +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=O8hxm/lP/NRf/HYfVg8+X7VREZMskmoeilcXgNkSOFo=; b=UvCwR3rRiZ/orf1KiNLPNqxIGXuZ6HQ/kGLdVa5offNX4ozbiTc8DHtvsUHcWnFusNxi38Go5UAlcBbfFAykwH7uZ/B9XLiZH0ws0A4oyQGl3jwjyGyI6o1m6pDxR/urnteKZf1HfMMlBBBgfm9QP4kMOEZkVkXfUShYLFT7aiA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; Received: from splinter.mtl.com (193.47.165.251) by HE1PR0501MB2331.eurprd05.prod.outlook.com (2603:10a6:3:27::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.20; Sun, 22 Jul 2018 13:18:01 +0000 From: Ido Schimmel To: linux-internal@mellanox.com Subject: [PATCH net-next mlxsw 07/18] mlxsw: spectrum_acl: Enable C-TCAM only mode in eRP core Date: Sun, 22 Jul 2018 16:17:01 +0300 Message-Id: <20180722131712.30578-8-idosch@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180722131712.30578-1-idosch@mellanox.com> References: <20180722131712.30578-1-idosch@mellanox.com> MIME-Version: 1.0 X-Originating-IP: [193.47.165.251] X-ClientProxiedBy: AM0PR01CA0036.eurprd01.prod.exchangelabs.com (2603:10a6:208:69::49) To HE1PR0501MB2331.eurprd05.prod.outlook.com (2603:10a6:3:27::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4e8c76de-2b1a-434c-999e-08d5efd58d76 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0501MB2331; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2331; 3:R6EJ02rCMduyDWKSbQ9NHN4wfRRDIS0l0gGIzCYqMmhME7rfAhyKNdRssf2Qk0vQX9e+zyECAYWHg8XDfoj02g/jqb9aekSu2JElTDf67fRjU2TKj8RHEQCg7SRSyWNXZ5Y1992veAO9/TYLsA1qjH8vyA3nKKP0EbTeb+XUlU+mZJx4oxkMSI0L8SV/B+ILK9lkDA8zfrk9khwBXm95IXZ04c2BY0UQBP45aZNB1EgFlmNjvNiwjx/ZMMij40IN; 25:DIsPxYq/Ny6RwFFlKPEVlU9mB7vqcDtSt4XsHeDGi4eirHuUmQmK9XBkxvaqztmw14c0726xbZQWE6MU/mN/Nlit+OxDXPll1PSJtPNEybBXQgcIsVEVfezVH56Vs/8y3Zv3zJTzNInTcJHIxozKs+dVUj6tv4gGPLhM2vqNAn8I15hDDPp1MIBPZhxh18mZrKwm4zjBqVWKSg49TnaJTy6TJY8L8CW9FkseGGTrA6fddKo8+XZ0UGhgjBX3nZzAb+6H+sdvtPpSY3FMgq015WYjDFJOYhDFwwBZy+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5Xd5qsl+2UUAE8ldYkB2i73IWRjYGSWlecw10/dUBVvsARze2l+Jk/Oc0aTKg1wQ/Gx5NMDSKn1ZNhyiJUCA== 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)(8121501046)(5005006)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:HE1PR0501MB2331; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2331; X-Forefront-PRVS: 0741C77572 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(1496009)(376002)(366004)(136003)(346002)(396003)(39860400002)(199004)(189003)(47776003)(956004)(14444005)(81156014)(106356001)(66066001)(3846002)(6116002)(2361001)(486006)(97736004)(68736007)(81166006)(1076002)(36756003)(4326008)(2906002)(86362001)(16526019)(11346002)(26005)(105586002)(6636002)(386003)(6506007)(478600001)(446003)(8676002)(8936002)(5660300001)(53936002)(48376002)(34206002)(107886003)(50226002)(76176011)(316002)(53416004)(305945005)(476003)(6512007)(25786009)(2616005)(2351001)(37006003)(7736002)(51416003)(16586007)(50466002)(52116002)(6486002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2331; 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; HE1PR0501MB2331; 23:h9JvAvxWnfXKgeXA20tJCYUtp0HD99oTpO28HXc?= dQVviq6pc+da/WSU4vkt4xHQirr7ANQmVpRGK1vu1xNLD9hR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goAupfwvFa5KFFroK4ODDOFYVXK4xj4EYFM+jUGSl/1FAL03WKM63tPa3r7qxou4x374nGGA==; 5:bW2NY4xJrWnASOterpw3PiDhPeuskAUaOFL1sMHGylfLi5E1t0k63mH/x2iuTk+QHzwJLiLn1WbBFSKgpLxUYDsM4MZVYt/s0Sb8XAqNlSZI1QcfbdhG2JSJP6pwDuZ5Cp7w9FKT5SXDC9FDMehhSNNkmj8vva1JqEWfVPjFJpk=; 7:IZRFx5m9I6viWA67yQHc8obs9B4nDVhoHOQufF4cwiuq/MXdflkD8JvNxKQttNrY9jr3D/mEfH8LLxCZ/xinPbELtAq4UlmYjgMSxLKw/x+n5n6eGLtPi4yVE72Zewt+Jl+HPu/h2+iPxX0q3sF/VT5gkN/pCr6cE5Ahj1KiotxuYyyP7ihM1EOAx/4gU8QEMzqJstGVLmS6trSDEfZ5o9lD+gXRz6ZK3uYA6OnZJu/8OrnJ1+QWFj4WAk3D+uSs SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2018 13:18:01.7600 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e8c76de-2b1a-434c-999e-08d5efd58d76 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2331 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 Currently, no calls are performed into the eRP core, but in order to make review easier we would like to gradually add these calls. Have the eRP core initialize a region's master mask to all ones and allow it to use an empty eRP table. This directs the lookup to the C-TCAM and allows the C-TCAM only mode to continue working. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c index 960f29140b43..86600c780c95 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c @@ -879,7 +879,7 @@ mlxsw_sp_acl_erp_region_param_init(struct mlxsw_sp_acl_atcam_region *aregion) struct mlxsw_sp *mlxsw_sp = aregion->region->mlxsw_sp; char pererp_pl[MLXSW_REG_PERERP_LEN]; - mlxsw_reg_pererp_pack(pererp_pl, aregion->region->id, false, false, 0, + mlxsw_reg_pererp_pack(pererp_pl, aregion->region->id, true, true, 0, 0, 0); return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pererp), pererp_pl); } @@ -894,12 +894,16 @@ int mlxsw_sp_acl_erp_region_init(struct mlxsw_sp_acl_atcam_region *aregion) return PTR_ERR(erp_table); aregion->erp_table = erp_table; - /* Initialize the region's master mask to all zeroes */ + /* Initialize the region's master mask to all ones for C-TCAM + * only mode + */ err = mlxsw_sp_acl_erp_master_mask_init(aregion); if (err) goto err_erp_master_mask_init; - /* Initialize the region to not use the eRP table */ + /* Initialize the region to use the eRP table and enable C-TCAM + * lookup + */ err = mlxsw_sp_acl_erp_region_param_init(aregion); if (err) goto err_erp_region_param_init;