[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230317113238.142970-10-mie@igel.co.jp>
Date: Fri, 17 Mar 2023 20:32:36 +0900
From: Shunsuke Mie <mie@...l.co.jp>
To: Gustavo Pimentel <gustavo.pimentel@...opsys.com>
Cc: Vinod Koul <vkoul@...nel.org>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Manivannan Sadhasivam <mani@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Shunsuke Mie <mie@...l.co.jp>,
Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Frank Li <Frank.Li@....com>, linux-kernel@...r.kernel.org,
dmaengine@...r.kernel.org, linux-pci@...r.kernel.org
Subject: [RFC PATCH 09/11] tools: PCI: Add 'C' option to support continuous transfer
Add a new command line option 'C' to specify the number of transfers to
perform continuously. This option helps to detect problem of DMAC in DMA
transfers. By default, the number is set to 1.
Signed-off-by: Shunsuke Mie <mie@...l.co.jp>
---
tools/pci/pcitest.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c
index 441b54234635..a66b28e1e65e 100644
--- a/tools/pci/pcitest.c
+++ b/tools/pci/pcitest.c
@@ -35,6 +35,7 @@ struct pci_test {
bool write;
bool copy;
unsigned long size;
+ unsigned long count;
bool use_dma;
};
@@ -115,6 +116,7 @@ static int run_test(struct pci_test *test)
if (test->write) {
param.size = test->size;
+ param.count = test->count;
if (test->use_dma)
param.flags = PCITEST_FLAGS_USE_DMA;
ret = ioctl(fd, PCITEST_WRITE, ¶m);
@@ -127,6 +129,7 @@ static int run_test(struct pci_test *test)
if (test->read) {
param.size = test->size;
+ param.count = test->count;
if (test->use_dma)
param.flags = PCITEST_FLAGS_USE_DMA;
ret = ioctl(fd, PCITEST_READ, ¶m);
@@ -139,6 +142,7 @@ static int run_test(struct pci_test *test)
if (test->copy) {
param.size = test->size;
+ param.count = test->count;
if (test->use_dma)
param.flags = PCITEST_FLAGS_USE_DMA;
ret = ioctl(fd, PCITEST_COPY, ¶m);
@@ -171,10 +175,13 @@ int main(int argc, char **argv)
/* set default size as 100KB */
test->size = 0x19000;
+ /* set default transfer count */
+ test->count = 1;
+
/* set default endpoint device */
test->device = "/dev/pci-endpoint-test.0";
- while ((c = getopt(argc, argv, "D:b:m:x:i:deIlhrwcs:")) != EOF)
+ while ((c = getopt(argc, argv, "D:b:m:x:i:deIlhrwcs:C:")) != EOF)
switch (c) {
case 'D':
test->device = optarg;
@@ -221,6 +228,9 @@ int main(int argc, char **argv)
case 's':
test->size = strtoul(optarg, NULL, 0);
continue;
+ case 'C':
+ test->count = strtoul(optarg, NULL, 0);
+ continue;
case 'd':
test->use_dma = true;
continue;
@@ -243,6 +253,7 @@ int main(int argc, char **argv)
"\t-w Write buffer test\n"
"\t-c Copy buffer test\n"
"\t-s <size> Size of buffer {default: 100KB}\n"
+ "\t-C <count> Number of The continuous data transfers {default: 1}\n"
"\t-h Print this help message\n",
argv[0]);
return -EINVAL;
--
2.25.1
Powered by blists - more mailing lists