From patchwork Mon Nov 18 16:44:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lucero Palau, Alejandro" X-Patchwork-Id: 13878855 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2079.outbound.protection.outlook.com [40.107.100.79]) (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 D0D6F1C68B2; Mon, 18 Nov 2024 16:45:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731948324; cv=fail; b=a6tt2SgoxdmEgUxc7AN9+TElGeomyafoc+9c7usWG0iZ++ewYvbR/5OO0PGQhup86aa6SSXYm5Y4Zy0dfcHuiAPAvmtV4Jj5aYD3mTzAkpgz6q2Nb3txkG3XQXxOkpTDT1Au/ZroL8nFg9QdCqD0IBWxoAQNJ6LxKsx38LO098o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731948324; c=relaxed/simple; bh=6fS3IMzGQ65vbuOdU2xN8MSOoVUxo5huzSUg1BqkR4c=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Tn5oB0/DZKROo+jvyYow/zvdKjdVnyEanHPLPrY55PwnJ2Vrc8+U3gEsbbr19h+/KLSq4Dfn3CZf6WqQ86GKs4FUtcVfgwZKK7OxTfY9mTLJnxPH3c/hDvXBcwCZq+9BDj/xkvfXKvhV3r+0C7AZ9CvrhO2YvodzhCqtdfu1f1M= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=TBOcH4I3; arc=fail smtp.client-ip=40.107.100.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="TBOcH4I3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w5FC/+/hgbm/s4e0vyqAtg++JGokxRV0VELl2BTX6sGHpwzNpsKhry8HyENI7ylwwACYyVGcemNHviv2WAImil7pnfF40w5NCwu+N8EBYOx9XFd0n5CREtQHEEqVw9PvtLvWGVjtpPnBTiCLVJKGGNUOBMcYLvaEjRQHuRmW1B7KDC3FavjcP7P/xxmqdCXl1DxLF1G2Rj/S7Ihn9Za9gIApcEiga0XuNpLz8LVy13MPForW1ncaO0AWxGezcwotAxhxY8LczRwPTBjCbMMn4QnrYwyuCDRbF4OMCCjRFZz2mRzQsZ2o+Nn6AH1VQ2L7AAw4Un4TwkEyPdsFBMKg9A== 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=/WubTte/ckcogiS9lKn4vEmspzisbu69tyjq8pCWp+s=; b=x//dTVD329qJ2HtiE+QqcgQCE+wCcr8HpuSyf4kpmM68LojEuIcDb8Q9q5D5a9OHGouRiOmdesFL2dFzv2Bhr1+vohF7sv4h6PAf2i8vrp0JvK+nhxJfJVsHcirdShsqFAzJ3Vd1S9jLjSQyHpwUDX0O/TVnrlsbKjY7sIvkPkUy2KJeFWgeVxSGwiNh3hINrfRvI+P7vjjjOuwko13NeHVn+3d00PlCv4Rw5gJ6cQ+si53cAQ8x6SgXFA2mJvDfJxENA8xAB5nhfhTls8JjL1k4tMiZLSqd/MWrFATz9ZI9xlVGPwGFvEJDXlsY37LExrArQqEk9hr6boS4EaQ8+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.12) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/WubTte/ckcogiS9lKn4vEmspzisbu69tyjq8pCWp+s=; b=TBOcH4I3QZZfqG/uN91NULYRM01g4bntwBO8z3pA5P/nzuiP6DumWLxeabhdp6Qn6kMd8NDdead3z8mlU1gH6xsQ88Kj31kUovcUp3o/1W7gzDBlLUHIFKrsYBfbggHnnFs7DZERgMisuVM5uNlGr3VuBwsiKa98d/9AQKYsOos= Received: from BYAPR06CA0049.namprd06.prod.outlook.com (2603:10b6:a03:14b::26) by DS7PR12MB9503.namprd12.prod.outlook.com (2603:10b6:8:251::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Mon, 18 Nov 2024 16:45:20 +0000 Received: from SJ1PEPF00002327.namprd03.prod.outlook.com (2603:10b6:a03:14b:cafe::af) by BYAPR06CA0049.outlook.office365.com (2603:10b6:a03:14b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.20 via Frontend Transport; Mon, 18 Nov 2024 16:45:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.12) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.12 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.12; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.12) by SJ1PEPF00002327.mail.protection.outlook.com (10.167.242.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Mon, 18 Nov 2024 16:45:19 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 18 Nov 2024 10:45:16 -0600 Received: from xcbalucerop41x.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Mon, 18 Nov 2024 10:45:15 -0600 From: To: , , , , , , , , CC: Alejandro Lucero Subject: [PATCH v5 23/27] sfc: create cxl region Date: Mon, 18 Nov 2024 16:44:30 +0000 Message-ID: <20241118164434.7551-24-alejandro.lucero-palau@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20241118164434.7551-1-alejandro.lucero-palau@amd.com> References: <20241118164434.7551-1-alejandro.lucero-palau@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: alejandro.lucero-palau@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002327:EE_|DS7PR12MB9503:EE_ X-MS-Office365-Filtering-Correlation-Id: 66b95a20-fb83-4161-74ba-08dd07f06368 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026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Mg0Xj6MpudWZ0glkBv90Ne0jweHn2VzYtZ8WzOiHiZgcw+2KoHfaGydzViK22ywwixAhbqckiZemqtLWVo7gsJqpE3E83ICM5T6WTjMU1Xdx97bdM7dtECdeptLByYWPZBF9nUCLTaoU02QQnQDA7WmIJvxZYLfD3Z7OqKxbMe8MsfbW1gEBKCLuj0HPchy671L1N4Ab+R49YfHyTMZ7VAIHNw07xu9bac6/Zz/Z+E97eTHDEPW1FX7K6LJvUVHHWN4iCxjVitpmlF5NRyrr+F1k/h6/LztF/ih3lc7bQYYrauIFtCFtxIPeNxcDi4X7lexLTxNENx93fkKpBrWZj98EqJXx4fgNj9i1xugNWxOCOczvv4QyZgGBtuHNkO1XHA== X-Forefront-Antispam-Report: CIP:165.204.84.12;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:atlvpn-bp.amd.com;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 16:45:19.6251 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66b95a20-fb83-4161-74ba-08dd07f06368 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.12];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002327.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB9503 X-Patchwork-Delegate: kuba@kernel.org From: Alejandro Lucero Use cxl api for creating a region using the endpoint decoder related to a DPA range. Signed-off-by: Alejandro Lucero --- drivers/net/ethernet/sfc/efx_cxl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/sfc/efx_cxl.c b/drivers/net/ethernet/sfc/efx_cxl.c index 85d9632f497a..f9f3af28690b 100644 --- a/drivers/net/ethernet/sfc/efx_cxl.c +++ b/drivers/net/ethernet/sfc/efx_cxl.c @@ -128,10 +128,19 @@ int efx_cxl_init(struct efx_probe_data *probe_data) goto err3; } + cxl->efx_region = cxl_create_region(cxl->cxlrd, cxl->cxled); + if (!cxl->efx_region) { + pci_err(pci_dev, "CXL accel create region failed"); + rc = PTR_ERR(cxl->efx_region); + goto err_region; + } + probe_data->cxl = cxl; return 0; +err_region: + cxl_dpa_free(cxl->cxled); err3: cxl_release_resource(cxl->cxlds, CXL_RES_RAM); err2: @@ -145,6 +154,7 @@ int efx_cxl_init(struct efx_probe_data *probe_data) void efx_cxl_exit(struct efx_probe_data *probe_data) { if (probe_data->cxl) { + cxl_accel_region_detach(probe_data->cxl->cxled); cxl_dpa_free(probe_data->cxl->cxled); cxl_release_resource(probe_data->cxl->cxlds, CXL_RES_RAM); kfree(probe_data->cxl->cxlds);