Skip to content

Commit

Permalink
Suppress Cable length errors in case pg profile lookup file is not pr…
Browse files Browse the repository at this point in the history
…ovided (#509)

* Suppress Cable length error in case buffer config file is not provided

* fix PR feedback
  • Loading branch information
zhenggen-xu authored and yxieca committed May 25, 2018
1 parent 7331f92 commit 44a8845
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cfgmgr/buffermgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ void BufferMgr::readPgProfileLookupFile(string file)
{
SWSS_LOG_NOTICE("Read lookup configuration file...");

m_pgfile_processed = false;

ifstream infile(file);
if (!infile.is_open())
{
SWSS_LOG_WARN("PG profile lookup file: %s is not readable", file.c_str());
return;
}

Expand Down Expand Up @@ -69,6 +72,7 @@ void BufferMgr::readPgProfileLookupFile(string file)
);
}

m_pgfile_processed = true;
infile.close();
}

Expand Down Expand Up @@ -211,7 +215,7 @@ void BufferMgr::doTask(Consumer &consumer)
task_status = doCableTask(fvField(i), fvValue(i));
}
// In case of PORT table update, Buffer Manager is interested in speed update only
if (table_name == CFG_PORT_TABLE_NAME && fvField(i) == "speed")
if (m_pgfile_processed && table_name == CFG_PORT_TABLE_NAME && fvField(i) == "speed")
{
// create/update profile for port
task_status = doSpeedUpdateTask(port, fvValue(i));
Expand Down
1 change: 1 addition & 0 deletions cfgmgr/buffermgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class BufferMgr : public Orch
Table m_cfgBufferProfileTable;
Table m_cfgBufferPgTable;
Table m_cfgLosslessPgPoolTable;
bool m_pgfile_processed;

pg_profile_lookup_t m_pgProfileLookup;
port_cable_length_t m_cableLenLookup;
Expand Down

0 comments on commit 44a8845

Please sign in to comment.