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 <malloc_heap.h>
45 #include <telemetry_internal.h>
47 #include "eal_private.h"
48 #include "eal_thread.h"
49 #include "eal_internal_cfg.h"
50 #include "eal_filesystem.h"
51 #include "eal_hugepages.h"
52 #include "eal_options.h"
53 #include "eal_memcfg.h"
54 #include "eal_trace.h"
56 #define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL)
58 /* define fd variable here, because file needs to be kept open for the
59 * duration of the program, as we hold a write lock on it in the primary proc */
60 static int mem_cfg_fd = -1;
62 static struct flock wr_lock = {
65 .l_start = offsetof(struct rte_mem_config, memsegs),
66 .l_len = RTE_SIZEOF_FIELD(struct rte_mem_config, memsegs),
69 /* internal configuration (per-core) */
70 struct lcore_config lcore_config[RTE_MAX_LCORE];
72 /* used by rte_rdtsc() */
73 int rte_cycles_vmware_tsc_map;
77 eal_clean_runtime_dir(void)
79 /* FreeBSD doesn't need this implemented for now, because, unlike Linux,
80 * FreeBSD doesn't create per-process files, so no need to clean up.
85 /* create memory configuration in shared/mmap memory. Take out
86 * a write lock on the memsegs, so we can auto-detect primary/secondary.
87 * This means we never close the file while running (auto-close on exit).
88 * We also don't lock the whole file, so that in future we can use read-locks
89 * on other parts, e.g. memzones, to detect if there are running secondary
92 rte_eal_config_create(void)
94 struct rte_config *config = rte_eal_get_configuration();
95 const struct internal_config *internal_conf =
96 eal_get_internal_configuration();
97 size_t page_sz = sysconf(_SC_PAGE_SIZE);
98 size_t cfg_len = sizeof(struct rte_mem_config);
99 size_t cfg_len_aligned = RTE_ALIGN(cfg_len, page_sz);
100 void *rte_mem_cfg_addr, *mapped_mem_cfg_addr;
103 const char *pathname = eal_runtime_config_path();
105 if (internal_conf->no_shconf)
108 /* map the config before base address so that we don't waste a page */
109 if (internal_conf->base_virtaddr != 0)
110 rte_mem_cfg_addr = (void *)
111 RTE_ALIGN_FLOOR(internal_conf->base_virtaddr -
112 sizeof(struct rte_mem_config), page_sz);
114 rte_mem_cfg_addr = NULL;
117 mem_cfg_fd = open(pathname, O_RDWR | O_CREAT, 0600);
118 if (mem_cfg_fd < 0) {
119 RTE_LOG(ERR, EAL, "Cannot open '%s' for rte_mem_config\n",
125 retval = ftruncate(mem_cfg_fd, cfg_len);
129 RTE_LOG(ERR, EAL, "Cannot resize '%s' for rte_mem_config\n",
134 retval = fcntl(mem_cfg_fd, F_SETLK, &wr_lock);
138 RTE_LOG(ERR, EAL, "Cannot create lock on '%s'. Is another primary "
139 "process running?\n", pathname);
143 /* reserve space for config */
144 rte_mem_cfg_addr = eal_get_virtual_area(rte_mem_cfg_addr,
145 &cfg_len_aligned, page_sz, 0, 0);
146 if (rte_mem_cfg_addr == NULL) {
147 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config\n");
153 /* remap the actual file into the space we've just reserved */
154 mapped_mem_cfg_addr = mmap(rte_mem_cfg_addr,
155 cfg_len_aligned, PROT_READ | PROT_WRITE,
156 MAP_SHARED | MAP_FIXED, mem_cfg_fd, 0);
157 if (mapped_mem_cfg_addr == MAP_FAILED) {
158 RTE_LOG(ERR, EAL, "Cannot remap memory for rte_config\n");
159 munmap(rte_mem_cfg_addr, cfg_len);
165 memcpy(rte_mem_cfg_addr, config->mem_config, sizeof(struct rte_mem_config));
166 config->mem_config = rte_mem_cfg_addr;
168 /* store address of the config in the config itself so that secondary
169 * processes could later map the config into this exact location
171 config->mem_config->mem_cfg_addr = (uintptr_t) rte_mem_cfg_addr;
175 /* attach to an existing shared memory config */
177 rte_eal_config_attach(void)
179 void *rte_mem_cfg_addr;
180 const char *pathname = eal_runtime_config_path();
181 struct rte_config *config = rte_eal_get_configuration();
182 const struct internal_config *internal_conf =
183 eal_get_internal_configuration();
186 if (internal_conf->no_shconf)
190 mem_cfg_fd = open(pathname, O_RDWR);
191 if (mem_cfg_fd < 0) {
192 RTE_LOG(ERR, EAL, "Cannot open '%s' for rte_mem_config\n",
198 rte_mem_cfg_addr = mmap(NULL, sizeof(*config->mem_config),
199 PROT_READ, MAP_SHARED, mem_cfg_fd, 0);
200 /* don't close the fd here, it will be closed on reattach */
201 if (rte_mem_cfg_addr == MAP_FAILED) {
204 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config! error %i (%s)\n",
205 errno, strerror(errno));
209 config->mem_config = rte_mem_cfg_addr;
214 /* reattach the shared config at exact memory location primary process has it */
216 rte_eal_config_reattach(void)
218 struct rte_mem_config *mem_config;
219 void *rte_mem_cfg_addr;
220 struct rte_config *config = rte_eal_get_configuration();
221 const struct internal_config *internal_conf =
222 eal_get_internal_configuration();
224 if (internal_conf->no_shconf)
227 /* save the address primary process has mapped shared config to */
229 (void *)(uintptr_t)config->mem_config->mem_cfg_addr;
231 /* unmap original config */
232 munmap(config->mem_config, sizeof(struct rte_mem_config));
234 /* remap the config at proper address */
235 mem_config = (struct rte_mem_config *) mmap(rte_mem_cfg_addr,
236 sizeof(*mem_config), PROT_READ | PROT_WRITE, MAP_SHARED,
241 if (mem_config == MAP_FAILED || mem_config != rte_mem_cfg_addr) {
242 if (mem_config != MAP_FAILED) {
243 /* errno is stale, don't use */
244 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config at [%p], got [%p]"
245 " - please use '--" OPT_BASE_VIRTADDR
247 rte_mem_cfg_addr, mem_config);
248 munmap(mem_config, sizeof(struct rte_mem_config));
251 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config! error %i (%s)\n",
252 errno, strerror(errno));
256 config->mem_config = mem_config;
261 /* Detect if we are a primary or a secondary process */
263 eal_proc_type_detect(void)
265 enum rte_proc_type_t ptype = RTE_PROC_PRIMARY;
266 const char *pathname = eal_runtime_config_path();
267 const struct internal_config *internal_conf =
268 eal_get_internal_configuration();
270 /* if there no shared config, there can be no secondary processes */
271 if (!internal_conf->no_shconf) {
272 /* if we can open the file but not get a write-lock we are a
273 * secondary process. NOTE: if we get a file handle back, we
274 * keep that open and don't close it to prevent a race condition
275 * between multiple opens.
277 if (((mem_cfg_fd = open(pathname, O_RDWR)) >= 0) &&
278 (fcntl(mem_cfg_fd, F_SETLK, &wr_lock) < 0))
279 ptype = RTE_PROC_SECONDARY;
282 RTE_LOG(INFO, EAL, "Auto-detected process type: %s\n",
283 ptype == RTE_PROC_PRIMARY ? "PRIMARY" : "SECONDARY");
288 /* Sets up rte_config structure with the pointer to shared memory config.*/
290 rte_config_init(void)
292 struct rte_config *config = rte_eal_get_configuration();
293 const struct internal_config *internal_conf =
294 eal_get_internal_configuration();
296 config->process_type = internal_conf->process_type;
298 switch (config->process_type) {
299 case RTE_PROC_PRIMARY:
300 if (rte_eal_config_create() < 0)
302 eal_mcfg_update_from_internal();
304 case RTE_PROC_SECONDARY:
305 if (rte_eal_config_attach() < 0)
307 eal_mcfg_wait_complete();
308 if (eal_mcfg_check_version() < 0) {
309 RTE_LOG(ERR, EAL, "Primary and secondary process DPDK version mismatch\n");
312 if (rte_eal_config_reattach() < 0)
314 if (!__rte_mp_enable()) {
315 RTE_LOG(ERR, EAL, "Primary process refused secondary attachment\n");
318 eal_mcfg_update_internal();
321 case RTE_PROC_INVALID:
322 RTE_LOG(ERR, EAL, "Invalid process type %d\n",
323 config->process_type);
332 eal_usage(const char *prgname)
334 rte_usage_hook_t hook = eal_get_application_usage_hook();
336 printf("\nUsage: %s ", prgname);
338 /* Allow the application to print its usage message too if hook is set */
340 printf("===== Application Usage =====\n\n");
346 eal_get_hugepage_mem_size(void)
350 struct internal_config *internal_conf =
351 eal_get_internal_configuration();
353 for (i = 0; i < internal_conf->num_hugepage_sizes; i++) {
354 struct hugepage_info *hpi = &internal_conf->hugepage_info[i];
355 if (strnlen(hpi->hugedir, sizeof(hpi->hugedir)) != 0) {
356 for (j = 0; j < RTE_MAX_NUMA_NODES; j++) {
357 size += hpi->hugepage_sz * hpi->num_pages[j];
362 return (size < SIZE_MAX) ? (size_t)(size) : SIZE_MAX;
365 /* Parse the arguments for --log-level only */
367 eal_log_level_parse(int argc, char **argv)
372 const int old_optind = optind;
373 const int old_optopt = optopt;
374 const int old_optreset = optreset;
375 char * const old_optarg = optarg;
376 struct internal_config *internal_conf =
377 eal_get_internal_configuration();
383 while ((opt = getopt_long(argc, argvopt, eal_short_options,
384 eal_long_options, &option_index)) != EOF) {
388 /* getopt is not happy, stop right now */
392 ret = (opt == OPT_LOG_LEVEL_NUM) ?
393 eal_parse_common_option(opt, optarg, internal_conf) : 0;
395 /* common parser is not happy */
400 /* restore getopt lib */
403 optreset = old_optreset;
407 /* Parse the argument given in the command line of the application */
409 eal_parse_args(int argc, char **argv)
414 char *prgname = argv[0];
415 const int old_optind = optind;
416 const int old_optopt = optopt;
417 const int old_optreset = optreset;
418 char * const old_optarg = optarg;
419 struct internal_config *internal_conf =
420 eal_get_internal_configuration();
426 while ((opt = getopt_long(argc, argvopt, eal_short_options,
427 eal_long_options, &option_index)) != EOF) {
429 /* getopt didn't recognise the option */
436 /* eal_log_level_parse() already handled this option */
437 if (opt == OPT_LOG_LEVEL_NUM)
440 ret = eal_parse_common_option(opt, optarg, internal_conf);
441 /* common parser is not happy */
447 /* common parser handled this option */
452 case OPT_MBUF_POOL_OPS_NAME_NUM:
454 char *ops_name = strdup(optarg);
455 if (ops_name == NULL)
456 RTE_LOG(ERR, EAL, "Could not store mbuf pool ops name\n");
458 /* free old ops name */
459 free(internal_conf->user_mbuf_pool_ops_name);
461 internal_conf->user_mbuf_pool_ops_name =
470 if (opt < OPT_LONG_MIN_NUM && isprint(opt)) {
471 RTE_LOG(ERR, EAL, "Option %c is not supported "
472 "on FreeBSD\n", opt);
473 } else if (opt >= OPT_LONG_MIN_NUM &&
474 opt < OPT_LONG_MAX_NUM) {
475 RTE_LOG(ERR, EAL, "Option %s is not supported "
477 eal_long_options[option_index].name);
479 RTE_LOG(ERR, EAL, "Option %d is not supported "
480 "on FreeBSD\n", opt);
488 /* create runtime data directory. In no_shconf mode, skip any errors */
489 if (eal_create_runtime_dir() < 0) {
490 if (internal_conf->no_shconf == 0) {
491 RTE_LOG(ERR, EAL, "Cannot create runtime directory\n");
495 RTE_LOG(WARNING, EAL, "No DPDK runtime directory created\n");
498 if (eal_adjust_config(internal_conf) != 0) {
504 if (eal_check_common_options(internal_conf) != 0) {
511 argv[optind-1] = prgname;
515 /* restore getopt lib */
518 optreset = old_optreset;
525 check_socket(const struct rte_memseg_list *msl, void *arg)
527 int *socket_id = arg;
532 if (msl->socket_id == *socket_id && msl->memseg_arr.count != 0)
539 eal_check_mem_on_local_socket(void)
542 const struct rte_config *config = rte_eal_get_configuration();
544 socket_id = rte_lcore_to_socket_id(config->main_lcore);
546 if (rte_memseg_list_walk(check_socket, &socket_id) == 0)
547 RTE_LOG(WARNING, EAL, "WARNING: Main core has no memory on local socket!\n");
552 sync_func(__rte_unused void *arg)
556 /* Abstraction for port I/0 privilege */
558 rte_eal_iopl_init(void)
563 fd = open("/dev/io", O_RDWR);
567 /* keep fd open for iopl */
571 static void rte_eal_init_alert(const char *msg)
573 fprintf(stderr, "EAL: FATAL: %s\n", msg);
574 RTE_LOG(ERR, EAL, "%s\n", msg);
577 /* Launch threads, called at application init(). */
579 rte_eal_init(int argc, char **argv)
582 static uint32_t run_once;
583 uint32_t has_run = 0;
584 char cpuset[RTE_CPU_AFFINITY_STR_LEN];
585 char thread_name[RTE_MAX_THREAD_NAME_LEN];
586 const struct rte_config *config = rte_eal_get_configuration();
587 struct internal_config *internal_conf =
588 eal_get_internal_configuration();
590 enum rte_iova_mode iova_mode;
592 /* checks if the machine is adequate */
593 if (!rte_cpu_is_supported()) {
594 rte_eal_init_alert("unsupported cpu type.");
599 if (!__atomic_compare_exchange_n(&run_once, &has_run, 1, 0,
600 __ATOMIC_RELAXED, __ATOMIC_RELAXED)) {
601 rte_eal_init_alert("already called initialization.");
602 rte_errno = EALREADY;
606 eal_reset_internal_config(internal_conf);
608 /* clone argv to report out later in telemetry */
609 eal_save_args(argc, argv);
611 /* set log level as early as possible */
612 eal_log_level_parse(argc, argv);
614 if (rte_eal_cpu_init() < 0) {
615 rte_eal_init_alert("Cannot detect lcores.");
620 fctret = eal_parse_args(argc, argv);
622 rte_eal_init_alert("Invalid 'command line' arguments.");
624 __atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);
628 /* FreeBSD always uses legacy memory model */
629 internal_conf->legacy_mem = true;
630 if (internal_conf->in_memory) {
631 RTE_LOG(WARNING, EAL, "Warning: ignoring unsupported flag, '%s'\n", OPT_IN_MEMORY);
632 internal_conf->in_memory = false;
635 if (eal_plugins_init() < 0) {
636 rte_eal_init_alert("Cannot init plugins");
638 __atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);
642 if (eal_trace_init() < 0) {
643 rte_eal_init_alert("Cannot init trace");
645 __atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);
649 if (eal_option_device_parse()) {
651 __atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);
655 if (rte_config_init() < 0) {
656 rte_eal_init_alert("Cannot init config");
660 if (rte_eal_intr_init() < 0) {
661 rte_eal_init_alert("Cannot init interrupt-handling thread");
665 if (rte_eal_alarm_init() < 0) {
666 rte_eal_init_alert("Cannot init alarm");
667 /* rte_eal_alarm_init sets rte_errno on failure. */
671 /* Put mp channel init before bus scan so that we can init the vdev
672 * bus through mp channel in the secondary process before the bus scan.
674 if (rte_mp_channel_init() < 0 && rte_errno != ENOTSUP) {
675 rte_eal_init_alert("failed to init mp channel");
676 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
682 if (rte_bus_scan()) {
683 rte_eal_init_alert("Cannot scan the buses for devices");
685 __atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);
690 * PA are only available for hugepages via contigmem.
691 * If contigmem is inaccessible, rte_eal_hugepage_init() will fail
692 * with a message describing the cause.
694 has_phys_addr = internal_conf->no_hugetlbfs == 0;
695 iova_mode = internal_conf->iova_mode;
696 if (iova_mode == RTE_IOVA_PA && !has_phys_addr) {
697 rte_eal_init_alert("Cannot use IOVA as 'PA' since physical addresses are not available");
701 if (iova_mode == RTE_IOVA_DC) {
702 RTE_LOG(DEBUG, EAL, "Specific IOVA mode is not requested, autodetecting\n");
704 RTE_LOG(DEBUG, EAL, "Selecting IOVA mode according to bus requests\n");
705 iova_mode = rte_bus_get_iommu_class();
706 if (iova_mode == RTE_IOVA_DC)
707 iova_mode = RTE_IOVA_PA;
709 iova_mode = RTE_IOVA_VA;
712 rte_eal_get_configuration()->iova_mode = iova_mode;
713 RTE_LOG(INFO, EAL, "Selected IOVA mode '%s'\n",
714 rte_eal_iova_mode() == RTE_IOVA_PA ? "PA" : "VA");
716 if (internal_conf->no_hugetlbfs == 0) {
717 /* rte_config isn't initialized yet */
718 ret = internal_conf->process_type == RTE_PROC_PRIMARY ?
719 eal_hugepage_info_init() :
720 eal_hugepage_info_read();
722 rte_eal_init_alert("Cannot get hugepage information.");
724 __atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);
729 if (internal_conf->memory == 0 && internal_conf->force_sockets == 0) {
730 if (internal_conf->no_hugetlbfs)
731 internal_conf->memory = MEMSIZE_IF_NO_HUGE_PAGE;
733 internal_conf->memory = eal_get_hugepage_mem_size();
736 if (internal_conf->vmware_tsc_map == 1) {
737 #ifdef RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT
738 rte_cycles_vmware_tsc_map = 1;
739 RTE_LOG (DEBUG, EAL, "Using VMWARE TSC MAP, "
740 "you must have monitor_control.pseudo_perfctr = TRUE\n");
742 RTE_LOG (WARNING, EAL, "Ignoring --vmware-tsc-map because "
743 "RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT is not set\n");
747 /* in secondary processes, memory init may allocate additional fbarrays
748 * not present in primary processes, so to avoid any potential issues,
749 * initialize memzones first.
751 if (rte_eal_memzone_init() < 0) {
752 rte_eal_init_alert("Cannot init memzone");
757 if (rte_eal_memory_init() < 0) {
758 rte_eal_init_alert("Cannot init memory");
763 if (rte_eal_malloc_heap_init() < 0) {
764 rte_eal_init_alert("Cannot init malloc heap");
769 if (rte_eal_tailqs_init() < 0) {
770 rte_eal_init_alert("Cannot init tail queues for objects");
775 if (rte_eal_timer_init() < 0) {
776 rte_eal_init_alert("Cannot init HPET or TSC timers");
781 eal_check_mem_on_local_socket();
783 if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
784 &lcore_config[config->main_lcore].cpuset) != 0) {
785 rte_eal_init_alert("Cannot set affinity");
789 __rte_thread_init(config->main_lcore,
790 &lcore_config[config->main_lcore].cpuset);
792 ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
794 RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%zx;cpuset=[%s%s])\n",
795 config->main_lcore, (uintptr_t)pthread_self(), cpuset,
796 ret == 0 ? "" : "...");
798 RTE_LCORE_FOREACH_WORKER(i) {
801 * create communication pipes between main thread
804 if (pipe(lcore_config[i].pipe_main2worker) < 0)
805 rte_panic("Cannot create pipe\n");
806 if (pipe(lcore_config[i].pipe_worker2main) < 0)
807 rte_panic("Cannot create pipe\n");
809 lcore_config[i].state = WAIT;
811 /* create a thread for each lcore */
812 ret = pthread_create(&lcore_config[i].thread_id, NULL,
813 eal_thread_loop, (void *)(uintptr_t)i);
815 rte_panic("Cannot create thread\n");
817 /* Set thread_name for aid in debugging. */
818 snprintf(thread_name, sizeof(thread_name),
819 "lcore-worker-%d", i);
820 rte_thread_setname(lcore_config[i].thread_id, thread_name);
822 ret = pthread_setaffinity_np(lcore_config[i].thread_id,
823 sizeof(rte_cpuset_t), &lcore_config[i].cpuset);
825 rte_panic("Cannot set affinity\n");
829 * Launch a dummy function on all worker lcores, so that main lcore
830 * knows they are all ready when this function returns.
832 rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
833 rte_eal_mp_wait_lcore();
835 /* initialize services so vdevs register service during bus_probe. */
836 ret = rte_service_init();
838 rte_eal_init_alert("rte_service_init() failed");
843 /* Probe all the buses and devices/drivers on them */
844 if (rte_bus_probe()) {
845 rte_eal_init_alert("Cannot probe devices");
850 /* initialize default service/lcore mappings and start running. Ignore
851 * -ENOTSUP, as it indicates no service coremask passed to EAL.
853 ret = rte_service_start_with_defaults();
854 if (ret < 0 && ret != -ENOTSUP) {
860 * Clean up unused files in runtime directory. We do this at the end of
861 * init and not at the beginning because we want to clean stuff up
862 * whether we are primary or secondary process, but we cannot remove
863 * primary process' files because secondary should be able to run even
864 * if primary process is dead.
866 * In no_shconf mode, no runtime directory is created in the first
867 * place, so no cleanup needed.
869 if (!internal_conf->no_shconf && eal_clean_runtime_dir() < 0) {
870 rte_eal_init_alert("Cannot clear runtime directory");
873 if (rte_eal_process_type() == RTE_PROC_PRIMARY && !internal_conf->no_telemetry) {
874 int tlog = rte_log_register_type_and_pick_level(
875 "lib.telemetry", RTE_LOG_WARNING);
877 tlog = RTE_LOGTYPE_EAL;
878 if (rte_telemetry_init(rte_eal_get_runtime_dir(),
880 &internal_conf->ctrl_cpuset, rte_log, tlog) != 0)
890 rte_eal_cleanup(void)
892 struct internal_config *internal_conf =
893 eal_get_internal_configuration();
894 rte_service_finalize();
895 rte_mp_channel_cleanup();
896 /* after this point, any DPDK pointers will become dangling */
897 rte_eal_memory_detach();
898 rte_eal_alarm_cleanup();
901 eal_cleanup_config(internal_conf);
905 int rte_eal_create_uio_dev(void)
907 const struct internal_config *internal_conf =
908 eal_get_internal_configuration();
909 return internal_conf->create_uio_dev;
913 rte_eal_vfio_intr_mode(void)
915 return RTE_INTR_MODE_NONE;
919 rte_eal_vfio_get_vf_token(__rte_unused rte_uuid_t vf_token)
923 int rte_vfio_setup_device(__rte_unused const char *sysfs_base,
924 __rte_unused const char *dev_addr,
925 __rte_unused int *vfio_dev_fd,
926 __rte_unused struct vfio_device_info *device_info)
932 int rte_vfio_release_device(__rte_unused const char *sysfs_base,
933 __rte_unused const char *dev_addr,
940 int rte_vfio_enable(__rte_unused const char *modname)
946 int rte_vfio_is_enabled(__rte_unused const char *modname)
951 int rte_vfio_noiommu_is_enabled(void)
956 int rte_vfio_clear_group(__rte_unused int vfio_group_fd)
963 rte_vfio_get_group_num(__rte_unused const char *sysfs_base,
964 __rte_unused const char *dev_addr,
965 __rte_unused int *iommu_group_num)
972 rte_vfio_get_container_fd(void)
979 rte_vfio_get_group_fd(__rte_unused int iommu_group_num)
986 rte_vfio_container_create(void)
993 rte_vfio_container_destroy(__rte_unused int container_fd)
1000 rte_vfio_container_group_bind(__rte_unused int container_fd,
1001 __rte_unused int iommu_group_num)
1003 rte_errno = ENOTSUP;
1008 rte_vfio_container_group_unbind(__rte_unused int container_fd,
1009 __rte_unused int iommu_group_num)
1011 rte_errno = ENOTSUP;
1016 rte_vfio_container_dma_map(__rte_unused int container_fd,
1017 __rte_unused uint64_t vaddr,
1018 __rte_unused uint64_t iova,
1019 __rte_unused uint64_t len)
1021 rte_errno = ENOTSUP;
1026 rte_vfio_container_dma_unmap(__rte_unused int container_fd,
1027 __rte_unused uint64_t vaddr,
1028 __rte_unused uint64_t iova,
1029 __rte_unused uint64_t len)
1031 rte_errno = ENOTSUP;