1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2014 6WIND S.A. 3 */ 4 5 #ifndef EAL_OPTIONS_H 6 #define EAL_OPTIONS_H 7 8 #include "getopt.h" 9 10 struct rte_tel_data; 11 12 enum { 13 /* long options mapped to a short option */ 14 #define OPT_HELP "help" 15 OPT_HELP_NUM = 'h', 16 #define OPT_DEV_ALLOW "allow" 17 OPT_DEV_ALLOW_NUM = 'a', 18 #define OPT_DEV_BLOCK "block" 19 OPT_DEV_BLOCK_NUM = 'b', 20 21 /* first long only option value must be >= 256, so that we won't 22 * conflict with short options */ 23 OPT_LONG_MIN_NUM = 256, 24 #define OPT_BASE_VIRTADDR "base-virtaddr" 25 OPT_BASE_VIRTADDR_NUM, 26 #define OPT_CREATE_UIO_DEV "create-uio-dev" 27 OPT_CREATE_UIO_DEV_NUM, 28 #define OPT_FILE_PREFIX "file-prefix" 29 OPT_FILE_PREFIX_NUM, 30 #define OPT_HUGE_DIR "huge-dir" 31 OPT_HUGE_DIR_NUM, 32 #define OPT_HUGE_UNLINK "huge-unlink" 33 OPT_HUGE_UNLINK_NUM, 34 #define OPT_LCORES "lcores" 35 OPT_LCORES_NUM, 36 #define OPT_LOG_COLOR "log-color" 37 OPT_LOG_COLOR_NUM, 38 #define OPT_LOG_LEVEL "log-level" 39 OPT_LOG_LEVEL_NUM, 40 #define OPT_LOG_TIMESTAMP "log-timestamp" 41 OPT_LOG_TIMESTAMP_NUM, 42 #define OPT_TRACE "trace" 43 OPT_TRACE_NUM, 44 #define OPT_TRACE_DIR "trace-dir" 45 OPT_TRACE_DIR_NUM, 46 #define OPT_TRACE_BUF_SIZE "trace-bufsz" 47 OPT_TRACE_BUF_SIZE_NUM, 48 #define OPT_TRACE_MODE "trace-mode" 49 OPT_TRACE_MODE_NUM, 50 #define OPT_MAIN_LCORE "main-lcore" 51 OPT_MAIN_LCORE_NUM, 52 #define OPT_MBUF_POOL_OPS_NAME "mbuf-pool-ops-name" 53 OPT_MBUF_POOL_OPS_NAME_NUM, 54 #define OPT_PROC_TYPE "proc-type" 55 OPT_PROC_TYPE_NUM, 56 #define OPT_NO_HPET "no-hpet" 57 OPT_NO_HPET_NUM, 58 #define OPT_NO_HUGE "no-huge" 59 OPT_NO_HUGE_NUM, 60 #define OPT_NO_PCI "no-pci" 61 OPT_NO_PCI_NUM, 62 #define OPT_NO_SHCONF "no-shconf" 63 OPT_NO_SHCONF_NUM, 64 #define OPT_IN_MEMORY "in-memory" 65 OPT_IN_MEMORY_NUM, 66 #define OPT_SOCKET_MEM "socket-mem" 67 OPT_SOCKET_MEM_NUM, 68 #define OPT_SOCKET_LIMIT "socket-limit" 69 OPT_SOCKET_LIMIT_NUM, 70 #define OPT_SYSLOG "syslog" 71 OPT_SYSLOG_NUM, 72 #define OPT_VDEV "vdev" 73 OPT_VDEV_NUM, 74 #define OPT_VFIO_INTR "vfio-intr" 75 OPT_VFIO_INTR_NUM, 76 #define OPT_VFIO_VF_TOKEN "vfio-vf-token" 77 OPT_VFIO_VF_TOKEN_NUM, 78 #define OPT_VMWARE_TSC_MAP "vmware-tsc-map" 79 OPT_VMWARE_TSC_MAP_NUM, 80 #define OPT_LEGACY_MEM "legacy-mem" 81 OPT_LEGACY_MEM_NUM, 82 #define OPT_SINGLE_FILE_SEGMENTS "single-file-segments" 83 OPT_SINGLE_FILE_SEGMENTS_NUM, 84 #define OPT_IOVA_MODE "iova-mode" 85 OPT_IOVA_MODE_NUM, 86 #define OPT_MATCH_ALLOCATIONS "match-allocations" 87 OPT_MATCH_ALLOCATIONS_NUM, 88 #define OPT_TELEMETRY "telemetry" 89 OPT_TELEMETRY_NUM, 90 #define OPT_NO_TELEMETRY "no-telemetry" 91 OPT_NO_TELEMETRY_NUM, 92 #define OPT_FORCE_MAX_SIMD_BITWIDTH "force-max-simd-bitwidth" 93 OPT_FORCE_MAX_SIMD_BITWIDTH_NUM, 94 #define OPT_HUGE_WORKER_STACK "huge-worker-stack" 95 OPT_HUGE_WORKER_STACK_NUM, 96 97 OPT_LONG_MAX_NUM 98 }; 99 100 extern const char eal_short_options[]; 101 extern const struct option eal_long_options[]; 102 103 bool eal_option_is_log(int opt); 104 int eal_parse_log_options(int argc, char * const argv[]); 105 int eal_parse_common_option(int opt, const char *argv, 106 struct internal_config *conf); 107 int eal_option_device_parse(void); 108 int eal_adjust_config(struct internal_config *internal_cfg); 109 int eal_cleanup_config(struct internal_config *internal_cfg); 110 int eal_check_common_options(struct internal_config *internal_cfg); 111 void eal_common_usage(void); 112 enum rte_proc_type_t eal_proc_type_detect(void); 113 int eal_plugins_init(void); 114 int eal_save_args(int argc, char **argv); 115 int handle_eal_info_request(const char *cmd, const char *params __rte_unused, 116 struct rte_tel_data *d); 117 118 #endif /* EAL_OPTIONS_H */ 119