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_option.h>
45 #include <rte_atomic.h>
46 #include <malloc_heap.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"
56 #define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL)
58 /* Allow the application to print its usage message too if set */
59 static rte_usage_hook_t rte_application_usage_hook = NULL;
60 /* early configuration structure, when memory config is not mmapped */
61 static struct rte_mem_config early_mem_config;
63 /* define fd variable here, because file needs to be kept open for the
64 * duration of the program, as we hold a write lock on it in the primary proc */
65 static int mem_cfg_fd = -1;
67 static struct flock wr_lock = {
70 .l_start = offsetof(struct rte_mem_config, memsegs),
71 .l_len = sizeof(early_mem_config.memsegs),
74 /* Address of global and public configuration */
75 static struct rte_config rte_config = {
76 .mem_config = &early_mem_config,
79 /* internal configuration (per-core) */
80 struct lcore_config lcore_config[RTE_MAX_LCORE];
82 /* internal configuration */
83 struct internal_config internal_config;
85 /* used by rte_rdtsc() */
86 int rte_cycles_vmware_tsc_map;
88 /* platform-specific runtime dir */
89 static char runtime_dir[PATH_MAX];
91 static const char *default_runtime_dir = "/var/run";
94 eal_create_runtime_dir(void)
96 const char *directory = default_runtime_dir;
97 const char *xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
98 const char *fallback = "/tmp";
103 /* try XDG path first, fall back to /tmp */
104 if (xdg_runtime_dir != NULL)
105 directory = xdg_runtime_dir;
107 directory = fallback;
109 /* create DPDK subdirectory under runtime dir */
110 ret = snprintf(tmp, sizeof(tmp), "%s/dpdk", directory);
111 if (ret < 0 || ret == sizeof(tmp)) {
112 RTE_LOG(ERR, EAL, "Error creating DPDK runtime path name\n");
116 /* create prefix-specific subdirectory under DPDK runtime dir */
117 ret = snprintf(runtime_dir, sizeof(runtime_dir), "%s/%s",
118 tmp, eal_get_hugefile_prefix());
119 if (ret < 0 || ret == sizeof(runtime_dir)) {
120 RTE_LOG(ERR, EAL, "Error creating prefix-specific runtime path name\n");
124 /* create the path if it doesn't exist. no "mkdir -p" here, so do it
127 ret = mkdir(tmp, 0700);
128 if (ret < 0 && errno != EEXIST) {
129 RTE_LOG(ERR, EAL, "Error creating '%s': %s\n",
130 tmp, strerror(errno));
134 ret = mkdir(runtime_dir, 0700);
135 if (ret < 0 && errno != EEXIST) {
136 RTE_LOG(ERR, EAL, "Error creating '%s': %s\n",
137 runtime_dir, strerror(errno));
145 eal_clean_runtime_dir(void)
147 /* FreeBSD doesn't need this implemented for now, because, unlike Linux,
148 * FreeBSD doesn't create per-process files, so no need to clean up.
155 rte_eal_get_runtime_dir(void)
160 /* Return user provided mbuf pool ops name */
162 rte_eal_mbuf_user_pool_ops(void)
164 return internal_config.user_mbuf_pool_ops_name;
167 /* Return a pointer to the configuration structure */
169 rte_eal_get_configuration(void)
175 rte_eal_iova_mode(void)
177 return rte_eal_get_configuration()->iova_mode;
180 /* parse a sysfs (or other) file containing one integer value */
182 eal_parse_sysfs_value(const char *filename, unsigned long *val)
188 if ((f = fopen(filename, "r")) == NULL) {
189 RTE_LOG(ERR, EAL, "%s(): cannot open sysfs value %s\n",
194 if (fgets(buf, sizeof(buf), f) == NULL) {
195 RTE_LOG(ERR, EAL, "%s(): cannot read sysfs value %s\n",
200 *val = strtoul(buf, &end, 0);
201 if ((buf[0] == '\0') || (end == NULL) || (*end != '\n')) {
202 RTE_LOG(ERR, EAL, "%s(): cannot parse sysfs value %s\n",
212 /* create memory configuration in shared/mmap memory. Take out
213 * a write lock on the memsegs, so we can auto-detect primary/secondary.
214 * This means we never close the file while running (auto-close on exit).
215 * We also don't lock the whole file, so that in future we can use read-locks
216 * on other parts, e.g. memzones, to detect if there are running secondary
219 rte_eal_config_create(void)
221 void *rte_mem_cfg_addr;
224 const char *pathname = eal_runtime_config_path();
226 if (internal_config.no_shconf)
230 mem_cfg_fd = open(pathname, O_RDWR | O_CREAT, 0600);
231 if (mem_cfg_fd < 0) {
232 RTE_LOG(ERR, EAL, "Cannot open '%s' for rte_mem_config\n",
238 retval = ftruncate(mem_cfg_fd, sizeof(*rte_config.mem_config));
242 RTE_LOG(ERR, EAL, "Cannot resize '%s' for rte_mem_config\n",
247 retval = fcntl(mem_cfg_fd, F_SETLK, &wr_lock);
251 RTE_LOG(ERR, EAL, "Cannot create lock on '%s'. Is another primary "
252 "process running?\n", pathname);
256 rte_mem_cfg_addr = mmap(NULL, sizeof(*rte_config.mem_config),
257 PROT_READ | PROT_WRITE, MAP_SHARED, mem_cfg_fd, 0);
259 if (rte_mem_cfg_addr == MAP_FAILED){
260 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config\n");
265 memcpy(rte_mem_cfg_addr, &early_mem_config, sizeof(early_mem_config));
266 rte_config.mem_config = rte_mem_cfg_addr;
268 /* store address of the config in the config itself so that secondary
269 * processes could later map the config into this exact location
271 rte_config.mem_config->mem_cfg_addr = (uintptr_t) rte_mem_cfg_addr;
276 /* attach to an existing shared memory config */
278 rte_eal_config_attach(void)
280 void *rte_mem_cfg_addr;
281 const char *pathname = eal_runtime_config_path();
283 if (internal_config.no_shconf)
287 mem_cfg_fd = open(pathname, O_RDWR);
288 if (mem_cfg_fd < 0) {
289 RTE_LOG(ERR, EAL, "Cannot open '%s' for rte_mem_config\n",
295 rte_mem_cfg_addr = mmap(NULL, sizeof(*rte_config.mem_config),
296 PROT_READ, MAP_SHARED, mem_cfg_fd, 0);
297 /* don't close the fd here, it will be closed on reattach */
298 if (rte_mem_cfg_addr == MAP_FAILED) {
301 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config! error %i (%s)\n",
302 errno, strerror(errno));
306 rte_config.mem_config = rte_mem_cfg_addr;
311 /* reattach the shared config at exact memory location primary process has it */
313 rte_eal_config_reattach(void)
315 struct rte_mem_config *mem_config;
316 void *rte_mem_cfg_addr;
318 if (internal_config.no_shconf)
321 /* save the address primary process has mapped shared config to */
323 (void *)(uintptr_t)rte_config.mem_config->mem_cfg_addr;
325 /* unmap original config */
326 munmap(rte_config.mem_config, sizeof(struct rte_mem_config));
328 /* remap the config at proper address */
329 mem_config = (struct rte_mem_config *) mmap(rte_mem_cfg_addr,
330 sizeof(*mem_config), PROT_READ | PROT_WRITE, MAP_SHARED,
335 if (mem_config == MAP_FAILED) {
336 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config! error %i (%s)\n",
337 errno, strerror(errno));
339 } else if (mem_config != rte_mem_cfg_addr) {
340 /* errno is stale, don't use */
341 RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config at [%p], got [%p]\n",
342 rte_mem_cfg_addr, mem_config);
346 rte_config.mem_config = mem_config;
351 /* Detect if we are a primary or a secondary process */
353 eal_proc_type_detect(void)
355 enum rte_proc_type_t ptype = RTE_PROC_PRIMARY;
356 const char *pathname = eal_runtime_config_path();
358 /* if there no shared config, there can be no secondary processes */
359 if (!internal_config.no_shconf) {
360 /* if we can open the file but not get a write-lock we are a
361 * secondary process. NOTE: if we get a file handle back, we
362 * keep that open and don't close it to prevent a race condition
363 * between multiple opens.
365 if (((mem_cfg_fd = open(pathname, O_RDWR)) >= 0) &&
366 (fcntl(mem_cfg_fd, F_SETLK, &wr_lock) < 0))
367 ptype = RTE_PROC_SECONDARY;
370 RTE_LOG(INFO, EAL, "Auto-detected process type: %s\n",
371 ptype == RTE_PROC_PRIMARY ? "PRIMARY" : "SECONDARY");
376 /* Sets up rte_config structure with the pointer to shared memory config.*/
378 rte_config_init(void)
380 rte_config.process_type = internal_config.process_type;
382 switch (rte_config.process_type){
383 case RTE_PROC_PRIMARY:
384 if (rte_eal_config_create() < 0)
386 eal_mcfg_update_from_internal();
388 case RTE_PROC_SECONDARY:
389 if (rte_eal_config_attach() < 0)
391 eal_mcfg_wait_complete();
392 if (eal_mcfg_check_version() < 0) {
393 RTE_LOG(ERR, EAL, "Primary and secondary process DPDK version mismatch\n");
396 if (rte_eal_config_reattach() < 0)
398 eal_mcfg_update_internal();
401 case RTE_PROC_INVALID:
402 RTE_LOG(ERR, EAL, "Invalid process type %d\n",
403 rte_config.process_type);
412 eal_usage(const char *prgname)
414 printf("\nUsage: %s ", prgname);
416 /* Allow the application to print its usage message too if hook is set */
417 if ( rte_application_usage_hook ) {
418 printf("===== Application Usage =====\n\n");
419 rte_application_usage_hook(prgname);
423 /* Set a per-application usage message */
425 rte_set_application_usage_hook( rte_usage_hook_t usage_func )
427 rte_usage_hook_t old_func;
429 /* Will be NULL on the first call to denote the last usage routine. */
430 old_func = rte_application_usage_hook;
431 rte_application_usage_hook = usage_func;
437 eal_get_hugepage_mem_size(void)
442 for (i = 0; i < internal_config.num_hugepage_sizes; i++) {
443 struct hugepage_info *hpi = &internal_config.hugepage_info[i];
444 if (strnlen(hpi->hugedir, sizeof(hpi->hugedir)) != 0) {
445 for (j = 0; j < RTE_MAX_NUMA_NODES; j++) {
446 size += hpi->hugepage_sz * hpi->num_pages[j];
451 return (size < SIZE_MAX) ? (size_t)(size) : SIZE_MAX;
454 /* Parse the arguments for --log-level only */
456 eal_log_level_parse(int argc, char **argv)
461 const int old_optind = optind;
462 const int old_optopt = optopt;
463 const int old_optreset = optreset;
464 char * const old_optarg = optarg;
470 while ((opt = getopt_long(argc, argvopt, eal_short_options,
471 eal_long_options, &option_index)) != EOF) {
475 /* getopt is not happy, stop right now */
479 ret = (opt == OPT_LOG_LEVEL_NUM) ?
480 eal_parse_common_option(opt, optarg, &internal_config) : 0;
482 /* common parser is not happy */
487 /* restore getopt lib */
490 optreset = old_optreset;
494 /* Parse the argument given in the command line of the application */
496 eal_parse_args(int argc, char **argv)
501 char *prgname = argv[0];
502 const int old_optind = optind;
503 const int old_optopt = optopt;
504 const int old_optreset = optreset;
505 char * const old_optarg = optarg;
512 while ((opt = getopt_long(argc, argvopt, eal_short_options,
513 eal_long_options, &option_index)) != EOF) {
516 * getopt didn't recognise the option, lets parse the
517 * registered options to see if the flag is valid
520 ret = rte_option_parse(argv[optind-1]);
529 ret = eal_parse_common_option(opt, optarg, &internal_config);
530 /* common parser is not happy */
536 /* common parser handled this option */
541 case OPT_MBUF_POOL_OPS_NAME_NUM:
543 char *ops_name = strdup(optarg);
544 if (ops_name == NULL)
545 RTE_LOG(ERR, EAL, "Could not store mbuf pool ops name\n");
547 /* free old ops name */
548 if (internal_config.user_mbuf_pool_ops_name !=
550 free(internal_config.user_mbuf_pool_ops_name);
552 internal_config.user_mbuf_pool_ops_name =
561 if (opt < OPT_LONG_MIN_NUM && isprint(opt)) {
562 RTE_LOG(ERR, EAL, "Option %c is not supported "
563 "on FreeBSD\n", opt);
564 } else if (opt >= OPT_LONG_MIN_NUM &&
565 opt < OPT_LONG_MAX_NUM) {
566 RTE_LOG(ERR, EAL, "Option %s is not supported "
568 eal_long_options[option_index].name);
570 RTE_LOG(ERR, EAL, "Option %d is not supported "
571 "on FreeBSD\n", opt);
579 /* create runtime data directory */
580 if (internal_config.no_shconf == 0 &&
581 eal_create_runtime_dir() < 0) {
582 RTE_LOG(ERR, EAL, "Cannot create runtime directory\n");
587 if (eal_adjust_config(&internal_config) != 0) {
593 if (eal_check_common_options(&internal_config) != 0) {
600 argv[optind-1] = prgname;
604 /* restore getopt lib */
607 optreset = old_optreset;
614 check_socket(const struct rte_memseg_list *msl, void *arg)
616 int *socket_id = arg;
621 if (msl->socket_id == *socket_id && msl->memseg_arr.count != 0)
628 eal_check_mem_on_local_socket(void)
632 socket_id = rte_lcore_to_socket_id(rte_config.master_lcore);
634 if (rte_memseg_list_walk(check_socket, &socket_id) == 0)
635 RTE_LOG(WARNING, EAL, "WARNING: Master core has no memory on local socket!\n");
640 sync_func(__attribute__((unused)) void *arg)
645 /* return non-zero if hugepages are enabled. */
646 int rte_eal_has_hugepages(void)
648 return !internal_config.no_hugetlbfs;
651 /* Abstraction for port I/0 privilege */
653 rte_eal_iopl_init(void)
658 fd = open("/dev/io", O_RDWR);
662 /* keep fd open for iopl */
666 static void rte_eal_init_alert(const char *msg)
668 fprintf(stderr, "EAL: FATAL: %s\n", msg);
669 RTE_LOG(ERR, EAL, "%s\n", msg);
672 /* Launch threads, called at application init(). */
674 rte_eal_init(int argc, char **argv)
678 static rte_atomic32_t run_once = RTE_ATOMIC32_INIT(0);
679 char cpuset[RTE_CPU_AFFINITY_STR_LEN];
680 char thread_name[RTE_MAX_THREAD_NAME_LEN];
682 /* checks if the machine is adequate */
683 if (!rte_cpu_is_supported()) {
684 rte_eal_init_alert("unsupported cpu type.");
689 if (!rte_atomic32_test_and_set(&run_once)) {
690 rte_eal_init_alert("already called initialization.");
691 rte_errno = EALREADY;
695 thread_id = pthread_self();
697 eal_reset_internal_config(&internal_config);
699 /* set log level as early as possible */
700 eal_log_level_parse(argc, argv);
702 if (rte_eal_cpu_init() < 0) {
703 rte_eal_init_alert("Cannot detect lcores.");
708 fctret = eal_parse_args(argc, argv);
710 rte_eal_init_alert("Invalid 'command line' arguments.");
712 rte_atomic32_clear(&run_once);
716 /* FreeBSD always uses legacy memory model */
717 internal_config.legacy_mem = true;
719 if (eal_plugins_init() < 0) {
720 rte_eal_init_alert("Cannot init plugins");
722 rte_atomic32_clear(&run_once);
726 if (eal_option_device_parse()) {
728 rte_atomic32_clear(&run_once);
732 if (rte_config_init() < 0) {
733 rte_eal_init_alert("Cannot init config");
737 if (rte_eal_intr_init() < 0) {
738 rte_eal_init_alert("Cannot init interrupt-handling thread");
742 if (rte_eal_alarm_init() < 0) {
743 rte_eal_init_alert("Cannot init alarm");
744 /* rte_eal_alarm_init sets rte_errno on failure. */
748 /* Put mp channel init before bus scan so that we can init the vdev
749 * bus through mp channel in the secondary process before the bus scan.
751 if (rte_mp_channel_init() < 0 && rte_errno != ENOTSUP) {
752 rte_eal_init_alert("failed to init mp channel");
753 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
759 if (rte_bus_scan()) {
760 rte_eal_init_alert("Cannot scan the buses for devices");
762 rte_atomic32_clear(&run_once);
766 /* if no EAL option "--iova-mode=<pa|va>", use bus IOVA scheme */
767 if (internal_config.iova_mode == RTE_IOVA_DC) {
768 /* autodetect the IOVA mapping mode (default is RTE_IOVA_PA) */
769 enum rte_iova_mode iova_mode = rte_bus_get_iommu_class();
771 if (iova_mode == RTE_IOVA_DC)
772 iova_mode = RTE_IOVA_PA;
773 rte_eal_get_configuration()->iova_mode = iova_mode;
775 rte_eal_get_configuration()->iova_mode =
776 internal_config.iova_mode;
779 RTE_LOG(INFO, EAL, "Selected IOVA mode '%s'\n",
780 rte_eal_iova_mode() == RTE_IOVA_PA ? "PA" : "VA");
782 if (internal_config.no_hugetlbfs == 0) {
783 /* rte_config isn't initialized yet */
784 ret = internal_config.process_type == RTE_PROC_PRIMARY ?
785 eal_hugepage_info_init() :
786 eal_hugepage_info_read();
788 rte_eal_init_alert("Cannot get hugepage information.");
790 rte_atomic32_clear(&run_once);
795 if (internal_config.memory == 0 && internal_config.force_sockets == 0) {
796 if (internal_config.no_hugetlbfs)
797 internal_config.memory = MEMSIZE_IF_NO_HUGE_PAGE;
799 internal_config.memory = eal_get_hugepage_mem_size();
802 if (internal_config.vmware_tsc_map == 1) {
803 #ifdef RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT
804 rte_cycles_vmware_tsc_map = 1;
805 RTE_LOG (DEBUG, EAL, "Using VMWARE TSC MAP, "
806 "you must have monitor_control.pseudo_perfctr = TRUE\n");
808 RTE_LOG (WARNING, EAL, "Ignoring --vmware-tsc-map because "
809 "RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT is not set\n");
813 /* in secondary processes, memory init may allocate additional fbarrays
814 * not present in primary processes, so to avoid any potential issues,
815 * initialize memzones first.
817 if (rte_eal_memzone_init() < 0) {
818 rte_eal_init_alert("Cannot init memzone");
823 if (rte_eal_memory_init() < 0) {
824 rte_eal_init_alert("Cannot init memory");
829 if (rte_eal_malloc_heap_init() < 0) {
830 rte_eal_init_alert("Cannot init malloc heap");
835 if (rte_eal_tailqs_init() < 0) {
836 rte_eal_init_alert("Cannot init tail queues for objects");
841 if (rte_eal_timer_init() < 0) {
842 rte_eal_init_alert("Cannot init HPET or TSC timers");
847 eal_check_mem_on_local_socket();
849 eal_thread_init_master(rte_config.master_lcore);
851 ret = eal_thread_dump_affinity(cpuset, sizeof(cpuset));
853 RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
854 rte_config.master_lcore, thread_id, cpuset,
855 ret == 0 ? "" : "...");
857 RTE_LCORE_FOREACH_SLAVE(i) {
860 * create communication pipes between master thread
863 if (pipe(lcore_config[i].pipe_master2slave) < 0)
864 rte_panic("Cannot create pipe\n");
865 if (pipe(lcore_config[i].pipe_slave2master) < 0)
866 rte_panic("Cannot create pipe\n");
868 lcore_config[i].state = WAIT;
870 /* create a thread for each lcore */
871 ret = pthread_create(&lcore_config[i].thread_id, NULL,
872 eal_thread_loop, NULL);
874 rte_panic("Cannot create thread\n");
876 /* Set thread_name for aid in debugging. */
877 snprintf(thread_name, sizeof(thread_name),
878 "lcore-slave-%d", i);
879 rte_thread_setname(lcore_config[i].thread_id, thread_name);
883 * Launch a dummy function on all slave lcores, so that master lcore
884 * knows they are all ready when this function returns.
886 rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
887 rte_eal_mp_wait_lcore();
889 /* initialize services so vdevs register service during bus_probe. */
890 ret = rte_service_init();
892 rte_eal_init_alert("rte_service_init() failed");
897 /* Probe all the buses and devices/drivers on them */
898 if (rte_bus_probe()) {
899 rte_eal_init_alert("Cannot probe devices");
904 /* initialize default service/lcore mappings and start running. Ignore
905 * -ENOTSUP, as it indicates no service coremask passed to EAL.
907 ret = rte_service_start_with_defaults();
908 if (ret < 0 && ret != -ENOTSUP) {
914 * Clean up unused files in runtime directory. We do this at the end of
915 * init and not at the beginning because we want to clean stuff up
916 * whether we are primary or secondary process, but we cannot remove
917 * primary process' files because secondary should be able to run even
918 * if primary process is dead.
920 * In no_shconf mode, no runtime directory is created in the first
921 * place, so no cleanup needed.
923 if (!internal_config.no_shconf && eal_clean_runtime_dir() < 0) {
924 rte_eal_init_alert("Cannot clear runtime directory\n");
930 /* Call each registered callback, if enabled */
937 rte_eal_cleanup(void)
939 rte_service_finalize();
940 rte_mp_channel_cleanup();
941 eal_cleanup_config(&internal_config);
946 enum rte_lcore_role_t
947 rte_eal_lcore_role(unsigned lcore_id)
949 return rte_config.lcore_role[lcore_id];
953 rte_eal_process_type(void)
955 return rte_config.process_type;
958 int rte_eal_has_pci(void)
960 return !internal_config.no_pci;
963 int rte_eal_create_uio_dev(void)
965 return internal_config.create_uio_dev;
969 rte_eal_vfio_intr_mode(void)
971 return RTE_INTR_MODE_NONE;
974 int rte_vfio_setup_device(__rte_unused const char *sysfs_base,
975 __rte_unused const char *dev_addr,
976 __rte_unused int *vfio_dev_fd,
977 __rte_unused struct vfio_device_info *device_info)
982 int rte_vfio_release_device(__rte_unused const char *sysfs_base,
983 __rte_unused const char *dev_addr,
989 int rte_vfio_enable(__rte_unused const char *modname)
994 int rte_vfio_is_enabled(__rte_unused const char *modname)
999 int rte_vfio_noiommu_is_enabled(void)
1004 int rte_vfio_clear_group(__rte_unused int vfio_group_fd)
1010 rte_vfio_dma_map(uint64_t __rte_unused vaddr, __rte_unused uint64_t iova,
1011 __rte_unused uint64_t len)
1017 rte_vfio_dma_unmap(uint64_t __rte_unused vaddr, uint64_t __rte_unused iova,
1018 __rte_unused uint64_t len)
1024 rte_vfio_get_group_num(__rte_unused const char *sysfs_base,
1025 __rte_unused const char *dev_addr,
1026 __rte_unused int *iommu_group_num)
1032 rte_vfio_get_container_fd(void)
1038 rte_vfio_get_group_fd(__rte_unused int iommu_group_num)
1044 rte_vfio_container_create(void)
1050 rte_vfio_container_destroy(__rte_unused int container_fd)
1056 rte_vfio_container_group_bind(__rte_unused int container_fd,
1057 __rte_unused int iommu_group_num)
1063 rte_vfio_container_group_unbind(__rte_unused int container_fd,
1064 __rte_unused int iommu_group_num)
1070 rte_vfio_container_dma_map(__rte_unused int container_fd,
1071 __rte_unused uint64_t vaddr,
1072 __rte_unused uint64_t iova,
1073 __rte_unused uint64_t len)
1079 rte_vfio_container_dma_unmap(__rte_unused int container_fd,
1080 __rte_unused uint64_t vaddr,
1081 __rte_unused uint64_t iova,
1082 __rte_unused uint64_t len)