net/hns3: support fixed link speed
[dpdk.git] / lib / librte_eal / freebsd / eal.c
index ccea60a..f4d1676 100644 (file)
@@ -42,7 +42,7 @@
 #include <rte_version.h>
 #include <rte_vfio.h>
 #include <malloc_heap.h>
-#include <rte_telemetry.h>
+#include <telemetry_internal.h>
 
 #include "eal_private.h"
 #include "eal_thread.h"
@@ -521,6 +521,10 @@ eal_parse_args(int argc, char **argv)
                        goto out;
                }
 
+               /* eal_log_level_parse() already handled this option */
+               if (opt == OPT_LOG_LEVEL_NUM)
+                       continue;
+
                ret = eal_parse_common_option(opt, optarg, internal_conf);
                /* common parser is not happy */
                if (ret < 0) {
@@ -625,10 +629,10 @@ eal_check_mem_on_local_socket(void)
        int socket_id;
        const struct rte_config *config = rte_eal_get_configuration();
 
-       socket_id = rte_lcore_to_socket_id(config->master_lcore);
+       socket_id = rte_lcore_to_socket_id(config->main_lcore);
 
        if (rte_memseg_list_walk(check_socket, &socket_id) == 0)
-               RTE_LOG(WARNING, EAL, "WARNING: Master core has no memory on local socket!\n");
+               RTE_LOG(WARNING, EAL, "WARNING: Main core has no memory on local socket!\n");
 }
 
 
@@ -851,29 +855,29 @@ rte_eal_init(int argc, char **argv)
        eal_check_mem_on_local_socket();
 
        if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
-                       &lcore_config[config->master_lcore].cpuset) != 0) {
+                       &lcore_config[config->main_lcore].cpuset) != 0) {
                rte_eal_init_alert("Cannot set affinity");
                rte_errno = EINVAL;
                return -1;
        }
-       __rte_thread_init(config->master_lcore,
-               &lcore_config[config->master_lcore].cpuset);
+       __rte_thread_init(config->main_lcore,
+               &lcore_config[config->main_lcore].cpuset);
 
        ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
 
-       RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
-               config->master_lcore, thread_id, cpuset,
+       RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
+               config->main_lcore, thread_id, cpuset,
                ret == 0 ? "" : "...");
 
-       RTE_LCORE_FOREACH_SLAVE(i) {
+       RTE_LCORE_FOREACH_WORKER(i) {
 
                /*
-                * create communication pipes between master thread
+                * create communication pipes between main thread
                 * and children
                 */
-               if (pipe(lcore_config[i].pipe_master2slave) < 0)
+               if (pipe(lcore_config[i].pipe_main2worker) < 0)
                        rte_panic("Cannot create pipe\n");
-               if (pipe(lcore_config[i].pipe_slave2master) < 0)
+               if (pipe(lcore_config[i].pipe_worker2main) < 0)
                        rte_panic("Cannot create pipe\n");
 
                lcore_config[i].state = WAIT;
@@ -886,7 +890,7 @@ rte_eal_init(int argc, char **argv)
 
                /* Set thread_name for aid in debugging. */
                snprintf(thread_name, sizeof(thread_name),
-                               "lcore-slave-%d", i);
+                               "lcore-worker-%d", i);
                rte_thread_setname(lcore_config[i].thread_id, thread_name);
 
                ret = pthread_setaffinity_np(lcore_config[i].thread_id,
@@ -896,17 +900,17 @@ rte_eal_init(int argc, char **argv)
        }
 
        /*
-        * Launch a dummy function on all slave lcores, so that master lcore
+        * Launch a dummy function on all worker lcores, so that main lcore
         * knows they are all ready when this function returns.
         */
-       rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
+       rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
        rte_eal_mp_wait_lcore();
 
        /* initialize services so vdevs register service during bus_probe. */
        ret = rte_service_init();
        if (ret) {
                rte_eal_init_alert("rte_service_init() failed");
-               rte_errno = ENOEXEC;
+               rte_errno = -ret;
                return -1;
        }
 
@@ -922,7 +926,7 @@ rte_eal_init(int argc, char **argv)
         */
        ret = rte_service_start_with_defaults();
        if (ret < 0 && ret != -ENOTSUP) {
-               rte_errno = ENOEXEC;
+               rte_errno = -ret;
                return -1;
        }
 
@@ -941,15 +945,14 @@ rte_eal_init(int argc, char **argv)
                return -1;
        }
        if (!internal_conf->no_telemetry) {
-               const char *error_str = NULL;
+               int tlog = rte_log_register_type_and_pick_level(
+                               "lib.telemetry", RTE_LOG_WARNING);
+               if (tlog < 0)
+                       tlog = RTE_LOGTYPE_EAL;
                if (rte_telemetry_init(rte_eal_get_runtime_dir(),
-                               &internal_conf->ctrl_cpuset, &error_str)
-                               != 0) {
-                       rte_eal_init_alert(error_str);
+                               rte_version(),
+                               &internal_conf->ctrl_cpuset, rte_log, tlog) != 0)
                        return -1;
-               }
-               if (error_str != NULL)
-                       RTE_LOG(NOTICE, EAL, "%s\n", error_str);
        }
 
        eal_mcfg_complete();
@@ -964,6 +967,8 @@ rte_eal_cleanup(void)
                eal_get_internal_configuration();
        rte_service_finalize();
        rte_mp_channel_cleanup();
+       /* after this point, any DPDK pointers will become dangling */
+       rte_eal_memory_detach();
        rte_trace_save();
        eal_trace_fini();
        eal_cleanup_config(internal_conf);