Skip to content

Commit 93d584d

Browse files
authored
Do not set PG to Buffer porfile mapping again if already exist. (#1261)
This will avoid not to call SAI API set_ingress_priority_group_attribute() if mapping already exist Signed-off-by: Abhishek Dosi <[email protected]>
1 parent aa116f4 commit 93d584d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cfgmgr/buffermgr.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,21 @@ task_process_status BufferMgr::doSpeedUpdateTask(string port, string speed)
182182
buffer_profile_key +
183183
"]";
184184

185+
/* Check if PG Mapping is already then log message and return. */
186+
187+
m_cfgBufferPgTable.get(buffer_pg_key, fvVector);
188+
189+
for (auto& prop : fvVector)
190+
{
191+
if ((fvField(prop) == "profile") && (profile_ref == fvValue(prop)))
192+
{
193+
SWSS_LOG_NOTICE("PG to Buffer Profile Mapping %s already present", buffer_pg_key.c_str());
194+
return task_process_status::task_success;
195+
}
196+
}
197+
198+
fvVector.clear();
199+
185200
fvVector.push_back(make_pair("profile", profile_ref));
186201
m_cfgBufferPgTable.set(buffer_pg_key, fvVector);
187202
return task_process_status::task_success;

0 commit comments

Comments
 (0)