Skip to content

Commit

Permalink
Remove obsolete bind parameter
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Georgy Kirichenko authored and taitov committed Oct 6, 2023
1 parent b926f3f commit a395ed3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
20 changes: 4 additions & 16 deletions dataplane/dataplane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1366,23 +1365,14 @@ 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))
{
YADECAP_LOG_ERROR("interfaceName '%s' already exist\n", interfaceName.data());
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"])
{
Expand Down Expand Up @@ -1586,8 +1576,7 @@ eResult cDataPlane::checkConfig()
std::set<std::string> pcis;
for (const auto& portIter : config.ports)
{
const auto& [pci, bind] = portIter.second;
(void)bind;
const auto& [pci] = portIter.second;

if (exist(pcis, pci))
{
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 8 additions & 2 deletions dataplane/dataplane.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string, ///< interfaceName
std::tuple<std::string, ///< pci
bool>> ///< bind driver
std::tuple<std::string>> ///< pci
ports;

std::set<tCoreId> workerGCs;
tCoreId controlPlaneCoreId;
std::map<tCoreId, std::vector<std::string>> workers;
Expand Down

0 comments on commit a395ed3

Please sign in to comment.