Skip to content

Commit ed56339

Browse files
committed
Prevent profile creation for invalid cable length
Added a check in BufferMgrDynamic::allocateProfile to skip profile creation when the cable length is 0m. This change ensures that profiles are not created for invalid cable lengths, preventing potential configuration errors. Logged a notice message when skipping profile creation due to 0m cable length. Signed-off-by: Jianyue Wu <jianyuew@nvidia.com>
1 parent 4eb74f0 commit ed56339

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cfgmgr/buffermgrdyn.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,11 @@ void BufferMgrDynamic::updateBufferObjectListToDb(const string &key, const strin
944944
// We have to check the headroom ahead of applying them
945945
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)
946946
{
947+
if (cable_len == "0m")
948+
{
949+
SWSS_LOG_NOTICE("Skipping profile creation for cable length '0m'");
950+
return task_process_status::task_success;
951+
}
947952
// Create record in BUFFER_PROFILE table
948953

949954
SWSS_LOG_INFO("Allocating new BUFFER_PROFILE %s", profile_name.c_str());

0 commit comments

Comments
 (0)