@@ -214,7 +214,7 @@ bool PortsOrch::setPortAdminStatus(sai_object_id_t id, bool up)
214
214
up ? " UP" : " DOWN" , id);
215
215
return false ;
216
216
}
217
- SWSS_LOG_NOTICE (" Set admin status %s to port pid:%lx" ,
217
+ SWSS_LOG_INFO (" Set admin status %s to port pid:%lx" ,
218
218
up ? " UP" : " DOWN" , id);
219
219
return true ;
220
220
}
@@ -330,7 +330,9 @@ void PortsOrch::doPortTask(Consumer &consumer)
330
330
331
331
/* Determin if the port has already been initialized before */
332
332
if (m_portList.find (alias) != m_portList.end () && m_portList[alias].m_port_id == id)
333
- SWSS_LOG_NOTICE (" Port has already been initialized before alias:%s" , alias.c_str ());
333
+ {
334
+ SWSS_LOG_INFO (" Port has already been initialized before alias:%s" , alias.c_str ());
335
+ }
334
336
else
335
337
{
336
338
Port p (alias, Port::PHY);
@@ -368,10 +370,10 @@ void PortsOrch::doPortTask(Consumer &consumer)
368
370
if (getPort (alias, p))
369
371
{
370
372
if (setPortAdminStatus (p.m_port_id , admin_status == " up" ))
371
- SWSS_LOG_NOTICE (" Port is set to admin %s alias: %s" , admin_status .c_str (), alias .c_str ());
373
+ SWSS_LOG_NOTICE (" Set port %s admin status to %s" , alias .c_str (), admin_status .c_str ());
372
374
else
373
375
{
374
- SWSS_LOG_ERROR (" Failed to set port to admin %s alias: %s" , admin_status .c_str (), alias .c_str ());
376
+ SWSS_LOG_ERROR (" Failed to set port %s admin status to %s" , alias .c_str (), admin_status .c_str ());
375
377
it++;
376
378
continue ;
377
379
}
@@ -459,8 +461,21 @@ void PortsOrch::doVlanTask(Consumer &consumer)
459
461
{
460
462
assert (m_portList.find (vlan_alias) != m_portList.end ());
461
463
Port vlan, port;
462
- getPort (vlan_alias, vlan);
463
- getPort (port_alias, port);
464
+
465
+ /* When VLAN member is to be created before VLAN is created */
466
+ if (!getPort (vlan_alias, vlan))
467
+ {
468
+ SWSS_LOG_INFO (" Failed to locate VLAN %s" , vlan_alias.c_str ());
469
+ it++;
470
+ continue ;
471
+ }
472
+
473
+ if (!getPort (port_alias, port))
474
+ {
475
+ SWSS_LOG_ERROR (" Failed to locate port %s" , port_alias.c_str ());
476
+ it = consumer.m_toSync .erase (it);
477
+ continue ;
478
+ }
464
479
465
480
if (op == SET_COMMAND)
466
481
{
@@ -570,8 +585,21 @@ void PortsOrch::doLagTask(Consumer &consumer)
570
585
{
571
586
assert (m_portList.find (lag_alias) != m_portList.end ());
572
587
Port lag, port;
573
- getPort (lag_alias, lag);
574
- getPort (port_alias, port);
588
+
589
+ /* When LAG member is to be created before LAG is created */
590
+ if (!getPort (lag_alias, lag))
591
+ {
592
+ SWSS_LOG_INFO (" Failed to locate LAG %s" , lag_alias.c_str ());
593
+ it++;
594
+ continue ;
595
+ }
596
+
597
+ if (!getPort (port_alias, port))
598
+ {
599
+ SWSS_LOG_ERROR (" Failed to locate port %s" , port_alias.c_str ());
600
+ it = consumer.m_toSync .erase (it);
601
+ continue ;
602
+ }
575
603
576
604
/* Add a LAG member */
577
605
if (op == SET_COMMAND)
@@ -871,7 +899,7 @@ bool PortsOrch::addVlanMember(Port vlan, Port port)
871
899
return false ;
872
900
}
873
901
874
- SWSS_LOG_NOTICE (" Set port %s VLAN ID to %hu" , port.m_alias .c_str (), vlan.m_vlan_id );
902
+ SWSS_LOG_INFO (" Set port %s VLAN ID to %hu" , port.m_alias .c_str (), vlan.m_vlan_id );
875
903
876
904
port.m_vlan_id = vlan.m_vlan_id ;
877
905
port.m_port_vlan_id = vlan.m_vlan_id ;
0 commit comments