eal/windows: probe vdev
authorTal Shnaiderman <talshn@mellanox.com>
Tue, 7 Jul 2020 08:48:22 +0000 (11:48 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 9 Sep 2020 12:40:41 +0000 (14:40 +0200)
Add needed function calls in rte_eal_init to detect vdev PMD.

eal_option_device_parse()
rte_service_init()
rte_bus_probe()

Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>
Tested-by: Narcisa Vasile <navasile@linux.microsoft.com>
Tested-by: Pallavi Kadam <pallavi.kadam@intel.com>
lib/librte_eal/common/meson.build
lib/librte_eal/windows/eal.c

index c1d9f21..9f32262 100644 (file)
@@ -31,6 +31,7 @@ if is_windows
                'malloc_heap.c',
                'rte_malloc.c',
                'eal_common_timer.c',
+               'rte_service.c',
        )
        subdir_done()
 endif
index e50601d..bc48f27 100644 (file)
@@ -17,6 +17,7 @@
 #include <eal_filesystem.h>
 #include <eal_options.h>
 #include <eal_private.h>
+#include <rte_service_component.h>
 #include <rte_vfio.h>
 
 #include "eal_hugepages.h"
@@ -284,6 +285,11 @@ rte_eal_init(int argc, char **argv)
        if (fctret < 0)
                exit(1);
 
+       if (eal_option_device_parse()) {
+               rte_errno = ENODEV;
+               return -1;
+       }
+
        /* Prevent creation of shared memory files. */
        if (internal_conf->in_memory == 0) {
                RTE_LOG(WARNING, EAL, "Multi-process support is requested, "
@@ -374,6 +380,19 @@ rte_eal_init(int argc, char **argv)
                        rte_panic("Cannot create thread\n");
        }
 
+       /* Initialize services so drivers can register services during probe. */
+       if (rte_service_init()) {
+               rte_eal_init_alert("rte_service_init() failed");
+               rte_errno = ENOEXEC;
+               return -1;
+       }
+
+       if (rte_bus_probe()) {
+               rte_eal_init_alert("Cannot probe devices");
+               rte_errno = ENOTSUP;
+               return -1;
+       }
+
        /*
         * Launch a dummy function on all slave lcores, so that master lcore
         * knows they are all ready when this function returns.