[dpdk-dev] [PATCH 1/2] test/eventdev: fix unintended vdev creation

pbhagavatula at marvell.com pbhagavatula at marvell.com
Mon Jan 6 08:42:41 CET 2020


From: Pavan Nikhilesh <pbhagavatula at marvell.com>

Virtual eventdevice should only be created when there is no existing
device with the same name.

Fixes: e0f4a0ed4237 ("test: skip tests when missing requirements")
Cc: stable at dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
---
 app/test/test_eventdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
index 427dbbf77..56155838d 100644
--- a/app/test/test_eventdev.c
+++ b/app/test/test_eventdev.c
@@ -996,9 +996,13 @@ test_eventdev_common(void)
 static int
 test_eventdev_selftest_impl(const char *pmd, const char *opts)
 {
-	rte_vdev_init(pmd, opts);
+	int ret = 0;
+
 	if (rte_event_dev_get_dev_id(pmd) == -ENODEV)
+		ret = rte_vdev_init(pmd, opts);
+	if (ret)
 		return TEST_SKIPPED;
+
 	return rte_event_dev_selftest(rte_event_dev_get_dev_id(pmd));
 }
 
-- 
2.17.1



More information about the dev mailing list