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 /* early configuration structure, when memory config is not mmapped */
62 static struct rte_mem_config early_mem_config;
64 /* define fd variable here, because file needs to be kept open for the
65 * duration of the program, as we hold a write lock on it in the primary proc */
66 static int mem_cfg_fd = -1;
68 static struct flock wr_lock = {
71 .l_start = offsetof(struct rte_mem_config, memsegs),
72 .l_len = sizeof(early_mem_config.memsegs),
75 /* Address of global and public configuration */
76 static struct rte_config rte_config = {
77 .mem_config = &early_mem_config,
80 /* internal configuration (per-core) */
81 struct lcore_config lcore_config[RTE_MAX_LCORE];
83 /* internal configuration */
84 struct internal_config internal_config;
86 /* used by rte_rdtsc() */
87 int rte_cycles_vmware_tsc_map;
89 /* platform-specific runtime dir */
90 static char runtime_dir[PATH_MAX];
92 static const char *default_runtime_dir = "/var/run";
95 eal_create_runtime_dir(void)
97 const char *directory = default_runtime_dir;
98 const char *xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
99 const char *fallback = "/tmp";
104 /* try XDG path first, fall back to /tmp */
105 if (xdg_runtime_dir != NULL)
106 directory = xdg_runtime_dir;
108 directory = fallback;
110 /* create DPDK subdirectory under runtime dir */
111 ret = snprintf(tmp, sizeof(tmp), "%s/dpdk", directory);
112 if (ret < 0 || ret == sizeof(tmp)) {
113 RTE_LOG(ERR, EAL, "Error creating DPDK runtime path name\n");
117 /* create prefix-specific subdirectory under DPDK runtime dir */
118 ret = snprintf(runtime_dir, sizeof(runtime_dir), "%s/%s",
119 tmp, eal_get_hugefile_prefix());
120 if (ret < 0 || ret == sizeof(runtime_dir)) {
121 RTE_LOG(ERR, EAL, "Error creating prefix-specific runtime path name\n");
125 /* create the path if it doesn't exist. no "mkdir -p" here, so do it
128 ret = mkdir(tmp, 0700);
129 if (ret < 0 && errno != EEXIST) {
130 RTE_LOG(ERR, EAL, "Error creating '%s': %s\n",
131 tmp, strerror(errno));
135 ret = mkdir(runtime_dir, 0700);
136 if (ret < 0 && errno != EEXIST) {
137 RTE_LOG(ERR, EAL, "Error creating '%s': %s\n",
138 runtime_dir, strerror(errno));
146 eal_clean_runtime_dir(void)
148 /* FreeBSD doesn't need this implemented for now, because, unlike Linux,
149 * FreeBSD doesn't create per-process files, so no need to clean up.
156 rte_eal_get_runtime_dir(void)
161 /* Return user provided mbuf pool ops name */
163 rte_eal_mbuf_user_pool_ops(void)
165 return internal_config.user_mbuf_pool_ops_name;
168 /* Return a pointer to the configuration structure */
170 rte_eal_get_configuration(void)
176 rte_eal_iova_mode(void)
178 return rte_eal_get_configuration()->iova_mode;
181 /* parse a sysfs (or other) file containing one integer value */
183 eal_parse_sysfs_value(const char *filename, unsigned long *val)
189 if ((f = fopen(filename, "r")) == NULL) {
190 RTE_LOG(ERR, EAL, "%s(): cannot open sysfs value %s\n",
195 if (fgets(buf, sizeof(buf), f) == NULL) {
196 RTE_LOG(ERR, EAL, "%s(): cannot read sysfs value %s\n",
201 *val = strtoul(buf, &end, 0);
202 if ((buf[0] == '\0') || (end == NULL) || (*end != '\n')) {
203 RTE_LOG(ERR, EAL, "%s(): cannot parse sysfs value %s\n",
213 /* create memory configuration in shared/mmap memory. Take out
214 * a write lock on the memsegs, so we can auto-detect primary/secondary.
215 * This means we never close the file while running (auto-close on exit).
216 * We also don't lock the whole file, so that in future we can use read-locks
217 * on other parts, e.g. memzones, to detect if there are running secondary
220 rte_eal_config_create(void)
222 size_t page_sz = sysconf(_SC_PAGE_SIZE);
223 size_t cfg_len = sizeof(*rte_config.mem_config);
224 size_t cfg_len_aligned = RTE_ALIGN(cfg_len, page_sz);
225 void *rte_mem_cfg_addr, *mapped_mem_cfg_addr;
228 const char *pathname = eal_runtime_config_path();
230 if (internal_config.no_shconf)
233 /* map the config before base address so that we don't waste a page */
234 if (internal_config.base_virtaddr != 0)
235 rte_mem_cfg_addr = (void *)
236 RTE_ALIGN_FLOOR(internal_config.base_virtaddr -
237 sizeof(struct rte_mem_config), page_sz);
239 rte_mem_cfg_addr = NULL;
242 mem_cfg_fd = open(pathname, O_RDWR | O_CREAT, 0600);
243 if (mem_cfg_fd < 0) {
244 RTE_LOG(ERR, EAL, "Cannot open '%s' for rte_mem_config\n",
250 retval = ftruncate(mem_cfg_fd, cfg_len);
254 RTE_LOG(ERR, EAL, "Cannot resize '%s' for rte_mem_config\n",
259 retval = fcntl(mem_cfg_fd, F_SETLK, &wr_lock);
263 RTE_LOG(ERR, EAL, "Cannot create lock on '%s'. Is another primary "
264 "process running?\n", pathname);
268 /* reserve space for config */
269 rte_mem_cfg_addr = eal_get_virtual_area(rte_mem_cfg_addr,
270 &cfg_len_aligned, page_sz, 0, 0);
271 if (rte_mem_cfg_addr == NULL) {
272 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config\n");
278 /* remap the actual file into the space we've just reserved */
279 mapped_mem_cfg_addr = mmap(rte_mem_cfg_addr,
280 cfg_len_aligned, PROT_READ | PROT_WRITE,
281 MAP_SHARED | MAP_FIXED, mem_cfg_fd, 0);
282 if (mapped_mem_cfg_addr == MAP_FAILED) {
283 RTE_LOG(ERR, EAL, "Cannot remap memory for rte_config\n");
284 munmap(rte_mem_cfg_addr, cfg_len);
290 memcpy(rte_mem_cfg_addr, &early_mem_config, sizeof(early_mem_config));
291 rte_config.mem_config = rte_mem_cfg_addr;
293 /* store address of the config in the config itself so that secondary
294 * processes could later map the config into this exact location
296 rte_config.mem_config->mem_cfg_addr = (uintptr_t) rte_mem_cfg_addr;
301 /* attach to an existing shared memory config */
303 rte_eal_config_attach(void)
305 void *rte_mem_cfg_addr;
306 const char *pathname = eal_runtime_config_path();
308 if (internal_config.no_shconf)
312 mem_cfg_fd = open(pathname, O_RDWR);
313 if (mem_cfg_fd < 0) {
314 RTE_LOG(ERR, EAL, "Cannot open '%s' for rte_mem_config\n",
320 rte_mem_cfg_addr = mmap(NULL, sizeof(*rte_config.mem_config),
321 PROT_READ, MAP_SHARED, mem_cfg_fd, 0);
322 /* don't close the fd here, it will be closed on reattach */
323 if (rte_mem_cfg_addr == MAP_FAILED) {
326 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config! error %i (%s)\n",
327 errno, strerror(errno));
331 rte_config.mem_config = rte_mem_cfg_addr;
336 /* reattach the shared config at exact memory location primary process has it */
338 rte_eal_config_reattach(void)
340 struct rte_mem_config *mem_config;
341 void *rte_mem_cfg_addr;
343 if (internal_config.no_shconf)
346 /* save the address primary process has mapped shared config to */
348 (void *)(uintptr_t)rte_config.mem_config->mem_cfg_addr;
350 /* unmap original config */
351 munmap(rte_config.mem_config, sizeof(struct rte_mem_config));
353 /* remap the config at proper address */
354 mem_config = (struct rte_mem_config *) mmap(rte_mem_cfg_addr,
355 sizeof(*mem_config), PROT_READ | PROT_WRITE, MAP_SHARED,
360 if (mem_config == MAP_FAILED || mem_config != rte_mem_cfg_addr) {
361 if (mem_config != MAP_FAILED) {
362 /* errno is stale, don't use */
363 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config at [%p], got [%p]"
364 " - please use '--" OPT_BASE_VIRTADDR
366 rte_mem_cfg_addr, mem_config);
367 munmap(mem_config, sizeof(struct rte_mem_config));
370 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config! error %i (%s)\n",
371 errno, strerror(errno));
375 rte_config.mem_config = mem_config;
380 /* Detect if we are a primary or a secondary process */
382 eal_proc_type_detect(void)
384 enum rte_proc_type_t ptype = RTE_PROC_PRIMARY;
385 const char *pathname = eal_runtime_config_path();
387 /* if there no shared config, there can be no secondary processes */
388 if (!internal_config.no_shconf) {
389 /* if we can open the file but not get a write-lock we are a
390 * secondary process. NOTE: if we get a file handle back, we
391 * keep that open and don't close it to prevent a race condition
392 * between multiple opens.
394 if (((mem_cfg_fd = open(pathname, O_RDWR)) >= 0) &&
395 (fcntl(mem_cfg_fd, F_SETLK, &wr_lock) < 0))
396 ptype = RTE_PROC_SECONDARY;
399 RTE_LOG(INFO, EAL, "Auto-detected process type: %s\n",
400 ptype == RTE_PROC_PRIMARY ? "PRIMARY" : "SECONDARY");
405 /* Sets up rte_config structure with the pointer to shared memory config.*/
407 rte_config_init(void)
409 rte_config.process_type = internal_config.process_type;
411 switch (rte_config.process_type){
412 case RTE_PROC_PRIMARY:
413 if (rte_eal_config_create() < 0)
415 eal_mcfg_update_from_internal();
417 case RTE_PROC_SECONDARY:
418 if (rte_eal_config_attach() < 0)
420 eal_mcfg_wait_complete();
421 if (eal_mcfg_check_version() < 0) {
422 RTE_LOG(ERR, EAL, "Primary and secondary process DPDK version mismatch\n");
425 if (rte_eal_config_reattach() < 0)
427 eal_mcfg_update_internal();
430 case RTE_PROC_INVALID:
431 RTE_LOG(ERR, EAL, "Invalid process type %d\n",
432 rte_config.process_type);
441 eal_usage(const char *prgname)
443 printf("\nUsage: %s ", prgname);
445 /* Allow the application to print its usage message too if hook is set */
446 if ( rte_application_usage_hook ) {
447 printf("===== Application Usage =====\n\n");
448 rte_application_usage_hook(prgname);
452 /* Set a per-application usage message */
454 rte_set_application_usage_hook( rte_usage_hook_t usage_func )
456 rte_usage_hook_t old_func;
458 /* Will be NULL on the first call to denote the last usage routine. */
459 old_func = rte_application_usage_hook;
460 rte_application_usage_hook = usage_func;
466 eal_get_hugepage_mem_size(void)
471 for (i = 0; i < internal_config.num_hugepage_sizes; i++) {
472 struct hugepage_info *hpi = &internal_config.hugepage_info[i];
473 if (strnlen(hpi->hugedir, sizeof(hpi->hugedir)) != 0) {
474 for (j = 0; j < RTE_MAX_NUMA_NODES; j++) {
475 size += hpi->hugepage_sz * hpi->num_pages[j];
480 return (size < SIZE_MAX) ? (size_t)(size) : SIZE_MAX;
483 /* Parse the arguments for --log-level only */
485 eal_log_level_parse(int argc, char **argv)
490 const int old_optind = optind;
491 const int old_optopt = optopt;
492 const int old_optreset = optreset;
493 char * const old_optarg = optarg;
499 while ((opt = getopt_long(argc, argvopt, eal_short_options,
500 eal_long_options, &option_index)) != EOF) {
504 /* getopt is not happy, stop right now */
508 ret = (opt == OPT_LOG_LEVEL_NUM) ?
509 eal_parse_common_option(opt, optarg, &internal_config) : 0;
511 /* common parser is not happy */
516 /* restore getopt lib */
519 optreset = old_optreset;
523 /* Parse the argument given in the command line of the application */
525 eal_parse_args(int argc, char **argv)
530 char *prgname = argv[0];
531 const int old_optind = optind;
532 const int old_optopt = optopt;
533 const int old_optreset = optreset;
534 char * const old_optarg = optarg;
540 while ((opt = getopt_long(argc, argvopt, eal_short_options,
541 eal_long_options, &option_index)) != EOF) {
543 /* getopt didn't recognise the option */
550 ret = eal_parse_common_option(opt, optarg, &internal_config);
551 /* common parser is not happy */
557 /* common parser handled this option */
562 case OPT_MBUF_POOL_OPS_NAME_NUM:
564 char *ops_name = strdup(optarg);
565 if (ops_name == NULL)
566 RTE_LOG(ERR, EAL, "Could not store mbuf pool ops name\n");
568 /* free old ops name */
569 if (internal_config.user_mbuf_pool_ops_name !=
571 free(internal_config.user_mbuf_pool_ops_name);
573 internal_config.user_mbuf_pool_ops_name =
582 if (opt < OPT_LONG_MIN_NUM && isprint(opt)) {
583 RTE_LOG(ERR, EAL, "Option %c is not supported "
584 "on FreeBSD\n", opt);
585 } else if (opt >= OPT_LONG_MIN_NUM &&
586 opt < OPT_LONG_MAX_NUM) {
587 RTE_LOG(ERR, EAL, "Option %s is not supported "
589 eal_long_options[option_index].name);
591 RTE_LOG(ERR, EAL, "Option %d is not supported "
592 "on FreeBSD\n", opt);
600 /* create runtime data directory */
601 if (internal_config.no_shconf == 0 &&
602 eal_create_runtime_dir() < 0) {
603 RTE_LOG(ERR, EAL, "Cannot create runtime directory\n");
608 if (eal_adjust_config(&internal_config) != 0) {
614 if (eal_check_common_options(&internal_config) != 0) {
621 argv[optind-1] = prgname;
625 /* restore getopt lib */
628 optreset = old_optreset;
635 check_socket(const struct rte_memseg_list *msl, void *arg)
637 int *socket_id = arg;
642 if (msl->socket_id == *socket_id && msl->memseg_arr.count != 0)
649 eal_check_mem_on_local_socket(void)
653 socket_id = rte_lcore_to_socket_id(rte_config.master_lcore);
655 if (rte_memseg_list_walk(check_socket, &socket_id) == 0)
656 RTE_LOG(WARNING, EAL, "WARNING: Master core has no memory on local socket!\n");
661 sync_func(__rte_unused void *arg)
666 /* return non-zero if hugepages are enabled. */
667 int rte_eal_has_hugepages(void)
669 return !internal_config.no_hugetlbfs;
672 /* Abstraction for port I/0 privilege */
674 rte_eal_iopl_init(void)
679 fd = open("/dev/io", O_RDWR);
683 /* keep fd open for iopl */
687 static void rte_eal_init_alert(const char *msg)
689 fprintf(stderr, "EAL: FATAL: %s\n", msg);
690 RTE_LOG(ERR, EAL, "%s\n", msg);
693 /* Launch threads, called at application init(). */
695 rte_eal_init(int argc, char **argv)
699 static rte_atomic32_t run_once = RTE_ATOMIC32_INIT(0);
700 char cpuset[RTE_CPU_AFFINITY_STR_LEN];
701 char thread_name[RTE_MAX_THREAD_NAME_LEN];
703 /* checks if the machine is adequate */
704 if (!rte_cpu_is_supported()) {
705 rte_eal_init_alert("unsupported cpu type.");
710 if (!rte_atomic32_test_and_set(&run_once)) {
711 rte_eal_init_alert("already called initialization.");
712 rte_errno = EALREADY;
716 thread_id = pthread_self();
718 eal_reset_internal_config(&internal_config);
720 /* clone argv to report out later in telemetry */
721 eal_save_args(argc, argv);
723 /* set log level as early as possible */
724 eal_log_level_parse(argc, argv);
726 if (rte_eal_cpu_init() < 0) {
727 rte_eal_init_alert("Cannot detect lcores.");
732 fctret = eal_parse_args(argc, argv);
734 rte_eal_init_alert("Invalid 'command line' arguments.");
736 rte_atomic32_clear(&run_once);
740 /* FreeBSD always uses legacy memory model */
741 internal_config.legacy_mem = true;
743 if (eal_plugins_init() < 0) {
744 rte_eal_init_alert("Cannot init plugins");
746 rte_atomic32_clear(&run_once);
750 if (eal_trace_init() < 0) {
751 rte_eal_init_alert("Cannot init trace");
753 rte_atomic32_clear(&run_once);
757 if (eal_option_device_parse()) {
759 rte_atomic32_clear(&run_once);
763 if (rte_config_init() < 0) {
764 rte_eal_init_alert("Cannot init config");
768 if (rte_eal_intr_init() < 0) {
769 rte_eal_init_alert("Cannot init interrupt-handling thread");
773 if (rte_eal_alarm_init() < 0) {
774 rte_eal_init_alert("Cannot init alarm");
775 /* rte_eal_alarm_init sets rte_errno on failure. */
779 /* Put mp channel init before bus scan so that we can init the vdev
780 * bus through mp channel in the secondary process before the bus scan.
782 if (rte_mp_channel_init() < 0 && rte_errno != ENOTSUP) {
783 rte_eal_init_alert("failed to init mp channel");
784 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
790 if (rte_bus_scan()) {
791 rte_eal_init_alert("Cannot scan the buses for devices");
793 rte_atomic32_clear(&run_once);
797 /* if no EAL option "--iova-mode=<pa|va>", use bus IOVA scheme */
798 if (internal_config.iova_mode == RTE_IOVA_DC) {
799 /* autodetect the IOVA mapping mode (default is RTE_IOVA_PA) */
800 enum rte_iova_mode iova_mode = rte_bus_get_iommu_class();
802 if (iova_mode == RTE_IOVA_DC)
803 iova_mode = RTE_IOVA_PA;
804 rte_eal_get_configuration()->iova_mode = iova_mode;
806 rte_eal_get_configuration()->iova_mode =
807 internal_config.iova_mode;
810 RTE_LOG(INFO, EAL, "Selected IOVA mode '%s'\n",
811 rte_eal_iova_mode() == RTE_IOVA_PA ? "PA" : "VA");
813 if (internal_config.no_hugetlbfs == 0) {
814 /* rte_config isn't initialized yet */
815 ret = internal_config.process_type == RTE_PROC_PRIMARY ?
816 eal_hugepage_info_init() :
817 eal_hugepage_info_read();
819 rte_eal_init_alert("Cannot get hugepage information.");
821 rte_atomic32_clear(&run_once);
826 if (internal_config.memory == 0 && internal_config.force_sockets == 0) {
827 if (internal_config.no_hugetlbfs)
828 internal_config.memory = MEMSIZE_IF_NO_HUGE_PAGE;
830 internal_config.memory = eal_get_hugepage_mem_size();
833 if (internal_config.vmware_tsc_map == 1) {
834 #ifdef RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT
835 rte_cycles_vmware_tsc_map = 1;
836 RTE_LOG (DEBUG, EAL, "Using VMWARE TSC MAP, "
837 "you must have monitor_control.pseudo_perfctr = TRUE\n");
839 RTE_LOG (WARNING, EAL, "Ignoring --vmware-tsc-map because "
840 "RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT is not set\n");
844 /* in secondary processes, memory init may allocate additional fbarrays
845 * not present in primary processes, so to avoid any potential issues,
846 * initialize memzones first.
848 if (rte_eal_memzone_init() < 0) {
849 rte_eal_init_alert("Cannot init memzone");
854 if (rte_eal_memory_init() < 0) {
855 rte_eal_init_alert("Cannot init memory");
860 if (rte_eal_malloc_heap_init() < 0) {
861 rte_eal_init_alert("Cannot init malloc heap");
866 if (rte_eal_tailqs_init() < 0) {
867 rte_eal_init_alert("Cannot init tail queues for objects");
872 if (rte_eal_timer_init() < 0) {
873 rte_eal_init_alert("Cannot init HPET or TSC timers");
878 eal_check_mem_on_local_socket();
880 eal_thread_init_master(rte_config.master_lcore);
882 ret = eal_thread_dump_affinity(cpuset, sizeof(cpuset));
884 RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
885 rte_config.master_lcore, thread_id, cpuset,
886 ret == 0 ? "" : "...");
888 RTE_LCORE_FOREACH_SLAVE(i) {
891 * create communication pipes between master thread
894 if (pipe(lcore_config[i].pipe_master2slave) < 0)
895 rte_panic("Cannot create pipe\n");
896 if (pipe(lcore_config[i].pipe_slave2master) < 0)
897 rte_panic("Cannot create pipe\n");
899 lcore_config[i].state = WAIT;
901 /* create a thread for each lcore */
902 ret = pthread_create(&lcore_config[i].thread_id, NULL,
903 eal_thread_loop, NULL);
905 rte_panic("Cannot create thread\n");
907 /* Set thread_name for aid in debugging. */
908 snprintf(thread_name, sizeof(thread_name),
909 "lcore-slave-%d", i);
910 rte_thread_setname(lcore_config[i].thread_id, thread_name);
914 * Launch a dummy function on all slave lcores, so that master lcore
915 * knows they are all ready when this function returns.
917 rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
918 rte_eal_mp_wait_lcore();
920 /* initialize services so vdevs register service during bus_probe. */
921 ret = rte_service_init();
923 rte_eal_init_alert("rte_service_init() failed");
928 /* Probe all the buses and devices/drivers on them */
929 if (rte_bus_probe()) {
930 rte_eal_init_alert("Cannot probe devices");
935 /* initialize default service/lcore mappings and start running. Ignore
936 * -ENOTSUP, as it indicates no service coremask passed to EAL.
938 ret = rte_service_start_with_defaults();
939 if (ret < 0 && ret != -ENOTSUP) {
945 * Clean up unused files in runtime directory. We do this at the end of
946 * init and not at the beginning because we want to clean stuff up
947 * whether we are primary or secondary process, but we cannot remove
948 * primary process' files because secondary should be able to run even
949 * if primary process is dead.
951 * In no_shconf mode, no runtime directory is created in the first
952 * place, so no cleanup needed.
954 if (!internal_config.no_shconf && eal_clean_runtime_dir() < 0) {
955 rte_eal_init_alert("Cannot clear runtime directory\n");
958 if (!internal_config.no_telemetry) {
959 const char *error_str;
960 if (rte_telemetry_init(rte_eal_get_runtime_dir(),
961 &internal_config.ctrl_cpuset, &error_str)
963 rte_eal_init_alert(error_str);
974 rte_eal_cleanup(void)
976 rte_service_finalize();
977 rte_mp_channel_cleanup();
980 eal_cleanup_config(&internal_config);
985 rte_eal_process_type(void)
987 return rte_config.process_type;
990 int rte_eal_has_pci(void)
992 return !internal_config.no_pci;
995 int rte_eal_create_uio_dev(void)
997 return internal_config.create_uio_dev;
1001 rte_eal_vfio_intr_mode(void)
1003 return RTE_INTR_MODE_NONE;
1006 int rte_vfio_setup_device(__rte_unused const char *sysfs_base,
1007 __rte_unused const char *dev_addr,
1008 __rte_unused int *vfio_dev_fd,
1009 __rte_unused struct vfio_device_info *device_info)
1014 int rte_vfio_release_device(__rte_unused const char *sysfs_base,
1015 __rte_unused const char *dev_addr,
1016 __rte_unused int fd)
1021 int rte_vfio_enable(__rte_unused const char *modname)
1026 int rte_vfio_is_enabled(__rte_unused const char *modname)
1031 int rte_vfio_noiommu_is_enabled(void)
1036 int rte_vfio_clear_group(__rte_unused int vfio_group_fd)
1042 rte_vfio_get_group_num(__rte_unused const char *sysfs_base,
1043 __rte_unused const char *dev_addr,
1044 __rte_unused int *iommu_group_num)
1050 rte_vfio_get_container_fd(void)
1056 rte_vfio_get_group_fd(__rte_unused int iommu_group_num)
1062 rte_vfio_container_create(void)
1068 rte_vfio_container_destroy(__rte_unused int container_fd)
1074 rte_vfio_container_group_bind(__rte_unused int container_fd,
1075 __rte_unused int iommu_group_num)
1081 rte_vfio_container_group_unbind(__rte_unused int container_fd,
1082 __rte_unused int iommu_group_num)
1088 rte_vfio_container_dma_map(__rte_unused int container_fd,
1089 __rte_unused uint64_t vaddr,
1090 __rte_unused uint64_t iova,
1091 __rte_unused uint64_t len)
1097 rte_vfio_container_dma_unmap(__rte_unused int container_fd,
1098 __rte_unused uint64_t vaddr,
1099 __rte_unused uint64_t iova,
1100 __rte_unused uint64_t len)