[25.11 PATCH v3 0/5] Introduce DMA enqueue/dequeue operations
pbhagavatula at marvell.com
pbhagavatula at marvell.com
Sat May 24 11:13:10 CEST 2025
From: Pavan Nikhilesh <pbhagavatula at marvell.com>
Introduce DMA enqueue/dequeue operations to the DMA device library.
Add configuration flags to rte_dma_config instead of boolean for
individual features.
The enqueue/dequeue operations allow applications to communicate with the
DMA device using the rte_dma_op structure, providing a more flexible and
efficient way to manage DMA operations.
The programming model for the enqueue/dequeue operations is as follows:
* Query DMA devices capability for RTE_DMA_CAPA_OPS_ENQ_DEQ through
rte_dma_info::dev_capa.
* Enable enqueue/dequeue operations on DMA device by enabling the
flag RTE_DMA_CFG_FLAG_ENQ_DEQ in rte_dma_config::flags
during device configuration.
* Allocate a mempool for rte_dma_ops with object size of
rte_dma_op + (sizeof(struct rte_dma_sge) * rte_dma_info::max_sges * 2).
* Configure vchans and start the dma device.
* Get an rte_dma_op from the mempool, fill it with the necessary
information and use rte_dma_enqueue() to enqueue the operation.
* The enqueue operation behaves as a submit i.e., all the ops enqueued
should be considered as submitted.
* Call rte_dma_dequeue() operation to get the array of finished operations.
* Free the rte_dma_op back to the mempool.
The ``rte_event_dma_adapter_op`` structure encapsulates all the
necessary fields required for DMA operations and does not introduce
any hard dependencies. Given its completeness and modular design,
it is a suitable candidate for reuse within the DMA library as
``rte_dma_op``.
This approach promotes consistency across subsystems, reduces code
duplication, and simplifies maintenance by leveraging an existing,
well-defined data structure.
Note: Not all fields inside ``rte_dma_ops`` are used by the DMA device
as some of them are valid only in the context of event device
programming model and can be repurposed by the application.
These include ``op_mp``, ``impl_opaque``,
``user_meta``, ``event_meta``, ``dma_dev_id`` and ``vchan``.
When the DMA device is configured with RTE_DMA_CFG_FLAG_ENQ_DEQ
flag, the enqueue/dequeue operations should be used to perform
DMA operations.
All other operations i.e., rte_dma_copy, rte_dma_copy_sg,
rte_dma_fill, rte_dma_submit, rte_dma_completed,
rte_dma_completed_status are not supported.
On OCTEON CNXK platform, we observed upto 20% latency reduction by using
enqueue and dequeue ops.
v2 Changes:
- Split app/test changes to new patch.
- update app/test-dma-perf by adding option to test enq/deq ops.
v3 Changes:
- Fix github build failure.
Pavan Nikhilesh (5):
dmadev: add enqueue dequeue operations
test/dma: add enqueue dequeue operations
app/dma-perf: add option to measure enq deq ops
dma/cnxk: implement enqueue dequeue ops
eventdev: refactor DMA adapter ops
app/test-dma-perf/benchmark.c | 137 +++++++++++-
app/test-dma-perf/config.ini | 3 +
app/test-dma-perf/main.c | 13 +-
app/test-dma-perf/main.h | 1 +
app/test-eventdev/test_perf_common.c | 6 +-
app/test-eventdev/test_perf_common.h | 4 +-
app/test/test_dmadev.c | 160 ++++++++++++++
app/test/test_dmadev_api.c | 78 ++++++-
app/test/test_event_dma_adapter.c | 6 +-
doc/guides/prog_guide/dmadev.rst | 34 +++
.../prog_guide/eventdev/event_dma_adapter.rst | 6 +-
doc/guides/tools/dmaperf.rst | 5 +
drivers/dma/cnxk/cnxk_dmadev.c | 80 +++++--
drivers/dma/cnxk/cnxk_dmadev.h | 7 +
drivers/dma/cnxk/cnxk_dmadev_fp.c | 201 +++++++++++++++---
drivers/dma/dpaa/dpaa_qdma.c | 2 +-
drivers/dma/dpaa2/dpaa2_qdma.c | 2 +-
lib/dmadev/rte_dmadev.c | 30 ++-
lib/dmadev/rte_dmadev.h | 155 +++++++++++++-
lib/dmadev/rte_dmadev_core.h | 10 +
lib/dmadev/rte_dmadev_trace.h | 2 +-
lib/dmadev/rte_dmadev_trace_fp.h | 20 ++
lib/dmadev/rte_dmadev_trace_points.c | 8 +
lib/eventdev/rte_event_dma_adapter.c | 18 +-
lib/eventdev/rte_event_dma_adapter.h | 57 -----
25 files changed, 886 insertions(+), 159 deletions(-)
--
2.43.0
More information about the dev
mailing list