From: Luis Chamberlain <mcgrof@kernel.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Robin Murphy <robin.murphy@arm.com>,
vkoul@kernel.org, chenxiang66@hisilicon.com, leon@kernel.org,
jgg@nvidia.com, alex.williamson@redhat.com,
joel.granados@kernel.org, iommu@lists.linux.dev,
dmaengine@vger.kernel.org, linux-block@vger.kernel.org,
gost.dev@samsung.com, Haavard.Skinnemoen@google.com,
Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH 1/6] fake-dma: add fake dma engine driver
Date: Thu, 22 May 2025 09:59:01 -0700 [thread overview]
Message-ID: <aC9X1VFrRJbH4bYm@bombadil.infradead.org> (raw)
In-Reply-To: <fe97e7ba-85d1-44c7-9de8-2082146f335d@samsung.com>
On Thu, May 22, 2025 at 01:18:45PM +0200, Marek Szyprowski wrote:
> On 21.05.2025 19:07, Luis Chamberlain wrote:
> > On Wed, May 21, 2025 at 03:20:11PM +0100, Robin Murphy wrote:
> >> On 2025-05-20 11:39 pm, Luis Chamberlain wrote:
> >>> Today on x86_64 q35 guests we can't easily test some of the DMA API
> >>> with the dmatest out of the box because we lack a DMA engine as the
> >>> current qemu intel IOT patches are out of tree. This implements a basic
> >>> dma engine to let us use the dmatest API to expand on it and leverage
> >>> it on q35 guests.
> >> What does doing so ultimately achieve though?
> > What do you do to test for regressions automatically today for the DMA API?
> >
> > This patch series didn't just add a fake-dma engine though but let's
> > first address that as its what you raised a question for:
> >
> > Although I didn't add them, with this we can easily enable kernel
> > selftests to now allow any q35 guest to easily run basic API tests for the
> > DMA API. It's actually how I found the dma benchmark code, as its the only
> > selftest we have for DMA. However that benchmark test is not easy to
> > configure or enable. With kernel selftests you can test for things
> > outside of the scope of performance.
>
> IMHO adding a fake driver just to use some of its side-effects that are
> related with dma-mapping without the obvious information what would
> actually be tested, is not the right approach. Maybe the dma benchmark
> code can be extended with similar functionality as the selftests for
> dma-engine, I didn't check yet.
I like the idea, however I will can save you time. The dmatest was
added with the requirement for a DMA controller exposing DMA channels
through the DMA engine. The dma benchmark does not, it test an existing device.
At a cursory glance, if we want to do something like this I think this
would be evaluating merging both. Merging both is possible if we're willing
to then make the DMA channel requests optional, as I don't think every
device which we'd bind to the DMA benchmark would / could use the DMA
channels.
The point to the fake-dma driver was to write a DMA controller which
simulates fake DMA channels and registers to the DMA engine, it exposes
these channels so we can leverage the dmatest. The DMA controller capabitilies
are a full feature set to ensure we can test all APIs used for them through
DMA channels. At first I was under the impression DMA controllers always
need to register DMA channels, however I'm now under the impression DMA
controllers don't need to expose DMA channels. Is that right?
If DMA channels are optional and a specialized feature only leveraged
by certain devices, then bundling this into dma-benchmark just
architecturally doesn't make sense.
> It would be better to have such self-test in the proper layer.
Agreed. Perhaps the dmatest reflects the age of the evolution of the
DMA engine with some specialized DMA controllers with DMA channels,
either private or public for verfy specialized offload operations. And
that's optional?
Regardless, its a feature of the DMA engine, and if we want to keep
test coverage for it, my point that its not feasible today to test
dmatest on q35 guests stands, still validating the need for something
like the fake-dma driver.
Then we'd need stick with two selftests:
- dmatest - perhaps should be renamed for the emphasis on channels
- dma-benchmark - for regular DMA API
If this is correct, this patchset still seems to be going in the
right direction.
> If adding the needed functionality to dma
> benchmark is not possible, then maybe create another self-test, which
> will do similar calls to the dma-mapping api as those dma-engine
> self-tests do, but without the whole dma-engine related part.
That's what this patchset does already. What I wish was easier was
to not have to *require* doing to unbind/bind of a real device. That
would allow us to also enable CI testing through virtualization. I'll
try the few knobs suggested by Leon to see if that enables it.
Luis
next prev parent reply other threads:[~2025-05-22 16:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 22:39 [PATCH 0/6] dma: fake-dma and IOVA tests Luis Chamberlain
2025-05-20 22:39 ` [PATCH 1/6] fake-dma: add fake dma engine driver Luis Chamberlain
2025-05-21 14:20 ` Robin Murphy
2025-05-21 17:07 ` Luis Chamberlain
2025-05-22 11:18 ` Marek Szyprowski
2025-05-22 16:59 ` Luis Chamberlain [this message]
2025-05-22 19:38 ` Luis Chamberlain
2025-05-21 23:40 ` kernel test robot
2025-05-20 22:39 ` [PATCH 2/6] dmatest: split dmatest_func() into helpers Luis Chamberlain
2025-05-20 22:39 ` [PATCH 3/6] dmatest: move printing to its own routine Luis Chamberlain
2025-05-21 14:41 ` Robin Murphy
2025-05-21 17:10 ` Luis Chamberlain
2025-05-21 22:26 ` kernel test robot
2025-05-20 22:39 ` [PATCH 4/6] dmatest: add IOVA tests Luis Chamberlain
2025-05-20 22:39 ` [PATCH 5/6] dma-mapping: benchmark: move validation parameters into a helper Luis Chamberlain
2025-05-20 22:39 ` [PATCH 6/6] dma-mapping: benchmark: add IOVA support Luis Chamberlain
2025-05-21 11:58 ` kernel test robot
2025-05-21 16:08 ` Robin Murphy
2025-05-21 17:17 ` Luis Chamberlain
2025-05-21 11:17 ` [PATCH 0/6] dma: fake-dma and IOVA tests Leon Romanovsky
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=aC9X1VFrRJbH4bYm@bombadil.infradead.org \
--to=mcgrof@kernel.org \
--cc=Haavard.Skinnemoen@google.com \
--cc=alex.williamson@redhat.com \
--cc=chenxiang66@hisilicon.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=gost.dev@samsung.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=joel.granados@kernel.org \
--cc=leon@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.com \
--cc=vkoul@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).