@@ -1626,6 +1626,28 @@ void InspectAsic()
1626
1626
}
1627
1627
}
1628
1628
1629
+ sai_status_t onApplyViewInFastFastBoot ()
1630
+ {
1631
+ SWSS_LOG_ENTER ();
1632
+
1633
+ sai_switch_api_t * sai_switch_api = nullptr ;
1634
+ sai_api_query (SAI_API_SWITCH, (void **)&sai_switch_api);
1635
+
1636
+ sai_attribute_t attr;
1637
+
1638
+ attr.id = SAI_SWITCH_ATTR_FAST_API_ENABLE;
1639
+ attr.value .booldata = false ;
1640
+
1641
+ sai_status_t status = sai_switch_api->set_switch_attribute (gSwitchId , &attr);
1642
+
1643
+ if (status != SAI_STATUS_SUCCESS)
1644
+ {
1645
+ SWSS_LOG_ERROR (" Failed to set SAI_SWITCH_ATTR_FAST_API_ENABLE=false: %s" , sai_serialize_status (status).c_str ());
1646
+ }
1647
+
1648
+ return status;
1649
+ }
1650
+
1629
1651
sai_status_t notifySyncd (
1630
1652
_In_ const std::string& op)
1631
1653
{
@@ -1657,6 +1679,8 @@ sai_status_t notifySyncd(
1657
1679
{
1658
1680
SWSS_LOG_NOTICE (" very first run is TRUE, op = %s" , op.c_str ());
1659
1681
1682
+ sai_status_t status = SAI_STATUS_SUCCESS;
1683
+
1660
1684
/*
1661
1685
* On the very first start of syncd, "compile" view is directly applied
1662
1686
* on device, since it will make it easier to switch to new asic state
@@ -1686,16 +1710,22 @@ sai_status_t notifySyncd(
1686
1710
1687
1711
g_asicInitViewMode = false ;
1688
1712
1713
+ if (options.startType == SAI_FASTFAST_BOOT)
1714
+ {
1715
+ /* fastfast boot configuration end */
1716
+ status = onApplyViewInFastFastBoot ();
1717
+ }
1718
+
1689
1719
SWSS_LOG_NOTICE (" setting very first run to FALSE, op = %s" , op.c_str ());
1690
1720
}
1691
1721
else
1692
1722
{
1693
1723
SWSS_LOG_THROW (" unknown operation: %s" , op.c_str ());
1694
1724
}
1695
1725
1696
- sendNotifyResponse (SAI_STATUS_SUCCESS );
1726
+ sendNotifyResponse (status );
1697
1727
1698
- return SAI_STATUS_SUCCESS ;
1728
+ return status ;
1699
1729
}
1700
1730
1701
1731
if (op == SYNCD_INIT_VIEW)
@@ -3246,35 +3276,6 @@ syncd_restart_type_t handleRestartQuery(swss::NotificationConsumer &restartQuery
3246
3276
return SYNCD_RESTART_TYPE_COLD;
3247
3277
}
3248
3278
3249
- void handleFfbEvent (swss::NotificationConsumer &ffb)
3250
- {
3251
- SWSS_LOG_ENTER ();
3252
-
3253
- std::string op;
3254
- std::string data;
3255
- std::vector<swss::FieldValueTuple> values;
3256
-
3257
- ffb.pop (op, data, values);
3258
-
3259
- if ((op == " SET" ) && (data == " ISSU_END" ))
3260
- {
3261
- sai_switch_api_t *sai_switch_api = NULL ;
3262
- sai_api_query (SAI_API_SWITCH, (void **)&sai_switch_api);
3263
-
3264
- sai_attribute_t attr;
3265
-
3266
- attr.id = SAI_SWITCH_ATTR_FAST_API_ENABLE;
3267
- attr.value .booldata = false ;
3268
-
3269
- sai_status_t status = sai_switch_api->set_switch_attribute (gSwitchId , &attr);
3270
-
3271
- if (status != SAI_STATUS_SUCCESS)
3272
- {
3273
- SWSS_LOG_ERROR (" Failed to set SAI_SWITCH_ATTR_FAST_API_ENABLE=false: %s" , sai_serialize_status (status).c_str ());
3274
- }
3275
- }
3276
- }
3277
-
3278
3279
bool isVeryFirstRun ()
3279
3280
{
3280
3281
SWSS_LOG_ENTER ();
@@ -3530,7 +3531,6 @@ int syncd_main(int argc, char **argv)
3530
3531
std::shared_ptr<swss::NotificationConsumer> restartQuery = std::make_shared<swss::NotificationConsumer>(dbAsic.get (), " RESTARTQUERY" );
3531
3532
std::shared_ptr<swss::ConsumerTable> flexCounter = std::make_shared<swss::ConsumerTable>(dbFlexCounter.get (), FLEX_COUNTER_TABLE);
3532
3533
std::shared_ptr<swss::ConsumerTable> flexCounterGroup = std::make_shared<swss::ConsumerTable>(dbFlexCounter.get (), FLEX_COUNTER_GROUP_TABLE);
3533
- std::shared_ptr<swss::NotificationConsumer> ffb = std::make_shared<swss::NotificationConsumer>(dbAsic.get (), " MLNX_FFB" );
3534
3534
3535
3535
/*
3536
3536
* At the end we cant use producer consumer concept since if one process
@@ -3543,7 +3543,8 @@ int syncd_main(int argc, char **argv)
3543
3543
3544
3544
g_veryFirstRun = isVeryFirstRun ();
3545
3545
3546
- if (swss::WarmStart::isWarmStart ())
3546
+ /* ignore warm logic here if syncd starts in Mellanox fastfast boot mode */
3547
+ if (swss::WarmStart::isWarmStart () && (options.startType != SAI_FASTFAST_BOOT))
3547
3548
{
3548
3549
options.startType = SAI_WARM_BOOT;
3549
3550
}
@@ -3580,7 +3581,7 @@ int syncd_main(int argc, char **argv)
3580
3581
{
3581
3582
/*
3582
3583
* Mellanox SAI requires to pass SAI_WARM_BOOT as SAI_BOOT_KEY
3583
- * to start 'fast-fast '
3584
+ * to start 'fastfast '
3584
3585
*/
3585
3586
gProfileMap [SAI_KEY_BOOT_TYPE] = std::to_string (SAI_WARM_BOOT);
3586
3587
} else {
@@ -3639,7 +3640,6 @@ int syncd_main(int argc, char **argv)
3639
3640
s->addSelectable (restartQuery.get ());
3640
3641
s->addSelectable (flexCounter.get ());
3641
3642
s->addSelectable (flexCounterGroup.get ());
3642
- s->addSelectable (ffb.get ());
3643
3643
3644
3644
SWSS_LOG_NOTICE (" starting main loop" );
3645
3645
@@ -3728,10 +3728,6 @@ int syncd_main(int argc, char **argv)
3728
3728
status = sai_switch_api->set_switch_attribute (gSwitchId , &attr);
3729
3729
}
3730
3730
}
3731
- else if (sel == ffb.get ())
3732
- {
3733
- handleFfbEvent (*ffb);
3734
- }
3735
3731
else if (sel == flexCounter.get ())
3736
3732
{
3737
3733
processFlexCounterEvent (*(swss::ConsumerTable*)sel);
@@ -3789,11 +3785,11 @@ int syncd_main(int argc, char **argv)
3789
3785
3790
3786
SWSS_LOG_NOTICE (" Removing the switch gSwitchId=0x%lx" , gSwitchId );
3791
3787
3792
- #ifdef SAI_SWITCH_ATTR_UNINIT_DATA_PLANE_ON_REMOVAL
3788
+ #ifdef SAI_SUPPORT_UNINIT_DATA_PLANE_ON_REMOVAL
3793
3789
3794
- if (shutdownType == SYNCD_RESTART_TYPE_FAST)
3790
+ if (shutdownType == SYNCD_RESTART_TYPE_FAST || shutdownType == SYNCD_RESTART_TYPE_WARM )
3795
3791
{
3796
- SWSS_LOG_NOTICE (" Fast Reboot requested, keeping data plane running" );
3792
+ SWSS_LOG_NOTICE (" Fast/warm reboot requested, keeping data plane running" );
3797
3793
3798
3794
sai_attribute_t attr;
3799
3795
0 commit comments