@@ -944,13 +944,6 @@ void BufferMgrDynamic::updateBufferObjectListToDb(const string &key, const strin
944
944
// We have to check the headroom ahead of applying them
945
945
task_process_status BufferMgrDynamic::allocateProfile (const string &speed, const string &cable_len, const string &mtu, const string &threshold, const string &gearbox_model, long lane_count, string &profile_name)
946
946
{
947
- bool is_lossless = (profile_name.find (" lossless" ) != string::npos);
948
- if (cable_len == " 0m" && is_lossless)
949
- {
950
- SWSS_LOG_NOTICE (" Not creating lossless profile when cable length is set to %s" , cable_len.c_str ());
951
- return task_process_status::task_success;
952
- }
953
-
954
947
// Create record in BUFFER_PROFILE table
955
948
956
949
SWSS_LOG_INFO (" Allocating new BUFFER_PROFILE %s" , profile_name.c_str ());
@@ -1470,22 +1463,18 @@ task_process_status BufferMgrDynamic::refreshPgsForPort(const string &port, cons
1470
1463
}
1471
1464
1472
1465
// If cable len is 0m, remove lossless PG, keep lossy PG.
1473
- bool old_profile_is_lossless = (oldProfile.find (" lossless" ) != string::npos);
1474
- if (cable_length == " 0m" && portPg.lossless && old_profile_is_lossless)
1466
+ if (cable_length == " 0m" && portPg.lossless )
1475
1467
{
1476
1468
if (oldProfile.empty ())
1477
1469
{
1478
- SWSS_LOG_WARN (" No lossless profile found for port %s when cable length is set to '0m'." , port.c_str ());
1470
+ SWSS_LOG_NOTICE (" No lossless profile found for port %s when cable length is set to '0m'." , port.c_str ());
1479
1471
continue ;
1480
1472
}
1481
1473
updateBufferObjectToDb (key, oldProfile, false );
1482
1474
SWSS_LOG_NOTICE (" All profiles for port %s have been removed due to cable length being set to '0m'" , port.c_str ());
1483
1475
1484
- if (!oldProfile.empty ())
1485
- {
1486
- profilesToBeReleased.insert (oldProfile);
1487
- m_bufferProfileLookup[oldProfile].port_pgs .erase (key);
1488
- }
1476
+ profilesToBeReleased.insert (oldProfile);
1477
+ m_bufferProfileLookup[oldProfile].port_pgs .erase (key);
1489
1478
continue ;
1490
1479
}
1491
1480
0 commit comments