@@ -635,7 +635,7 @@ bool PortsOrch::addSubPort(Port &port, const string &alias, const bool &adminUp,
635
635
}
636
636
if (vlan_id > MAX_VALID_VLAN_ID)
637
637
{
638
- SWSS_LOG_ERROR (" sub interface %s Port object creation failed: invalid VLAN id %u" , alias.c_str (), vlan_id);
638
+ SWSS_LOG_ERROR (" Sub interface %s Port object creation failed: invalid VLAN id %u" , alias.c_str (), vlan_id);
639
639
return false ;
640
640
}
641
641
@@ -2815,7 +2815,6 @@ void PortsOrch::doLagTask(Consumer &consumer)
2815
2815
// Retrieve attributes
2816
2816
uint32_t mtu = 0 ;
2817
2817
string learn_mode;
2818
- bool operation_status_changed = false ;
2819
2818
string operation_status;
2820
2819
2821
2820
for (auto i : kfvFieldsValues (t))
@@ -2837,16 +2836,6 @@ void PortsOrch::doLagTask(Consumer &consumer)
2837
2836
it++;
2838
2837
continue ;
2839
2838
}
2840
-
2841
- gNeighOrch ->ifChangeInformNextHop (alias,
2842
- (operation_status == " up" ));
2843
- Port lag;
2844
- if (getPort (alias, lag))
2845
- {
2846
- operation_status_changed =
2847
- (string_oper_status.at (operation_status) !=
2848
- lag.m_oper_status );
2849
- }
2850
2839
}
2851
2840
}
2852
2841
@@ -2868,19 +2857,13 @@ void PortsOrch::doLagTask(Consumer &consumer)
2868
2857
}
2869
2858
else
2870
2859
{
2871
-
2872
2860
if (!operation_status.empty ())
2873
2861
{
2874
- l.m_oper_status = string_oper_status.at (operation_status);
2862
+ updatePortOperStatus (l, string_oper_status.at (operation_status));
2863
+
2875
2864
m_portList[alias] = l;
2876
2865
}
2877
- if (operation_status_changed)
2878
- {
2879
- PortOperStateUpdate update;
2880
- update.port = l;
2881
- update.operStatus = string_oper_status.at (operation_status);
2882
- notify (SUBJECT_TYPE_PORT_OPER_STATE_CHANGE, static_cast <void *>(&update));
2883
- }
2866
+
2884
2867
if (mtu != 0 )
2885
2868
{
2886
2869
l.m_mtu = mtu;
@@ -4124,22 +4107,35 @@ void PortsOrch::updatePortOperStatus(Port &port, sai_port_oper_status_t status)
4124
4107
oper_status_strings.at (status).c_str ());
4125
4108
if (status == port.m_oper_status )
4126
4109
{
4127
- return ;
4110
+ return ;
4128
4111
}
4129
4112
4130
- updateDbPortOperStatus (port, status);
4113
+ if (port.m_type == Port::PHY)
4114
+ {
4115
+ updateDbPortOperStatus (port, status);
4116
+ }
4131
4117
port.m_oper_status = status;
4132
4118
4133
4119
bool isUp = status == SAI_PORT_OPER_STATUS_UP;
4134
- if (! setHostIntfsOperStatus ( port, isUp) )
4120
+ if (port. m_type == Port::PHY )
4135
4121
{
4136
- SWSS_LOG_ERROR (" Failed to set host interface %s operational status %s" , port.m_alias .c_str (),
4137
- isUp ? " up" : " down" );
4122
+ if (!setHostIntfsOperStatus (port, isUp))
4123
+ {
4124
+ SWSS_LOG_ERROR (" Failed to set host interface %s operational status %s" , port.m_alias .c_str (),
4125
+ isUp ? " up" : " down" );
4126
+ }
4138
4127
}
4139
4128
if (!gNeighOrch ->ifChangeInformNextHop (port.m_alias , isUp))
4140
4129
{
4141
4130
SWSS_LOG_WARN (" Inform nexthop operation failed for interface %s" , port.m_alias .c_str ());
4142
4131
}
4132
+ for (const auto &child_port : port.m_child_ports )
4133
+ {
4134
+ if (!gNeighOrch ->ifChangeInformNextHop (child_port, isUp))
4135
+ {
4136
+ SWSS_LOG_WARN (" Inform nexthop operation failed for sub interface %s" , child_port.c_str ());
4137
+ }
4138
+ }
4143
4139
4144
4140
PortOperStateUpdate update = {port, status};
4145
4141
notify (SUBJECT_TYPE_PORT_OPER_STATE_CHANGE, static_cast <void *>(&update));
0 commit comments