Skip to content

Commit cd82389

Browse files
vasant17Vasant
andauthored
Return correct error code when port is in use (sonic-net#565)
Co-authored-by: Vasant <vapatil@linkedin.com>
1 parent 2189c2f commit cd82389

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

meta/Meta.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2958,7 +2958,7 @@ sai_status_t Meta::meta_generic_validation_remove(
29582958

29592959
SWSS_LOG_ERROR("object 0x%" PRIx64 " reference count is %d, can't remove", oid, count);
29602960

2961-
return SAI_STATUS_INVALID_PARAMETER;
2961+
return SAI_STATUS_OBJECT_IN_USE;
29622962
}
29632963

29642964
if (meta_key.objecttype == SAI_OBJECT_TYPE_PORT)
@@ -2987,14 +2987,6 @@ sai_status_t Meta::meta_port_remove_validation(
29872987
return SAI_STATUS_SUCCESS;
29882988
}
29892989

2990-
if (m_oids.getObjectReferenceCount(port_id) != 0)
2991-
{
2992-
SWSS_LOG_ERROR("port %s reference count is not zero, can't remove",
2993-
sai_serialize_object_id(port_id).c_str());
2994-
2995-
return SAI_STATUS_OBJECT_IN_USE;
2996-
}
2997-
29982990
if (!meta_is_object_in_default_state(port_id))
29992991
{
30002992
SWSS_LOG_ERROR("port %s is not in default state, can't remove",

0 commit comments

Comments
 (0)