f-stack/dpdk/lib/librte_eal/common/eal_internal_cfg.h

101 lines
3.8 KiB
C
Raw Normal View History

2019-06-25 11:12:58 +00:00
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2010-2014 Intel Corporation
2017-04-21 10:43:26 +00:00
*/
/**
* @file
* Holds the structures for the eal internal configuration
*/
#ifndef EAL_INTERNAL_CFG_H
#define EAL_INTERNAL_CFG_H
#include <rte_eal.h>
#include <rte_pci_dev_feature_defs.h>
2019-06-26 10:17:41 +00:00
#include "eal_thread.h"
2021-02-05 08:48:47 +00:00
#if defined(RTE_ARCH_ARM)
2019-11-23 08:13:38 +00:00
#define MAX_HUGEPAGE_SIZES 4 /**< support up to 4 page sizes */
#else
2017-04-21 10:43:26 +00:00
#define MAX_HUGEPAGE_SIZES 3 /**< support up to 3 page sizes */
2019-11-23 08:13:38 +00:00
#endif
2017-04-21 10:43:26 +00:00
/*
* internal configuration structure for the number, size and
* mount points of hugepages
*/
struct hugepage_info {
uint64_t hugepage_sz; /**< size of a huge page */
2019-06-25 11:12:58 +00:00
char hugedir[PATH_MAX]; /**< dir where hugetlbfs is mounted */
2017-04-21 10:43:26 +00:00
uint32_t num_pages[RTE_MAX_NUMA_NODES];
2019-06-25 11:12:58 +00:00
/**< number of hugepages of that size on each socket */
2017-04-21 10:43:26 +00:00
int lock_descriptor; /**< file descriptor for hugepage dir */
};
2021-02-05 08:48:47 +00:00
struct simd_bitwidth {
bool forced;
/**< flag indicating if bitwidth is forced and can't be modified */
uint16_t bitwidth; /**< bitwidth value */
};
2017-04-21 10:43:26 +00:00
/**
* internal configuration
*/
struct internal_config {
volatile size_t memory; /**< amount of asked memory */
volatile unsigned force_nchannel; /**< force number of channels */
volatile unsigned force_nrank; /**< force number of ranks */
volatile unsigned no_hugetlbfs; /**< true to disable hugetlbfs */
unsigned hugepage_unlink; /**< true to unlink backing files */
volatile unsigned no_pci; /**< true to disable PCI */
volatile unsigned no_hpet; /**< true to disable HPET */
volatile unsigned vmware_tsc_map; /**< true to use VMware TSC mapping
* instead of native TSC */
volatile unsigned no_shconf; /**< true if there is no shared config */
2019-06-25 11:12:58 +00:00
volatile unsigned in_memory;
/**< true if DPDK should operate entirely in-memory and not create any
* shared files or runtime data.
*/
2017-04-21 10:43:26 +00:00
volatile unsigned create_uio_dev; /**< true to create /dev/uioX devices */
volatile enum rte_proc_type_t process_type; /**< multi-process proc type */
/** true to try allocating memory on specific sockets */
volatile unsigned force_sockets;
volatile uint64_t socket_mem[RTE_MAX_NUMA_NODES]; /**< amount of memory per socket */
2019-06-25 11:12:58 +00:00
volatile unsigned force_socket_limits;
volatile uint64_t socket_limit[RTE_MAX_NUMA_NODES]; /**< limit amount of memory per socket */
2017-04-21 10:43:26 +00:00
uintptr_t base_virtaddr; /**< base address to try and reserve memory from */
2019-06-25 11:12:58 +00:00
volatile unsigned legacy_mem;
/**< true to enable legacy memory behavior (no dynamic allocation,
* IOVA-contiguous segments).
*/
2020-06-18 16:55:50 +00:00
volatile unsigned match_allocations;
/**< true to free hugepages exactly as allocated */
2019-06-25 11:12:58 +00:00
volatile unsigned single_file_segments;
/**< true if storing all pages within single files (per-page-size,
* per-node) non-legacy mode only.
*/
2017-04-21 10:43:26 +00:00
volatile int syslog_facility; /**< facility passed to openlog() */
/** default interrupt mode for VFIO */
volatile enum rte_intr_mode vfio_intr_mode;
2021-02-05 08:48:47 +00:00
/** the shared VF token for VFIO-PCI bound PF and VFs devices */
rte_uuid_t vfio_vf_token;
2019-06-26 10:17:41 +00:00
char *hugefile_prefix; /**< the base filename of hugetlbfs files */
char *hugepage_dir; /**< specific hugetlbfs directory to use */
char *user_mbuf_pool_ops_name;
2019-06-25 11:12:58 +00:00
/**< user defined mbuf pool ops name */
2017-04-21 10:43:26 +00:00
unsigned num_hugepage_sizes; /**< how many sizes on this system */
struct hugepage_info hugepage_info[MAX_HUGEPAGE_SIZES];
2019-06-25 11:12:58 +00:00
enum rte_iova_mode iova_mode ; /**< Set IOVA mode on this system */
2019-06-26 10:17:41 +00:00
rte_cpuset_t ctrl_cpuset; /**< cpuset for ctrl threads */
2019-06-25 11:12:58 +00:00
volatile unsigned int init_complete;
/**< indicates whether EAL has completed initialization */
2021-02-05 08:48:47 +00:00
unsigned int no_telemetry; /**< true to disable Telemetry */
struct simd_bitwidth max_simd_bitwidth;
/**< max simd bitwidth path to use */
2017-04-21 10:43:26 +00:00
};
void eal_reset_internal_config(struct internal_config *internal_cfg);
#endif /* EAL_INTERNAL_CFG_H */