Skip to content

Commit

Permalink
[dpb]: make sure port is in admin down state before remove port. (son…
Browse files Browse the repository at this point in the history
…ic-net#1513)

Bring down the port before remove. 

During DPB SET request to bring down the port may get replaced DEL. Make sure to bring down the port before remove.
  • Loading branch information
vishnushetty authored Dec 18, 2020
1 parent 4365bb8 commit 97b32c6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1819,6 +1819,18 @@ sai_status_t PortsOrch::removePort(sai_object_id_t port_id)
{
SWSS_LOG_ENTER();

Port port;

/*
* Make sure to bring down admin state.
* SET would have replaced with DEL
*/
if (getPort(port_id, port))
{
setPortAdminStatus(port, false);
}
/* else : port is in default state or not yet created */

sai_status_t status = sai_port_api->remove_port(port_id);
if (status != SAI_STATUS_SUCCESS)
{
Expand Down

0 comments on commit 97b32c6

Please sign in to comment.