eal: move internal config initialization
[dpdk.git] / lib / librte_eal / bsdapp / eal / eal.c
index dbea035..ed16c2e 100644 (file)
@@ -323,7 +323,7 @@ eal_log_level_parse(int argc, char **argv)
        optind = 1;
        optreset = 1;
 
-       eal_reset_internal_config(&internal_config);
+       rte_log_set_global_level(internal_config.log_level);
 
        while ((opt = getopt_long(argc, argvopt, eal_short_options,
                                  eal_long_options, &option_index)) != EOF) {
@@ -519,6 +519,8 @@ rte_eal_init(int argc, char **argv)
 
        thread_id = pthread_self();
 
+       eal_reset_internal_config(&internal_config);
+
        /* set log level as early as possible */
        eal_log_level_parse(argc, argv);
 
@@ -602,13 +604,6 @@ rte_eal_init(int argc, char **argv)
                return -1;
        }
 
-       if (rte_eal_pci_init() < 0) {
-               rte_eal_init_alert("Cannot init PCI\n");
-               rte_errno = EPROTO;
-               rte_atomic32_clear(&run_once);
-               return -1;
-       }
-
        eal_check_mem_on_local_socket();
 
        if (eal_plugins_init() < 0)
@@ -667,16 +662,6 @@ rte_eal_init(int argc, char **argv)
                return -1;
        }
 
-       /* Probe & Initialize PCI devices */
-       if (rte_eal_pci_probe()) {
-               rte_eal_init_alert("Cannot probe PCI\n");
-               rte_errno = ENOTSUP;
-               return -1;
-       }
-
-       if (rte_eal_dev_init() < 0)
-               rte_eal_init_alert("Cannot init pmd devices\n");
-
        rte_eal_mcfg_complete();
 
        return fctret;