test/event: fix unintended vdev creation
authorPavan Nikhilesh <pbhagavatula@marvell.com>
Mon, 6 Jan 2020 07:42:41 +0000 (13:12 +0530)
committerJerin Jacob <jerinj@marvell.com>
Wed, 15 Jan 2020 11:05:38 +0000 (12:05 +0100)
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 <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
app/test/test_eventdev.c

index 427dbbf..5615583 100644 (file)
@@ -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));
 }