From: Alejandro Lucero Palau <alucerop@amd.com>
To: Gregory Price <gourry@gourry.net>
Cc: linux-cxl@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 22/22] sfc: support pio mapping based on cxl
Date: Fri, 20 Feb 2026 08:04:38 +0000 [thread overview]
Message-ID: <b1c31603-b94b-4863-9e01-10e0c1df9b67@amd.com> (raw)
In-Reply-To: <20260213161410.2945294-3-gourry@gourry.net>
On 2/13/26 16:14, Gregory Price wrote:
> This review was generated by kreview-0811365ff2.
>
> This is not an automated email, the reviewer though this report
> looked valid enough to consider discussion.
>
> ----
> I am completely unfamiliar with this code, but the question it poses
> at least seems reasonable.
Yes, and again, it makes sense. We have only tried with one VI, so that
explains why we have not suffered the issue. But it needs to be fixed.
Thanks!
> ~Gregory
> ----
>
> On Sat, Feb 01, 2026, Alejandro Lucero wrote:
>
>> diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
>> index fcec81f862ec..2bb6d3136c7c 100644
>> --- a/drivers/net/ethernet/sfc/ef10.c
>> +++ b/drivers/net/ethernet/sfc/ef10.c
> [ ... ]
>
>> @@ -1263,8 +1281,25 @@ static int efx_ef10_dimension_resources(struct efx_nic *efx)
>> iounmap(efx->membase);
>> efx->membase = membase;
>>
>> - /* Set up the WC mapping if needed */
>> - if (wc_mem_map_size) {
>> + if (!wc_mem_map_size)
>> + goto skip_pio;
>> +
>> + /* Set up the WC mapping */
>> +
>> +#ifdef CONFIG_SFC_CXL
>> + probe_data = container_of(efx, struct efx_probe_data, efx);
>> + if ((nic_data->datapath_caps3 &
>> + (1 << MC_CMD_GET_CAPABILITIES_V7_OUT_CXL_CONFIG_ENABLE_LBN)) &&
>> + probe_data->cxl_pio_initialised) {
>> + /* Using PIO through CXL mapping? */
>> + nic_data->pio_write_base = probe_data->cxl->ctpio_cxl +
>> + (pio_write_vi_base * efx->vi_stride +
>> + ER_DZ_TX_PIOBUF - uc_mem_map_size);
>> + probe_data->cxl_pio_in_use = true;
>> + } else
>> +#endif
>> + {
>> + /* Using legacy PIO BAR mapping */
>> nic_data->wc_membase = ioremap_wc(efx->membase_phys +
>> uc_mem_map_size,
>> wc_mem_map_size);
>> @@ -1279,12 +1314,13 @@ static int efx_ef10_dimension_resources(struct efx_nic *efx)
>> nic_data->wc_membase +
>> (pio_write_vi_base * efx->vi_stride + ER_DZ_TX_PIOBUF -
>> uc_mem_map_size);
>> -
>> - rc = efx_ef10_link_piobufs(efx);
>> - if (rc)
>> - efx_ef10_free_piobufs(efx);
>> }
> The CXL path sets nic_data->pio_write_base but does not set
> nic_data->pio_write_vi_base, while the legacy path does:
>
> nic_data->pio_write_vi_base = pio_write_vi_base;
>
> Since nic_data is kzalloc'd, pio_write_vi_base stays at 0 in the CXL
> path. efx_ef10_link_piobufs() then uses nic_data->pio_write_vi_base
> to issue MC_CMD_LINK_PIOBUF commands:
>
> MCDI_SET_DWORD(inbuf, LINK_PIOBUF_IN_TXQ_INSTANCE,
> nic_data->pio_write_vi_base + index);
>
> and also for the special-case check:
>
> if (tx_queue->queue == nic_data->pio_write_vi_base) {
>
> Wouldn't this link PIO buffers to incorrect VI instances when using
> CXL, since the local variable pio_write_vi_base has the correct
> non-zero value but the struct field was never updated?
prev parent reply other threads:[~2026-02-20 8:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260201155438.2664640-1-alejandro.lucero-palau@amd.com>
[not found] ` <20260201155438.2664640-15-alejandro.lucero-palau@amd.com>
2026-02-13 16:14 ` [PATCH 14/22] cxl: Define a driver interface for DPA allocation Gregory Price
2026-02-16 12:34 ` Alejandro Lucero Palau
[not found] ` <20260201155438.2664640-22-alejandro.lucero-palau@amd.com>
2026-02-13 16:14 ` [PATCH 21/22] sfc: create cxl region Gregory Price
2026-02-20 8:00 ` Alejandro Lucero Palau
[not found] ` <20260201155438.2664640-23-alejandro.lucero-palau@amd.com>
2026-02-13 16:14 ` [PATCH 22/22] sfc: support pio mapping based on cxl Gregory Price
2026-02-20 8:04 ` Alejandro Lucero Palau [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b1c31603-b94b-4863-9e01-10e0c1df9b67@amd.com \
--to=alucerop@amd.com \
--cc=gourry@gourry.net \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®