1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
7 * Holds the structures for the eal internal configuration
10 #ifndef EAL_INTERNAL_CFG_H
11 #define EAL_INTERNAL_CFG_H
14 #include <rte_pci_dev_feature_defs.h>
16 #include "eal_thread.h"
18 #define MAX_HUGEPAGE_SIZES 3 /**< support up to 3 page sizes */
21 * internal configuration structure for the number, size and
22 * mount points of hugepages
24 struct hugepage_info
{
25 uint64_t hugepage_sz
; /**< size of a huge page */
26 char hugedir
[PATH_MAX
]; /**< dir where hugetlbfs is mounted */
27 uint32_t num_pages
[RTE_MAX_NUMA_NODES
];
28 /**< number of hugepages of that size on each socket */
29 int lock_descriptor
; /**< file descriptor for hugepage dir */
33 * internal configuration
35 struct internal_config
{
36 volatile size_t memory
; /**< amount of asked memory */
37 volatile unsigned force_nchannel
; /**< force number of channels */
38 volatile unsigned force_nrank
; /**< force number of ranks */
39 volatile unsigned no_hugetlbfs
; /**< true to disable hugetlbfs */
40 unsigned hugepage_unlink
; /**< true to unlink backing files */
41 volatile unsigned no_pci
; /**< true to disable PCI */
42 volatile unsigned no_hpet
; /**< true to disable HPET */
43 volatile unsigned vmware_tsc_map
; /**< true to use VMware TSC mapping
44 * instead of native TSC */
45 volatile unsigned no_shconf
; /**< true if there is no shared config */
46 volatile unsigned in_memory
;
47 /**< true if DPDK should operate entirely in-memory and not create any
48 * shared files or runtime data.
50 volatile unsigned create_uio_dev
; /**< true to create /dev/uioX devices */
51 volatile enum rte_proc_type_t process_type
; /**< multi-process proc type */
52 /** true to try allocating memory on specific sockets */
53 volatile unsigned force_sockets
;
54 volatile uint64_t socket_mem
[RTE_MAX_NUMA_NODES
]; /**< amount of memory per socket */
55 volatile unsigned force_socket_limits
;
56 volatile uint64_t socket_limit
[RTE_MAX_NUMA_NODES
]; /**< limit amount of memory per socket */
57 uintptr_t base_virtaddr
; /**< base address to try and reserve memory from */
58 volatile unsigned legacy_mem
;
59 /**< true to enable legacy memory behavior (no dynamic allocation,
60 * IOVA-contiguous segments).
62 volatile unsigned match_allocations
;
63 /**< true to free hugepages exactly as allocated */
64 volatile unsigned single_file_segments
;
65 /**< true if storing all pages within single files (per-page-size,
66 * per-node) non-legacy mode only.
68 volatile int syslog_facility
; /**< facility passed to openlog() */
69 /** default interrupt mode for VFIO */
70 volatile enum rte_intr_mode vfio_intr_mode
;
71 char *hugefile_prefix
; /**< the base filename of hugetlbfs files */
72 char *hugepage_dir
; /**< specific hugetlbfs directory to use */
73 char *user_mbuf_pool_ops_name
;
74 /**< user defined mbuf pool ops name */
75 unsigned num_hugepage_sizes
; /**< how many sizes on this system */
76 struct hugepage_info hugepage_info
[MAX_HUGEPAGE_SIZES
];
77 enum rte_iova_mode iova_mode
; /**< Set IOVA mode on this system */
78 rte_cpuset_t ctrl_cpuset
; /**< cpuset for ctrl threads */
79 volatile unsigned int init_complete
;
80 /**< indicates whether EAL has completed initialization */
82 extern struct internal_config internal_config
; /**< Global EAL configuration. */
84 void eal_reset_internal_config(struct internal_config
*internal_cfg
);
86 #endif /* EAL_INTERNAL_CFG_H */