[PATCH v5-S1 0/5] dpaa2: bus, DMA and mempool base fixes
Stephen Hemminger
stephen at networkplumber.org
Tue Sep 29 17:45:23 CEST 2026
On Tue, 29 Sep 2026 19:51:12 +0530
Prashant Gupta <prashant.gupta_3 at nxp.com> wrote:
> This series is the first of four that upstream the missing NXP dpaa2
> driver changes. It collects the foundational bus/fslmc, dma/dpaa2 and
> mempool/dpaa2 fixes that the later series build on:
>
> - defer fslmc bus initialization to probe; reduce probe-time logging
> and skip ignored devices during DPRC population,
> - fix a GCC -Warray-bounds warning and an SG FD double-put in the
> dpaa2 QDMA dequeue path,
> - validate the FLE pool IOVA mapping at vchan setup and free the pool
> on failure,
> - resolve the mempool ops index locally in secondary processes by
> scanning rte_mempool_ops_table, removing the need for IPC.
>
> Every commit builds cleanly (including the aarch64 DPAA cross build with
> -Werror) and the series is bisectable.
>
> Gagandeep Singh (1):
> dma/dpaa2: validate FLE pool IOVA mapping at vchan setup
>
> Hemant Agrawal (1):
> bus/fslmc: reduce probe-time logging and skip ignored devices
>
> Jun Yang (2):
> mempool/dpaa2: look up ops index locally in secondary
> dma/dpaa2: fix array-bounds warning and SG FD double-put
>
> Prashant Gupta (1):
> bus/fslmc: defer bus initialization to probe
>
> drivers/bus/fslmc/fslmc_bus.c | 92 ++++++++++++++++++--------------
> drivers/bus/fslmc/fslmc_vfio.c | 3 +-
> drivers/bus/fslmc/portal/dpaa2_hw_dprc.c | 4 ++
> drivers/dma/dpaa2/dpaa2_qdma.c | 46 ++++++++++++----
> drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 25 +++++++--
> 5 files changed, 113 insertions(+), 57 deletions(-)
>
Several AI errors here.
I think it is complaining that From and Signed-off-by don't match.
If you are managing these with git the problem is that you merged patch
but the author field didn't get set to match.
[PATCH v5-S1 0/5] dpaa2 bus/dma/mempool fixes
Series
Warning
Prashant Gupta sent patches 2-5, but they carry only the original
authors' Signed-off-by. The submitter needs to add his own
Signed-off-by to each one (DCO clause c).
Info
cdefd2e980bd made the same scan/probe move for bus/dpaa, and that
bus has the problem this series fixes for fslmc.
rte_dpaa_bus_scan() calls rte_mbuf_set_platform_mempool_ops()
(memzone reserve) and dpaax_iova_table_populate() (rte_zmalloc)
before EAL runs rte_eal_memzone_init() and
rte_eal_malloc_heap_init(). Both return values are ignored.
bus/dpaa needs a matching fix.
Patch 1 reverses part of cdefd2e980bd (the move to generic probe).
Cc David Marchand.
Patch 2/5: bus/fslmc: reduce probe-time logging and skip ignored
devices
Warning
The commit message says "clean up a redundant variable assignment
while there", but the fslmc_vfio.c hunk only changes the log
call. Drop the stale sentence.
Warning
+ if (rte_bus_device_is_ignored(&rte_fslmc_bus, dev->device.name))
+ continue;
This skip leaves ep_dev_type, ep_object_id and ep_name unset for
devices that stay on the bus. fslmc_vfio_process_group() only
removes devices with devargs->policy == RTE_DEV_BLOCKED. In
allowlist mode, unlisted devices stay on the list, still go
through fslmc_process_iodevices(), and can be attached later with
rte_dev_probe() because fslmc sets .probe_device. Such a dpni
keeps ep_dev_type == 0 (DPAA2_ETH, from the calloc() in
scan_one_fslmc_device()) and ep_object_id == 0. The loopback setup
in dpaa2_recycle.c then treats dpni.0 as self-connected, and a
DPMAC-connected port gets -ENOTSUP.
The commit message does not say what fails without the check. If
the problem is dprc_get_connection() failing for an ignored dpni
and aborting the whole DPRC, make that failure non-fatal: set
DPAA2_UNKNOWN and continue instead of skipping the query. If this
fixes a regression, add a Fixes tag.
The log level change and the ignore check are unrelated. Split
them into separate patches.
Info
Pre-existing, not introduced by this patch:
sprintf(dev->ep_name, "%s.%d", endpoint2.type, endpoint2.id);
This runs for every device, but endpoint2 is only initialized in
the DPAA2_ETH branch. A non-ETH device ahead of the first dpni
formats uninitialized stack, and type[16] need not be NUL
terminated.
Info
Pre-existing: net/dpaa2 never assigns priv->ep_dev_type,
priv->ep_object_id or priv->ep_name. The test
"if (priv->ep_dev_type != DPAA2_MAC)" in dpaa2_ethdev.c reads a
field nothing writes, and rte_pmd_dpaa2_ep_name() returns a buffer
nothing fills.
Patch 3/5: dma/dpaa2: fix array-bounds warning and SG FD double-put
Error
The SG FD change does not fix a bug. Before the patch, fle_sdd was
stored in fle_elem[] ahead of qdma_cntx_idx_ring_eq(). On -ENOSPC,
dpaa2_qdma_dequeue() clears pending, leaves the loop, and still
runs:
rte_mempool_put_bulk(qdma_vq->fle_pool,
qdma_vq->fle_elem, fle_elem_nb);
So the FLE went back to the pool exactly once. After the patch it
also goes back exactly once, through rte_mempool_put(). There was
no double put. rte_mempool_free() does not free objects
individually, so the described "double-free when the pool was
later destroyed" cannot happen. The DPAA2_QDMA_FD_LONG branch just
above keeps the same store-before-enqueue order. Drop this half,
or reword it as a cleanup with no Fixes or stable tag.
Warning
The array-bounds half does not name the compiler, version or
target, and does not quote the diagnostic. The pre-patch loop
builds clean on x86_64 with GCC 13.3 and 14.2 at -O3 -Werror
-Warray-bounds=2. The loop it replaces came from 07d679bceee3
("dma/dpaa2: refactor driver"), not 388e888dc082, so the Fixes
tag does not cover it. Make it a separate patch with its own
Fixes tag and the warning text in the message.
Info
Pre-existing: when dpaa2_qdma_dq_fd() returns -ENOSPC, the FD has
already been pulled from hardware. Its cntx_idx values never reach
the ring, so rte_dma_completed() never reports those jobs. The
early exit on
if (ret || free_space < RTE_DPAAX_QDMA_JOB_SUBMIT_MAX)
pending = 0;
also abandons any later results already written to dq_storage,
because active_dqs is then switched to dq_storage1.
Patch 4/5: dma/dpaa2: validate FLE pool IOVA mapping at vchan setup
Info
The check confirms each chunk has an fslmc mapping. It does not
check the property the fast path relies on. Enqueue converts every
FLE with
fle_iova = (uint64_t)fle - qdma_vq->fle_iova2va_offset;
and that offset comes from fle_pool->mz. That memzone is the
mempool header (mp->mz in rte_mempool_create_empty()), not the
object chunks reserved in rte_mempool_populate_default(). The
callback already has memhdr->iova. Comparing
(uint64_t)memhdr->addr - memhdr->iova against the offset would
catch a pool spread over chunks with different VA/IOVA offsets
(IOVA as PA with fragmented hugepages). The offset handling itself
is pre-existing.
Info
Pre-existing: later error paths still leave the stale pool that
the commit message describes. The two rte_mempool_get_bulk()
failures in silent mode and the ring_cntx_idx allocation failure
return without freeing fle_pool. The fle_elem rte_malloc() result
is never checked and is written in dpaa2_qdma_dq_fd().
Patch 5/5: mempool/dpaa2: look up ops index locally in secondary
Warning
This fixes a bug from de6a6e897fe6 ("mempool/dpaa2: add operation
index"), which shipped in 25.07 and is in 25.11 LTS. In a
secondary process, dpaa2_sec compares mb_pool->ops_index against
the sentinel and always takes the MAX_BPID path. Add:
Fixes: de6a6e897fe6 ("mempool/dpaa2: add operation index")
Cc: stable at dpdk.org
More information about the dev
mailing list