diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp index 7e21f8c50c..7b164c6190 100644 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -7291,7 +7291,9 @@ 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); @@ -7302,6 +7304,7 @@ bool PortsOrch::removeTunnel(Port tunnel) { SWSS_LOG_ENTER(); + saiOidToAlias.erase(tunnel.m_tunnel_id); m_portList.erase(tunnel.m_alias); return true; @@ -8251,9 +8254,10 @@ void PortsOrch::updatePortOperStatus(Port &port, sai_port_oper_status_t status) return; } + updateDbPortOperStatus(port, status); + if (port.m_type == Port::PHY) { - updateDbPortOperStatus(port, status); updateDbPortFlapCount(port, status); updateGearboxPortOperStatus(port); diff --git a/orchagent/vxlanorch.cpp b/orchagent/vxlanorch.cpp index 05a2d3e603..0fdffcac6d 100644 --- a/orchagent/vxlanorch.cpp +++ b/orchagent/vxlanorch.cpp @@ -275,7 +275,7 @@ create_tunnel( sai_ip_address_t *dst_ip, sai_object_id_t underlay_rif, bool p2p, - sai_uint8_t encap_ttl=0) + sai_uint8_t encap_ttl=DEFAULT_TUNNEL_ENCAP_TTL) { sai_attribute_t attr; std::vector tunnel_attrs; @@ -349,16 +349,13 @@ create_tunnel( tunnel_attrs.push_back(attr); } - if (encap_ttl != 0) - { - attr.id = SAI_TUNNEL_ATTR_ENCAP_TTL_MODE; - attr.value.s32 = SAI_TUNNEL_TTL_MODE_PIPE_MODEL; - tunnel_attrs.push_back(attr); + attr.id = SAI_TUNNEL_ATTR_ENCAP_TTL_MODE; + attr.value.s32 = SAI_TUNNEL_TTL_MODE_PIPE_MODEL; + tunnel_attrs.push_back(attr); - attr.id = SAI_TUNNEL_ATTR_ENCAP_TTL_VAL; - attr.value.u8 = encap_ttl; - tunnel_attrs.push_back(attr); - } + attr.id = SAI_TUNNEL_ATTR_ENCAP_TTL_VAL; + attr.value.u8 = encap_ttl; + tunnel_attrs.push_back(attr); sai_object_id_t tunnel_id; sai_status_t status = sai_tunnel_api->create_tunnel( diff --git a/orchagent/vxlanorch.h b/orchagent/vxlanorch.h index 695f7441e0..eb68d0ce70 100644 --- a/orchagent/vxlanorch.h +++ b/orchagent/vxlanorch.h @@ -46,6 +46,7 @@ typedef enum #define MAX_VLAN_ID 4095 #define MAX_VNI_ID 16777215 +#define DEFAULT_TUNNEL_ENCAP_TTL 64 typedef enum {