Skip to content

Commit

Permalink
kamel: fix VXLAN tunnel status (PR sonic-net#2080)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecmd committed Feb 23, 2024
1 parent e53ccb6 commit 58b48cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion orchagent/fdborch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ bool FdbOrch::bake()
return true;
}


bool FdbOrch::storeFdbEntryState(const FdbUpdate& update)
{
const FdbEntry& entry = update.entry;
Expand Down
6 changes: 5 additions & 1 deletion orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6222,7 +6222,10 @@ bool PortsOrch::addTunnel(string tunnel_alias, sai_object_id_t tunnel_id, bool h
{
tunnel.m_learn_mode = SAI_BRIDGE_PORT_FDB_LEARNING_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 @@ -6233,6 +6236,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 @@ -6972,7 +6976,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);
updateGearboxPortOperStatus(port);
Expand Down
5 changes: 3 additions & 2 deletions orchagent/vxlanorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ create_tunnel(
num_map++;
}
}

attr.id = SAI_TUNNEL_ATTR_DECAP_MAPPERS;
attr.value.objlist.count = num_map;
attr.value.objlist.list = map_list;
Expand Down Expand Up @@ -1476,7 +1476,7 @@ bool VxlanTunnelOrch::removeVxlanTunnelMap(string tunnelName, uint32_t vni)
return false;
}

// Update the map count and if this is the last mapping entry
// Update the map count and if this is the last mapping entry
// make SAI calls to delete the tunnel and tunnel termination objects.

tunnel_obj->vlan_vrf_vni_count--;
Expand Down Expand Up @@ -1654,6 +1654,7 @@ bool VxlanTunnelOrch::delTunnelUser(const std::string remote_vtep, uint32_t vni

port_tunnel_name = getTunnelPortName(remote_vtep);
gPortsOrch->getPort(port_tunnel_name,tunnelPort);

if ((vtep_ptr->getRemoteEndPointRefCnt(remote_vtep) == 1) &&
tunnelPort.m_fdb_count == 0)
{
Expand Down

0 comments on commit 58b48cb

Please sign in to comment.