diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp index b84760fa3b..a779e76517 100644 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -7297,7 +7297,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); @@ -7308,6 +7310,7 @@ bool PortsOrch::removeTunnel(Port tunnel) { SWSS_LOG_ENTER(); + saiOidToAlias.erase(tunnel.m_tunnel_id); m_portList.erase(tunnel.m_alias); return true; @@ -8257,9 +8260,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.h b/orchagent/vxlanorch.h index 695f7441e0..f53dca05f3 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 255 typedef enum { @@ -196,7 +197,7 @@ class VxlanTunnel bool deleteMapperHw(uint8_t mapper_list, tunnel_map_use_t map_src); bool createMapperHw(uint8_t mapper_list, tunnel_map_use_t map_src); - bool createTunnelHw(uint8_t mapper_list, tunnel_map_use_t map_src, bool with_term = true, sai_uint8_t encap_ttl=0); + bool createTunnelHw(uint8_t mapper_list, tunnel_map_use_t map_src, bool with_term = true, sai_uint8_t encap_ttl=DEFAULT_TUNNEL_ENCAP_TTL); bool deleteTunnelHw(uint8_t mapper_list, tunnel_map_use_t map_src, bool with_term = true); void deletePendingSIPTunnel(); void increment_spurious_imr_add(const std::string remote_vtep); @@ -299,7 +300,7 @@ class VxlanTunnelOrch : public Orch2 bool createVxlanTunnelMap(string tunnelName, tunnel_map_type_t mapType, uint32_t vni, - sai_object_id_t encap, sai_object_id_t decap, uint8_t encap_ttl=0); + sai_object_id_t encap, sai_object_id_t decap, uint8_t encap_ttl=DEFAULT_TUNNEL_ENCAP_TTL); bool removeVxlanTunnelMap(string tunnelName, uint32_t vni); diff --git a/tests/test_vxlan_tunnel.py b/tests/test_vxlan_tunnel.py index d296fcc741..82de242fb8 100644 --- a/tests/test_vxlan_tunnel.py +++ b/tests/test_vxlan_tunnel.py @@ -152,7 +152,9 @@ def check_vxlan_tunnel(dvs, src_ip, dst_ip, tunnel_map_ids, tunnel_map_entry_ids 'SAI_TUNNEL_ATTR_DECAP_MAPPERS': decapstr, 'SAI_TUNNEL_ATTR_ENCAP_MAPPERS': encapstr, 'SAI_TUNNEL_ATTR_PEER_MODE': 'SAI_TUNNEL_PEER_MODE_P2MP', - 'SAI_TUNNEL_ATTR_ENCAP_SRC_IP': src_ip + 'SAI_TUNNEL_ATTR_ENCAP_SRC_IP': src_ip, + 'SAI_TUNNEL_ATTR_ENCAP_TTL_MODE': 'SAI_TUNNEL_TTL_MODE_PIPE_MODEL', + 'SAI_TUNNEL_ATTR_ENCAP_TTL_VAL': '255' } )