Since the dmadev provides a common API for all devices, there should be no need to drivers to perform their own selftests, but instead should be tested by the common tests in the autotest binary.
Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> --- app/test/test_dmadev.c | 27 ++++------------- drivers/dma/skeleton/skeleton_dmadev.c | 41 +++----------------------- drivers/dma/skeleton/skeleton_dmadev.h | 3 -- lib/dmadev/rte_dmadev.c | 10 ------- lib/dmadev/rte_dmadev.h | 18 ----------- lib/dmadev/rte_dmadev_core.h | 4 --- lib/dmadev/version.map | 1 - 7 files changed, 9 insertions(+), 95 deletions(-) diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c index 62fe27b7e8..683e024a56 100644 --- a/app/test/test_dmadev.c +++ b/app/test/test_dmadev.c @@ -13,7 +13,7 @@ extern int test_dmadev_api(uint16_t dev_id); static int -test_dmadev_selftest_skeleton(void) +test_apis(void) { const char *pmd = "dma_skeleton"; int id; @@ -32,30 +32,13 @@ test_dmadev_selftest_skeleton(void) } static int -test_dmadev_selftests(void) +test_dmadev(void) { - const int count = rte_dmadev_count(); - int ret = 0; - int i; - /* basic sanity on dmadev infrastructure */ - if (test_dmadev_selftest_skeleton() < 0) + if (test_apis() < 0) return -1; - /* now run self-test on all dmadevs */ - if (count > 0) - printf("\n### Run selftest on each available dmadev\n"); - for (i = 0; i < RTE_DMADEV_MAX_DEVS; i++) { - if (rte_dmadevices[i].state != RTE_DMADEV_ATTACHED) - continue; - int result = rte_dmadev_selftest(i); - printf("dmadev %u (%s) selftest: %s\n", i, - rte_dmadevices[i].data->dev_name, - result == 0 ? "Passed" : "Failed"); - ret |= result; - } - - return ret; + return 0; } -REGISTER_TEST_COMMAND(dmadev_autotest, test_dmadev_selftests); +REGISTER_TEST_COMMAND(dmadev_autotest, test_dmadev); diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c index ad129c578c..85ba4dae54 100644 --- a/drivers/dma/skeleton/skeleton_dmadev.c +++ b/drivers/dma/skeleton/skeleton_dmadev.c @@ -30,12 +30,6 @@ /* Count of instances */ static uint16_t skeldma_init_once; -int -test_dma_skeleton(uint16_t dev_id __rte_unused) -{ - return 0; -} - static int skeldma_info_get(const struct rte_dmadev *dev, struct rte_dmadev_info *dev_info, uint32_t info_sz) @@ -436,7 +430,6 @@ static const struct rte_dmadev_ops skeldma_ops = { .stats_reset = skeldma_stats_reset, .dev_dump = skeldma_dump, - .dev_selftest = test_dma_skeleton, }; static int @@ -510,24 +503,11 @@ skeldma_parse_lcore(const char *key __rte_unused, return 0; } -static int -skeldma_parse_selftest(const char *key __rte_unused, - const char *value, - void *opaque) -{ - int flag = atoi(value); - if (flag == 0 || flag == 1) - *(int *)opaque = flag; - return 0; -} - static void -skeldma_parse_vdev_args(struct rte_vdev_device *vdev, - int *lcore_id, int *selftest) +skeldma_parse_vdev_args(struct rte_vdev_device *vdev, int *lcore_id) { static const char *const args[] = { SKELDMA_ARG_LCORE, - SKELDMA_ARG_SELFTEST, NULL }; @@ -544,11 +524,7 @@ skeldma_parse_vdev_args(struct rte_vdev_device *vdev, (void)rte_kvargs_process(kvlist, SKELDMA_ARG_LCORE, skeldma_parse_lcore, lcore_id); - (void)rte_kvargs_process(kvlist, SKELDMA_ARG_SELFTEST, - skeldma_parse_selftest, selftest); - - SKELDMA_INFO("Parse lcore_id = %d selftest = %d\n", - *lcore_id, *selftest); + SKELDMA_INFO("Parse lcore_id = %d\n", *lcore_id); rte_kvargs_free(kvlist); } @@ -558,7 +534,6 @@ skeldma_probe(struct rte_vdev_device *vdev) { const char *name; int lcore_id = -1; - int selftest = 0; int ret; name = rte_vdev_device_name(vdev); @@ -576,17 +551,10 @@ skeldma_probe(struct rte_vdev_device *vdev) return -EINVAL; } - skeldma_parse_vdev_args(vdev, &lcore_id, &selftest); + skeldma_parse_vdev_args(vdev, &lcore_id); ret = skeldma_create(name, vdev, lcore_id); if (ret >= 0) { - /* In case command line argument for 'selftest' was passed; - * if invalid arguments were passed, execution continues but - * without selftest. - */ - if (selftest) - (void)test_dma_skeleton(ret); - SKELDMA_INFO("Create %s dmadev lcore-id %d\n", name, lcore_id); /* Device instance created; Second instance not possible */ skeldma_init_once = 1; @@ -623,5 +591,4 @@ static struct rte_vdev_driver skeldma_pmd_drv = { RTE_LOG_REGISTER_DEFAULT(skeldma_logtype, INFO); RTE_PMD_REGISTER_VDEV(dma_skeleton, skeldma_pmd_drv); RTE_PMD_REGISTER_PARAM_STRING(dma_skeleton, - SKELDMA_ARG_LCORE "=<uint16> " - SKELDMA_ARG_SELFTEST "=<0|1> "); + SKELDMA_ARG_LCORE "=<uint16> "); diff --git a/drivers/dma/skeleton/skeleton_dmadev.h b/drivers/dma/skeleton/skeleton_dmadev.h index e8a310da18..8cdc2bb0c9 100644 --- a/drivers/dma/skeleton/skeleton_dmadev.h +++ b/drivers/dma/skeleton/skeleton_dmadev.h @@ -22,7 +22,6 @@ extern int skeldma_logtype; SKELDMA_LOG(ERR, fmt, ## args) #define SKELDMA_ARG_LCORE "lcore" -#define SKELDMA_ARG_SELFTEST "selftest" struct skeldma_desc { void *src; @@ -71,6 +70,4 @@ struct skeldma_hw { uint64_t completed_count; }; -int test_dma_skeleton(uint16_t dev_id); - #endif /* __SKELETON_DMADEV_H__ */ diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 80be485b78..1c946402db 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -555,13 +555,3 @@ rte_dmadev_dump(uint16_t dev_id, FILE *f) return 0; } - -int -rte_dmadev_selftest(uint16_t dev_id) -{ - struct rte_dmadev *dev = &rte_dmadevices[dev_id]; - - RTE_DMADEV_VALID_DEV_ID_OR_ERR_RET(dev_id, -EINVAL); - RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_selftest, -ENOTSUP); - return (*dev->dev_ops->dev_selftest)(dev_id); -} diff --git a/lib/dmadev/rte_dmadev.h b/lib/dmadev/rte_dmadev.h index cf9e4bfa0f..e8f58e9213 100644 --- a/lib/dmadev/rte_dmadev.h +++ b/lib/dmadev/rte_dmadev.h @@ -654,24 +654,6 @@ __rte_experimental int rte_dmadev_dump(uint16_t dev_id, FILE *f); -/** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * - * Trigger the dmadev self test. - * - * @param dev_id - * The identifier of the device. - * - * @return - * - 0: selftest successful. - * - -ENOTSUP: if the device doesn't support selftest. - * - other values < 0 on failure. - */ -__rte_experimental -int -rte_dmadev_selftest(uint16_t dev_id); - /** * rte_dma_status_code - DMA transfer result status code defines. */ diff --git a/lib/dmadev/rte_dmadev_core.h b/lib/dmadev/rte_dmadev_core.h index aa8e622f85..e94aa1c457 100644 --- a/lib/dmadev/rte_dmadev_core.h +++ b/lib/dmadev/rte_dmadev_core.h @@ -53,9 +53,6 @@ typedef int (*rte_dmadev_stats_reset_t)(struct rte_dmadev *dev, uint16_t vchan); typedef int (*rte_dmadev_dump_t)(const struct rte_dmadev *dev, FILE *f); /**< @internal Used to dump internal information. */ -typedef int (*rte_dmadev_selftest_t)(uint16_t dev_id); -/**< @internal Used to start dmadev selftest. */ - typedef int (*rte_dmadev_copy_t)(struct rte_dmadev *dev, uint16_t vchan, rte_iova_t src, rte_iova_t dst, uint32_t length, uint64_t flags); @@ -109,7 +106,6 @@ struct rte_dmadev_ops { rte_dmadev_stats_get_t stats_get; rte_dmadev_stats_reset_t stats_reset; rte_dmadev_dump_t dev_dump; - rte_dmadev_selftest_t dev_selftest; }; /** diff --git a/lib/dmadev/version.map b/lib/dmadev/version.map index 86c5e75321..80be592713 100644 --- a/lib/dmadev/version.map +++ b/lib/dmadev/version.map @@ -13,7 +13,6 @@ EXPERIMENTAL { rte_dmadev_get_dev_id; rte_dmadev_info_get; rte_dmadev_is_valid_dev; - rte_dmadev_selftest; rte_dmadev_start; rte_dmadev_stats_get; rte_dmadev_stats_reset; -- 2.30.2