From a395ed38fa4996a36dc1cd6d3ca66d7848aee82d Mon Sep 17 00:00:00 2001 From: Georgy Kirichenko Date: Thu, 5 Oct 2023 17:40:40 +0300 Subject: [PATCH] Remove obsolete `bind` parameter The parameter lived inside `dataplane` configuration and denoted that `igb_uio` driver should be loaded to handle the port. This parameter support was removed so we need to clean the code artifacts. Closes #32 --- dataplane/dataplane.cpp | 20 ++++---------------- dataplane/dataplane.h | 10 ++++++++-- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/dataplane/dataplane.cpp b/dataplane/dataplane.cpp index e261694b..b9c23abb 100644 --- a/dataplane/dataplane.cpp +++ b/dataplane/dataplane.cpp @@ -298,8 +298,7 @@ eResult cDataPlane::initPorts() for (const auto& configPortIter : config.ports) { const std::string& interfaceName = configPortIter.first; - const auto& [pci, bind] = configPortIter.second; - (void)bind; + const auto& [pci] = configPortIter.second; tPortId portId; if (strncmp(pci.data(), SOCK_DEV_PREFIX, strlen(SOCK_DEV_PREFIX)) == 0) @@ -1366,7 +1365,6 @@ eResult cDataPlane::parseJsonPorts(const nlohmann::json& json) { std::string interfaceName = portJson["interfaceName"]; std::string pci = portJson["pci"]; - bool bind = false; if (exist(config.ports, interfaceName)) { @@ -1374,15 +1372,7 @@ eResult cDataPlane::parseJsonPorts(const nlohmann::json& json) return eResult::invalidConfigurationFile; } - if (exist(portJson, "bind")) - { - if (portJson["bind"] == "true") - { - bind = true; - } - } - - config.ports[interfaceName] = {pci, bind}; + config.ports[interfaceName] = {pci}; for (tCoreId coreId : portJson["coreIds"]) { @@ -1586,8 +1576,7 @@ eResult cDataPlane::checkConfig() std::set pcis; for (const auto& portIter : config.ports) { - const auto& [pci, bind] = portIter.second; - (void)bind; + const auto& [pci] = portIter.second; if (exist(pcis, pci)) { @@ -1679,8 +1668,7 @@ eResult cDataPlane::initEal(const std::string& binaryPath, for (const auto& port : config.ports) { - const auto& [pci, bind] = port.second; - (void)bind; + const auto& [pci] = port.second; // Do not whitelist sock dev virtual devices if (strncmp(pci.data(), SOCK_DEV_PREFIX, strlen(SOCK_DEV_PREFIX)) == 0) diff --git a/dataplane/dataplane.h b/dataplane/dataplane.h index 62a6c614..d2790e3e 100644 --- a/dataplane/dataplane.h +++ b/dataplane/dataplane.h @@ -60,10 +60,16 @@ enum class eConfigType struct tDataPlaneConfig { + /* + DPDK ports used by `dataplane`. + Each port has a name with which is exposed into host system + and an identifier (typically pci id) used to lookup the port within + DPDK. + */ std::map> ///< bind driver + std::tuple> ///< pci ports; + std::set workerGCs; tCoreId controlPlaneCoreId; std::map> workers;