[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2be540bf-ea3f-42da-93f3-0dd35eb7a6b7@amd.com>
Date: Mon, 10 Nov 2025 12:08:21 +0000
From: Alejandro Lucero Palau <alucerop@....com>
To: Dave Jiang <dave.jiang@...el.com>, alejandro.lucero-palau@....com,
linux-cxl@...r.kernel.org, netdev@...r.kernel.org, dan.j.williams@...el.com,
edward.cree@....com, davem@...emloft.net, kuba@...nel.org,
pabeni@...hat.com, edumazet@...gle.com
Cc: Martin Habets <habetsm.xilinx@...il.com>,
Edward Cree <ecree.xilinx@...il.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Ben Cheatham <benjamin.cheatham@....com>
Subject: Re: [PATCH v19 14/22] sfc: get endpoint decoder
On 10/15/25 21:15, Dave Jiang wrote:
>
> On 10/6/25 3:01 AM, alejandro.lucero-palau@....com wrote:
>> From: Alejandro Lucero <alucerop@....com>
>>
>> Use cxl api for getting DPA (Device Physical Address) to use through an
>> endpoint decoder.
>>
>> Signed-off-by: Alejandro Lucero <alucerop@....com>
>> Reviewed-by: Martin Habets <habetsm.xilinx@...il.com>
>> Acked-by: Edward Cree <ecree.xilinx@...il.com>
>> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
>> Reviewed-by: Ben Cheatham <benjamin.cheatham@....com>
>> ---
>> drivers/net/ethernet/sfc/efx_cxl.c | 12 +++++++++++-
>> 1 file changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/sfc/efx_cxl.c b/drivers/net/ethernet/sfc/efx_cxl.c
>> index d7c34c978434..1a50bb2c0913 100644
>> --- a/drivers/net/ethernet/sfc/efx_cxl.c
>> +++ b/drivers/net/ethernet/sfc/efx_cxl.c
>> @@ -108,6 +108,14 @@ int efx_cxl_init(struct efx_probe_data *probe_data)
>> return -ENOSPC;
>> }
>>
>> + cxl->cxled = cxl_request_dpa(cxl->cxlmd, CXL_PARTMODE_RAM,
>> + EFX_CTPIO_BUFFER_SIZE);
>> + if (IS_ERR(cxl->cxled)) {
>> + pci_err(pci_dev, "CXL accel request DPA failed");
>> + cxl_put_root_decoder(cxl->cxlrd);
> Might be good to create a __free() macro for freeing the root decoder instead of having to do this for every error path in this function.
We are in netdev territory here and this is not recommended, so I have
tried to avoid other uses of this kernel releasing functionality here
since the RFC.
Thanks
> DJ
>
>> + return PTR_ERR(cxl->cxled);
>> + }
>> +
>> probe_data->cxl = cxl;
>>
>> return 0;
>> @@ -115,8 +123,10 @@ int efx_cxl_init(struct efx_probe_data *probe_data)
>>
>> void efx_cxl_exit(struct efx_probe_data *probe_data)
>> {
>> - if (probe_data->cxl)
>> + if (probe_data->cxl) {
>> + cxl_dpa_free(probe_data->cxl->cxled);
>> cxl_put_root_decoder(probe_data->cxl->cxlrd);
>> + }
>> }
>>
>> MODULE_IMPORT_NS("CXL");
Powered by blists - more mailing lists