From: sashiko-bot@kernel.org
To: alejandro.lucero-palau@amd.com
Cc: linux-cxl@vger.kernel.org
Subject: Re: [PATCH v31 5/5] sfc: support pio mapping based on cxl
Date: Tue, 30 Jun 2026 15:22:17 +0000 [thread overview]
Message-ID: <20260630152217.8C2811F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260630151346.31201-6-alejandro.lucero-palau@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] Missing VI base and PIO register offsets in CXL PIO mapping, leading to hardware register corruption
--
commit 125e7b168b7494938907570e29acc3c906cb9a0a
Author: Alejandro Lucero <alucerop@amd.com>
sfc: support pio mapping based on cxl
This patch adds support for mapping PIO buffers using CXL memory if the device
supports it and is successfully initialized. Using CXL for the PIO buffer region
can help further reduce latency during TX packet exchanges.
> diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
> index 7e04f115bbaaa..73bc064929f63 100644
> --- a/drivers/net/ethernet/sfc/ef10.c
> +++ b/drivers/net/ethernet/sfc/ef10.c
[ ... ]
> @@ -1263,8 +1273,23 @@ 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;
[Severity: Critical]
Does this assignment miss the required hardware offsets for the VI base and PIO
buffer register?
In the legacy PIO BAR mapping path just below, the base is calculated with
these offsets:
pio_write_vi_base * efx->vi_stride + ER_DZ_TX_PIOBUF - uc_mem_map_size
When efx_ef10_link_piobufs() sets up the TX queue, it computes the pointer
using this base:
tx_queue->piobuf =
nic_data->pio_write_base +
index * efx->vi_stride + offset;
Without adding the VI base and PIO register offsets to the CXL mapping,
will the calculated pointer target the doorbell registers at offset 0
(e.g., ER_DZ_EVQ_RPTR, ER_DZ_TX_DESC_UPD) instead of the PIO buffers,
causing packet data writes to corrupt hardware state?
> + nic_data->pio_write_vi_base = pio_write_vi_base;
> + } else
> +#endif
> + {
> + /* Using legacy PIO BAR mapping */
> nic_data->wc_membase = ioremap_wc(efx->membase_phys +
> uc_mem_map_size,
> wc_mem_map_size);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260630151346.31201-1-alejandro.lucero-palau@amd.com?part=5
prev parent reply other threads:[~2026-06-30 15:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 15:13 [PATCH v31 0/5] Type2 device basic support alejandro.lucero-palau
2026-06-30 15:13 ` [PATCH v31 1/5] sfc: add cxl support alejandro.lucero-palau
2026-06-30 15:13 ` [PATCH v31 2/5] sfc: Map cxl regs alejandro.lucero-palau
2026-06-30 14:39 ` sashiko-bot
2026-06-30 15:13 ` [PATCH v31 3/5] sfc: Initialize cxl dpa alejandro.lucero-palau
2026-06-30 14:52 ` sashiko-bot
2026-06-30 15:13 ` [PATCH v31 4/5] sfc: obtain and map cxl range using devm_cxl_probe_mem alejandro.lucero-palau
2026-06-30 15:04 ` sashiko-bot
2026-06-30 15:13 ` [PATCH v31 5/5] sfc: support pio mapping based on cxl alejandro.lucero-palau
2026-06-30 15:22 ` sashiko-bot [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=20260630152217.8C2811F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alejandro.lucero-palau@amd.com \
--cc=linux-cxl@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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