From 2155b9ca1a0d4aaf25d51f63034bc9357f66b96a Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Mon, 6 Jan 2020 13:12:41 +0530 Subject: [PATCH] test/event: fix unintended vdev creation 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@dpdk.org Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- 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 427dbbf77f..56155838d8 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.20.1