On Fri, 27 Jun 2026 at 08:09, fengchengwen <[email protected]> wrote:
>
> >  - dev_info_get: advertise RTE_DMA_CAPA_MEM_TO_MEM and the fixed
> >    ring depth.
>
> It seemed declare support 2~32 depth, not fixed

Right. The commit log is reworded in v4 to say the device supports a
2 to 32 descriptor range (rounded up to a power of two), not a fixed
depth.

> > +    if (sizeof(struct rte_dma_conf) != conf_sz)
> > +        return -EINVAL;
> This may break ABI compatible
> ...
> > +    if (sizeof(struct rte_dma_vchan_conf) != qconf_sz)
> > +        return -EINVAL;
> This may break ABI compatible

Both changed to "conf_sz < sizeof(...)" / "qconf_sz < sizeof(...)" in
dev_configure and vchan_setup.

> > +    if (max_desc < 2)
> > +        return -EINVAL;
> No need to do this because rte_dma_vchan_setup already do it.
> ...
> > +    if (max_desc > AE4DMA_DESCRIPTORS_PER_CMDQ) {
> No need to do this because rte_dma_vchan_setup already do it.

Removed both. The framework clamps nb_desc to the advertised
[min_desc, max_desc] range before calling us.

The power-of-two rounding is kept, though: the framework-visible ring
index is free-running and the HW ring slot is derived from it by
masking ((hw_base + idx) & (nb_desc - 1)), which is only correct for a
power-of-two depth. I added a comment to that effect.

> > +    info->dev_capa = RTE_DMA_CAPA_MEM_TO_MEM;
>
> You need also decalre support RTE_DMA_CAP_OPS_COPY, please use dpdk-test
> dmadev_autotest to test it. The dpdk-dma-perf could also test dmadev.

Added. v4 advertises RTE_DMA_CAPA_MEM_TO_MEM | RTE_DMA_CAPA_OPS_COPY.
Together with the data-path ring-index fix in patch 3/4, the device now
correctly reports memory-to-memory copy operation support.

On testing: with these fixes the device passes the DMA API tests and
dpdk-dma-perf. The "DMA dev instance" test suite enqueues 32-deep
bursts, but the AE4DMA ring holds 32 descriptors and reserves one slot
(full when (write + 1) % max == read), so at most 31 can be
outstanding. That suite is therefore skipped on this hardware; patch
4/4 makes its setup return TEST_SKIPPED rather than a hard failure,
matching the existing behaviour of the burst_capacity test (which
already skips below 64).

> > +    if (size < sizeof(*rte_stats))
> > +        return -EINVAL;
> > +    if (rte_stats == NULL)
> > +        return -EINVAL;
> No need to do this check because rte_dma_stats_get already check it
> Please make such check on other ops.

Removed the NULL/size checks in stats_get, and likewise the redundant
size check in dev_info_get (the framework validates the pointer and
passes a fixed size).

Thanks,
Raghavendra

Reply via email to