1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Mellanox Technologies, Ltd
7 #include <rte_string_fns.h>
9 #include "eal_private.h"
10 #include "eal_memcfg.h"
12 /* early configuration structure, when memory config is not mmapped */
13 static struct rte_mem_config early_mem_config;
15 /* Address of global and public configuration */
16 static struct rte_config rte_config = {
17 .mem_config = &early_mem_config,
20 /* platform-specific runtime dir */
21 static char runtime_dir[PATH_MAX];
23 /* internal configuration */
24 static struct internal_config internal_config;
27 rte_eal_get_runtime_dir(void)
33 eal_set_runtime_dir(char *run_dir, size_t size)
37 str_size = strlcpy(runtime_dir, run_dir, size);
38 if (str_size >= size) {
39 RTE_LOG(ERR, EAL, "Runtime directory string too long\n");
46 /* Return a pointer to the configuration structure */
48 rte_eal_get_configuration(void)
53 /* Return a pointer to the internal configuration structure */
54 struct internal_config *
55 eal_get_internal_configuration(void)
57 return &internal_config;
61 rte_eal_iova_mode(void)
63 return rte_eal_get_configuration()->iova_mode;
67 rte_eal_process_type(void)
69 return rte_config.process_type;
72 /* Return user provided mbuf pool ops name */
74 rte_eal_mbuf_user_pool_ops(void)
76 return internal_config.user_mbuf_pool_ops_name;
79 /* return non-zero if hugepages are enabled. */
81 rte_eal_has_hugepages(void)
83 return !internal_config.no_hugetlbfs;
89 return !internal_config.no_pci;