Skip to content

Commit

Permalink
Do not set PG to Buffer porfile mapping again if already exist. (#1261)
Browse files Browse the repository at this point in the history
This will avoid not to call SAI API
set_ingress_priority_group_attribute() if mapping already exist

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
  • Loading branch information
abdosi committed Apr 16, 2020
1 parent aa116f4 commit 93d584d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cfgmgr/buffermgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,21 @@ task_process_status BufferMgr::doSpeedUpdateTask(string port, string speed)
buffer_profile_key +
"]";

/* Check if PG Mapping is already then log message and return. */

m_cfgBufferPgTable.get(buffer_pg_key, fvVector);

for (auto& prop : fvVector)
{
if ((fvField(prop) == "profile") && (profile_ref == fvValue(prop)))
{
SWSS_LOG_NOTICE("PG to Buffer Profile Mapping %s already present", buffer_pg_key.c_str());
return task_process_status::task_success;
}
}

fvVector.clear();

fvVector.push_back(make_pair("profile", profile_ref));
m_cfgBufferPgTable.set(buffer_pg_key, fvVector);
return task_process_status::task_success;
Expand Down

0 comments on commit 93d584d

Please sign in to comment.