From: Frank Li <Frank.Li@nxp.com>
To: tglx@linutronix.de
Cc: aisheng.dong@nxp.com, bhelgaas@google.com,
devicetree@vger.kernel.org, festevam@gmail.com, frank.li@nxp.com,
imx@lists.linux.dev, jdmason@kudzu.us, kernel@pengutronix.de,
kishon@ti.com, krzysztof.kozlowski+dt@linaro.org, kw@linux.com,
linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
lorenzo.pieralisi@arm.com, lpieralisi@kernel.org,
manivannan.sadhasivam@linaro.org, maz@kernel.org,
ntb@lists.linux.dev, peng.fan@nxp.com, robh+dt@kernel.org,
s.hauer@pengutronix.de, shawnguo@kernel.org
Subject: [PATCH 3/3] tools: PCI: Add 'B' option for test doorbell
Date: Wed, 26 Apr 2023 16:34:36 -0400 [thread overview]
Message-ID: <20230426203436.1277307-4-Frank.Li@nxp.com> (raw)
In-Reply-To: <20230426203436.1277307-1-Frank.Li@nxp.com>
Add doorbell test support.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
tools/pci/pcitest.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c
index 441b54234635..215d0aa8a09f 100644
--- a/tools/pci/pcitest.c
+++ b/tools/pci/pcitest.c
@@ -36,6 +36,7 @@ struct pci_test {
bool copy;
unsigned long size;
bool use_dma;
+ bool doorbell;
};
static int run_test(struct pci_test *test)
@@ -149,6 +150,15 @@ static int run_test(struct pci_test *test)
fprintf(stdout, "%s\n", result[ret]);
}
+ if (test->doorbell) {
+ ret = ioctl(fd, PCITEST_DOORBELL, 0);
+ fprintf(stdout, "Push doorbell\t\t");
+ if (ret < 0)
+ fprintf(stdout, "TEST FAILED\n");
+ else
+ fprintf(stdout, "%s\n", result[ret]);
+ }
+
fflush(stdout);
close(fd);
return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */
@@ -174,7 +184,7 @@ int main(int argc, char **argv)
/* 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:BdeIlhrwcs:")) != EOF)
switch (c) {
case 'D':
test->device = optarg;
@@ -224,6 +234,9 @@ int main(int argc, char **argv)
case 'd':
test->use_dma = true;
continue;
+ case 'B':
+ test->doorbell = true;
+ continue;
case 'h':
default:
usage:
@@ -243,6 +256,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-B Doorbell test\n"
"\t-h Print this help message\n",
argv[0]);
return -EINVAL;
--
2.34.1
next prev parent reply other threads:[~2023-04-26 20:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-26 20:34 [PATCH 0/3] Add RC-to-EP doorbell with platform MSI controller Frank Li
2023-04-26 20:34 ` [PATCH 1/3] PCI: endpoint: Add RC-to-EP doorbell support using " Frank Li
2023-09-02 4:52 ` Manivannan Sadhasivam
2023-09-02 4:53 ` Manivannan Sadhasivam
2023-09-06 4:24 ` Frank Li
2023-09-06 12:26 ` Manivannan Sadhasivam
2023-09-06 14:33 ` Frank Li
2023-09-06 14:52 ` Manivannan Sadhasivam
2023-09-06 15:00 ` Frank Li
2023-09-06 15:27 ` Manivannan Sadhasivam
2023-09-06 15:36 ` Frank Li
2023-04-26 20:34 ` [PATCH 2/3] misc: pci_endpoint_test: Add doorbell test case Frank Li
2023-09-02 5:11 ` Manivannan Sadhasivam
2023-04-26 20:34 ` Frank Li [this message]
2023-05-12 14:45 ` [PATCH 0/3] Add RC-to-EP doorbell with platform MSI controller Frank Li
2023-06-12 16:17 ` Frank Li
2023-07-17 14:06 ` Frank Li
2023-08-24 19:01 ` Frank Li
2023-08-25 8:34 ` Manivannan Sadhasivam
2023-08-30 7:36 ` Li Chen
2023-08-30 18:27 ` Frank Li
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=20230426203436.1277307-4-Frank.Li@nxp.com \
--to=frank.li@nxp.com \
--cc=aisheng.dong@nxp.com \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=jdmason@kudzu.us \
--cc=kernel@pengutronix.de \
--cc=kishon@ti.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=maz@kernel.org \
--cc=ntb@lists.linux.dev \
--cc=peng.fan@nxp.com \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=tglx@linutronix.de \
/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).