1 /* SPDX-License-Identifier: BSD-3-Clause
4 #include <rte_common.h>
6 #include <rte_malloc.h>
7 #include <rte_memcpy.h>
9 #include <rte_rawdev.h>
10 #include <rte_bus_vdev.h>
15 test_rawdev_selftest_impl(const char *pmd, const char *opts)
19 printf("\n### Test rawdev infrastructure using skeleton driver\n");
20 rte_vdev_init(pmd, opts);
21 ret = rte_rawdev_selftest(rte_rawdev_get_dev_id(pmd));
27 test_rawdev_selftest_skeleton(void)
29 return test_rawdev_selftest_impl("rawdev_skeleton", "");
33 test_rawdev_selftests(void)
35 const int count = rte_rawdev_count();
39 /* basic sanity on rawdev infrastructure */
40 if (test_rawdev_selftest_skeleton() < 0)
43 /* now run self-test on all rawdevs */
45 printf("\n### Run selftest on each available rawdev\n");
46 for (i = 0; i < count; i++) {
47 int result = rte_rawdev_selftest(i);
48 printf("Rawdev %u (%s) selftest: %s\n", i,
50 result == 0 ? "Passed" : "Failed");
57 REGISTER_TEST_COMMAND(rawdev_autotest, test_rawdev_selftests);