]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/seastar/src/core/dpdk_rte.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / seastar / src / core / dpdk_rte.cc
index 220802fb765619267f044019a2d76e55ef6122f0..5dc10f588a31b2a7c458d2504d543911220181b1 100644 (file)
@@ -30,7 +30,7 @@ namespace dpdk {
 
 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;
@@ -46,18 +46,12 @@ void eal::init(cpuset cpus, boost::program_options::variables_map opts)
     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) {
@@ -75,7 +69,7 @@ void eal::init(cpuset cpus, boost::program_options::variables_map opts)
 
         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