[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231020175527.GD46191@thinkpad>
Date: Fri, 20 Oct 2023 23:25:27 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Frank Li <Frank.Li@....com>
Cc: manivannan.sadhasivam@...aro.org, aisheng.dong@....com,
bhelgaas@...gle.com, devicetree@...r.kernel.org,
festevam@...il.com, imx@...ts.linux.dev, jdmason@...zu.us,
kernel@...gutronix.de, kishon@...nel.org, kw@...ux.com,
linux-arm-kernel@...ts.infradead.org, linux-imx@....com,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
lorenzo.pieralisi@....com, lpieralisi@...nel.org, maz@...nel.org,
s.hauer@...gutronix.de, shawnguo@...nel.org, tglx@...utronix.de
Subject: Re: [PATCH v2 5/5] tools: PCI: Add 'B' option for test doorbell
On Mon, Sep 11, 2023 at 06:09:20PM -0400, Frank Li wrote:
> Add doorbell test support.
>
> Signed-off-by: Frank Li <Frank.Li@....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 441b542346354..215d0aa8a09fe 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");
"Ringing doorbell on the EP".
- Mani
> + 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
>
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists