1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2018 Intel Corporation.
3 * Copyright(c) 2014 6WIND S.A.
20 #include <sys/queue.h>
23 #include <rte_compat.h>
24 #include <rte_common.h>
25 #include <rte_debug.h>
26 #include <rte_memory.h>
27 #include <rte_launch.h>
29 #include <rte_errno.h>
30 #include <rte_per_lcore.h>
31 #include <rte_lcore.h>
32 #include <rte_service_component.h>
34 #include <rte_random.h>
35 #include <rte_cycles.h>
36 #include <rte_string_fns.h>
37 #include <rte_cpuflags.h>
38 #include <rte_interrupts.h>
41 #include <rte_devargs.h>
42 #include <rte_version.h>
44 #include <rte_atomic.h>
45 #include <malloc_heap.h>
46 #include <rte_telemetry.h>
48 #include "eal_private.h"
49 #include "eal_thread.h"
50 #include "eal_internal_cfg.h"
51 #include "eal_filesystem.h"
52 #include "eal_hugepages.h"
53 #include "eal_options.h"
54 #include "eal_memcfg.h"
55 #include "eal_trace.h"
57 #define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL)
59 /* Allow the application to print its usage message too if set */
60 static rte_usage_hook_t rte_application_usage_hook = NULL;
61 /* define fd variable here, because file needs to be kept open for the
62 * duration of the program, as we hold a write lock on it in the primary proc */
63 static int mem_cfg_fd = -1;
65 static struct flock wr_lock = {
68 .l_start = offsetof(struct rte_mem_config, memsegs),
69 .l_len = RTE_SIZEOF_FIELD(struct rte_mem_config, memsegs),
72 /* internal configuration (per-core) */
73 struct lcore_config lcore_config[RTE_MAX_LCORE];
75 /* used by rte_rdtsc() */
76 int rte_cycles_vmware_tsc_map;
78 static const char *default_runtime_dir = "/var/run";
81 eal_create_runtime_dir(void)
83 const char *directory = default_runtime_dir;
84 const char *xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
85 const char *fallback = "/tmp";
86 char run_dir[PATH_MAX];
91 /* try XDG path first, fall back to /tmp */
92 if (xdg_runtime_dir != NULL)
93 directory = xdg_runtime_dir;
97 /* create DPDK subdirectory under runtime dir */
98 ret = snprintf(tmp, sizeof(tmp), "%s/dpdk", directory);
99 if (ret < 0 || ret == sizeof(tmp)) {
100 RTE_LOG(ERR, EAL, "Error creating DPDK runtime path name\n");
104 /* create prefix-specific subdirectory under DPDK runtime dir */
105 ret = snprintf(run_dir, sizeof(run_dir), "%s/%s",
106 tmp, eal_get_hugefile_prefix());
107 if (ret < 0 || ret == sizeof(run_dir)) {
108 RTE_LOG(ERR, EAL, "Error creating prefix-specific runtime path name\n");
112 /* create the path if it doesn't exist. no "mkdir -p" here, so do it
115 ret = mkdir(tmp, 0700);
116 if (ret < 0 && errno != EEXIST) {
117 RTE_LOG(ERR, EAL, "Error creating '%s': %s\n",
118 tmp, strerror(errno));
122 ret = mkdir(run_dir, 0700);
123 if (ret < 0 && errno != EEXIST) {
124 RTE_LOG(ERR, EAL, "Error creating '%s': %s\n",
125 run_dir, strerror(errno));
129 if (eal_set_runtime_dir(run_dir, sizeof(run_dir)))
136 eal_clean_runtime_dir(void)
138 /* FreeBSD doesn't need this implemented for now, because, unlike Linux,
139 * FreeBSD doesn't create per-process files, so no need to clean up.
144 /* parse a sysfs (or other) file containing one integer value */
146 eal_parse_sysfs_value(const char *filename, unsigned long *val)
152 if ((f = fopen(filename, "r")) == NULL) {
153 RTE_LOG(ERR, EAL, "%s(): cannot open sysfs value %s\n",
158 if (fgets(buf, sizeof(buf), f) == NULL) {
159 RTE_LOG(ERR, EAL, "%s(): cannot read sysfs value %s\n",
164 *val = strtoul(buf, &end, 0);
165 if ((buf[0] == '\0') || (end == NULL) || (*end != '\n')) {
166 RTE_LOG(ERR, EAL, "%s(): cannot parse sysfs value %s\n",
176 /* create memory configuration in shared/mmap memory. Take out
177 * a write lock on the memsegs, so we can auto-detect primary/secondary.
178 * This means we never close the file while running (auto-close on exit).
179 * We also don't lock the whole file, so that in future we can use read-locks
180 * on other parts, e.g. memzones, to detect if there are running secondary
183 rte_eal_config_create(void)
185 struct rte_config *config = rte_eal_get_configuration();
186 const struct internal_config *internal_conf =
187 eal_get_internal_configuration();
188 size_t page_sz = sysconf(_SC_PAGE_SIZE);
189 size_t cfg_len = sizeof(struct rte_mem_config);
190 size_t cfg_len_aligned = RTE_ALIGN(cfg_len, page_sz);
191 void *rte_mem_cfg_addr, *mapped_mem_cfg_addr;
194 const char *pathname = eal_runtime_config_path();
196 if (internal_conf->no_shconf)
199 /* map the config before base address so that we don't waste a page */
200 if (internal_conf->base_virtaddr != 0)
201 rte_mem_cfg_addr = (void *)
202 RTE_ALIGN_FLOOR(internal_conf->base_virtaddr -
203 sizeof(struct rte_mem_config), page_sz);
205 rte_mem_cfg_addr = NULL;
208 mem_cfg_fd = open(pathname, O_RDWR | O_CREAT, 0600);
209 if (mem_cfg_fd < 0) {
210 RTE_LOG(ERR, EAL, "Cannot open '%s' for rte_mem_config\n",
216 retval = ftruncate(mem_cfg_fd, cfg_len);
220 RTE_LOG(ERR, EAL, "Cannot resize '%s' for rte_mem_config\n",
225 retval = fcntl(mem_cfg_fd, F_SETLK, &wr_lock);
229 RTE_LOG(ERR, EAL, "Cannot create lock on '%s'. Is another primary "
230 "process running?\n", pathname);
234 /* reserve space for config */
235 rte_mem_cfg_addr = eal_get_virtual_area(rte_mem_cfg_addr,
236 &cfg_len_aligned, page_sz, 0, 0);
237 if (rte_mem_cfg_addr == NULL) {
238 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config\n");
244 /* remap the actual file into the space we've just reserved */
245 mapped_mem_cfg_addr = mmap(rte_mem_cfg_addr,
246 cfg_len_aligned, PROT_READ | PROT_WRITE,
247 MAP_SHARED | MAP_FIXED, mem_cfg_fd, 0);
248 if (mapped_mem_cfg_addr == MAP_FAILED) {
249 RTE_LOG(ERR, EAL, "Cannot remap memory for rte_config\n");
250 munmap(rte_mem_cfg_addr, cfg_len);
256 memcpy(rte_mem_cfg_addr, config->mem_config, sizeof(struct rte_mem_config));
257 config->mem_config = rte_mem_cfg_addr;
259 /* store address of the config in the config itself so that secondary
260 * processes could later map the config into this exact location
262 config->mem_config->mem_cfg_addr = (uintptr_t) rte_mem_cfg_addr;
266 /* attach to an existing shared memory config */
268 rte_eal_config_attach(void)
270 void *rte_mem_cfg_addr;
271 const char *pathname = eal_runtime_config_path();
272 struct rte_config *config = rte_eal_get_configuration();
273 const struct internal_config *internal_conf =
274 eal_get_internal_configuration();
277 if (internal_conf->no_shconf)
281 mem_cfg_fd = open(pathname, O_RDWR);
282 if (mem_cfg_fd < 0) {
283 RTE_LOG(ERR, EAL, "Cannot open '%s' for rte_mem_config\n",
289 rte_mem_cfg_addr = mmap(NULL, sizeof(*config->mem_config),
290 PROT_READ, MAP_SHARED, mem_cfg_fd, 0);
291 /* don't close the fd here, it will be closed on reattach */
292 if (rte_mem_cfg_addr == MAP_FAILED) {
295 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config! error %i (%s)\n",
296 errno, strerror(errno));
300 config->mem_config = rte_mem_cfg_addr;
305 /* reattach the shared config at exact memory location primary process has it */
307 rte_eal_config_reattach(void)
309 struct rte_mem_config *mem_config;
310 void *rte_mem_cfg_addr;
311 struct rte_config *config = rte_eal_get_configuration();
312 const struct internal_config *internal_conf =
313 eal_get_internal_configuration();
315 if (internal_conf->no_shconf)
318 /* save the address primary process has mapped shared config to */
320 (void *)(uintptr_t)config->mem_config->mem_cfg_addr;
322 /* unmap original config */
323 munmap(config->mem_config, sizeof(struct rte_mem_config));
325 /* remap the config at proper address */
326 mem_config = (struct rte_mem_config *) mmap(rte_mem_cfg_addr,
327 sizeof(*mem_config), PROT_READ | PROT_WRITE, MAP_SHARED,
332 if (mem_config == MAP_FAILED || mem_config != rte_mem_cfg_addr) {
333 if (mem_config != MAP_FAILED) {
334 /* errno is stale, don't use */
335 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config at [%p], got [%p]"
336 " - please use '--" OPT_BASE_VIRTADDR
338 rte_mem_cfg_addr, mem_config);
339 munmap(mem_config, sizeof(struct rte_mem_config));
342 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config! error %i (%s)\n",
343 errno, strerror(errno));
347 config->mem_config = mem_config;
352 /* Detect if we are a primary or a secondary process */
354 eal_proc_type_detect(void)
356 enum rte_proc_type_t ptype = RTE_PROC_PRIMARY;
357 const char *pathname = eal_runtime_config_path();
358 const struct internal_config *internal_conf =
359 eal_get_internal_configuration();
361 /* if there no shared config, there can be no secondary processes */
362 if (!internal_conf->no_shconf) {
363 /* if we can open the file but not get a write-lock we are a
364 * secondary process. NOTE: if we get a file handle back, we
365 * keep that open and don't close it to prevent a race condition
366 * between multiple opens.
368 if (((mem_cfg_fd = open(pathname, O_RDWR)) >= 0) &&
369 (fcntl(mem_cfg_fd, F_SETLK, &wr_lock) < 0))
370 ptype = RTE_PROC_SECONDARY;
373 RTE_LOG(INFO, EAL, "Auto-detected process type: %s\n",
374 ptype == RTE_PROC_PRIMARY ? "PRIMARY" : "SECONDARY");
379 /* Sets up rte_config structure with the pointer to shared memory config.*/
381 rte_config_init(void)
383 struct rte_config *config = rte_eal_get_configuration();
384 const struct internal_config *internal_conf =
385 eal_get_internal_configuration();
387 config->process_type = internal_conf->process_type;
389 switch (config->process_type) {
390 case RTE_PROC_PRIMARY:
391 if (rte_eal_config_create() < 0)
393 eal_mcfg_update_from_internal();
395 case RTE_PROC_SECONDARY:
396 if (rte_eal_config_attach() < 0)
398 eal_mcfg_wait_complete();
399 if (eal_mcfg_check_version() < 0) {
400 RTE_LOG(ERR, EAL, "Primary and secondary process DPDK version mismatch\n");
403 if (rte_eal_config_reattach() < 0)
405 eal_mcfg_update_internal();
408 case RTE_PROC_INVALID:
409 RTE_LOG(ERR, EAL, "Invalid process type %d\n",
410 config->process_type);
419 eal_usage(const char *prgname)
421 printf("\nUsage: %s ", prgname);
423 /* Allow the application to print its usage message too if hook is set */
424 if ( rte_application_usage_hook ) {
425 printf("===== Application Usage =====\n\n");
426 rte_application_usage_hook(prgname);
430 /* Set a per-application usage message */
432 rte_set_application_usage_hook( rte_usage_hook_t usage_func )
434 rte_usage_hook_t old_func;
436 /* Will be NULL on the first call to denote the last usage routine. */
437 old_func = rte_application_usage_hook;
438 rte_application_usage_hook = usage_func;
444 eal_get_hugepage_mem_size(void)
448 struct internal_config *internal_conf =
449 eal_get_internal_configuration();
451 for (i = 0; i < internal_conf->num_hugepage_sizes; i++) {
452 struct hugepage_info *hpi = &internal_conf->hugepage_info[i];
453 if (strnlen(hpi->hugedir, sizeof(hpi->hugedir)) != 0) {
454 for (j = 0; j < RTE_MAX_NUMA_NODES; j++) {
455 size += hpi->hugepage_sz * hpi->num_pages[j];
460 return (size < SIZE_MAX) ? (size_t)(size) : SIZE_MAX;
463 /* Parse the arguments for --log-level only */
465 eal_log_level_parse(int argc, char **argv)
470 const int old_optind = optind;
471 const int old_optopt = optopt;
472 const int old_optreset = optreset;
473 char * const old_optarg = optarg;
474 struct internal_config *internal_conf =
475 eal_get_internal_configuration();
481 while ((opt = getopt_long(argc, argvopt, eal_short_options,
482 eal_long_options, &option_index)) != EOF) {
486 /* getopt is not happy, stop right now */
490 ret = (opt == OPT_LOG_LEVEL_NUM) ?
491 eal_parse_common_option(opt, optarg, internal_conf) : 0;
493 /* common parser is not happy */
498 /* restore getopt lib */
501 optreset = old_optreset;
505 /* Parse the argument given in the command line of the application */
507 eal_parse_args(int argc, char **argv)
512 char *prgname = argv[0];
513 const int old_optind = optind;
514 const int old_optopt = optopt;
515 const int old_optreset = optreset;
516 char * const old_optarg = optarg;
517 struct internal_config *internal_conf =
518 eal_get_internal_configuration();
524 while ((opt = getopt_long(argc, argvopt, eal_short_options,
525 eal_long_options, &option_index)) != EOF) {
527 /* getopt didn't recognise the option */
534 ret = eal_parse_common_option(opt, optarg, internal_conf);
535 /* common parser is not happy */
541 /* common parser handled this option */
546 case OPT_MBUF_POOL_OPS_NAME_NUM:
548 char *ops_name = strdup(optarg);
549 if (ops_name == NULL)
550 RTE_LOG(ERR, EAL, "Could not store mbuf pool ops name\n");
552 /* free old ops name */
553 if (internal_conf->user_mbuf_pool_ops_name !=
555 free(internal_conf->user_mbuf_pool_ops_name);
557 internal_conf->user_mbuf_pool_ops_name =
566 if (opt < OPT_LONG_MIN_NUM && isprint(opt)) {
567 RTE_LOG(ERR, EAL, "Option %c is not supported "
568 "on FreeBSD\n", opt);
569 } else if (opt >= OPT_LONG_MIN_NUM &&
570 opt < OPT_LONG_MAX_NUM) {
571 RTE_LOG(ERR, EAL, "Option %s is not supported "
573 eal_long_options[option_index].name);
575 RTE_LOG(ERR, EAL, "Option %d is not supported "
576 "on FreeBSD\n", opt);
584 /* create runtime data directory */
585 if (internal_conf->no_shconf == 0 &&
586 eal_create_runtime_dir() < 0) {
587 RTE_LOG(ERR, EAL, "Cannot create runtime directory\n");
592 if (eal_adjust_config(internal_conf) != 0) {
598 if (eal_check_common_options(internal_conf) != 0) {
605 argv[optind-1] = prgname;
609 /* restore getopt lib */
612 optreset = old_optreset;
619 check_socket(const struct rte_memseg_list *msl, void *arg)
621 int *socket_id = arg;
626 if (msl->socket_id == *socket_id && msl->memseg_arr.count != 0)
633 eal_check_mem_on_local_socket(void)
636 const struct rte_config *config = rte_eal_get_configuration();
638 socket_id = rte_lcore_to_socket_id(config->master_lcore);
640 if (rte_memseg_list_walk(check_socket, &socket_id) == 0)
641 RTE_LOG(WARNING, EAL, "WARNING: Master core has no memory on local socket!\n");
646 sync_func(__rte_unused void *arg)
650 /* Abstraction for port I/0 privilege */
652 rte_eal_iopl_init(void)
657 fd = open("/dev/io", O_RDWR);
661 /* keep fd open for iopl */
665 static void rte_eal_init_alert(const char *msg)
667 fprintf(stderr, "EAL: FATAL: %s\n", msg);
668 RTE_LOG(ERR, EAL, "%s\n", msg);
671 /* Launch threads, called at application init(). */
673 rte_eal_init(int argc, char **argv)
677 static rte_atomic32_t run_once = RTE_ATOMIC32_INIT(0);
678 char cpuset[RTE_CPU_AFFINITY_STR_LEN];
679 char thread_name[RTE_MAX_THREAD_NAME_LEN];
680 const struct rte_config *config = rte_eal_get_configuration();
681 struct internal_config *internal_conf =
682 eal_get_internal_configuration();
684 /* checks if the machine is adequate */
685 if (!rte_cpu_is_supported()) {
686 rte_eal_init_alert("unsupported cpu type.");
691 if (!rte_atomic32_test_and_set(&run_once)) {
692 rte_eal_init_alert("already called initialization.");
693 rte_errno = EALREADY;
697 thread_id = pthread_self();
699 eal_reset_internal_config(internal_conf);
701 /* clone argv to report out later in telemetry */
702 eal_save_args(argc, argv);
704 /* set log level as early as possible */
705 eal_log_level_parse(argc, argv);
707 if (rte_eal_cpu_init() < 0) {
708 rte_eal_init_alert("Cannot detect lcores.");
713 fctret = eal_parse_args(argc, argv);
715 rte_eal_init_alert("Invalid 'command line' arguments.");
717 rte_atomic32_clear(&run_once);
721 /* FreeBSD always uses legacy memory model */
722 internal_conf->legacy_mem = true;
724 if (eal_plugins_init() < 0) {
725 rte_eal_init_alert("Cannot init plugins");
727 rte_atomic32_clear(&run_once);
731 if (eal_trace_init() < 0) {
732 rte_eal_init_alert("Cannot init trace");
734 rte_atomic32_clear(&run_once);
738 if (eal_option_device_parse()) {
740 rte_atomic32_clear(&run_once);
744 if (rte_config_init() < 0) {
745 rte_eal_init_alert("Cannot init config");
749 if (rte_eal_intr_init() < 0) {
750 rte_eal_init_alert("Cannot init interrupt-handling thread");
754 if (rte_eal_alarm_init() < 0) {
755 rte_eal_init_alert("Cannot init alarm");
756 /* rte_eal_alarm_init sets rte_errno on failure. */
760 /* Put mp channel init before bus scan so that we can init the vdev
761 * bus through mp channel in the secondary process before the bus scan.
763 if (rte_mp_channel_init() < 0 && rte_errno != ENOTSUP) {
764 rte_eal_init_alert("failed to init mp channel");
765 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
771 if (rte_bus_scan()) {
772 rte_eal_init_alert("Cannot scan the buses for devices");
774 rte_atomic32_clear(&run_once);
778 /* if no EAL option "--iova-mode=<pa|va>", use bus IOVA scheme */
779 if (internal_conf->iova_mode == RTE_IOVA_DC) {
780 /* autodetect the IOVA mapping mode (default is RTE_IOVA_PA) */
781 enum rte_iova_mode iova_mode = rte_bus_get_iommu_class();
783 if (iova_mode == RTE_IOVA_DC)
784 iova_mode = RTE_IOVA_PA;
785 rte_eal_get_configuration()->iova_mode = iova_mode;
787 rte_eal_get_configuration()->iova_mode =
788 internal_conf->iova_mode;
791 RTE_LOG(INFO, EAL, "Selected IOVA mode '%s'\n",
792 rte_eal_iova_mode() == RTE_IOVA_PA ? "PA" : "VA");
794 if (internal_conf->no_hugetlbfs == 0) {
795 /* rte_config isn't initialized yet */
796 ret = internal_conf->process_type == RTE_PROC_PRIMARY ?
797 eal_hugepage_info_init() :
798 eal_hugepage_info_read();
800 rte_eal_init_alert("Cannot get hugepage information.");
802 rte_atomic32_clear(&run_once);
807 if (internal_conf->memory == 0 && internal_conf->force_sockets == 0) {
808 if (internal_conf->no_hugetlbfs)
809 internal_conf->memory = MEMSIZE_IF_NO_HUGE_PAGE;
811 internal_conf->memory = eal_get_hugepage_mem_size();
814 if (internal_conf->vmware_tsc_map == 1) {
815 #ifdef RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT
816 rte_cycles_vmware_tsc_map = 1;
817 RTE_LOG (DEBUG, EAL, "Using VMWARE TSC MAP, "
818 "you must have monitor_control.pseudo_perfctr = TRUE\n");
820 RTE_LOG (WARNING, EAL, "Ignoring --vmware-tsc-map because "
821 "RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT is not set\n");
825 /* in secondary processes, memory init may allocate additional fbarrays
826 * not present in primary processes, so to avoid any potential issues,
827 * initialize memzones first.
829 if (rte_eal_memzone_init() < 0) {
830 rte_eal_init_alert("Cannot init memzone");
835 if (rte_eal_memory_init() < 0) {
836 rte_eal_init_alert("Cannot init memory");
841 if (rte_eal_malloc_heap_init() < 0) {
842 rte_eal_init_alert("Cannot init malloc heap");
847 if (rte_eal_tailqs_init() < 0) {
848 rte_eal_init_alert("Cannot init tail queues for objects");
853 if (rte_eal_timer_init() < 0) {
854 rte_eal_init_alert("Cannot init HPET or TSC timers");
859 eal_check_mem_on_local_socket();
861 eal_thread_init_master(config->master_lcore);
863 ret = eal_thread_dump_affinity(cpuset, sizeof(cpuset));
865 RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
866 config->master_lcore, thread_id, cpuset,
867 ret == 0 ? "" : "...");
869 RTE_LCORE_FOREACH_SLAVE(i) {
872 * create communication pipes between master thread
875 if (pipe(lcore_config[i].pipe_master2slave) < 0)
876 rte_panic("Cannot create pipe\n");
877 if (pipe(lcore_config[i].pipe_slave2master) < 0)
878 rte_panic("Cannot create pipe\n");
880 lcore_config[i].state = WAIT;
882 /* create a thread for each lcore */
883 ret = pthread_create(&lcore_config[i].thread_id, NULL,
884 eal_thread_loop, NULL);
886 rte_panic("Cannot create thread\n");
888 /* Set thread_name for aid in debugging. */
889 snprintf(thread_name, sizeof(thread_name),
890 "lcore-slave-%d", i);
891 rte_thread_setname(lcore_config[i].thread_id, thread_name);
895 * Launch a dummy function on all slave lcores, so that master lcore
896 * knows they are all ready when this function returns.
898 rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
899 rte_eal_mp_wait_lcore();
901 /* initialize services so vdevs register service during bus_probe. */
902 ret = rte_service_init();
904 rte_eal_init_alert("rte_service_init() failed");
909 /* Probe all the buses and devices/drivers on them */
910 if (rte_bus_probe()) {
911 rte_eal_init_alert("Cannot probe devices");
916 /* initialize default service/lcore mappings and start running. Ignore
917 * -ENOTSUP, as it indicates no service coremask passed to EAL.
919 ret = rte_service_start_with_defaults();
920 if (ret < 0 && ret != -ENOTSUP) {
926 * Clean up unused files in runtime directory. We do this at the end of
927 * init and not at the beginning because we want to clean stuff up
928 * whether we are primary or secondary process, but we cannot remove
929 * primary process' files because secondary should be able to run even
930 * if primary process is dead.
932 * In no_shconf mode, no runtime directory is created in the first
933 * place, so no cleanup needed.
935 if (!internal_conf->no_shconf && eal_clean_runtime_dir() < 0) {
936 rte_eal_init_alert("Cannot clear runtime directory");
939 if (!internal_conf->no_telemetry) {
940 const char *error_str = NULL;
941 if (rte_telemetry_init(rte_eal_get_runtime_dir(),
942 &internal_conf->ctrl_cpuset, &error_str)
944 rte_eal_init_alert(error_str);
947 if (error_str != NULL)
948 RTE_LOG(NOTICE, EAL, "%s\n", error_str);
957 rte_eal_cleanup(void)
959 struct internal_config *internal_conf =
960 eal_get_internal_configuration();
961 rte_service_finalize();
962 rte_mp_channel_cleanup();
965 eal_cleanup_config(internal_conf);
969 int rte_eal_create_uio_dev(void)
971 const struct internal_config *internal_conf =
972 eal_get_internal_configuration();
973 return internal_conf->create_uio_dev;
977 rte_eal_vfio_intr_mode(void)
979 return RTE_INTR_MODE_NONE;
982 int rte_vfio_setup_device(__rte_unused const char *sysfs_base,
983 __rte_unused const char *dev_addr,
984 __rte_unused int *vfio_dev_fd,
985 __rte_unused struct vfio_device_info *device_info)
990 int rte_vfio_release_device(__rte_unused const char *sysfs_base,
991 __rte_unused const char *dev_addr,
997 int rte_vfio_enable(__rte_unused const char *modname)
1002 int rte_vfio_is_enabled(__rte_unused const char *modname)
1007 int rte_vfio_noiommu_is_enabled(void)
1012 int rte_vfio_clear_group(__rte_unused int vfio_group_fd)
1018 rte_vfio_get_group_num(__rte_unused const char *sysfs_base,
1019 __rte_unused const char *dev_addr,
1020 __rte_unused int *iommu_group_num)
1026 rte_vfio_get_container_fd(void)
1032 rte_vfio_get_group_fd(__rte_unused int iommu_group_num)
1038 rte_vfio_container_create(void)
1044 rte_vfio_container_destroy(__rte_unused int container_fd)
1050 rte_vfio_container_group_bind(__rte_unused int container_fd,
1051 __rte_unused int iommu_group_num)
1057 rte_vfio_container_group_unbind(__rte_unused int container_fd,
1058 __rte_unused int iommu_group_num)
1064 rte_vfio_container_dma_map(__rte_unused int container_fd,
1065 __rte_unused uint64_t vaddr,
1066 __rte_unused uint64_t iova,
1067 __rte_unused uint64_t len)
1073 rte_vfio_container_dma_unmap(__rte_unused int container_fd,
1074 __rte_unused uint64_t vaddr,
1075 __rte_unused uint64_t iova,
1076 __rte_unused uint64_t len)