From patchwork Thu Jan 6 16:06:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12705509 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEB5AC433F5 for ; Thu, 6 Jan 2022 16:07:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240877AbiAFQHK (ORCPT ); Thu, 6 Jan 2022 11:07:10 -0500 Received: from mail-bn8nam11on2040.outbound.protection.outlook.com ([40.107.236.40]:14496 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240846AbiAFQHJ (ORCPT ); Thu, 6 Jan 2022 11:07:09 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CAeWoXbHJr9wPyYrS99aDnDRUdeuow9UHXjqIpCXmPFgVEmfY3gHjOMqw7ooN9adK+RMw0BNQVNhGqyxJANAiK8kg/j10qyIuGfsKXxVmO/BrQmJwCQ5Wdq2phUj/LGQQNGRe75WV975xvnnWSDP5L6DM2X+8eSgjmbeBudIYikXURhaQRXjTUgg/eMwXFHlBBN43f9j4cDsgSVhZ+vdZe+rGgFkk6L1h2054nx/fxIU8RLAC81Q3yCFyxiad0fvES0XFLx8NHwBhpHBmzI57Rg/SLzYiwmCwgFVQV4OvsLx0Hi8mAC3J0Lm7i9S02T5wGb+6U2I7YJMYxZLHcY3Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MiyhFiHHeSZ29johws5+38XVVfClf1uCKyS/cr3y9uE=; b=jp2DzK7tIWqjBUBpmaFPxxACgRupRboD0cxft4kq1arwcRwnepOVQ8vhXnGttANR6SRYVykNkCLUZcUYMeAtteFhTSZFhOgewgnq9dUjWUhqRTy27p1l+PyaUGEaUIYsGcUgXc+xUovDaf4b7ddf4uMxrUOEnp3hhOOTUKsdwO1bjBI0hMovG9hKyzhpFH3mC6rlqLJFkknL8ND2e8OA1l+RVoBGA0YuGRYWkeFJ6xdAc7imxwvEyoidptqIcmm8hWBMKJPWT2K4bVLBAQXUSiJQ/9TQqK4nGjjd9+mwnHcta5ZvVlYbAFL1v4ZXzNULIuJzGm4XqGo6bf2UCyfcgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MiyhFiHHeSZ29johws5+38XVVfClf1uCKyS/cr3y9uE=; b=Fn/BuukHaF6r+bAI1cMraxw63Fs8yKpN3Msf8CPRy/mAYWIPB/IhZ3HFJNEXNwUepDUCqyFj92HJl9YJJ/GYbrpdRHxWBlkhryzGLgJtK44FBwkpOBStRuYMKrp9krVyyjj0XUgaTVEfxa6j4MXqNVF56NAFXx3TqNnTMuel03Q/eCZ4BE12k17fxSGX8k5GZQbLzorQYunpgUgnXbI92rn22BXHFUfPkYe1a5ZFeyFYIQ7CEjZpIErwEMegsy81HHTleNwOTo5U5c70FJLunaLyQX53FsZF243TnBW0qb8SwUG9CYa/yazoJYx3hcnpYwfXZy1RtPdb7jx1OU/BfQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM5PR12MB1641.namprd12.prod.outlook.com (2603:10b6:4:10::23) by DM6PR12MB4058.namprd12.prod.outlook.com (2603:10b6:5:21d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Thu, 6 Jan 2022 16:07:07 +0000 Received: from DM5PR12MB1641.namprd12.prod.outlook.com ([fe80::41f2:c3c7:f19:7dfa]) by DM5PR12MB1641.namprd12.prod.outlook.com ([fe80::41f2:c3c7:f19:7dfa%11]) with mapi id 15.20.4844.016; Thu, 6 Jan 2022 16:07:07 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, amcohen@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net-next 0/8] mlxsw: Add Spectrum-4 support Date: Thu, 6 Jan 2022 18:06:44 +0200 Message-Id: <20220106160652.821176-1-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 X-ClientProxiedBy: MR1P264CA0137.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:51::21) To DM5PR12MB1641.namprd12.prod.outlook.com (2603:10b6:4:10::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 408a5fbd-dbec-410c-e6bf-08d9d12e962b X-MS-TrafficTypeDiagnostic: DM6PR12MB4058:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2043; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pKOu5oYVRlU2px+ktjjU2ydhrJqCQpGz5l3x13sZ+XMU1GKCuEua9kqU4nb8mDId3PE3PlSAz4CaadOWI/IFAHrErUq/MYNL8WgnSCuya+b0Z7f2B7G0x1+YLdTgBfmoVAulqpYfOwh/BhZ/OoYRiQHwD50oioKQD5H22UDwZuPYhXvQvzbQ3dUGngw8ftAlc2cFa8nkgiZrPX/MhM+AF5IEmLlPBAvdfAdsiSlScSM7MROpZWb0pZF4i64kFfeiIQuL2mMQaOSVfaE1nuKME2QtZAzGfl/K8uHVHFfEgCHZnaezXQ2B2dMdFDGIdQ9sAamt2uIp6/KnUIk4UyMQyPF0w2gUlMqK58M83etmov3V/jlburVWtQplYIXEs/LnsBlgP25gq/86LO+acz9K0LipqGfwYDsq8Z/daN9GWP9Ntlvsbkf7agi8CIMKq5NYsPE8LskL/mqtCNoO3KabERzzlFlv64OH3CaQkrguuIBp4zFQHVshdnpw1lc3UJwqXuqn0Lg2yB/MURZv76h+xipUQAmefoiRz+9t2FC0Sbp7xgIxuZZWEDf+3GSvKFhMW4PtDey4C6h9ZiHCAL81n0k1Dxw3mhIbIM4bszoUab+i5Ej3aZgFE6vbvHRHR9RJcswF+p7NwJbDkqCE1d54Qg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR12MB1641.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(186003)(6666004)(508600001)(66946007)(66476007)(5660300002)(36756003)(66556008)(6916009)(316002)(86362001)(66574015)(4326008)(26005)(38100700002)(8676002)(2616005)(83380400001)(6512007)(6486002)(2906002)(1076003)(107886003)(8936002)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /g/F58l+EZKwGoHZQLmaNAQckX5YN50AChmzy57m/hCaZchjxhI1dIKlkaHdIMVS1VnuLoTRQZqN8QCiVcy1naT/cQJoiP/yvm15J6uijP5wnGUph9UrWkk8Nfbd5giaA7XAt/4s5Omys+tk9Sb/DrXozv0l+WaFIJlv1t2+z70CEZBq75l6CWJv0S4S8FXj+N7VtLgxMb8q5NuzBeVRFgvvCw8vuwrgCXmZGSLqBtIpyiaf05UgI2ih5MoS8G/FYnZ4fNpEUICxYlSdvwwDvSRKfV/gQ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HOD42KmE0wy/oxdsFv3mj/6eOl2pB6JxBj2KvHt47htfrakn5jsGzBiPJxmTTIFn5t10JUccAnt/D+HQLisQQcir/ovW9w58ysJJDCEnZAZJpw9gj5gWqKuumBMvQ/U4P+lt+hA/Bv+ZRFRxgqyvq4/13zqc0OzKDYM6JCY0HWJQ+/2PdliKwOJ6enAaJldyDmhG1uaAoubdehYTCdIZi2za01hhxL9gOOHPMfIKkbJv+fRXGLyEgQKz3Z+yHuG4gr1uBqDwKPksRUiea7rOPpuhx/d/WQ= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 408a5fbd-dbec-410c-e6bf-08d9d12e962b X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1641.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2022 16:07:06.9202 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rjgwLfLCu3GwybtCqIwFZFs/12RxjXR4RL00IK3FpIqdVWjiQoRpxa7hgqTfAjsSlIlDfKp5Kf3dZqeYDsCmSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4058 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patchset adds Spectrum-4 support in mlxsw. It builds on top of a previous patchset merged in commit 10184da91666 ("Merge branch 'mlxsw-Spectrum-4-prep'") and makes two additional changes before adding Spectrum-4 support. Patchset overview: Patches #1-#2 add a few Spectrum-4 specific variants of existing ACL keys. The new variants are needed because the size of certain key elements (e.g., local port) was increased in Spectrum-4. Patches #3-#6 are preparations. Patch #7 implements the Spectrum-4 variant of the Bloom filter hash function. The Bloom filter is used to optimize ACL lookups by potentially skipping certain lookups if they are guaranteed not to match. See additional info in merge commit ae6750e0a5ef ("Merge branch 'mlxsw-spectrum_acl-Add-Bloom-filter-support'"). Patch #8 finally adds Spectrum-4 support. Amit Cohen (8): mlxsw: Rename virtual router flex key element mlxsw: Introduce flex key elements for Spectrum-4 mlxsw: spectrum_acl_bloom_filter: Reorder functions to make the code more aesthetic mlxsw: spectrum_acl_bloom_filter: Make mlxsw_sp_acl_bf_key_encode() more flexible mlxsw: spectrum_acl_bloom_filter: Rename Spectrum-2 specific objects for future use mlxsw: Add operations structure for bloom filter calculation mlxsw: spectrum_acl_bloom_filter: Add support for Spectrum-4 calculation mlxsw: spectrum: Extend to support Spectrum-4 ASIC drivers/net/ethernet/mellanox/mlxsw/Kconfig | 2 +- .../mellanox/mlxsw/core_acl_flex_keys.c | 4 +- .../mellanox/mlxsw/core_acl_flex_keys.h | 4 +- drivers/net/ethernet/mellanox/mlxsw/pci.h | 1 + drivers/net/ethernet/mellanox/mlxsw/reg.h | 1 + .../net/ethernet/mellanox/mlxsw/spectrum.c | 97 +++++ .../net/ethernet/mellanox/mlxsw/spectrum.h | 6 + .../mellanox/mlxsw/spectrum2_mr_tcam.c | 12 +- .../mlxsw/spectrum_acl_bloom_filter.c | 351 +++++++++++++++--- .../mellanox/mlxsw/spectrum_acl_flex_keys.c | 46 ++- .../mellanox/mlxsw/spectrum_acl_tcam.h | 6 + 11 files changed, 468 insertions(+), 62 deletions(-)