Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress Cable length errors in case pg profile lookup file is not provided #509

Merged
merged 2 commits into from
May 25, 2018
Merged
Show file tree
Hide file tree
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
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