From patchwork Thu Dec 14 13:19:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13493040 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="gKEjlE0o" Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2063.outbound.protection.outlook.com [40.107.212.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F74E116 for ; Thu, 14 Dec 2023 05:19:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k7z5rXq/4mPKwh9/2tIlFnsEcUX+x8KhTUbjWwcAYE55z8vtKdCbf1QItqOQdUa2vVfvgqfmBwmG8ysLii8oElymRsJtfyXcAKwYeenEujo9OL9jRbTWz32vwFfHKc2bIbeQqJ5+O2ZfcndWiVtOmuRrw1I/vMK6oX+f+xGQwAS1tIxynQUFZ67t4pkTAIb5sT/rN1wSQSQdsqAOHgtGCjiNfbUKSvDIzWl3mdgm3yMw/0NWxcPte2KGilIgPYjjUwshYxxARCRrvXJzx+LRb+X9vSCbe1wgNNBVJQ8LDDdsa6xkRG2nMmldDwjIrWW6WS6Csd8WAfN6azbro3cOjA== 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=f1rFWVmzKDuumcW6HqHiCkczcDyX5LXkmL7y/hqfZYo=; b=epY+AyfJfJEUpvtuw4AlFgwfK7/BVL+JiZO3RxoZmGLYZiQZe5Ta6t6t8XGI0siOM/Y0J/XK0eeWHssnfuyCU/cffjMlWfTBteiVz1j9k7JQTfnmueeqV3rzq8YaKJuSNWNDySFhInGEBIPugz4v08Q8OhgXjE8HOrlxkwAh6DH+/38GQpOAwimQOJPJGaf/+NQZHuTyObWjGcut7pWAid0+BayySeWfL5nYVajl0wmP/vK2axFUAyeaDguMLAIi084cKx+dEd+imM7aCpm9A7PA8Tz+ggkkamOFEMmMsy5U7fdn0WIedAeLf1yhifDMCVSuYyd6t0aFn/0JEx1Tiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=f1rFWVmzKDuumcW6HqHiCkczcDyX5LXkmL7y/hqfZYo=; b=gKEjlE0oeiBum3ACyJFTJmaKbPlzvVkmPocodtsiZmwtOyZiObHXnJzO+Qr46bkX4QhhkYJZ2i3oDwCcklK0QUTqB9SijLomYVwdFrMxL7/ASb9VVqqgFhoUARTYnIemraqRSQWljaybZ1XbawHFDJohi4gmujHsKSJ7N2VMl1LuyzqmsGri0UlwJCW0AUaityrohieKZwC8aNEb3rnUQh+zqL+kZ82poCrl+YTcClUTlO50hSWa3BBQHljxLTcWCS7Xzm2riyd8BreDhl53NYopLobq4umIOrmpynCBgBl6okxsxiVJXMJcl5kwrXbM8aaILKlo2jiYNxKMNC0REw== Received: from SJ2PR07CA0010.namprd07.prod.outlook.com (2603:10b6:a03:505::27) by CH3PR12MB8460.namprd12.prod.outlook.com (2603:10b6:610:156::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.38; Thu, 14 Dec 2023 13:19:44 +0000 Received: from CO1PEPF000042A7.namprd03.prod.outlook.com (2603:10b6:a03:505:cafe::4d) by SJ2PR07CA0010.outlook.office365.com (2603:10b6:a03:505::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.28 via Frontend Transport; Thu, 14 Dec 2023 13:19:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1PEPF000042A7.mail.protection.outlook.com (10.167.243.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26 via Frontend Transport; Thu, 14 Dec 2023 13:19:43 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 14 Dec 2023 05:19:31 -0800 Received: from localhost.localdomain (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 14 Dec 2023 05:19:28 -0800 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Ido Schimmel , Petr Machata , "Amit Cohen" , Subject: [PATCH net-next 1/3] mlxsw: reg: Add nve_flood_prf_id field to SFMR Date: Thu, 14 Dec 2023 14:19:05 +0100 Message-ID: <5f0354ee624195c394c57860802f61ebe43440a9.1702557104.git.petrm@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042A7:EE_|CH3PR12MB8460:EE_ X-MS-Office365-Filtering-Correlation-Id: c879131b-c178-4eb1-a84a-08dbfca7562f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kNf8p8UPcSb9n5j43Rr4yw8FA0z/M7nbX/c4jyJaQlDsMowO+6zAR1VDTFzsqTkvBeefVOnMWlMKDF6bPnHABfn9lVJxnPi7/7LlaM6SW6rA+BrFDIYe0PNib+q1O2n4LvkW6Urs3GnP6JU1G2WEZIQcPtHgrWbCGEsiRspcbjhY9vHqaXBMpfNOf4KZcj9aD3mHis8cO+22EeYmPBpfee9WMTxfxQkU6LDzruwKq2Wt3Sh5+gboXpf9vtc9wM/UzE06XdtBtzUlfRGSXs2HPfLVeZ/2+vVgIdeW0pkIRKP/BW21rleWNDSO5mxGh6V0lelyFWSDqbUOOmG+U/5jagkdLP6oX5UYIiMtI3uHKrTgal3XiDpvCUqjT6mTL/HMfdEmSzE5alUObN20VIyJhGZgdx6m6uwmgf3WgCFbXjRoU+ERdjElC8oo33POMPi+EcrKNp+DuMFegOV3mvfyXdt4riuOr7GnUOk2H7qjm+U6m19ZGKvhyjO1H2E+dClfCLKOiZZRB59VI4IKBBfbmcN2LS8oABzSMvY4i5srtL2m4/VUTVCVBsYKpZO7BSytA1eCV7lAm21vO8Po5oZYcGS7sZlwQCrN72XN+PvSQcKm65n6KRoWgaZgSQsPWKX79WGdeGJn7KLhvA85MOQyiCBmPO8gQBcv+rz+CQnIgHEUezG1hknkI2MkweuJp61g1N1aOizLYl3U7fbbKz3/gLY7XfzDESiNLGDNNQaqpUe5NmE1autjwL1oxcs4xhp3 X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(396003)(346002)(136003)(39860400002)(230922051799003)(186009)(82310400011)(64100799003)(1800799012)(451199024)(40470700004)(36840700001)(46966006)(40460700003)(47076005)(36860700001)(2906002)(5660300002)(41300700001)(86362001)(36756003)(82740400003)(7636003)(107886003)(478600001)(16526019)(26005)(6666004)(2616005)(4326008)(8936002)(8676002)(70206006)(83380400001)(426003)(70586007)(336012)(110136005)(54906003)(356005)(316002)(40480700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2023 13:19:43.7821 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c879131b-c178-4eb1-a84a-08dbfca7562f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042A7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8460 X-Patchwork-Delegate: kuba@kernel.org The field is used for setting a flood profile for lookup of KVD entry for NVE underlay. As the other uses of flood profile, this references a traffic type-to-offset mapping, except here it is not applied to PGT offsets, but KVD offsets. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/reg.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h index 3aae4467e431..8892654c685f 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h @@ -1954,6 +1954,15 @@ MLXSW_ITEM32(reg, sfmr, irif, 0x14, 0, 16); */ MLXSW_ITEM32(reg, sfmr, cff_mid_base, 0x20, 0, 16); +/* reg_sfmr_nve_flood_prf_id + * FID flooding profile_id for NVE Encap + * Range 0..(max_cap_nve_flood_prf-1) + * Access: RW + * + * Note: Reserved when SwitchX/-2 and Spectrum-1 + */ +MLXSW_ITEM32(reg, sfmr, nve_flood_prf_id, 0x24, 8, 2); + /* reg_sfmr_cff_prf_id * Compressed Fid Flooding profile_id * Range 0..(max_cap_nve_flood_prf-1) From patchwork Thu Dec 14 13:19:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13493041 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="px4CyyBM" Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2059.outbound.protection.outlook.com [40.107.244.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5768C116 for ; Thu, 14 Dec 2023 05:19:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cRJrfghbQyES+vvgW6N+OXBJVhUQXMHoc8nZteEmBPtPPyEKtKeYRWUJ5VxEnc6kpHbBSKvzyEqUPCyN8nVvOLZ/DI7eb/bz80w6/Oecjvvat48YPvhat3xHuQz0xxRKJ1M3vVLQbMrgBndtTZnEBJLeIDU8Gt0H8uOH2I78r/RaofnarzYmDV33zErNlMaK9hcdvH5rWPrO8yFTONqTkxcEb4zqzQhZnc3M6K/5xD6m5eKlJEcQLy9Qq0GjnE/owDlbWrgXoBBlavgYjI82kqnzbwAHn2Z7xnZnw0TFtgul9HuGXes9Cd4y68YqYBIV+63Tw42gFqiCNfE8mS+GAg== 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=vfMkKP5wvfPC33SQ750b3iymbxJdwcbYXzWLUYCcjNs=; b=ZvqV5dtjJsVlTsi2U1CpRMh+Q0UU/e2XWM5VXxWo75F/5oDHlMP69IQdzEAwQuk+RmL9+P96vfdEPqutfiTv3HBoiwMEQjkKZcz+GEm3udPSMNYqkjXGLYnIMb7eLPZhKRwGEPmENjrmV/9Uu25LFhV7oTpV42GixzVNi0oXARqtPZbiboekXv4RiDzL1a9zU9QfEhla74CsoF55pXMrCRzM7E7lKOElqdWR4SC3ZVNjKvNg8I28I/Mynnu46+GPHBvFpE1NG4i9/fMNoaEmqH9akcOlFuzmkXJapzCl8cD+it2RL/c/S3F0UCciQe7lj7DwgWq0sta5EVnBkvlLfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=vfMkKP5wvfPC33SQ750b3iymbxJdwcbYXzWLUYCcjNs=; b=px4CyyBM/90HrFo0rySr2mDZjPRO2amU/VgB6ym4YuolYrn5egnQuLLENh3LSjFr90Yuor7Kwa05Ouxqc2YEnHS50ri5Sti9J+Noit4NB9S7sIb3pXQ2tuRT+az/YNMvkolVZ+bpFfUS1cauWda13Pz9Uwx8tqzBYe0hi4L6qgsLwLzHDoeWYB41at6nyJhCncgdM639nwKjKMnwGVsPTdQB68R5SZNKrWPVHW3G3qu99WJ7L6WdZuppI0HHIzANlvMacKfpuZrS8usYeTRSH9Y2l+BZr4OkcQWpz0p8RbmVSlEyjRqBPWd9WONPe2EI69x6jbRSBiIMNlzXhcswpA== Received: from MW4PR03CA0005.namprd03.prod.outlook.com (2603:10b6:303:8f::10) by DM4PR12MB6446.namprd12.prod.outlook.com (2603:10b6:8:be::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.38; Thu, 14 Dec 2023 13:19:51 +0000 Received: from CO1PEPF000042A8.namprd03.prod.outlook.com (2603:10b6:303:8f:cafe::51) by MW4PR03CA0005.outlook.office365.com (2603:10b6:303:8f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.28 via Frontend Transport; Thu, 14 Dec 2023 13:19:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1PEPF000042A8.mail.protection.outlook.com (10.167.243.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26 via Frontend Transport; Thu, 14 Dec 2023 13:19:51 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 14 Dec 2023 05:19:33 -0800 Received: from localhost.localdomain (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 14 Dec 2023 05:19:31 -0800 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Ido Schimmel , Petr Machata , "Amit Cohen" , Subject: [PATCH net-next 2/3] mlxsw: spectrum_fid: Add an "any" packet type Date: Thu, 14 Dec 2023 14:19:06 +0100 Message-ID: <072ac59739e077cba93a4684b7a8a408010c8d29.1702557104.git.petrm@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042A8:EE_|DM4PR12MB6446:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a4faeb6-17b8-499c-0bc9-08dbfca75a86 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S1nUDjfc7A3fKY2+1H8jP/go8EfuTglSq5P0jBDUpdd4NmAaAwrbiyvkNeZYyfUrN/fAKhbMc4zprO6ZEL3PjvKoUQyRYOvQTWTZs489u5BRtW6hwcs2ut808aLyhaQluAu8zUD109D1HtRpE2mp0B38r28gOb3AZxxqu28+2vgrEU3Rus5URiA2xZxccSV8vP4GdWgb+rihXzHUmCY7Mk4jpR7k4GAgIFxRYT4YuVmPCEEBy98P5KM0MVRJOCTbGDlWfAyEFkEAxyr5fEEb/7NQi5Dl6PP/d4X7s02nnYfYunDZ1v6QipF6Vs0BV+ovfPZid/a+tm/7n1hILV6Rxs5aMrXITrdrYLPksnMJmRywh4Q6Al7vbWnkIJQC5IMMBB21UbiQKIDl2NaarxktJ/VrMT3RW85vpepWPGf0ObynVWzW7hBmf9aT9jMWmWsB2aDTnwRMpHFPwfS+es83izln9daKAUxSGNHvgfMybESPPWpKglLZLrbJuzd6NNuFBxBqhXpw3iWYfslza0U66jRli31+rStjxRVgJac/7q5xKB1Rd9FbZJ/iKbdjUfK/0Ebl6ttRUQhL23e0te/Ts8ST7azA6dYwkAA1aH6KjBuNyIcZ1P1j8bHCwOxvz+ceqNPyS5f65FPaJqE+joR5q09P8P/uN4yZTU6G+6xojQXUPa95SIeWFu5guu2vtSB0WivdGURR8W44Qakm7EN+9KYoUCZbBudDbwNdVDsJhAREaC62NQTu75wRg/8ER5kF X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(346002)(136003)(376002)(396003)(39860400002)(230922051799003)(186009)(64100799003)(451199024)(82310400011)(1800799012)(46966006)(40470700004)(36840700001)(82740400003)(40460700003)(7636003)(426003)(2616005)(107886003)(336012)(26005)(47076005)(8936002)(8676002)(16526019)(4326008)(110136005)(316002)(5660300002)(2906002)(36860700001)(478600001)(6666004)(54906003)(70206006)(70586007)(41300700001)(356005)(86362001)(36756003)(40480700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2023 13:19:51.0748 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2a4faeb6-17b8-499c-0bc9-08dbfca75a86 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042A8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6446 X-Patchwork-Delegate: kuba@kernel.org Flood profiles have been used prior to CFF support for NVE underlay. Like is the case with FID flooding, an NVE profile describes at which offset a datum is located given traffic type. mlxsw currently only ever uses one KVD entry for NVE lookup, i.e. regardless of traffic type, the offset is always zero. To be able to describe this, add a traffic type enumerator describing "any traffic type". Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 2 ++ drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h index 61612c413310..a0c9775fa955 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h @@ -515,6 +515,8 @@ enum mlxsw_sp_flood_type { MLXSW_SP_FLOOD_TYPE_MC, /* For RSP FIDs in CFF mode. */ MLXSW_SP_FLOOD_TYPE_NOT_UC, + /* For NVE traffic. */ + MLXSW_SP_FLOOD_TYPE_ANY, }; int mlxsw_sp_port_get_stats_raw(struct net_device *dev, int grp, diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c index 401117086235..379a911f463f 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c @@ -167,11 +167,22 @@ static const int mlxsw_sp_sfgc_not_uc_packet_types[MLXSW_REG_SFGC_TYPE_MAX] = { [MLXSW_REG_SFGC_TYPE_UNREGISTERED_MULTICAST_IPV4] = 1, }; +static const int mlxsw_sp_sfgc_any_packet_types[MLXSW_REG_SFGC_TYPE_MAX] = { + [MLXSW_REG_SFGC_TYPE_UNKNOWN_UNICAST] = 1, + [MLXSW_REG_SFGC_TYPE_BROADCAST] = 1, + [MLXSW_REG_SFGC_TYPE_UNREGISTERED_MULTICAST_NON_IP] = 1, + [MLXSW_REG_SFGC_TYPE_IPV4_LINK_LOCAL] = 1, + [MLXSW_REG_SFGC_TYPE_IPV6_ALL_HOST] = 1, + [MLXSW_REG_SFGC_TYPE_UNREGISTERED_MULTICAST_IPV6] = 1, + [MLXSW_REG_SFGC_TYPE_UNREGISTERED_MULTICAST_IPV4] = 1, +}; + static const int *mlxsw_sp_packet_type_sfgc_types[] = { [MLXSW_SP_FLOOD_TYPE_UC] = mlxsw_sp_sfgc_uc_packet_types, [MLXSW_SP_FLOOD_TYPE_BC] = mlxsw_sp_sfgc_bc_packet_types, [MLXSW_SP_FLOOD_TYPE_MC] = mlxsw_sp_sfgc_mc_packet_types, [MLXSW_SP_FLOOD_TYPE_NOT_UC] = mlxsw_sp_sfgc_not_uc_packet_types, + [MLXSW_SP_FLOOD_TYPE_ANY] = mlxsw_sp_sfgc_any_packet_types, }; struct mlxsw_sp_fid *mlxsw_sp_fid_lookup_by_index(struct mlxsw_sp *mlxsw_sp, From patchwork Thu Dec 14 13:19:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13493042 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="eCRBgo4b" Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2060.outbound.protection.outlook.com [40.107.101.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 289D2B9 for ; Thu, 14 Dec 2023 05:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mN/mkgVaCm0lwIivWPlqDVi0exb/ZlpH1u4UwcL2FMih+dTNhhBa8gqbqfPVaeRWWMeZ4N36sshL1l4r7f3477WfAF32qENHTsMITGEYlrnamFjOzgzqJ17cMO6c4bURtAUMM35z10xC4m68T7UUSIRRPT94FcfnBatQwxw3Ec6QIcYmhJ6TrQU1ug7FpaUEGQkW5W7QdBidcecfkkz9GEfmnfY+tA0kPpM9kHJAfbqg77eQODR0eWM9vCRlqREpPQyg5cuj4I5UVypD6uTUx/snaDumlt9amr3p9YtP0FYkxz5acHMH3jNEWifCiTPV1l9axtSkSzXvGKdJsALx/g== 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=OYg1bLUv6tqcZq81htXP/JliRQaiURrSmJl79t5YYWE=; b=Bq40XDXPnnCdfrDD1Y5VjbaMJ3tuw2xFm9ZKWkq//N9OIGSIaDeAZ1rUkqwhVxAlJn8RofnZ76NQUfTPcSTnqY8gp3q3GkhQ+veu7jUJE0BUCUfQchp9J7Frsn9l5aH6GZnzAvIX5ZSUpVIfZfd5Pc65aZnMyzrjYs/U1Zs8unWaFwQvFYWRJqBqrLrjZ9DmoRvE5LjRaU3Pmsm/i9H69v+nRzr1XpeteTYkCT95B7yT4hJkcA2D5xvnvGlipCd3NdYHITUnERmVXBUqKPWIyME/7DvVjkmzd3adC1OQ1Y7lZoSmlG1ymEe35DPHsZqpzmPDvUS+29OLFWwi0izLxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=OYg1bLUv6tqcZq81htXP/JliRQaiURrSmJl79t5YYWE=; b=eCRBgo4bpYCpK0klvk68j3sf9/bgoKtQCDlRmjdpVQlbyFy+wxb/ohzCRHli7z+rkrWchCq1A4kxSTYAoVYveNPyMoKOTp1Nqy9ecLHmcBtOizpwMpkXjHfP8tVXVAKwxnSrsEvHaDTP2/Oqf3tHAqsfkSOcuS88SBdLXOHcUDQUR5F5aAcicNCa/009XEnxl09dpuFSZltYVFw2l0KMQhVeCYGb0B7PAtLAdlvcgfmo4NhvPOW2w1VmV7Ax24Gq4X52RPtHOzz7No3pWcf4EyjiMT7qAlpvYfj9iNFh1uu2o/01Xd/2KSDnflcpgcch9QmJSkGroupM7p/evaB0oQ== Received: from MW4PR03CA0012.namprd03.prod.outlook.com (2603:10b6:303:8f::17) by CY5PR12MB6082.namprd12.prod.outlook.com (2603:10b6:930:2a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.28; Thu, 14 Dec 2023 13:19:52 +0000 Received: from CO1PEPF000042A8.namprd03.prod.outlook.com (2603:10b6:303:8f:cafe::61) by MW4PR03CA0012.outlook.office365.com (2603:10b6:303:8f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26 via Frontend Transport; Thu, 14 Dec 2023 13:19:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1PEPF000042A8.mail.protection.outlook.com (10.167.243.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26 via Frontend Transport; Thu, 14 Dec 2023 13:19:52 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 14 Dec 2023 05:19:36 -0800 Received: from localhost.localdomain (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 14 Dec 2023 05:19:33 -0800 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Ido Schimmel , Petr Machata , "Amit Cohen" , Subject: [PATCH net-next 3/3] mlxsw: spectrum_fid: Set NVE flood profile as part of FID configuration Date: Thu, 14 Dec 2023 14:19:07 +0100 Message-ID: <35da729781525163c9009c662d61757cef338283.1702557104.git.petrm@nvidia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042A8:EE_|CY5PR12MB6082:EE_ X-MS-Office365-Filtering-Correlation-Id: 7bda9f05-3c32-4841-64ac-08dbfca75b61 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fTdijEJzRi8eFQceayeyqGdtmEnhJ2xlOoIw6mI1J98y8TLrN/LYWhTntroEBZ+9PSKhNLD7OII6DgAAyNnaB6b5eTwx9MFvTxGL3EVWBSSn+qpwN7bjbJ4tdIgsxmDy/K4soQcKi1jYuFKfX3DqFo1Nryt+DR2neIzQ8AnAEBBWhjSIB7Bt+quLh3Pw8PNWbftpPAzAvgN9E7W+n0FA6hI9Hr1o4MjuQ8x0Mv1PkW6GryWYK8jFtVBnYYvatmQ1rKytcZjD48XpCrS3qAInfZ/j5HssyPVXzQpmE9u2+Cz+z9p3G78Rdbs0z/f0KlBE8HvEbeu0+aitYlQqMv+uIeZVIp3Au6ydtC0Gh/+g7xvulPfMuqcr/w2cYHlp19CQUjF0orsugxQ7QqIWbM11WM29Ex2FSpKo2ytOlfZxXGv+BsC+0KYeH93XqTQYO3bu6YtlsmvbLf5mU+9gYk+tdsZdrsrP08Dgs57tNwRo+oOuhOPg1h8WrTliDMDmVQQ1blmPUhk+cjyXGDoxpSU4A3xPXkEiv3BxL6ui85KvE5JkMNtgwtoMrDX8QyOMSlA+qGoG28aDFpcD+hgN6/pwSuG9L2QykUL8WDopt8EDi5QqHqhzjU13MnSozgTcDYFSMy/9bs7EfFCG7oaLcX7Oi6wa4pIOJfk/pmOLSbsLc2+nJ+P/on3QeeeTt7FAgDi1GF0kYcG8urgLDy2EKRFVFae5fAi3KLzEJ2f+E6SovusJQQjsA16LSLjQtM6wz6t/ X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(346002)(396003)(136003)(376002)(230922051799003)(82310400011)(451199024)(186009)(1800799012)(64100799003)(40470700004)(36840700001)(46966006)(40480700001)(16526019)(26005)(426003)(336012)(107886003)(2616005)(40460700003)(82740400003)(356005)(86362001)(36756003)(7636003)(47076005)(5660300002)(4326008)(36860700001)(6666004)(70206006)(110136005)(316002)(8676002)(8936002)(54906003)(41300700001)(2906002)(478600001)(70586007);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2023 13:19:52.5123 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7bda9f05-3c32-4841-64ac-08dbfca75b61 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042A8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6082 X-Patchwork-Delegate: kuba@kernel.org The NVE flood profile is used for determining of offset applied to KVD address for NVE flood. We currently do not set it, leaving it at the default value of 0. That is not an issue: all the traffic-type-to-offset mappings (as configured by SFFP) default to offset of 0. This is what we need anyway, as mlxsw only allocates a single KVD entry for NVE underlay. The field is only relevant on Spectrum-2 and above. So to be fully consistent, we should split the existing controlled ops to Spectrum-1 and Spectrum>1 variants, with only the latter setting the field. But that seems like a lot of overhead for a single field whose meaning is "everything is the default". So instead pretend that the NVE flood profile does not exist in the controlled flood mode, like we have so far, and only set it when flood mode is CFF. Setting this at all serves dual purpose. First, it is now clear which profile belongs to NVE, because in the CFF mode, we have multiple users. This should prevent bugs in flood profile management. Second, using specifically non-zero value means there will be no valid uses of the profile 0, which we can therefore use as a sentinel. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Ido Schimmel --- .../net/ethernet/mellanox/mlxsw/spectrum_fid.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c index 379a911f463f..65562ab208b3 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c @@ -117,6 +117,7 @@ struct mlxsw_sp_fid_ops { enum mlxsw_sp_fid_flood_profile_id { MLXSW_SP_FID_FLOOD_PROFILE_ID_BRIDGE = 1, MLXSW_SP_FID_FLOOD_PROFILE_ID_RSP, + MLXSW_SP_FID_FLOOD_PROFILE_ID_NVE, }; struct mlxsw_sp_fid_flood_profile { @@ -560,6 +561,8 @@ static void mlxsw_sp_fid_fid_pack_cff(char *sfmr_pl, mlxsw_reg_sfmr_cff_mid_base_set(sfmr_pl, pgt_base); mlxsw_reg_sfmr_cff_prf_id_set(sfmr_pl, fid_family->flood_profile->profile_id); + mlxsw_reg_sfmr_nve_flood_prf_id_set(sfmr_pl, + MLXSW_SP_FID_FLOOD_PROFILE_ID_NVE); } static u16 mlxsw_sp_fid_rfid_fid_offset_cff(struct mlxsw_sp *mlxsw_sp, @@ -1321,6 +1324,20 @@ struct mlxsw_sp_fid_flood_profile mlxsw_sp_fid_rsp_flood_profile_cff = { .profile_id = MLXSW_SP_FID_FLOOD_PROFILE_ID_RSP, }; +static const struct mlxsw_sp_flood_table mlxsw_sp_fid_nve_flood_tables_cff[] = { + { + .packet_type = MLXSW_SP_FLOOD_TYPE_ANY, + .table_index = 0, + }, +}; + +static const +struct mlxsw_sp_fid_flood_profile mlxsw_sp_fid_nve_flood_profile_cff = { + .flood_tables = mlxsw_sp_fid_nve_flood_tables_cff, + .nr_flood_tables = ARRAY_SIZE(mlxsw_sp_fid_nve_flood_tables_cff), + .profile_id = MLXSW_SP_FID_FLOOD_PROFILE_ID_NVE, +}; + static bool mlxsw_sp_fid_8021q_compare(const struct mlxsw_sp_fid *fid, const void *arg) { @@ -2422,6 +2439,7 @@ static const struct mlxsw_sp_fid_flood_profile *mlxsw_sp_fid_flood_profiles[] = { &mlxsw_sp_fid_8021d_flood_profile, &mlxsw_sp_fid_rsp_flood_profile_cff, + &mlxsw_sp_fid_nve_flood_profile_cff, }; static int