From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
To: <dev@dpdk.org>
Cc: <anoobj@marvell.com>, Chengwen Feng <fengchengwen@huawei.com>,
"Vamsi Attunuru" <vattunuru@marvell.com>,
Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Subject: [PATCH 2/4] test/dma: run tests according to PMD
Date: Thu, 10 Aug 2023 17:51:09 +0530 [thread overview]
Message-ID: <20230810122111.2329-3-gmuthukrishn@marvell.com> (raw)
In-Reply-To: <20230810122111.2329-1-gmuthukrishn@marvell.com>
Run tests according to PMD configured.
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
app/test/meson.build | 7 +++-
app/test/test_dmadev.c | 87 +++++++++++++++++++++++++++++++-----------
2 files changed, 71 insertions(+), 23 deletions(-)
diff --git a/app/test/meson.build b/app/test/meson.build
index 66897c14a3..de671b665f 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -319,7 +319,12 @@ driver_test_names = [
'cryptodev_sw_snow3g_autotest',
'cryptodev_sw_zuc_autotest',
'cryptodev_uadk_autotest',
- 'dmadev_autotest',
+ 'dmadev_dpaa_autotest',
+ 'dmadev_dpaa2_autotest',
+ 'dmadev_hisilicon_autotest',
+ 'dmadev_idxd_autotest',
+ 'dmadev_ioat_autotest',
+ 'dmadev_skeleton_autotest',
]
dump_test_names = []
diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c
index abe970baaf..5e72e8535c 100644
--- a/app/test/test_dmadev.c
+++ b/app/test/test_dmadev.c
@@ -1025,40 +1025,83 @@ test_dmadev_instance(int16_t dev_id)
}
static int
-test_apis(void)
+test_dma(const char *pmd)
+{
+ int16_t devs[UINT8_MAX];
+ uint8_t nb_devs;
+ int i;
+
+ if (rte_dma_count_avail() == 0)
+ return TEST_SKIPPED;
+
+ nb_devs = rte_dma_get_dev_list_by_driver(pmd, devs, UINT8_MAX);
+ if (nb_devs == 0)
+ ERR_RETURN("Error, No device found for pmd %s\n", pmd);
+
+ printf("\n### Test dmadev infrastructure using %s driver\n", pmd);
+ if (test_dma_api(devs[0]) < 0)
+ ERR_RETURN("Error, test failure for %d device\n", devs[0]);
+
+ for (i = 0; i < nb_devs; i++)
+ if (test_dmadev_instance(devs[i]) < 0)
+ ERR_RETURN("Error, test failure for %d device\n", devs[i]);
+
+ return 0;
+}
+
+static int
+test_skeleton_dma(void)
{
const char *pmd = "dma_skeleton";
- int id;
- int ret;
- /* attempt to create skeleton instance - ignore errors due to one being already present */
+ /* Attempt to create skeleton instance - ignore errors due to one being already present */
rte_vdev_init(pmd, NULL);
- id = rte_dma_get_dev_id_by_name(pmd);
- if (id < 0)
- return TEST_SKIPPED;
- printf("\n### Test dmadev infrastructure using skeleton driver\n");
- ret = test_dma_api(id);
+ return test_dma(pmd);
+}
- return ret;
+static int
+test_dpaa_dma(void)
+{
+ const char *pmd = "dpaa_qdma";
+
+ return test_dma(pmd);
}
static int
-test_dma(void)
+test_dpaa2_dma(void)
{
- int i;
+ const char *pmd = "dpaa2_qdma";
- /* basic sanity on dmadev infrastructure */
- if (test_apis() < 0)
- ERR_RETURN("Error performing API tests\n");
+ return test_dma(pmd);
+}
- if (rte_dma_count_avail() == 0)
- return TEST_SKIPPED;
+static int
+test_hisilicon_dma(void)
+{
+ const char *pmd = "dma_hisilicon";
- RTE_DMA_FOREACH_DEV(i)
- if (test_dmadev_instance(i) < 0)
- ERR_RETURN("Error, test failure for device %d\n", i);
+ return test_dma(pmd);
+}
- return 0;
+static int
+test_idxd_dma(void)
+{
+ const char *pmd = "dmadev_idxd_pci";
+
+ return test_dma(pmd);
+}
+
+static int
+test_ioat_dma(void)
+{
+ const char *pmd = "dmadev_ioat";
+
+ return test_dma(pmd);
}
-REGISTER_TEST_COMMAND(dmadev_autotest, test_dma);
+REGISTER_TEST_COMMAND(dmadev_skeleton_autotest, test_skeleton_dma);
+REGISTER_TEST_COMMAND(dmadev_dpaa_autotest, test_dpaa_dma);
+REGISTER_TEST_COMMAND(dmadev_dpaa2_autotest, test_dpaa2_dma);
+REGISTER_TEST_COMMAND(dmadev_hisilicon_autotest, test_hisilicon_dma);
+REGISTER_TEST_COMMAND(dmadev_idxd_autotest, test_idxd_dma);
+REGISTER_TEST_COMMAND(dmadev_ioat_autotest, test_ioat_dma);
--
2.25.1
next prev parent reply other threads:[~2023-08-10 12:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 12:21 [PATCH 0/4] test/dma: run tests as per configured pmd Gowrishankar Muthukrishnan
2023-08-10 12:21 ` [PATCH 1/4] dmadev: add function to get list of device identifiers Gowrishankar Muthukrishnan
2023-10-08 1:40 ` fengchengwen
2023-08-10 12:21 ` Gowrishankar Muthukrishnan [this message]
2023-08-10 12:21 ` [PATCH 3/4] dma/cnxk: update PCI driver name Gowrishankar Muthukrishnan
2023-08-10 12:21 ` [PATCH 4/4] test/dma: enable cnxk tests Gowrishankar Muthukrishnan
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=20230810122111.2329-3-gmuthukrishn@marvell.com \
--to=gmuthukrishn@marvell.com \
--cc=anoobj@marvell.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=vattunuru@marvell.com \
/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).