bool eal::initialized = false;
-void eal::init(cpuset cpus, boost::program_options::variables_map opts)
+void eal::init(cpuset cpus, const std::string& argv0, const std::optional<std::string>& hugepages_path, bool dpdk_pmd)
{
if (initialized) {
return;
std::string mask_str = mask.str();
std::reverse(mask_str.begin(), mask_str.end());
- // TODO: Inherit these from the app parameters - "opts"
std::vector<std::vector<char>> args {
- string2vector(opts["argv0"].as<std::string>()),
+ string2vector(argv0),
string2vector("-c"), string2vector(mask_str),
string2vector("-n"), string2vector("1")
};
- std::optional<std::string> hugepages_path;
- if (opts.count("hugepages")) {
- hugepages_path = opts["hugepages"].as<std::string>();
- }
-
// If "hugepages" is not provided and DPDK PMD drivers mode is requested -
// use the default DPDK huge tables configuration.
if (hugepages_path) {
args.push_back(string2vector("-m"));
args.push_back(string2vector(size_MB_str.str()));
- } else if (!opts.count("dpdk-pmd")) {
+ } else if (!dpdk_pmd) {
args.push_back(string2vector("--no-huge"));
}
#ifdef HAVE_OSV