Skip to content

Commit

Permalink
Set tunnel id to saiOidToAlias for support update tunnel status.
Browse files Browse the repository at this point in the history
  • Loading branch information
iris00522 committed Dec 14, 2021
1 parent 5d5c169 commit 5b6d07b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5347,7 +5347,10 @@ bool PortsOrch::addTunnel(string tunnel_alias, sai_object_id_t tunnel_id, bool h
{
tunnel.m_learn_mode = "disable";
}

tunnel.m_oper_status = SAI_PORT_OPER_STATUS_DOWN;
m_portList[tunnel_alias] = tunnel;
saiOidToAlias[tunnel_id] = tunnel_alias;

SWSS_LOG_INFO("addTunnel:: %" PRIx64, tunnel_id);

Expand All @@ -5358,6 +5361,7 @@ bool PortsOrch::removeTunnel(Port tunnel)
{
SWSS_LOG_ENTER();

saiOidToAlias.erase(tunnel.m_tunnel_id);
m_portList.erase(tunnel.m_alias);

return true;
Expand Down Expand Up @@ -5603,7 +5607,7 @@ void PortsOrch::doTask(NotificationConsumer &consumer)
}

updatePortOperStatus(port, status);
if (status == SAI_PORT_OPER_STATUS_UP)
if (port.m_type == Port::PHY && status == SAI_PORT_OPER_STATUS_UP)
{
sai_uint32_t speed;
if (getPortOperSpeed(port, speed))
Expand Down Expand Up @@ -5631,7 +5635,7 @@ void PortsOrch::updatePortOperStatus(Port &port, sai_port_oper_status_t status)
return;
}

if (port.m_type == Port::PHY)
if (port.m_type == Port::PHY || port.m_type == Port::TUNNEL)
{
updateDbPortOperStatus(port, status);
}
Expand Down

0 comments on commit 5b6d07b

Please sign in to comment.