diff mbox series

[v10,11/26] sfc: initialize dpa resources

Message ID 20250205151950.25268-12-alucerop@amd.com (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series cxl: add type2 device basic support | expand

Checks

Context Check Description
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Alejandro Lucero Palau Feb. 5, 2025, 3:19 p.m. UTC
From: Alejandro Lucero <alucerop@amd.com>

Use cxl dpa setup functions for defining and initializing dpa.

Signed-off-by: Alejandro Lucero <alucerop@amd.com>
---
 drivers/net/ethernet/sfc/efx_cxl.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/sfc/efx_cxl.c b/drivers/net/ethernet/sfc/efx_cxl.c
index b44c29efa176..d7279f9ca8fc 100644
--- a/drivers/net/ethernet/sfc/efx_cxl.c
+++ b/drivers/net/ethernet/sfc/efx_cxl.c
@@ -20,10 +20,12 @@ 
 
 int efx_cxl_init(struct efx_probe_data *probe_data)
 {
+	struct cxl_dpa_info sfc_dpa_info = { 0 };
 	struct efx_nic *efx = &probe_data->efx;
 	struct pci_dev *pci_dev = efx->pci_dev;
 	DECLARE_BITMAP(expected, CXL_MAX_CAPS);
 	DECLARE_BITMAP(found, CXL_MAX_CAPS);
+	struct mds_info sfc_mds_info;
 	struct efx_cxl *cxl;
 
 	u16 dvsec;
@@ -78,6 +80,20 @@  int efx_cxl_init(struct efx_probe_data *probe_data)
 	 */
 	cxl_set_media_ready(cxl->cxlmds);
 
+	sfc_mds_info.total_bytes = EFX_CTPIO_BUFFER_SIZE;
+	sfc_mds_info.volatile_only_bytes = EFX_CTPIO_BUFFER_SIZE;
+	sfc_mds_info.persistent_only_bytes = 0;
+
+	cxl_dev_state_setup(cxl->cxlmds, &sfc_mds_info);
+
+	rc = cxl_mem_dpa_fetch(cxl->cxlmds, &sfc_dpa_info);
+	if (rc)
+		goto err_regs;
+
+	rc = cxl_dpa_setup(cxl->cxlmds, &sfc_dpa_info);
+	if (rc)
+		goto err_regs;
+
 	probe_data->cxl = cxl;
 
 	return 0;