Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
11 changes: 10 additions & 1 deletion orchagent/neighorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ bool NeighOrch::addNextHop(const IpAddress &ipAddress, const string &alias)
ipAddress.to_string().c_str(), alias.c_str());
return false;
}
if (p.m_type == Port::SUBPORT)
{
if (!gPortsOrch->getPort(p.m_parent_port_id, p))
{
SWSS_LOG_ERROR("Neighbor %s seen on sub interface %s whose parent port doesn't exist",
ipAddress.to_string().c_str(), alias.c_str());
return false;
}
}

NextHopKey nexthop = { ipAddress, alias };
assert(!hasNextHop(nexthop));
Expand Down Expand Up @@ -90,7 +99,7 @@ bool NeighOrch::addNextHop(const IpAddress &ipAddress, const string &alias)
gFgNhgOrch->validNextHopInNextHopGroup(nexthop);

// For nexthop with incoming port which has down oper status, NHFLAGS_IFDOWN
// flag Should be set on it.
// flag should be set on it.
// This scenario may happen under race condition where buffered neighbor event
// is processed after incoming port is down.
if (p.m_oper_status == SAI_PORT_OPER_STATUS_DOWN)
Expand Down
26 changes: 22 additions & 4 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ bool PortsOrch::addSubPort(Port &port, const string &alias, const bool &adminUp,
}
if (vlan_id > MAX_VALID_VLAN_ID)
{
SWSS_LOG_ERROR("sub interface %s Port object creation failed: invalid VLAN id %u", alias.c_str(), vlan_id);
SWSS_LOG_ERROR("Sub interface %s Port object creation failed: invalid VLAN id %u", alias.c_str(), vlan_id);
return false;
}

Expand Down Expand Up @@ -2838,8 +2838,6 @@ void PortsOrch::doLagTask(Consumer &consumer)
continue;
}

gNeighOrch->ifChangeInformNextHop(alias,
(operation_status == "up"));
Port lag;
if (getPort(alias, lag))
{
Expand Down Expand Up @@ -2868,11 +2866,23 @@ void PortsOrch::doLagTask(Consumer &consumer)
}
else
{

if (!operation_status.empty())
{
l.m_oper_status = string_oper_status.at(operation_status);
m_portList[alias] = l;

bool isUp = operation_status == "up" ? true : false;
if (!gNeighOrch->ifChangeInformNextHop(alias, isUp))
{
SWSS_LOG_WARN("Inform nexthop operation failed for interface %s", alias.c_str());
}
for (const auto &child_port : l.m_child_ports)
{
if (!gNeighOrch->ifChangeInformNextHop(child_port, isUp))
{
SWSS_LOG_WARN("Inform nexthop operation failed for sub interface %s", child_port.c_str());
}
}
}
if (operation_status_changed)
{
Expand All @@ -2881,6 +2891,7 @@ void PortsOrch::doLagTask(Consumer &consumer)
update.operStatus = string_oper_status.at(operation_status);
notify(SUBJECT_TYPE_PORT_OPER_STATE_CHANGE, static_cast<void *>(&update));
}

if (mtu != 0)
{
l.m_mtu = mtu;
Expand Down Expand Up @@ -4140,6 +4151,13 @@ void PortsOrch::updatePortOperStatus(Port &port, sai_port_oper_status_t status)
{
SWSS_LOG_WARN("Inform nexthop operation failed for interface %s", port.m_alias.c_str());
}
for (const auto &child_port : port.m_child_ports)
{
if (!gNeighOrch->ifChangeInformNextHop(child_port, isUp))
{
SWSS_LOG_WARN("Inform nexthop operation failed for sub interface %s", child_port.c_str());
}
}

PortOperStateUpdate update = {port, status};
notify(SUBJECT_TYPE_PORT_OPER_STATE_CHANGE, static_cast<void *>(&update));
Expand Down
Loading