Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions portsyncd/portsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void usage()
}

void handlePortConfigFile(ProducerStateTable &p, string file, bool warm);
bool handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb, bool warm);
void handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb, bool warm);
void handleVlanIntfFile(string file);
void handlePortConfig(ProducerStateTable &p, map<string, KeyOpFieldsValuesTuple> &port_cfg_map);
void checkPortInitDone(DBConnector *appl_db);
Expand Down Expand Up @@ -86,11 +86,7 @@ int main(int argc, char **argv)
netlink.dumpRequest(RTM_GETLINK);
cout << "Listen to link messages..." << endl;

if (!handlePortConfigFromConfigDB(p, cfgDb, warm))
{
SWSS_LOG_NOTICE("ConfigDB does not have port information, "
"however ports can be added later on, continuing...");
}
handlePortConfigFromConfigDB(p, cfgDb, warm);

LinkSync sync(&appl_db, &state_db);
NetDispatcher::getInstance().registerMessageHandler(RTM_NEWLINK, &sync);
Expand Down Expand Up @@ -191,7 +187,7 @@ static void notifyPortConfigDone(ProducerStateTable &p)
p.set("PortConfigDone", attrs);
}

bool handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb, bool warm)
void handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb, bool warm)
{
SWSS_LOG_ENTER();

Expand All @@ -204,8 +200,8 @@ bool handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb, boo

if (keys.empty())
{
cout << "No port configuration in ConfigDB" << endl;
return false;
SWSS_LOG_NOTICE("ConfigDB does not have port information, "
"however ports can be added later on, continuing...");
}

for ( auto &k : keys )
Expand All @@ -228,7 +224,6 @@ bool handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb, boo
notifyPortConfigDone(p);
}

return true;
}

void handlePortConfig(ProducerStateTable &p, map<string, KeyOpFieldsValuesTuple> &port_cfg_map)
Expand Down