From: Raghavendra Ningoji <raghavendra.ningoji@amd.com>
To: fengchengwen <fengchengwen@huawei.com>, <dev@dpdk.org>
Cc: Raghavendra Ningoji <raghavendra.ningoji@amd.com>,
David Marchand <david.marchand@redhat.com>,
Bruce Richardson <bruce.richardson@intel.com>,
<Selwin.Sebastian@amd.com>,
Bhagyada Modali <bhagyada.modali@amd.com>,
"Robin Jarry" <rjarry@redhat.com>,
Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [PATCH v4 3/4] dma/ae4dma: add data path operations
Date: Fri, 10 Jul 2026 12:52:49 +0530 [thread overview]
Message-ID: <20260710072250.3034265-2-raghavendra.ningoji@amd.com> (raw)
In-Reply-To: <aa1b5a05-976f-4dfa-89bc-4cea18b56d33@huawei.com>
On Mon, 7 Jul 2026 at 06:49, fengchengwen <fengchengwen@huawei.com> wrote:
>
> > + if (last_idx != NULL)
> > + *last_idx = (uint16_t)(cmd_q->next_read - 1);
>
> 1\ the last_idx always non-NULL for driver, so no need for
> 'if (last_idx != NULL)'
> 2\ last_idx should be the last success completed index
Both fixed in v5. The NULL check is dropped, and last_idx now reports
the ring_idx of the last *successfully* completed op.
> Consider four reqests, the hardware mark each request as following:
> req1 success
> req2 err
> req3 success
> req4 err
> the cpl_count will be 4, and err_count will be 2
> It will return 2 in current impl, and last_idx will be the req4's
> But in this function, it should return 1, and last_idx should be req1's
Agreed - thanks for the clear example. rte_dma_completed() is reworked
in v5 to stop at the first failed descriptor: it returns only the run of
successful ops preceding the error (1 in your example), sets *has_error,
and leaves the failed op in place with last_idx pointing at the last
success (req1). The failed op and everything after it are then drained
and reported by rte_dma_completed_status().
On a related note, while implementing the above I found the last_idx
documentation for rte_dma_completed() and rte_dma_completed_status()
to be identical:
@param[out] last_idx
The last completed operation's ring_idx.
Since rte_dma_completed() only reports operations that completed
*successfully* (it stops at the first error), its last_idx is really the
last successfully completed operation's ring_idx, whereas for
rte_dma_completed_status() it is the last completed operation regardless
of status. Would a small doc clarification along these lines be welcome
(as a separate patch)?
rte_dma_completed():
@param[out] last_idx
The last successfully completed operation's ring_idx.
I'm happy to send that as a separate dmadev doc patch if you agree.
Thanks,
Raghavendra
next prev parent reply other threads:[~2026-07-10 7:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 11:55 [PATCH v4 0/4] dma/ae4dma: add AMD AE4DMA DMA PMD Raghavendra Ningoji
2026-07-06 11:55 ` [PATCH v4 1/4] dma/ae4dma: introduce " Raghavendra Ningoji
2026-07-07 1:24 ` fengchengwen
2026-07-10 7:22 ` Raghavendra Ningoji
2026-07-06 11:55 ` [PATCH v4 2/4] dma/ae4dma: add control path operations Raghavendra Ningoji
2026-07-06 11:55 ` [PATCH v4 3/4] dma/ae4dma: add data " Raghavendra Ningoji
2026-07-07 1:19 ` fengchengwen
2026-07-10 7:22 ` Raghavendra Ningoji [this message]
2026-07-10 7:57 ` fengchengwen
2026-07-06 11:55 ` [PATCH v4 4/4] test/dma: skip instance suite on low burst capacity Raghavendra Ningoji
2026-07-07 1:41 ` fengchengwen
2026-07-10 7:22 ` Raghavendra Ningoji
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=20260710072250.3034265-2-raghavendra.ningoji@amd.com \
--to=raghavendra.ningoji@amd.com \
--cc=Selwin.Sebastian@amd.com \
--cc=bhagyada.modali@amd.com \
--cc=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=rjarry@redhat.com \
--cc=thomas@monjalon.net \
/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