Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VxLAN fix tunnel oper_state issue #3216

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7203,7 +7203,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);

Expand All @@ -7214,6 +7216,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 @@ -8087,7 +8090,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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think only calling for updateDbPortOperStatus is relevant for tunnel case, everything else (like autoneg, link training, ...) is physical port specific.
Maybe moving updateDbPortOperStatus outside of this "if", should be more correct ?

updateDbPortFlapCount(port, status);
Expand Down
9 changes: 9 additions & 0 deletions orchagent/vxlanorch.cpp

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would better to use DEFAULT_TUNNEL_ENCAP_TTL as default value for the encap_ttl (instead of 0). It will reuse the existing code and you could also remove the "if (encap_ttl != 0)".

Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,15 @@ create_tunnel(
attr.id = SAI_TUNNEL_ATTR_ENCAP_TTL_VAL;
attr.value.u8 = encap_ttl;
tunnel_attrs.push_back(attr);
} else {
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 = DEFAULT_TUNNEL_ENCAP_TTL;
tunnel_attrs.push_back(attr);

}

sai_object_id_t tunnel_id;
Expand Down
1 change: 1 addition & 0 deletions orchagent/vxlanorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ typedef enum
#define MAX_VLAN_ID 4095

#define MAX_VNI_ID 16777215
#define DEFAULT_TUNNEL_ENCAP_TTL 64

typedef enum
{
Expand Down
Loading