From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Niklas Cassel <cassel@kernel.org>
Cc: kw@linux.com, gregkh@linuxfoundation.org, arnd@arndb.de,
lpieralisi@kernel.org, shuah@kernel.org, kishon@kernel.org,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
bhelgaas@google.com, linux-arm-msm@vger.kernel.org,
robh@kernel.org, linux-kselftest@vger.kernel.org,
Aman Gupta <aman1.gupta@samsung.com>,
Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>
Subject: Re: [PATCH v4 3/3] selftests: pci_endpoint: Migrate to Kselftest framework
Date: Wed, 1 Jan 2025 00:48:12 +0530 [thread overview]
Message-ID: <20241231191812.ymyss2dh7naz4oda@thinkpad> (raw)
In-Reply-To: <Z3QtEihbiKIGogWA@ryzen>
On Tue, Dec 31, 2024 at 06:42:42PM +0100, Niklas Cassel wrote:
> On Tue, Dec 31, 2024 at 06:43:41PM +0530, Manivannan Sadhasivam wrote:
>
> (...)
>
> > + # RUN pci_ep_data_transfer.dma.COPY_TEST ...
> > + # OK pci_ep_data_transfer.dma.COPY_TEST
> > + ok 11 pci_ep_data_transfer.dma.COPY_TEST
> > + # PASSED: 11 / 11 tests passed.
> > + # Totals: pass:11 fail:0 xfail:0 xpass:0 skip:0 error:0
> > +
> > +
> > +Testcase 11 (pci_ep_data_transfer.dma.COPY_TEST) will fail for most of the DMA
> > +capable endpoint controllers due to the absence of the MEMCPY over DMA. For such
> > +controllers, it is advisable to skip the forementioned testcase using below
> > +command::
>
> Hm.. this is strictly not correct. If will currently fail because pci-epf-test.c
> does:
> if ((reg->flags & FLAG_USE_DMA) && epf_test->dma_private)
> return -EINVAL;
>
> So even if a DMA driver has support for the DMA_MEMCPY cap, if the DMA driver
> also has the DMA_PRIVATE cap, this test will fail because of the code in
> pci-epf-test.c.
>
Right. But I think the condition should be changed to test for the MEMCPY
capability instead. Like,
diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index ef6677f34116..0b211d60a85b 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -328,7 +328,7 @@ static void pci_epf_test_copy(struct pci_epf_test *epf_test,
void *copy_buf = NULL, *buf;
if (reg->flags & FLAG_USE_DMA) {
- if (epf_test->dma_private) {
+ if (!dma_has_cap(DMA_MEMCPY, epf_test->dma_chan_tx->device->cap_mask)) {
dev_err(dev, "Cannot transfer data using DMA\n");
ret = -EINVAL;
goto set_status;
> Not sure how to formulate this properly... Perhaps:
> Testcase 11 (pci_ep_data_transfer.dma.COPY_TEST) will fail for DMA drivers that
> have the DMA_PRIVATE cap set. For DMA drivers which have the DMA_PRIVATE cap
> set, it is advisable to skip the forementioned testcase using below command::
>
> > +
> > + # pci_endpoint_test -f pci_ep_basic -v memcpy -T COPY_TEST -v dma
>
> Is this really correct? I would guess that it should be
> pci_endpoint_test -f pci_ep_data_transfer -v memcpy -T COPY_TEST -v dma
>
ah, typo. Thanks for catching!
>
> (...)
>
> > +TEST_F(pci_ep_basic, BAR_TEST)
> > +{
> > + int ret, i;
> > +
> > + for (i = 0; i <= 5; i++) {
> > + pci_ep_ioctl(PCITEST_BAR, i);
> > + EXPECT_FALSE(ret) TH_LOG("Test failed for BAR%d", i);
> > + }
> > +}
>
> From looking at this function, will we still be able to test a single BAR?
> Previous pcitest.c allowed us to do pcitest -b <barno> to only test a
> specific BAR. I think that is a useful feature that we shouldn't remove.
>
> It would be nice if we could do something like:
> # pci_endpoint_test -f pci_ep_basic -T BAR_TEST -v <barno>
>
I'll try to add it.
>
> (...)
>
> > +
> > +TEST_F(pci_ep_data_transfer, COPY_TEST)
> > +{
> > + struct pci_endpoint_test_xfer_param param = {0};
>
> This (also other places in this file) can be written as:
> struct pci_endpoint_test_xfer_param param = {};
>
Ack.
- Mani
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2024-12-31 19:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-31 13:13 [PATCH v4 0/3] Migrate PCI Endpoint Subsystem tests to Kselftest Manivannan Sadhasivam
2024-12-31 13:13 ` [PATCH v4 1/3] misc: pci_endpoint_test: Fix the return value of IOCTL Manivannan Sadhasivam
2024-12-31 16:57 ` Niklas Cassel
2024-12-31 18:51 ` Manivannan Sadhasivam
2024-12-31 13:13 ` [PATCH v4 2/3] selftests: Move PCI Endpoint tests from tools/pci to Kselftests Manivannan Sadhasivam
2024-12-31 17:17 ` Niklas Cassel
2024-12-31 18:53 ` Manivannan Sadhasivam
2024-12-31 13:13 ` [PATCH v4 3/3] selftests: pci_endpoint: Migrate to Kselftest framework Manivannan Sadhasivam
2024-12-31 17:42 ` Niklas Cassel
2024-12-31 19:18 ` Manivannan Sadhasivam [this message]
2024-12-31 19:33 ` Niklas Cassel
2025-01-02 7:04 ` Manivannan Sadhasivam
2025-01-02 14:23 ` Niklas Cassel
2025-01-16 4:47 ` Manivannan Sadhasivam
2025-01-16 10:30 ` Niklas Cassel
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=20241231191812.ymyss2dh7naz4oda@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=aman1.gupta@samsung.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=kishon@kernel.org \
--cc=kw@linux.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=p.rajanbabu@samsung.com \
--cc=robh@kernel.org \
--cc=shuah@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