From patchwork Thu Oct 31 12:58:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13857888 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2070.outbound.protection.outlook.com [40.107.92.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DF311974F4 for ; Thu, 31 Oct 2024 13:00:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730379609; cv=fail; b=Q7oVv+wTzWvFYOBmZ2Abt+bZ6Is1THdryEyGza+JmNgIe83TvlNaZBBN+3Zcn3PvK3njpXJrSi4NDp0Gwrrc3yrMnrd1/axNXBPH3S2HeZl22qf5YMPonVDynjtPRhnILdlATZNsxsud5LvtWQGgE1ZSAVu31c4H5/QlAR0Nt8k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730379609; c=relaxed/simple; bh=IzBA21ZoUNWRSmEhzaqMsSKfu/H7uAmX5jeilR+1fo0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nPkhSlEUmRYuLNbXXS+VIyBrcGC5BhRvKipis3D/3NakmhC5+2UeeLfPHblQpOFNouBopE/kDDRCtOHjukQTmaka//FrBQwI8uHD80o+qXtQcibn9QIKnhW2g5QZ+SoUtzj3SxEaA/qGwMC8ENgSdlKNxNqyfvdUGaS+FWXcxPk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=RcJ01zsh; arc=fail smtp.client-ip=40.107.92.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="RcJ01zsh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hE4AvTFfQNmlj2JxtD58b4hwx74XHc0d0pR1adB2C4tPFfB+L02c761gN5IvV7H8bP9r8sBo45SA50/L86OK4y7cDBNvY5tBxZsffVo7TxgXzJY9H//JmVN9+XJO0gPm62xbcMkHdUIzSqqagaVRppO9NkXZ8PgFOg5YlJTSkQKy/mSrLPuuS2MbmPjQQWEtq/h/YznIriP89t9kZd8/eUiZwusRPPXWyQG/oj27McGWvLlOsSRwxlBEIO4g93EcPmfvp352KWkPvIxW2xczlwhxPRFAAlMMJ/he7epaIjV00MR1A+g0ihHbWKbiRnlXR9Y9VVIxrXWfQwWekRnwsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=gY4hlquz3YL9+qExnqbiMea5By00s5wrPkZU6MffK7I=; b=fF9pFBG4Kmd1gftj/eSTC+reOdk1t60UvIXJLxuBO7b+KlFzZVvEBl0p5ApdikStkuMPzCEm50QGQz0kmu1iycDiJse2j6F0CDZVo6ituA+tPFaP8MIz1WF2X7GIiQL45E4X9zb6ZLhKyrXC3GOo84LJ4mDPh6EwMitVNI+IWiHHF9T2oxXCwoTser9pDy+9nHjNXg/Dw1CYAmCbC/LT+7ToYHqv9FQ8M2MHpqFOcDHxa4mNWeKuRfllHNEoga4ixc/230QI5j5LuXbIxV9sr0UrAvxR/2aQjR5CEUUNtb5g0tnQgrCSQ8x5oncZ6c5o7jZMa789F1g/2wg/I3psOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=gY4hlquz3YL9+qExnqbiMea5By00s5wrPkZU6MffK7I=; b=RcJ01zshv132cVlTX/Sg4PsWaPzFCWlJVishqHBAngV4AnxWVDkB4xSMpEjCqxPoS+UZy0ZpCTAQlRNGUbvC1Ib3mQF8ZbpFYqfmVpoD6RViu2SKer2PL9BmweOvVYfx6k116hKETOnTk2w/GDhv9xX1Vdxf/NkGhKPgXR54ajs2H6BhwVE1ZMwyJBse+CQex/w6XfSyDgvX96QHnPclthoLySsS/K7eUG057mBJTigyCn6lXX31COk/h1wf/cLUzBILmolTTVrQDy6w+39Ehb0bGfX4A5Fe066naT9Hcnp1IGVet524bA+0BwVHBApkCjaholadlJV6llIa8CH14Q== Received: from CH3P221CA0005.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:1e7::29) by BL1PR12MB5970.namprd12.prod.outlook.com (2603:10b6:208:399::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 13:00:00 +0000 Received: from DS2PEPF0000343F.namprd02.prod.outlook.com (2603:10b6:610:1e7:cafe::1c) by CH3P221CA0005.outlook.office365.com (2603:10b6:610:1e7::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.23 via Frontend Transport; Thu, 31 Oct 2024 13:00:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DS2PEPF0000343F.mail.protection.outlook.com (10.167.18.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.16 via Frontend Transport; Thu, 31 Oct 2024 12:59:59 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 31 Oct 2024 05:59:40 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 31 Oct 2024 05:59:39 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 31 Oct 2024 05:59:37 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , "Andrew Lunn" CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Cosmin Ratiu , Carolina Jubran , Tariq Toukan Subject: [PATCH net-next 1/5] net/mlx5: Rework esw qos domain init and cleanup Date: Thu, 31 Oct 2024 14:58:52 +0200 Message-ID: <20241031125856.530927-2-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241031125856.530927-1-tariqt@nvidia.com> References: <20241031125856.530927-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF0000343F:EE_|BL1PR12MB5970:EE_ X-MS-Office365-Filtering-Correlation-Id: ea0d5e5e-cc18-449f-ad70-08dcf9abeda2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: qJ92a7wBivO8RDVobl9MNMGTBf9n7/QM2hnBg/Nza9ghsWrlPj5l9YGwfy0r4EM3dXj9eavsm+OPBukMOi28TNpTkIJPf5YdFjUPA+acT+g81eI/vW7rWxdJyZeWZA+IU01dE9AyEJ8j1yD4tRLEEgEfUPwqpi48mJclkNPos3Nja0l2hF8/nWyy7k3ArsPWnZg5/qNqI6djR8kVmSN7Xb8iWoJi6CdMSKnDQU4O2VVETQKZ9xlcoSh0Eps4ORDIKanXBeFYQY07Uz2443Zv0oqag1AZfMPWmgfRo5B8sAKLykJE37dnZ1TgTGtswB8/i4O3Rs/wdUzSZ3/iVkcmYqmw3MMLwbAMJLEGJE+O7cyT4qleu9Jrtt07GvWL/8CFtYKC+H1JQ6F6ajHxGCGvq3MKq3v8B09m2MJKJEwVfRyAZCpdijM0wsZQKPSs7Zd6+F3W7QTQdNxbGZCCnPNGaHdb4IeB8AaimfkApzK87RPUKzR9plJ1WyPSzO+tueAYewHRVnz1PDvhkpnnrSA0WQX7XxvRf+xDpobb1C0eZMbFj2B1IPBvvGvUagXwjFntnwUghMl+YXXNzMa0elNbLX1bKIFwT7sxL2MKI1P1cQa+aTqbaqW5+gI/Sb4lU4IgFStlkiQcSJG8kzAXQTVN/91Xe28m5HxsHWvH679ZD0hUX80I3Us6GDUYJv3wwLHvOFzREUuOhU+/wzVJ1eXrUi3ZWB/FJzaPYewUJ1q1iWLGQaXFDLUXTU5rLxjXJJAP9+YG8m5y6MMQd6Amw8INXFVUNKytwGbqBi9NiV8/2NRRgB0eoNQO+l7vSPvKHq13H2bmWLYap1OlYTWACQNhqTQ66H/cWbccIss5kK+980z/DrNGYpqYvSbedrDFlua31DmG66gJ2IEsMEBm5m/z/3L44FueEkWn7I7A4qtCoNGlvXv+UFBCodCy6lzc3pKZueCTAyaOuovqeFqoKwvQ2WvpOAgIQT4H2vYN777A+Mi551liXVUq7CYBIDIhPGltgkxbBH+N9acHfrBD3Yn9t3UrxwgkgQUNAR2Jo/Lv+bAj8a+zdPWBzCZi7YlBXiCsvwre0R9ON8ydWqqdV5P9PNtvr3oPLMrI4T7nNMoz++bpIQzpsxphVt9Onlb4v58zaU9xhc/CcHvIyICOyjdH6RKO6oSnCWg39VCKtIsWqA7a9UI1TwfTSR+UOPYNdCLw7Wjdlzsb6VeySCyj0psc0ynxClkMDpq1744l7pjFbelRRM/JYVK1jpf0lhA4xfUQQwsJ56yr8VyRdcCsY7bPpfwiSPYmDPwZZDsxvgh1+HweDCfyVufkKPyB90M5ntjzfk0WRl8IZQ3/Qa2o2yb8O/4DNKj94X4maXh0Vzp7MRTU1mRMWKgrqFvQRpG9qBKRuv6Sg7FOOLX/KrtkKYAp5Q== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 12:59:59.9946 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea0d5e5e-cc18-449f-ad70-08dcf9abeda2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF0000343F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5970 X-Patchwork-Delegate: kuba@kernel.org From: Cosmin Ratiu The first approach was flawed, because there are situations where the esw mode change fails, leaving the qos domain as NULL. Various calls into the QoS infra then trigger a NULL pointer access and unhappiness. Improve that by a combination of: - Allocating the QoS domain on esw init and cleaning it up on teardown. - Refactoring mode change to only call qos domain init but not cleanup. - Making qos domain init idempotent - not change anything if nothing needs changing. Together, these should guarantee that, as long as the memory allocations succeed, there should always be a valid qos domain until the esw cleanup, no matter what mode changes happen (or failures thereof). Fixes: 107a034d5c1e ("net/mlx5: qos: Store rate groups in a qos domain") Signed-off-by: Cosmin Ratiu Reviewed-by: Carolina Jubran Signed-off-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 3 +++ .../net/ethernet/mellanox/mlx5/core/eswitch.c | 16 +++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c index 7e7f99b38a37..940e1c2d1e39 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c @@ -951,6 +951,9 @@ static int esw_qos_devlink_rate_to_mbps(struct mlx5_core_dev *mdev, const char * int mlx5_esw_qos_init(struct mlx5_eswitch *esw) { + if (esw->qos.domain) + return 0; /* Nothing to change. */ + return esw_qos_domain_init(esw); } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index 09719e9b8611..cead41ddbc38 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -1485,7 +1485,7 @@ int mlx5_eswitch_enable_locked(struct mlx5_eswitch *esw, int num_vfs) err = mlx5_esw_qos_init(esw); if (err) - goto err_qos_init; + goto err_esw_init; if (esw->mode == MLX5_ESWITCH_LEGACY) { err = esw_legacy_enable(esw); @@ -1495,7 +1495,7 @@ int mlx5_eswitch_enable_locked(struct mlx5_eswitch *esw, int num_vfs) } if (err) - goto err_esw_enable; + goto err_esw_init; esw->fdb_table.flags |= MLX5_ESW_FDB_CREATED; @@ -1509,9 +1509,7 @@ int mlx5_eswitch_enable_locked(struct mlx5_eswitch *esw, int num_vfs) return 0; -err_esw_enable: - mlx5_esw_qos_cleanup(esw); -err_qos_init: +err_esw_init: mlx5_eq_notifier_unregister(esw->dev, &esw->nb); mlx5_esw_acls_ns_cleanup(esw); return err; @@ -1640,7 +1638,6 @@ void mlx5_eswitch_disable_locked(struct mlx5_eswitch *esw) if (esw->mode == MLX5_ESWITCH_OFFLOADS) devl_rate_nodes_destroy(devlink); - mlx5_esw_qos_cleanup(esw); } void mlx5_eswitch_disable(struct mlx5_eswitch *esw) @@ -1884,6 +1881,11 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev) if (err) goto reps_err; + esw->mode = MLX5_ESWITCH_LEGACY; + err = mlx5_esw_qos_init(esw); + if (err) + goto reps_err; + mutex_init(&esw->offloads.encap_tbl_lock); hash_init(esw->offloads.encap_tbl); mutex_init(&esw->offloads.decap_tbl_lock); @@ -1897,7 +1899,6 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev) refcount_set(&esw->qos.refcnt, 0); esw->enabled_vports = 0; - esw->mode = MLX5_ESWITCH_LEGACY; esw->offloads.inline_mode = MLX5_INLINE_MODE_NONE; if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, reformat) && MLX5_CAP_ESW_FLOWTABLE_FDB(dev, decap)) @@ -1934,6 +1935,7 @@ void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw) esw_info(esw->dev, "cleanup\n"); + mlx5_esw_qos_cleanup(esw); destroy_workqueue(esw->work_queue); WARN_ON(refcount_read(&esw->qos.refcnt)); mutex_destroy(&esw->state_lock); From patchwork Thu Oct 31 12:58:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13857889 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2067.outbound.protection.outlook.com [40.107.237.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1730113A869 for ; Thu, 31 Oct 2024 13:00:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730379612; cv=fail; b=nzZDkT+ij6b1C7qWg2w2GHbRcYap4s3yHNT1LnNyR93vwTtE0UYhhpGX7p+LIQ0cW1oEnmY9AlglrsIRhzoVyHr1DiekchW/KYGKMNwasQQqJfMW1o2TCuGh5+OtEgpkag+5MVbH2S4K6wOT7OZ+Gkxl5hKYvUBmp/pi8pGRvmM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730379612; c=relaxed/simple; bh=KTlyehCMoteILaO4no1dxh5NJGJ0ps0QTgbrCGLfj0k=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sxS6GufymH6fUxZJC7EX0G0VU7XTzpvCU225kGP7bTcdCesbSurvBa9AOzfl8xmkG9ct0cGpwZhZ0GXdwct0IvxgE0HwPGxgxjVZHHCQIgTHErEBfd8Y83z71Yd5jfJJUT0zptqSAwCyZw+n773fr3Py8pHDwYSSTUYCeC4TaWw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=LwTQmRXr; arc=fail smtp.client-ip=40.107.237.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="LwTQmRXr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=y6H9btShBELhiP3FsC623kiHgzdzxzxbkXW0Jj1AI+9djggy3TYTchSycdlpe8zu9eDMdIV2pTaCtnZ8dOe4JNO/Kku8F6dRsd84upCG2TG/Zm7HcuFeQ33luGflvKK3L79bCz8W2zAuJAcMjgHw/XiuQnkxu/RaXWJthHWWzHrxIlnJxMNm/OAlAcRmM13PaF6MzhxQoApy4zKaBRQsegFSmqATjZ25SGj891NJM4h1eo7FJe88Er+KMiMsBPdP0aNgcUdBS53OTrI9kCQ/5hCNAs9oZY9A94QXdXwC1/3GJac5QTLaTLfoIuZJqGYCVotLTUMp2pcRCUIgOtdTfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=J3aH6lmSvTGn4+vS3tK6im0pJRifgtrLtUAApFnhPss=; b=ALJIA9u4Y5EKJoC53bmvn1/4U4J9KY9iCu433Hx1mTDOvwlpt/nTb4RGnjwcOusJ4BvRb+iKN6N+1mdwVWRoqzp87TRPYC81ThT0c2TLy0ZH+rpwPhDQCfnfrCeNXlpmdP1ChakAqZTf40hPv7/qwkIRNfd9mJQyptTGFsuRbGnuM1GfxkOX575mI40SeT+fVQd/RJiPskl2v3vQNzbNxL2Pxqb+EsqwBusUNIC9wTchgIROiIoCFOn99tEBCiXZOdln4tNXmk9aJq2+Jxm2NNbLJA9+N32G2+s868/Ze+RlxUdhEhNld3F7U3L/c8pJGjSdBe6DQCijr2P1leuDmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=J3aH6lmSvTGn4+vS3tK6im0pJRifgtrLtUAApFnhPss=; b=LwTQmRXr0Bp+HCzdZTVZJhWGAbhkPKD5fLKVJWjNvLW5rWijOG9eAWD5RiOb989H0he2rJ5MZJZtlStwsJn9DIufiqZ2+uqpNJBlc1AMkedt6X5Yp8Uy7Ua8aVKUPBvFIu9E0s+oe7lpKvPWBEV9StrcpT87jm6gvQU/oWYG9OKVXPb6EoqRx/thyYhy1rKmkP16F5ggi1ZWoema7fIQKV9+lz+Gl1FYDPyWsPuRgWr/kDUCYocWxaNJWX24BNzvG+lr3a7DhF2ix3OerMSIiAACHzLmMpj940YwqzuzWxQrJbprIcv7wj3SpmBxwc3L3VH6s2lISFYEKiLg8EKsTA== Received: from CH3P221CA0024.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:1e7::33) by CH2PR12MB4199.namprd12.prod.outlook.com (2603:10b6:610:a7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 13:00:01 +0000 Received: from DS2PEPF0000343F.namprd02.prod.outlook.com (2603:10b6:610:1e7:cafe::dc) by CH3P221CA0024.outlook.office365.com (2603:10b6:610:1e7::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.23 via Frontend Transport; Thu, 31 Oct 2024 13:00:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DS2PEPF0000343F.mail.protection.outlook.com (10.167.18.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.16 via Frontend Transport; Thu, 31 Oct 2024 13:00:01 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 31 Oct 2024 05:59:43 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 31 Oct 2024 05:59:42 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 31 Oct 2024 05:59:40 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , "Andrew Lunn" CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Yevgeny Kliteynik , Tariq Toukan Subject: [PATCH net-next 2/5] net/mlx5: DR, moved all the SWS code into a separate directory Date: Thu, 31 Oct 2024 14:58:53 +0200 Message-ID: <20241031125856.530927-3-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241031125856.530927-1-tariqt@nvidia.com> References: <20241031125856.530927-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF0000343F:EE_|CH2PR12MB4199:EE_ X-MS-Office365-Filtering-Correlation-Id: 630a449e-dcf0-477d-6ac9-08dcf9abee42 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: UbUhari+kvxDrqqFf4wss4l8kJBgW2ZB3/VvwM6qRKO95t7m3gIdw6nX2RbDPkegah4IbtoMxu2V1qGPkJBLkI3p987YgcvMOXwc+Xeajurah4qz0zaipRMoHPB7g3Qi3h9PY06uyvkf0YVDmXpmFFiaaYBn/FZw0COum98003WmqFtjmk4L9x6lT7GRrd9g9kqXkIzNzCpG4UXz3Kl/oFySzscTkfdtS9aFHnz+WFrGQTp1wZj9lmpawAjdRFwTUzboLlVFuwzUTvkRADYr8kf2/AUjZvawTzTlhH/ZirvZp8TXDDdZLbrWAr4Ny8KihJlIVNHh4OFMPRB4KhJxvF1e60tmaAmCRaG1iDtLcVS0GQp+/LqtXmwc92CKgyjPPUaXvWzufVW/opkGZAd6NPyEPLmFTiQroBIqxpOdMAiPJmSXz0w8lEz9FFYV2SDnJrxgA84cr6TQcJfLxHMenWhWfkeNCADM1YrkL+SIKKazBOj7isy6sFA1cbE5hfSkvzcQlCdwqAN1XyjxNKs8VQW53fUcKO1+DFrhLIuKhm3BemKHf2kKq27HKUk2Ea0AF0lUcoesVP2jpnV0Urq6XG6DEFC4lsatk4qrt3d4xJterwyg8IBnDFe4//brJw5Tda+4Y9cgRywPhGaTCGDDaQ0Ki9auFc2jeih6iza2DBes8ZYaIJOVptWw6RLlQJzA3AsfvXG8tEa+dGYkRTaQCrexw9N4RUyuDr48h+Jm5XOn7hhxT+38RYJKfqyQ2f2IgBB0UFe2aS8J28fAMRGNAZQRnx4PwcW7sBcxBpYmj2x3YjAvo8VNU+2wGepa1/g4mdBvBu/XTjbq+rubE3kR3uLU5iTTtCHniBQ5cwO/S4FhTllQeSR2trOsH6yTr5j2NWiiHg/eMg1OF3YDiwgWLPMAS9twcd/G6epoiAoWfnDJzD75vxPv9FUATAn3tBjfCfONLPqHv+MJbZplqJS1N/sAAN61ou6le3M7qHh6qwyitki31mIMYkxxYzEe1wRZ2Mb/q7knrYEobhwPjGot+eCEP+yvHY1gwysyc4ckh5/LrrvKv0OVcWvHTtl9paIC+tD9QJ+IxcBzsX/vKTx14xWpoQ+x6nH1wgTtmOiAXO8lNh7gx4BIl4o4jocHDMlqwilx4V0QwthQPeuElBGMHUdorRDPoIQ9OWTgV7fpwM1LGmO8h8RBEGG/suc/WJJ1bwXP/gU4fA+Yw7TRiGwCYrM//qAnzdqNsc3tqUDF/Mjp065UMEt+1VYP3jK/O1gMscvn/4ntnZp/ZZNHa21nf8U4IU/7l0VCkN+c1P0z88QDcYg+2fQ0jK89aEh3PzgKpNUO6CLsTRD0g9hUfvbC9Cc7MYkY+CvdSdcHOXpC9A03iHHuK9hVt50emnqyvqzTRfNM8OdbWXuXUbmdWArr4g== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 13:00:01.0572 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 630a449e-dcf0-477d-6ac9-08dcf9abee42 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF0000343F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4199 X-Patchwork-Delegate: kuba@kernel.org From: Yevgeny Kliteynik After adding HWS support in a separate folder, moving all the SWS code into its own folder as well. Now SWS and HWS implementation are located in their appropriate folders: - steering/sws/ - steering/hws/ Signed-off-by: Yevgeny Kliteynik Signed-off-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/Makefile | 33 +++++++++++++------ .../net/ethernet/mellanox/mlx5/core/fs_core.h | 2 +- .../ethernet/mellanox/mlx5/core/lib/smfs.h | 4 +-- .../mlx5/core/steering/{ => sws}/dr_action.c | 0 .../mlx5/core/steering/{ => sws}/dr_arg.c | 0 .../mlx5/core/steering/{ => sws}/dr_buddy.c | 0 .../mlx5/core/steering/{ => sws}/dr_cmd.c | 0 .../mlx5/core/steering/{ => sws}/dr_dbg.c | 0 .../mlx5/core/steering/{ => sws}/dr_dbg.h | 0 .../mlx5/core/steering/{ => sws}/dr_definer.c | 0 .../mlx5/core/steering/{ => sws}/dr_domain.c | 0 .../mlx5/core/steering/{ => sws}/dr_fw.c | 0 .../core/steering/{ => sws}/dr_icm_pool.c | 0 .../mlx5/core/steering/{ => sws}/dr_matcher.c | 0 .../mlx5/core/steering/{ => sws}/dr_ptrn.c | 0 .../mlx5/core/steering/{ => sws}/dr_rule.c | 0 .../mlx5/core/steering/{ => sws}/dr_send.c | 0 .../mlx5/core/steering/{ => sws}/dr_ste.c | 0 .../mlx5/core/steering/{ => sws}/dr_ste.h | 0 .../mlx5/core/steering/{ => sws}/dr_ste_v0.c | 0 .../mlx5/core/steering/{ => sws}/dr_ste_v1.c | 0 .../mlx5/core/steering/{ => sws}/dr_ste_v1.h | 0 .../mlx5/core/steering/{ => sws}/dr_ste_v2.c | 0 .../mlx5/core/steering/{ => sws}/dr_table.c | 0 .../mlx5/core/steering/{ => sws}/dr_types.h | 0 .../mlx5/core/steering/{ => sws}/fs_dr.c | 0 .../mlx5/core/steering/{ => sws}/fs_dr.h | 0 .../core/steering/{ => sws}/mlx5_ifc_dr.h | 0 .../steering/{ => sws}/mlx5_ifc_dr_ste_v1.h | 0 .../mlx5/core/steering/{ => sws}/mlx5dr.h | 0 30 files changed, 26 insertions(+), 13 deletions(-) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_action.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_arg.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_buddy.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_cmd.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_dbg.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_dbg.h (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_definer.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_domain.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_fw.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_icm_pool.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_matcher.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_ptrn.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_rule.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_send.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_ste.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_ste.h (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_ste_v0.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_ste_v1.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_ste_v1.h (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_ste_v2.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_table.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/dr_types.h (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/fs_dr.c (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/fs_dr.h (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/mlx5_ifc_dr.h (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/mlx5_ifc_dr_ste_v1.h (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/{ => sws}/mlx5dr.h (100%) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Makefile b/drivers/net/ethernet/mellanox/mlx5/core/Makefile index 5912f7e614f9..42411fe772ab 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/Makefile +++ b/drivers/net/ethernet/mellanox/mlx5/core/Makefile @@ -109,16 +109,29 @@ mlx5_core-$(CONFIG_MLX5_EN_TLS) += en_accel/ktls_stats.o \ en_accel/fs_tcp.o en_accel/ktls.o en_accel/ktls_txrx.o \ en_accel/ktls_tx.o en_accel/ktls_rx.o -mlx5_core-$(CONFIG_MLX5_SW_STEERING) += steering/dr_domain.o steering/dr_table.o \ - steering/dr_matcher.o steering/dr_rule.o \ - steering/dr_icm_pool.o steering/dr_buddy.o \ - steering/dr_ste.o steering/dr_send.o \ - steering/dr_ste_v0.o steering/dr_ste_v1.o \ - steering/dr_ste_v2.o \ - steering/dr_cmd.o steering/dr_fw.o \ - steering/dr_action.o steering/fs_dr.o \ - steering/dr_definer.o steering/dr_ptrn.o \ - steering/dr_arg.o steering/dr_dbg.o lib/smfs.o +# +# SW Steering +# +mlx5_core-$(CONFIG_MLX5_SW_STEERING) += steering/sws/dr_domain.o \ + steering/sws/dr_table.o \ + steering/sws/dr_matcher.o \ + steering/sws/dr_rule.o \ + steering/sws/dr_icm_pool.o \ + steering/sws/dr_buddy.o \ + steering/sws/dr_ste.o \ + steering/sws/dr_send.o \ + steering/sws/dr_ste_v0.o \ + steering/sws/dr_ste_v1.o \ + steering/sws/dr_ste_v2.o \ + steering/sws/dr_cmd.o \ + steering/sws/dr_fw.o \ + steering/sws/dr_action.o \ + steering/sws/dr_definer.o \ + steering/sws/dr_ptrn.o \ + steering/sws/dr_arg.o \ + steering/sws/dr_dbg.o \ + steering/sws/fs_dr.o \ + lib/smfs.o # # HW Steering diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h index b30976627c6b..bad2df0715ec 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h @@ -37,7 +37,7 @@ #include #include #include -#include +#include #define FDB_TC_MAX_CHAIN 3 #define FDB_FT_CHAIN (FDB_TC_MAX_CHAIN + 1) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/smfs.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/smfs.h index 452d0df339ac..404f3d4b6380 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/smfs.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/smfs.h @@ -4,8 +4,8 @@ #ifndef __MLX5_LIB_SMFS_H__ #define __MLX5_LIB_SMFS_H__ -#include "steering/mlx5dr.h" -#include "steering/dr_types.h" +#include "steering/sws/mlx5dr.h" +#include "steering/sws/dr_types.h" struct mlx5dr_matcher * mlx5_smfs_matcher_create(struct mlx5dr_table *table, u32 priority, struct mlx5_flow_spec *spec); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_action.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_action.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_arg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_arg.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_arg.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_buddy.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_buddy.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_buddy.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_buddy.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_cmd.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_cmd.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_dbg.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_definer.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_definer.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_definer.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_definer.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_fw.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_fw.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_fw.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_fw.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_matcher.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ptrn.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ptrn.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ptrn.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ptrn.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_rule.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_rule.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v0.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste_v0.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v0.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste_v0.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste_v1.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste_v1.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste_v1.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste_v1.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v2.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste_v2.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v2.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_ste_v2.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_table.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_table.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_types.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_types.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/fs_dr.c similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/fs_dr.c diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/fs_dr.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/fs_dr.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5_ifc_dr.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/mlx5_ifc_dr.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5_ifc_dr.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/mlx5_ifc_dr.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5_ifc_dr_ste_v1.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/mlx5_ifc_dr_ste_v1.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5_ifc_dr_ste_v1.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/mlx5_ifc_dr_ste_v1.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5dr.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/mlx5dr.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5dr.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/sws/mlx5dr.h From patchwork Thu Oct 31 12:58:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13857887 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2068.outbound.protection.outlook.com [40.107.237.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7D1819D880 for ; Thu, 31 Oct 2024 13:00:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730379609; cv=fail; b=RjzSR3+68j7Pr57ompzCSVuP1gvyzf9/RWsfHFxd1gMacZfXWazmygsk1tpcCgigEoTkeY6T2bEhTqvDthan9bdopCiQxPz4hWDG0+Sk4R9dsdsMHPEq3hBurnvLVJQ+7uXsrFyC0tJOf1KPZJISyBSosXldOE9jGqECqeSnM3s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730379609; c=relaxed/simple; bh=26WVM11myY7lZDAuS/N4HQwJb1SdRXG9GukuvEFGXvk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Zi5sjp7+2w5+BtX7k84DrGZRxw+dMopFO/0ZNp5FXInuVk2oUKHowlEKSXu8MYAacGPBwcKSb1Orm2mvGN7DF7AbFpKoNTafCM3K/q1HGSgVJPvt/4k6MCoxJ2ti7Uq9c5JIXIJsCfYQ0EUdMseP3kfZQ+XCsfw3Uh5aiBZOQSg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Xtyf88Oi; arc=fail smtp.client-ip=40.107.237.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Xtyf88Oi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l4FEQVj+E13Fz2gQRe+SGpwRg1AXG/0gtUNdv6nItD7cwAuEOmCPsviPV9P2R/CiNm70WBmwx0c/KzAJ2rIRH9lj35vGKtUZE0/AZYGqeCxj2jSNubjub5WaVsUsmy+8iJUAXA/LoHxXvp7Q1tM3PLQDdpf9ve9yfjUNoU8BU5gkhsyUtpbXZeiGy56hORhWGELGXeGT9xbPZTHDLeg2i53Nuv0ZSYZ9SisTBKwGO2Y0Ot6J9FVdYVneOkjEkBPLA5LyYMdY2Mw9F9sRNdMyMsc02FLXoKIXbI3zzvvN5pnufMtJ9pV7vBaa02sYEVOulNvmrP/LdbGHhaqJGiXXOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=wiFD9+HOXhZJg5Tws5gIommJoR9FJsrLrtek+VEiwVQ=; b=VjB+X67m9JhYcIW3ikYsfrndXYg2QEPXKOiEP2rk47q7hqOIXvsIxZ9mUGd9oYJVWabdQsHhJZdeG+B5bLgzraFivAm1FOhopqosGiEKRrPTiE3ZkpCjdsEAzhLsyOQpoRxKV+lBhjv7tqhhEFESZFM1XkxOfVJZbHp3Uq8g8OTIrG0vM2qwqZNSoF4yrZ4dGVMKRxN+csVL+9orhhhKNlTTPSJaz/BJ3xPE1iY+viJ8DSmvUnqeBrzPpaK30RYnW64mtr6H0OwX+bYsP10B8rLDNWQrA8YKQCUyLsqc8jveBIfJnMvgyhsJRrcN7OF+AtnISAlhmcj3rD4ZfoYn7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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=wiFD9+HOXhZJg5Tws5gIommJoR9FJsrLrtek+VEiwVQ=; b=Xtyf88OiTFmCWThVyIwHNKrTUShcZaUgbGaDDNBhtiS6CybzsGlp6SN8FbpGDrGMXmdZ0nq8nDOeElKBWgm82EZsqWRjTqdUMf/2ehgp/k0S4jH5XgjJRnny/DPGLiAclFVR5ajcKedR3aP/oAwhwJd57YdQwzSSHBjHHTMADYhORpJg+smwffS2syR3AY49BF9VI4Qa7G5UJFAWs/UrjePiT8DLWWvyTSc3gMMPJ85jzZc1e+RKFgtEJ/xrdxwpCtUwH2qgUg5qn7OLN8XNSFSh09vFIsPTKZjyhnsE0Wx/ysFXRR3JXTTKH/m2/mWoJeWXfoiwcnZtcMrdjy6zHA== Received: from CH2PR07CA0061.namprd07.prod.outlook.com (2603:10b6:610:5b::35) by LV2PR12MB5870.namprd12.prod.outlook.com (2603:10b6:408:175::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Thu, 31 Oct 2024 12:59:59 +0000 Received: from CH2PEPF00000146.namprd02.prod.outlook.com (2603:10b6:610:5b:cafe::4) by CH2PR07CA0061.outlook.office365.com (2603:10b6:610:5b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20 via Frontend Transport; Thu, 31 Oct 2024 12:59:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CH2PEPF00000146.mail.protection.outlook.com (10.167.244.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.16 via Frontend Transport; Thu, 31 Oct 2024 12:59:58 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 31 Oct 2024 05:59:46 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 31 Oct 2024 05:59:45 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 31 Oct 2024 05:59:43 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , "Andrew Lunn" CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Yevgeny Kliteynik , Tariq Toukan Subject: [PATCH net-next 3/5] net/mlx5: HWS, renamed the files in accordance with naming convention Date: Thu, 31 Oct 2024 14:58:54 +0200 Message-ID: <20241031125856.530927-4-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241031125856.530927-1-tariqt@nvidia.com> References: <20241031125856.530927-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF00000146:EE_|LV2PR12MB5870:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e970211-748a-46b4-2b46-08dcf9abeced X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: BY+4lcciR3+NFSdFgaoCrxsWFTJD0yArQzn7qmawcJZcxXorc/Xu+cYekjTFlol4swnz15+sEILIL8jmJfHn57O1ukZ5YAor1zf6iPV2K1mAGBCuoNamSKYTlLLUrFI393hmMCti5eOpjbUdusIeufgF7enI9uUX4QBYeMKBZ/WB9mTJdu+8Al1aDR6P009caYtCZqOOC0QVs2T5xATjt0BPk6HbKIxJNhHI3AM2OdsJ0WyGPfYt9aUb47gRk/+tYRDEow+81cjtdDAcqxjl9qS+a1KoAVOZYjKmmTeZ0Yh2p/FhQdmtceDB5hLYAbT4EwyMsDNROdwrU5/I0SXkaACIBC6ulX/Mgfl/6I3BfU5opTqEs+EXilyt4CD0MQpZ9Yi57TqXYx5ja+RttqfMkiiS5Kd1+1B8n9BIfq/BlGnSoT3ZINlV8ggBuUXn8rsQCZyCLjzv0Av7Nn69+t4qKQFM92HZgHxFjNoWxb03ktTg3ivmnpANKq0vsSeLfDhx4BZgvpUr+SdJsrqQydR2vlizHPJRhTwLaVgDO0nD3tDDvk734UusUo5abWaSNLc7GWiL1n8d7ZUkAvJy/4ZlLgELy6I9lW1SK89wRHyGTUCiGq9R46QoV7KjFAAenHEFqgMZ62mMrS3egn5WrW2pDS8dtgkmrveOYfNAlRr3ZPSvtMl7MOeXfPOoAgm8WiBfyldDf+3r4zzkRU4U+fRoiU1KN1i2ckTrgTMtLyS/jfzuHGRT3hrenH+DKPTNk1H25P23IxuJ9EZg6CdDZWW+AJvXi8SBPZ/ImtWsdRkSe9U5g/PwGji9kYFdvpTCyQblUdAmbqxDN49mz33lQORQCXNgOkQB5ucX052r9zPSbOLqxA+8zV/Be62X50kW2F3TmAKb1zy2T1bGA8SSl8OMSQkxQ8/CuiiFwjeOG7n9ihaoQbsNGUjQR/5RTS4xMiPSeq7+fG4YlGmVQOTe49hxhgQYwpyVeZq6TUZXq3nAOkAFsjmP1ZNFsQ+vyPuSSXPtIRPbOeOubUi0ASIRkT1Md7OGWBeqBXDlPbGQ/RRC3rx5v2jaicZah9gB/WBaGtL2fVsiuB8GvZr/zI8SmJ894QZKzSzO1aHJV84mA9ha/e+/1q28lY/Ad4yT1UcGkfBiWZUxpdp2J2LbfhetbXNlH5GD9MOU/tnuruHzGdBMS3ts24GdCGF3npuR2BiGDtzeAWfJVji2uiOCI32w5A4kbZ7pq1l1DmZAMP0Q9puMUxyopVA76swkQpo94493cD0NEjpSIr2NfBFOvIJyPDJCHWAT+LChLrlwxGMfd0U5VdiChQYQobizGkIpYVZouYIdk7WY6LomkNZXIfZ3TVSGV6HLKUqX5V6PZLuNe8myAfCMKJTRF0mG000sOMCjIjOJLI6xb6ZJ2PcNbr5M2JrYMw== X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 12:59:58.7895 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e970211-748a-46b4-2b46-08dcf9abeced X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF00000146.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5870 X-Patchwork-Delegate: kuba@kernel.org From: Yevgeny Kliteynik Removed the 'mlx5hws_' file name prefix from the internal HWS files. Signed-off-by: Yevgeny Kliteynik Signed-off-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/Makefile | 30 ++++++++-------- .../hws/{mlx5hws_action.c => action.c} | 2 +- .../hws/{mlx5hws_action.h => action.h} | 6 ++-- .../steering/hws/{mlx5hws_buddy.c => buddy.c} | 4 +-- .../steering/hws/{mlx5hws_buddy.h => buddy.h} | 6 ++-- .../steering/hws/{mlx5hws_bwc.c => bwc.c} | 2 +- .../steering/hws/{mlx5hws_bwc.h => bwc.h} | 6 ++-- .../{mlx5hws_bwc_complex.c => bwc_complex.c} | 2 +- .../{mlx5hws_bwc_complex.h => bwc_complex.h} | 6 ++-- .../steering/hws/{mlx5hws_cmd.c => cmd.c} | 2 +- .../steering/hws/{mlx5hws_cmd.h => cmd.h} | 6 ++-- .../hws/{mlx5hws_context.c => context.c} | 2 +- .../hws/{mlx5hws_context.h => context.h} | 6 ++-- .../steering/hws/{mlx5hws_debug.c => debug.c} | 2 +- .../steering/hws/{mlx5hws_debug.h => debug.h} | 6 ++-- .../hws/{mlx5hws_definer.c => definer.c} | 2 +- .../hws/{mlx5hws_definer.h => definer.h} | 6 ++-- .../hws/{mlx5hws_internal.h => internal.h} | 36 +++++++++---------- .../hws/{mlx5hws_matcher.c => matcher.c} | 2 +- .../hws/{mlx5hws_matcher.h => matcher.h} | 6 ++-- .../hws/{mlx5hws_pat_arg.c => pat_arg.c} | 2 +- .../hws/{mlx5hws_pat_arg.h => pat_arg.h} | 0 .../steering/hws/{mlx5hws_pool.c => pool.c} | 4 +-- .../steering/hws/{mlx5hws_pool.h => pool.h} | 0 .../steering/hws/{mlx5hws_prm.h => prm.h} | 0 .../steering/hws/{mlx5hws_rule.c => rule.c} | 2 +- .../steering/hws/{mlx5hws_rule.h => rule.h} | 0 .../steering/hws/{mlx5hws_send.c => send.c} | 2 +- .../steering/hws/{mlx5hws_send.h => send.h} | 0 .../steering/hws/{mlx5hws_table.c => table.c} | 2 +- .../steering/hws/{mlx5hws_table.h => table.h} | 0 .../steering/hws/{mlx5hws_vport.c => vport.c} | 2 +- .../steering/hws/{mlx5hws_vport.h => vport.h} | 0 33 files changed, 77 insertions(+), 77 deletions(-) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_action.c => action.c} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_action.h => action.h} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_buddy.c => buddy.c} (98%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_buddy.h => buddy.h} (86%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_bwc.c => bwc.c} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_bwc.h => bwc.h} (96%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_bwc_complex.c => bwc_complex.c} (98%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_bwc_complex.h => bwc_complex.h} (90%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_cmd.c => cmd.c} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_cmd.h => cmd.h} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_context.c => context.c} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_context.h => context.h} (95%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_debug.c => debug.c} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_debug.h => debug.h} (93%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_definer.c => definer.c} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_definer.h => definer.h} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_internal.h => internal.h} (67%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_matcher.c => matcher.c} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_matcher.h => matcher.h} (96%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_pat_arg.c => pat_arg.c} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_pat_arg.h => pat_arg.h} (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_pool.c => pool.c} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_pool.h => pool.h} (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_prm.h => prm.h} (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_rule.c => rule.c} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_rule.h => rule.h} (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_send.c => send.c} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_send.h => send.h} (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_table.c => table.c} (99%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_table.h => table.h} (100%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_vport.c => vport.c} (98%) rename drivers/net/ethernet/mellanox/mlx5/core/steering/hws/{mlx5hws_vport.h => vport.h} (100%) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Makefile b/drivers/net/ethernet/mellanox/mlx5/core/Makefile index 42411fe772ab..be3d0876c521 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/Makefile +++ b/drivers/net/ethernet/mellanox/mlx5/core/Makefile @@ -136,21 +136,21 @@ mlx5_core-$(CONFIG_MLX5_SW_STEERING) += steering/sws/dr_domain.o \ # # HW Steering # -mlx5_core-$(CONFIG_MLX5_HW_STEERING) += steering/hws/mlx5hws_cmd.o \ - steering/hws/mlx5hws_context.o \ - steering/hws/mlx5hws_pat_arg.o \ - steering/hws/mlx5hws_buddy.o \ - steering/hws/mlx5hws_pool.o \ - steering/hws/mlx5hws_table.o \ - steering/hws/mlx5hws_action.o \ - steering/hws/mlx5hws_rule.o \ - steering/hws/mlx5hws_matcher.o \ - steering/hws/mlx5hws_send.o \ - steering/hws/mlx5hws_definer.o \ - steering/hws/mlx5hws_bwc.o \ - steering/hws/mlx5hws_debug.o \ - steering/hws/mlx5hws_vport.o \ - steering/hws/mlx5hws_bwc_complex.o +mlx5_core-$(CONFIG_MLX5_HW_STEERING) += steering/hws/cmd.o \ + steering/hws/context.o \ + steering/hws/pat_arg.o \ + steering/hws/buddy.o \ + steering/hws/pool.o \ + steering/hws/table.o \ + steering/hws/action.o \ + steering/hws/rule.o \ + steering/hws/matcher.o \ + steering/hws/send.o \ + steering/hws/definer.o \ + steering/hws/bwc.o \ + steering/hws/debug.o \ + steering/hws/vport.o \ + steering/hws/bwc_complex.o # diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_action.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c index b27bb4106532..a897cdc60fdb 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_action.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" +#include "internal.h" #define MLX5HWS_ACTION_METER_INIT_COLOR_OFFSET 1 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_action.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.h similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_action.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.h index bf5c1b241006..e8f562c31826 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_action.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.h @@ -1,8 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#ifndef MLX5HWS_ACTION_H_ -#define MLX5HWS_ACTION_H_ +#ifndef HWS_ACTION_H_ +#define HWS_ACTION_H_ /* Max number of STEs needed for a rule (including match) */ #define MLX5HWS_ACTION_MAX_STE 20 @@ -304,4 +304,4 @@ mlx5hws_action_apply_setter(struct mlx5hws_actions_apply_data *apply, htonl(num_of_actions << 29); } -#endif /* MLX5HWS_ACTION_H_ */ +#endif /* HWS_ACTION_H_ */ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_buddy.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.c similarity index 98% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_buddy.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.c index e6ed66202a40..b9aef80ba094 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_buddy.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" -#include "mlx5hws_buddy.h" +#include "internal.h" +#include "buddy.h" static int hws_buddy_init(struct mlx5hws_buddy_mem *buddy, u32 max_order) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_buddy.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.h similarity index 86% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_buddy.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.h index 338c44bbedaf..ef6b223677aa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_buddy.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/buddy.h @@ -1,8 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#ifndef MLX5HWS_BUDDY_H_ -#define MLX5HWS_BUDDY_H_ +#ifndef HWS_BUDDY_H_ +#define HWS_BUDDY_H_ struct mlx5hws_buddy_mem { unsigned long **bitmap; @@ -18,4 +18,4 @@ int mlx5hws_buddy_alloc_mem(struct mlx5hws_buddy_mem *buddy, u32 order); void mlx5hws_buddy_free_mem(struct mlx5hws_buddy_mem *buddy, u32 seg, u32 order); -#endif /* MLX5HWS_BUDDY_H_ */ +#endif /* HWS_BUDDY_H_ */ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c index 8f3a6f9d703d..baacf662c0ab 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" +#include "internal.h" static u16 hws_bwc_gen_queue_idx(struct mlx5hws_context *ctx) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.h similarity index 96% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.h index 4fe8c32d8fbe..0b745968e21e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.h @@ -1,8 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#ifndef MLX5HWS_BWC_H_ -#define MLX5HWS_BWC_H_ +#ifndef HWS_BWC_H_ +#define HWS_BWC_H_ #define MLX5HWS_BWC_MATCHER_INIT_SIZE_LOG 1 #define MLX5HWS_BWC_MATCHER_SIZE_LOG_STEP 1 @@ -70,4 +70,4 @@ static inline u16 mlx5hws_bwc_get_queue_id(struct mlx5hws_context *ctx, u16 idx) return idx + mlx5hws_bwc_queues(ctx); } -#endif /* MLX5HWS_BWC_H_ */ +#endif /* HWS_BWC_H_ */ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c similarity index 98% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c index 601fad5fc54a..c00010ca86bd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" +#include "internal.h" bool mlx5hws_bwc_match_params_is_complex(struct mlx5hws_context *ctx, u8 match_criteria_enable, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.h similarity index 90% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.h index 068ee8118609..340f0688e394 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_bwc_complex.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.h @@ -1,8 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#ifndef MLX5HWS_BWC_COMPLEX_H_ -#define MLX5HWS_BWC_COMPLEX_H_ +#ifndef HWS_BWC_COMPLEX_H_ +#define HWS_BWC_COMPLEX_H_ bool mlx5hws_bwc_match_params_is_complex(struct mlx5hws_context *ctx, u8 match_criteria_enable, @@ -26,4 +26,4 @@ int mlx5hws_bwc_rule_create_complex(struct mlx5hws_bwc_rule *bwc_rule, int mlx5hws_bwc_rule_destroy_complex(struct mlx5hws_bwc_rule *bwc_rule); -#endif /* MLX5HWS_BWC_COMPLEX_H_ */ +#endif /* HWS_BWC_COMPLEX_H_ */ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_cmd.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c index 2c7b14172049..c00c138c3366 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" +#include "internal.h" static enum mlx5_ifc_flow_destination_type hws_cmd_dest_type_to_ifc_dest_type(enum mlx5_flow_destination_type type) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_cmd.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.h similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_cmd.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.h index 2fbcf4ff571a..434f62b0904e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_cmd.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.h @@ -1,8 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#ifndef MLX5HWS_CMD_H_ -#define MLX5HWS_CMD_H_ +#ifndef HWS_CMD_H_ +#define HWS_CMD_H_ #define WIRE_PORT 0xFFFF @@ -358,4 +358,4 @@ int mlx5hws_cmd_allow_other_vhca_access(struct mlx5_core_dev *mdev, int mlx5hws_cmd_query_gvmi(struct mlx5_core_dev *mdev, bool other_function, u16 vport_number, u16 *gvmi); -#endif /* MLX5HWS_CMD_H_ */ +#endif /* HWS_CMD_H_ */ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_context.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_context.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c index 00e4fdf4a558..fd48b05e91e0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_context.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved. */ -#include "mlx5hws_internal.h" +#include "internal.h" bool mlx5hws_context_cap_dynamic_reparse(struct mlx5hws_context *ctx) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_context.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.h similarity index 95% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_context.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.h index 8ab548aa402b..47f5cc8de73f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_context.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/context.h @@ -1,8 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#ifndef MLX5HWS_CONTEXT_H_ -#define MLX5HWS_CONTEXT_H_ +#ifndef HWS_CONTEXT_H_ +#define HWS_CONTEXT_H_ enum mlx5hws_context_flags { MLX5HWS_CONTEXT_FLAG_HWS_SUPPORT = 1 << 0, @@ -62,4 +62,4 @@ bool mlx5hws_context_cap_dynamic_reparse(struct mlx5hws_context *ctx); u8 mlx5hws_context_get_reparse_mode(struct mlx5hws_context *ctx); -#endif /* MLX5HWS_CONTEXT_H_ */ +#endif /* HWS_CONTEXT_H_ */ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_debug.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/debug.c similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_debug.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/debug.c index 2b8c5a4e1c4c..5b200b4bc1a8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_debug.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/debug.c @@ -5,7 +5,7 @@ #include #include #include -#include "mlx5hws_internal.h" +#include "internal.h" static int hws_debug_dump_matcher_template_definer(struct seq_file *f, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_debug.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/debug.h similarity index 93% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_debug.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/debug.h index b93a536035d9..e44e7ae28f93 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_debug.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/debug.h @@ -1,8 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#ifndef MLX5HWS_DEBUG_H_ -#define MLX5HWS_DEBUG_H_ +#ifndef HWS_DEBUG_H_ +#define HWS_DEBUG_H_ #define HWS_DEBUG_FORMAT_VERSION "1.0" @@ -37,4 +37,4 @@ mlx5hws_debug_icm_to_idx(u64 icm_addr) void mlx5hws_debug_init_dump(struct mlx5hws_context *ctx); void mlx5hws_debug_uninit_dump(struct mlx5hws_context *ctx); -#endif /* MLX5HWS_DEBUG_H_ */ +#endif /* HWS_DEBUG_H_ */ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_definer.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_definer.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c index 3f4c58bada37..8fe96eb76baf 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_definer.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" +#include "internal.h" /* Pattern tunnel Layer bits. */ #define MLX5_FLOW_LAYER_VXLAN BIT(12) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_definer.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.h similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_definer.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.h index 2f6a7df4021c..9432d5084def 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_definer.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.h @@ -1,8 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#ifndef MLX5HWS_DEFINER_H_ -#define MLX5HWS_DEFINER_H_ +#ifndef HWS_DEFINER_H_ +#define HWS_DEFINER_H_ /* Max available selecotrs */ #define DW_SELECTORS 9 @@ -831,4 +831,4 @@ mlx5hws_definer_conv_match_params_to_compressed_fc(struct mlx5hws_context *ctx, u32 *match_param, int *fc_sz); -#endif /* MLX5HWS_DEFINER_H_ */ +#endif /* HWS_DEFINER_H_ */ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_internal.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/internal.h similarity index 67% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_internal.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/internal.h index 5643be1cd5bf..3c8635f286ce 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_internal.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/internal.h @@ -1,8 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#ifndef MLX5HWS_INTERNAL_H_ -#define MLX5HWS_INTERNAL_H_ +#ifndef HWS_INTERNAL_H_ +#define HWS_INTERNAL_H_ #include #include @@ -10,22 +10,22 @@ #include "wq.h" #include "lib/mlx5.h" -#include "mlx5hws_prm.h" +#include "prm.h" #include "mlx5hws.h" -#include "mlx5hws_pool.h" -#include "mlx5hws_vport.h" -#include "mlx5hws_context.h" -#include "mlx5hws_table.h" -#include "mlx5hws_send.h" -#include "mlx5hws_rule.h" -#include "mlx5hws_cmd.h" -#include "mlx5hws_action.h" -#include "mlx5hws_definer.h" -#include "mlx5hws_matcher.h" -#include "mlx5hws_debug.h" -#include "mlx5hws_pat_arg.h" -#include "mlx5hws_bwc.h" -#include "mlx5hws_bwc_complex.h" +#include "pool.h" +#include "vport.h" +#include "context.h" +#include "table.h" +#include "send.h" +#include "rule.h" +#include "cmd.h" +#include "action.h" +#include "definer.h" +#include "matcher.h" +#include "debug.h" +#include "pat_arg.h" +#include "bwc.h" +#include "bwc_complex.h" #define W_SIZE 2 #define DW_SIZE 4 @@ -56,4 +56,4 @@ static inline unsigned long align(unsigned long val, unsigned long align) return (val + align - 1) & ~(align - 1); } -#endif /* MLX5HWS_INTERNAL_H_ */ +#endif /* HWS_INTERNAL_H_ */ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c index 61a1155d4b4f..1bb3a6f8c3cd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" +#include "internal.h" enum mlx5hws_matcher_rtc_type { HWS_MATCHER_RTC_TYPE_MATCH, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.h similarity index 96% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.h index 125391d1a114..81ff487f57be 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_matcher.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.h @@ -1,8 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#ifndef MLX5HWS_MATCHER_H_ -#define MLX5HWS_MATCHER_H_ +#ifndef HWS_MATCHER_H_ +#define HWS_MATCHER_H_ /* We calculated that concatenating a collision table to the main table with * 3% of the main table rows will be enough resources for high insertion @@ -104,4 +104,4 @@ static inline bool mlx5hws_matcher_is_insert_by_idx(struct mlx5hws_matcher *matc return matcher->attr.insert_mode == MLX5HWS_MATCHER_INSERT_BY_INDEX; } -#endif /* MLX5HWS_MATCHER_H_ */ +#endif /* HWS_MATCHER_H_ */ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_pat_arg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_pat_arg.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c index e084a5cbf81f..06db5e4726ae 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_pat_arg.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" +#include "internal.h" enum mlx5hws_arg_chunk_size mlx5hws_arg_data_size_to_arg_log_size(u16 data_size) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_pat_arg.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_pat_arg.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_pool.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_pool.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c index a8a63e3278be..fed2d913f3b8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_pool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" -#include "mlx5hws_buddy.h" +#include "internal.h" +#include "buddy.h" static void hws_pool_free_one_resource(struct mlx5hws_pool_resource *resource) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_pool.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_pool.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_prm.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/prm.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_prm.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/prm.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_rule.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.c similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_rule.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.c index 8a011b958b43..e20c67a04203 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_rule.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" +#include "internal.h" static void hws_rule_skip(struct mlx5hws_matcher *matcher, struct mlx5hws_match_template *mt, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_rule.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_rule.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c index 6d443e6ee8d9..424797b6d802 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" +#include "internal.h" #include "lib/clock.h" enum { CQ_OK = 0, CQ_EMPTY = -1, CQ_POLL_ERR = -2 }; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_send.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/send.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_table.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.c similarity index 99% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_table.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.c index 8c063a8d87d7..9576e02d00c3 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" +#include "internal.h" u32 mlx5hws_table_get_id(struct mlx5hws_table *tbl) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_table.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_table.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/table.h diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_vport.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/vport.c similarity index 98% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_vport.c rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/vport.c index faf42421c43f..d8e382b9fa61 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_vport.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/vport.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2024 NVIDIA Corporation & Affiliates */ -#include "mlx5hws_internal.h" +#include "internal.h" int mlx5hws_vport_init_vports(struct mlx5hws_context *ctx) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_vport.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/vport.h similarity index 100% rename from drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_vport.h rename to drivers/net/ethernet/mellanox/mlx5/core/steering/hws/vport.h From patchwork Thu Oct 31 12:58:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13857890 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2040.outbound.protection.outlook.com [40.107.95.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79B5F19DFA4 for ; Thu, 31 Oct 2024 13:00:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730379615; cv=fail; b=fI04cjFsBLoOzECSpDez60oFZi/TvPwS+ZC+KkZAhvLfVQCJa4RbcASFT/j/ft474RNYQRilc+FdoYUNeX0FKYMEJAt1FAqFK58ij0HdTlB4uh0GjKXgfJwg1PouYWhs7axe+72NC1Wv2QoM6OIAT9vxGUDIzoDRtz1fSNrag3w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730379615; c=relaxed/simple; bh=ao5UXs+XgmqyytN6QQhu8NA9um46yaUMUeao8OJELCQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tBJ9MIyUoOY39GDLHyjYz1oPY0whHNrbyDHXgtvWyeO+qO/+RR670KbB8Ut8491o/4KE/LlKNrIFg08qbKB9sa+FmYSHy3lW+vDzAdHO3P49ZFYlweFZKuzKOXlXo1s+IGOHi23Cjc81aSmm+V6fPn677tFeOIWfs5az8Shgh/4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=SoVY6J0u; arc=fail smtp.client-ip=40.107.95.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="SoVY6J0u" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c6j5PnXAENKsc/V8RM24d7HGwk/lZ7wf5vGTyyJk63UX4MdaL07BXLnPQ9YqvBaCGpMnmuKOklbWzQS9+gT4iHP7wSNRH8vC5joZTtqBjXKqs9pU7RaUcAd+piEg7SW4gBB06dDF42Wm3uRdGHbWAkonm529gc6uNzvY9uN3ycJChA08/W2j5/OsBX53mmsDpI9pRV8i2DqsUjZasEXqk9+RQB/aCziuyV1bFFLtr9k4+y6HuMMXEYr1DQrPL1hk15dhXcub2N/U2op4ej5n2GgTAJ1itRSrPaZM5J1IeDnN1QbCyACy24RvfkwMKnUh7musttggwExKCko1vl2vqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=fmDqfN5HpKTXnZp5AxPQ6xIvMDbx1E/RNa4Jbet3TO4=; b=ZU8KuuEOv86sjrQ8jfSiye4kIxyVtzUMNImmbTO5LRxiCWKi33xqItKVlc4iPP8/IJgRKNdVbxiBfXoEU+6fv6QSzfVE1W4byZY2xC8TG525CHvAc7RrH4o84MaHmTcw/FuY6benmipZVmq0+AzTDecNjHgBdJuvfYjZL2NHF8NIXtXv50otYUomNnZ/msVmmPUlWvj4DkIdmPOkEsj1BaxTpWryvyWNLTrKeY0jVPg8kTZPpZCackblkNuGv4UMTQERcrGo7jWrXaIiHGg1vmRVLqvGmYFE3o2VB/nY8NmGEZYXovszxZ9ce0ZoBF8/DJIc66T8qnKwJchMHkkbNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=fmDqfN5HpKTXnZp5AxPQ6xIvMDbx1E/RNa4Jbet3TO4=; b=SoVY6J0uovIFBH/D0bMtavcY5oKHSBLEtD/jzFailrXxKEXi62XzISB5/Q/Cm1KFdIS9lTjE7AYiRdvjd59JckAFrUlbh48x6ZjLFk5ErafTGKh0cSct4wPYezoOndehSaF/36vU2+K08VjhohJ1Upxppabs1nA/CkQJfpcix9mgYrMsBHGQXfZDSw7JYZ4/IojYk94ABDMyI7wXT/uJvpPypvaf9PRFlFYthBn+5Mg8J0tPun6GwXMVkGPQAhGbOmFjXsx8i3RhurxW1hnzvmEq27ooV6IqWq7dg1L+243QDlbIjkWCK9VXQ7M5d6uJf+kcRBJ7QrUapxJD6Rb9dQ== Received: from CH0P221CA0035.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11d::22) by DM4PR12MB6640.namprd12.prod.outlook.com (2603:10b6:8:8f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Thu, 31 Oct 2024 13:00:08 +0000 Received: from DS2PEPF0000343D.namprd02.prod.outlook.com (2603:10b6:610:11d:cafe::fe) by CH0P221CA0035.outlook.office365.com (2603:10b6:610:11d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.17 via Frontend Transport; Thu, 31 Oct 2024 13:00:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DS2PEPF0000343D.mail.protection.outlook.com (10.167.18.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.16 via Frontend Transport; Thu, 31 Oct 2024 13:00:07 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 31 Oct 2024 05:59:49 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 31 Oct 2024 05:59:49 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 31 Oct 2024 05:59:46 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , "Andrew Lunn" CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , William Tu , Parav Pandit , Tariq Toukan Subject: [PATCH net-next 4/5] net/mlx5e: move XDP_REDIRECT sq to dynamic allocation Date: Thu, 31 Oct 2024 14:58:55 +0200 Message-ID: <20241031125856.530927-5-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241031125856.530927-1-tariqt@nvidia.com> References: <20241031125856.530927-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF0000343D:EE_|DM4PR12MB6640:EE_ X-MS-Office365-Filtering-Correlation-Id: 80f62d16-e034-4418-a843-08dcf9abf20b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: +cI4/UNh9xx1kvU+bC/pEy0eQZ7KhOP+5R14en92nhIaDSTMhePFB+n3DPdW4xG61wrOtGWutkgCsVrnTE5ky4B9B0IhbOd1HbaLn7o6FydA94gmAfOqH70d93Au82VEH6UY+DJQqM+a4vCpUGW8ZbFchJs5Kygfpd851Rp87qQF0rvHhZfqsXCqpDWhMwZO5+SY48zR85eDm4u2QEJSLf0sB0TkZAa+CNCwXbTbMam0ObihVruHTRZKU3Ym+Xzu5sJr+Y4S9yR7iwKgEzcCBrc+LR2LtFL871hX9ETfkUy+vditRPnZbGWw+q8ng9IfRCDuAy+g/bo7M3QMqcp5PUg1cWnlgltFFeDkk1oN1IFHmSdOZ5eunE6am4mJ1clgGO2LPSY3AF5WBORspmzLWOSngGcvknEzw8wfxirGfw0gh51zrrhF6gK0qSrjSondooEykE282/CfdByv3+Nr1mQJd2kyF/d8Sxnd0lfJ8W66I6hCFWgsHEAEEeTDBzzEsyKsCPYPZdXBSlqgjFW2vnyijtYXnFbJhs9DaGTbRDC56aaQ1TYKW9+s32lUyzo5Guu0HNjwFwQR3icVAOJZEVecv8AFjAa0bcvujtynKIRXz2PE5FSkjmdbm7osTSw/7cGlu+Z7s6NMXS2XGTK2oej4anwIU/2RFt6eVNHxEvr5XeyvrA0ddJAgjjVHCU4++nVfqMNeebK/rzir2O9FxvkfSz0eLQVMV97C8JD/6TqF7pdnvwv8WO2q76dqy/nXBdyJmsXqVBxg1opWsrIm3o0tGnpyH4E/lzz6bB7EQEtHRwdKlCifLjaDesuMbqTF60fSoJnJmc4jFX+QC1z5Z6xXJrxR2xocopFlCtUjJF+UwxjnB4bBxuiFybQ0cqOvpWbNp/QY23zOO2MVR+b1HpC6ytDgVitXVBkbnbJtKKaEgQklGZh8NI76WIVODVrGqMZCWwFe7EkuLt35nE1AW30qqYbLhLqRRfvF7AEPun0oYynvXXAHFrU1pwTcNMUIaQRNg/8LhiyRWPJQHa8YIX5gU7hrC/r/c0fLAYr1UivU7+B2GDrtYJh1nLfUFhYwcYje5oszCkDKr7G69IF3H2eKnbSfcYhXPLDzP0ZjuhL2FVBHlbGuIguWQ0QrfkFG3sRV4jHyI3ycUeNQInvucnIAkTGGQX0cu/XCWcvYswup+s4FrNg8uiTA8fcCTb6C+z1r33A8HPZGBSAo2H8qSiUnJocZ1PZGpYv045WyzONzul45HJuI1ipqvjDlE+nev59aJwqqP2+VnnthKvCdLzF9zmBw7y7oKg9+tyVkpSF+kKFlD56os8AY6uDqUXDtktyzE+jS5lRPDk1x5E35CcovJoGhnoZ/gmhjVl9s2mbZ9xuFoYDABUy3buA6L9TIfvXVzNoZC1sOyw3e/L4GJw== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 13:00:07.3935 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 80f62d16-e034-4418-a843-08dcf9abf20b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF0000343D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6640 X-Patchwork-Delegate: kuba@kernel.org From: William Tu Dynamically allocating xdpsq, used by egress side XDP_REDIRECT. mlx5 has multiple XDP sqs. Under struct mlx5e_channel: 1. rx_xdpsq: used for XDP_TX, an XDP prog handles the rx packet and transmits using the same queue as rx. 2. xdpsq: used by egress side XDP_REDIRECT. This is for another interface to redirect packet to the mlx5 interface, using ndo_xdp_xmit . 3. xsksq: used by XSK. XSK has its own dedicated channel, and it also has resources of 1 and 2. The patch changes only the 2. xdpsq. Signed-off-by: William Tu Reviewed-by: Parav Pandit Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 +- .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en_main.c | 66 ++++++++++++++----- .../net/ethernet/mellanox/mlx5/core/en_rep.c | 3 +- .../net/ethernet/mellanox/mlx5/core/en_txrx.c | 6 +- 5 files changed, 56 insertions(+), 23 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index 57b7298a0e79..58f3df784ded 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -755,7 +755,7 @@ struct mlx5e_channel { u8 lag_port; /* XDP_REDIRECT */ - struct mlx5e_xdpsq xdpsq; + struct mlx5e_xdpsq *xdpsq; /* AF_XDP zero-copy */ struct mlx5e_rq xskrq; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c index 4610621a340e..94b291662087 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c @@ -865,7 +865,7 @@ int mlx5e_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames, if (unlikely(sq_num >= priv->channels.num)) return -ENXIO; - sq = &priv->channels.c[sq_num]->xdpsq; + sq = priv->channels.c[sq_num]->xdpsq; for (i = 0; i < n; i++) { struct mlx5e_xmit_data_frags xdptxdf = {}; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index f37afa52e2b8..2f609b92d29b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -2086,6 +2086,44 @@ void mlx5e_close_xdpsq(struct mlx5e_xdpsq *sq) mlx5e_free_xdpsq(sq); } +static struct mlx5e_xdpsq *mlx5e_open_xdpredirect_sq(struct mlx5e_channel *c, + struct mlx5e_params *params, + struct mlx5e_channel_param *cparam, + struct mlx5e_create_cq_param *ccp) +{ + struct mlx5e_xdpsq *xdpsq; + int err; + + xdpsq = kvzalloc_node(sizeof(*xdpsq), GFP_KERNEL, c->cpu); + if (!xdpsq) + return ERR_PTR(-ENOMEM); + + err = mlx5e_open_cq(c->mdev, params->tx_cq_moderation, + &cparam->xdp_sq.cqp, ccp, &xdpsq->cq); + if (err) + goto err_free_xdpsq; + + err = mlx5e_open_xdpsq(c, params, &cparam->xdp_sq, NULL, xdpsq, true); + if (err) + goto err_close_xdpsq_cq; + + return xdpsq; + +err_close_xdpsq_cq: + mlx5e_close_cq(&xdpsq->cq); +err_free_xdpsq: + kvfree(xdpsq); + + return ERR_PTR(err); +} + +static void mlx5e_close_xdpredirect_sq(struct mlx5e_xdpsq *xdpsq) +{ + mlx5e_close_xdpsq(xdpsq); + mlx5e_close_cq(&xdpsq->cq); + kvfree(xdpsq); +} + static int mlx5e_alloc_cq_common(struct mlx5_core_dev *mdev, struct net_device *netdev, struct workqueue_struct *workqueue, @@ -2496,15 +2534,16 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, if (err) goto err_close_icosq_cq; - err = mlx5e_open_cq(c->mdev, params->tx_cq_moderation, &cparam->xdp_sq.cqp, &ccp, - &c->xdpsq.cq); - if (err) + c->xdpsq = mlx5e_open_xdpredirect_sq(c, params, cparam, &ccp); + if (IS_ERR(c->xdpsq)) { + err = PTR_ERR(c->xdpsq); goto err_close_tx_cqs; + } err = mlx5e_open_cq(c->mdev, params->rx_cq_moderation, &cparam->rq.cqp, &ccp, &c->rq.cq); if (err) - goto err_close_xdp_tx_cqs; + goto err_close_xdpredirect_sq; err = c->xdp ? mlx5e_open_cq(c->mdev, params->tx_cq_moderation, &cparam->xdp_sq.cqp, &ccp, &c->rq_xdpsq.cq) : 0; @@ -2516,7 +2555,7 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, err = mlx5e_open_icosq(c, params, &cparam->async_icosq, &c->async_icosq, mlx5e_async_icosq_err_cqe_work); if (err) - goto err_close_xdpsq_cq; + goto err_close_rq_xdpsq_cq; mutex_init(&c->icosq_recovery_lock); @@ -2540,16 +2579,8 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, goto err_close_rq; } - err = mlx5e_open_xdpsq(c, params, &cparam->xdp_sq, NULL, &c->xdpsq, true); - if (err) - goto err_close_xdp_sq; - return 0; -err_close_xdp_sq: - if (c->xdp) - mlx5e_close_xdpsq(&c->rq_xdpsq); - err_close_rq: mlx5e_close_rq(&c->rq); @@ -2562,15 +2593,15 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, err_close_async_icosq: mlx5e_close_icosq(&c->async_icosq); -err_close_xdpsq_cq: +err_close_rq_xdpsq_cq: if (c->xdp) mlx5e_close_cq(&c->rq_xdpsq.cq); err_close_rx_cq: mlx5e_close_cq(&c->rq.cq); -err_close_xdp_tx_cqs: - mlx5e_close_cq(&c->xdpsq.cq); +err_close_xdpredirect_sq: + mlx5e_close_xdpredirect_sq(c->xdpsq); err_close_tx_cqs: mlx5e_close_tx_cqs(c); @@ -2586,7 +2617,6 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, static void mlx5e_close_queues(struct mlx5e_channel *c) { - mlx5e_close_xdpsq(&c->xdpsq); if (c->xdp) mlx5e_close_xdpsq(&c->rq_xdpsq); /* The same ICOSQ is used for UMRs for both RQ and XSKRQ. */ @@ -2599,7 +2629,7 @@ static void mlx5e_close_queues(struct mlx5e_channel *c) if (c->xdp) mlx5e_close_cq(&c->rq_xdpsq.cq); mlx5e_close_cq(&c->rq.cq); - mlx5e_close_cq(&c->xdpsq.cq); + mlx5e_close_xdpredirect_sq(c->xdpsq); mlx5e_close_tx_cqs(c); mlx5e_close_cq(&c->icosq.cq); mlx5e_close_cq(&c->async_icosq.cq); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index 92094bf60d59..554f9cb5b53f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -600,7 +600,8 @@ mlx5e_add_sqs_fwd_rules(struct mlx5e_priv *priv) if (c->xdp) sqs[num_sqs++] = c->rq_xdpsq.sqn; - sqs[num_sqs++] = c->xdpsq.sqn; + if (c->xdpsq) + sqs[num_sqs++] = c->xdpsq->sqn; } } if (ptp_sq) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c index 5873fde65c2e..3a12a933ed87 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c @@ -165,7 +165,8 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget) if (unlikely(!budget)) goto out; - busy |= mlx5e_poll_xdpsq_cq(&c->xdpsq.cq); + if (c->xdpsq) + busy |= mlx5e_poll_xdpsq_cq(&c->xdpsq->cq); if (c->xdp) busy |= mlx5e_poll_xdpsq_cq(&c->rq_xdpsq.cq); @@ -236,7 +237,8 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget) mlx5e_cq_arm(&rq->cq); mlx5e_cq_arm(&c->icosq.cq); mlx5e_cq_arm(&c->async_icosq.cq); - mlx5e_cq_arm(&c->xdpsq.cq); + if (c->xdpsq) + mlx5e_cq_arm(&c->xdpsq->cq); if (xsk_open) { mlx5e_handle_rx_dim(xskrq); From patchwork Thu Oct 31 12:58:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13857891 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2069.outbound.protection.outlook.com [40.107.244.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52BDC19D091 for ; Thu, 31 Oct 2024 13:00:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730379620; cv=fail; b=rNT2K0tUc0tzGHILl6vM7MOI4Fv48mxxheCRgaaX9Lmuv92wC5195WD13FfbuMuwnZLw7XTCjuvulG147vDf6fmd47zGlrk0XkxbMcwZjPkRSjqva36/faF5yz1vCYjVKqIHp2Mite0n/4Y3m5GLPDW3C3ZTNN1yWkjFyB4JuY4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730379620; c=relaxed/simple; bh=y+DH2EfvsfwmMteBTTwqSrIhzKqABHI6FBB03FgoyPk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NRFOA6L6UI9DM8oEGqKVJBbLyqLEcFU/cre+xeiQ/2q6Ojy+gfwou2it7PMyBNiKuKdRx7hqAu62Z5bo0YajMCgAJzNDpwATu7BhPRisv+mmxf4Ywfeq7D0ZXuCeyaRX+67BkdIjw4JR6Crq9a1q641XtcQlPMhlBLQO3M/L9as= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=GTybwIMh; arc=fail smtp.client-ip=40.107.244.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="GTybwIMh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P9vlXL49L5fX3PHM4fQx9/2TolJLXzctdFZWuVQjtoFRRkPzbj1XJxozBkuypAstLXQ9xOW+ZCNoE3gHMUYivlct4+doGz9fETFE94b87i/uajl0LlHa0e1uTjw9+r9CEV1W2mWQeEoR+ElNKt1Mn9ejHaBbHpSrMRrk0GCdIFYffyDbuzPttRtkVU18fv/3xw6VtjeUHzLaRqFmOl8L8fhXDF5Wtf9uiGOP25JSQ+3BhJnQU/lXNdxe9egjMpDynyzCfkP8/3pRLWEcv4Wzbf3IUSVuLDfxNcmm+McY4iSsip5t23d7eSMhPrYxiGGrZUXU+6W/33JgRYJXuiBmjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=nt2FsRATwimwLze+s3f7Xb4wQwEhRZ35tBEc7ilZsQ0=; b=CXci1yWLqNSpYyV8bLX1mEH+64oxqX9sNRFydoznwFiC/HDDRJyLCjJ+mcdbdfZHVguatINdb+y/cGpxkdccdkZzROvYbg4V48ljgBbpyLvs4cogTE5tfvSIpAA4q5jQJx4KQve8oJ46qAKNP/FNaCOZKVYoi6jKXlomZvxBzUT0gCNnRFguQ5Eu4L0h4Rnh6+aumz8uhfHeipk2x0GdgxyWUw4PZXiVtaoPDvQL4bnMgizI0/p8itU2NaQOMicAAVYfTSFVEy5Ow//n8227jU89OKYcdcyg9ngjM1jnQCEKRRZTcQHngbJBB8Hsin3se4sbiFfdmY4tE5A7DjYdSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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=nt2FsRATwimwLze+s3f7Xb4wQwEhRZ35tBEc7ilZsQ0=; b=GTybwIMhpouE3wYRWw6aQ/GtUx5JGvh/wWtTjCLYWdpwqlKKsqbgXsJ9gBbTLxiLb93WtxIM3ZvoBnpG2aFp9gD/kylAPq3+hgpJ/6LKACyn9yEck2DMpKCjdjz3FlD6ei5sGczt6tT9tnQjnPcI/Vj1PM0Fxf8qrKy/n832AzDOUnVF1tPeswGs8bLMHukjft7khefflBHJuUa/zXsLYTYZ/nuzeAj5EnJ2ZQx7lWgKxRvtaWd8hhoosG8BhQ4xh+0L1H7roZa0uL57IGKOCFVYWToK/z5hkv1u1axQVCbGlJC1z/ERwKj8T6s0Vj7PJX+N7grXd3eU5k2XyahIQg== Received: from CH2PR11CA0026.namprd11.prod.outlook.com (2603:10b6:610:54::36) by DM4PR12MB8452.namprd12.prod.outlook.com (2603:10b6:8:184::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.23; Thu, 31 Oct 2024 13:00:08 +0000 Received: from CH2PEPF00000147.namprd02.prod.outlook.com (2603:10b6:610:54:cafe::3d) by CH2PR11CA0026.outlook.office365.com (2603:10b6:610:54::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20 via Frontend Transport; Thu, 31 Oct 2024 13:00:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CH2PEPF00000147.mail.protection.outlook.com (10.167.244.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.16 via Frontend Transport; Thu, 31 Oct 2024 13:00:07 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 31 Oct 2024 05:59:53 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 31 Oct 2024 05:59:52 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 31 Oct 2024 05:59:49 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , "Andrew Lunn" CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , William Tu , Parav Pandit , Tariq Toukan Subject: [PATCH net-next 5/5] net/mlx5e: do not create xdp_redirect for non-uplink rep Date: Thu, 31 Oct 2024 14:58:56 +0200 Message-ID: <20241031125856.530927-6-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241031125856.530927-1-tariqt@nvidia.com> References: <20241031125856.530927-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF00000147:EE_|DM4PR12MB8452:EE_ X-MS-Office365-Filtering-Correlation-Id: 31cf640e-6249-44d5-cc21-08dcf9abf235 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: 6hdXyia+4hrDhVmUB+Ip/01PeSuLhQp2vXNkJNuGXKJl9bO15lI6eiReldO/fP6R1NePXp1C9Kox+b0KIDP9RtRlyzGK5HwMRtYY8YUjaftMWOa8h3a69jAFp22djIxIPF8cwc/WcTskO7Efnwwqe+xKzaWetRyk8T9+q596hF6AhnntvQfoqlFUUG7+t+G4ICKK/CaIKAFbo3Ci+2kkI/CgVxlXrcnlpQP+lgaZt7e2+Z1XcH+CsBUjQzWYsn1WA7nwJSJKYxCpwfGDfG2Kya/Z7tZ2hwJKSKWy58HtOqeaf0PS+xff8cyqdpD0htqLh/AZ/PxbiMhSHwujM4F78rnqlj28izF9t/2UpigIMXcd5y2Zg3KtH/XndN9EaJ/+BhMuR+ZrMAEVa9iF3tmBUv13vuqG2PyPs/qCkB24qGUt80/hIgTNT/YtG7Rx4xlLH6L3nSXGBZQy8J/UHN7OKn/Tuh5g71JHNNUs/yoRILnCN0j0CGcoFEoFkOKx3THC8Omm0VzSj1Ctpl7DAF+NTEcHiGDMF7NglMnvUwe7K9M54f5d3psPGvZUJGIcqBRR9UlO8KwNsTCC6JXjDa0rgRmHiPWJEV14eLEGLjN7B71+Jn989XCxT3USYR5aJ+eZgBvUlJr8wQr7zLWaEcFstEfTo/sw63mxbGBZZVskPeRHDn2QDl7pJsDLySqscqWrIe88t4eDdPsU/HlI+nFkYJn6zt0ehZPq28qDmvyhWLKYMiWjt4UWWbbQUIeMuG+KBy0wEehO0cXw6r4JvSI7KtrLVraPJCWlrZ7iLUtAVQfW7xLNXLYu4uI8BEw6dwyrEv4Wyb05lVL6jxRb1RTsNr+w0N87ET36MhaAnPQ8ZOe/BaI/vUCdWO/taRCH+g8ryT5ZQNjpMKDCWtqC+MVEXX2Tgnza7j96Yp+iVJ/1x6GGkTAwF/+9+pGfWJwqxN81wInVZmSwsjdKfOZyPYysbMPDSe0TFoxbLKYMMfsNVt8kM8NFne4wOC16dwcNghCjkMl1VIJ4bJ7EV3b3hOZihDIQWT8BsT41yue/7E1CdtT695KbRZHv97ebKfF0JD0WVVih/vzlGjzsThUyAYt3xEVOJc+WP0XdzVcPX70mRddYQMAW19cC/s2T4evar9qUosbtSMW4GKP80o5HEwG6cOP1UZEE1qPxOk/ANfT12ZZ28glhHAGVp9e6T3SP0xwKEeS0ZzIu59D/VCsijWK0MjMHkxHxOn0CmliEUbgLV7bkl1uQqaFig6i7xIkXzpVADs/J8Vcn6ul600X1QsPkR7PcWSS4tUSqZBkmYbwud3dkAcS9GglTiNKjrcbeIuf6X9GyvXtVd3PERacS7PpvRJdOiSa3pvbgrcV8efVT2cXWKtSwKILi8S5eDb5EeAfTjkIJsppFS05Exjajp8Cbew== X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 13:00:07.6697 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31cf640e-6249-44d5-cc21-08dcf9abf235 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF00000147.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8452 X-Patchwork-Delegate: kuba@kernel.org From: William Tu XDP and XDP socket require extra SQ/RQ/CQs. Most of these resources are dynamically created: no XDP program loaded, no resources are created. One exception is the SQ/CQ created for XDP_REDRIECT, used for other netdev to forward packet to mlx5 for transmit. The patch disables creation of SQ and CQ used for egress XDP_REDIRECT, by checking whether ndo_xdp_xmit is set or not. For netdev without XDP support such as non-uplink representor, this saves around 0.35MB of memory, per representor netdevice per channel. Signed-off-by: William Tu Reviewed-by: Parav Pandit Signed-off-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/en_main.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 2f609b92d29b..59d7a0e28f24 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -2514,6 +2514,7 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, struct mlx5e_params *params, struct mlx5e_channel_param *cparam) { + const struct net_device_ops *netdev_ops = c->netdev->netdev_ops; struct dim_cq_moder icocq_moder = {0, 0}; struct mlx5e_create_cq_param ccp; int err; @@ -2534,10 +2535,12 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, if (err) goto err_close_icosq_cq; - c->xdpsq = mlx5e_open_xdpredirect_sq(c, params, cparam, &ccp); - if (IS_ERR(c->xdpsq)) { - err = PTR_ERR(c->xdpsq); - goto err_close_tx_cqs; + if (netdev_ops->ndo_xdp_xmit) { + c->xdpsq = mlx5e_open_xdpredirect_sq(c, params, cparam, &ccp); + if (IS_ERR(c->xdpsq)) { + err = PTR_ERR(c->xdpsq); + goto err_close_tx_cqs; + } } err = mlx5e_open_cq(c->mdev, params->rx_cq_moderation, &cparam->rq.cqp, &ccp, @@ -2601,7 +2604,8 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, mlx5e_close_cq(&c->rq.cq); err_close_xdpredirect_sq: - mlx5e_close_xdpredirect_sq(c->xdpsq); + if (c->xdpsq) + mlx5e_close_xdpredirect_sq(c->xdpsq); err_close_tx_cqs: mlx5e_close_tx_cqs(c); @@ -2629,7 +2633,8 @@ static void mlx5e_close_queues(struct mlx5e_channel *c) if (c->xdp) mlx5e_close_cq(&c->rq_xdpsq.cq); mlx5e_close_cq(&c->rq.cq); - mlx5e_close_xdpredirect_sq(c->xdpsq); + if (c->xdpsq) + mlx5e_close_xdpredirect_sq(c->xdpsq); mlx5e_close_tx_cqs(c); mlx5e_close_cq(&c->icosq.cq); mlx5e_close_cq(&c->async_icosq.cq);