@@ -2925,7 +2925,7 @@ void printUsage()
2925
2925
{
2926
2926
SWSS_LOG_ENTER ();
2927
2927
2928
- std::cout << " Usage: syncd [-N] [-U] [-d] [-p profile] [-i interval] [-t [cold|warm|fast]] [-h] [-u] [-S]" << std::endl;
2928
+ std::cout << " Usage: syncd [-N] [-U] [-d] [-p profile] [-i interval] [-t [cold|warm|fast|fastfast ]] [-h] [-u] [-S]" << std::endl;
2929
2929
std::cout << " -N --nocounters" << std::endl;
2930
2930
std::cout << " Disable counter thread" << std::endl;
2931
2931
std::cout << " -d --diag" << std::endl;
@@ -2935,7 +2935,7 @@ void printUsage()
2935
2935
std::cout << " -i --countersInterval interval" << std::endl;
2936
2936
std::cout << " Provide counter thread interval" << std::endl;
2937
2937
std::cout << " -t --startType type" << std::endl;
2938
- std::cout << " Specify cold|warm|fast start type" << std::endl;
2938
+ std::cout << " Specify cold|warm|fast|fastfast start type" << std::endl;
2939
2939
std::cout << " -u --useTempView:" << std::endl;
2940
2940
std::cout << " Use temporary view between init and apply" << std::endl;
2941
2941
std::cout << " -S --disableExitSleep" << std::endl;
@@ -3034,6 +3034,10 @@ void handleCmdLine(int argc, char **argv)
3034
3034
{
3035
3035
options.startType = SAI_FAST_BOOT;
3036
3036
}
3037
+ else if (std::string (optarg ) == " fastfast" )
3038
+ {
3039
+ options.startType = SAI_FASTFAST_BOOT;
3040
+ }
3037
3041
else
3038
3042
{
3039
3043
SWSS_LOG_ERROR (" unknown start type %s" , optarg );
@@ -3220,6 +3224,35 @@ syncd_restart_type_t handleRestartQuery(swss::NotificationConsumer &restartQuery
3220
3224
return SYNCD_RESTART_TYPE_COLD;
3221
3225
}
3222
3226
3227
+ void handleFfbEvent (swss::NotificationConsumer &ffb)
3228
+ {
3229
+ SWSS_LOG_ENTER ();
3230
+
3231
+ std::string op;
3232
+ std::string data;
3233
+ std::vector<swss::FieldValueTuple> values;
3234
+
3235
+ ffb.pop (op, data, values);
3236
+
3237
+ if ((op == " SET" ) && (data == " ISSU_END" ))
3238
+ {
3239
+ sai_switch_api_t *sai_switch_api = NULL ;
3240
+ sai_api_query (SAI_API_SWITCH, (void **)&sai_switch_api);
3241
+
3242
+ sai_attribute_t attr;
3243
+
3244
+ attr.id = SAI_SWITCH_ATTR_FAST_API_ENABLE;
3245
+ attr.value .booldata = false ;
3246
+
3247
+ sai_status_t status = sai_switch_api->set_switch_attribute (gSwitchId , &attr);
3248
+
3249
+ if (status != SAI_STATUS_SUCCESS)
3250
+ {
3251
+ SWSS_LOG_ERROR (" Failed to set SAI_SWITCH_ATTR_FAST_API_ENABLE=false: %s" , sai_serialize_status (status).c_str ());
3252
+ }
3253
+ }
3254
+ }
3255
+
3223
3256
bool isVeryFirstRun ()
3224
3257
{
3225
3258
SWSS_LOG_ENTER ();
@@ -3475,6 +3508,7 @@ int syncd_main(int argc, char **argv)
3475
3508
std::shared_ptr<swss::NotificationConsumer> restartQuery = std::make_shared<swss::NotificationConsumer>(dbAsic.get (), " RESTARTQUERY" );
3476
3509
std::shared_ptr<swss::ConsumerTable> flexCounter = std::make_shared<swss::ConsumerTable>(dbFlexCounter.get (), FLEX_COUNTER_TABLE);
3477
3510
std::shared_ptr<swss::ConsumerTable> flexCounterGroup = std::make_shared<swss::ConsumerTable>(dbFlexCounter.get (), FLEX_COUNTER_GROUP_TABLE);
3511
+ std::shared_ptr<swss::NotificationConsumer> ffb = std::make_shared<swss::NotificationConsumer>(dbAsic.get (), " MLNX_FFB" );
3478
3512
3479
3513
/*
3480
3514
* At the end we cant use producer consumer concept since if one process
@@ -3520,7 +3554,16 @@ int syncd_main(int argc, char **argv)
3520
3554
options.startType = SAI_COLD_BOOT;
3521
3555
}
3522
3556
3523
- gProfileMap [SAI_KEY_BOOT_TYPE] = std::to_string (options.startType );
3557
+ if (options.startType == SAI_FASTFAST_BOOT)
3558
+ {
3559
+ /*
3560
+ * Mellanox SAI requires to pass SAI_WARM_BOOT as SAI_BOOT_KEY
3561
+ * to start 'fast-fast'
3562
+ */
3563
+ gProfileMap [SAI_KEY_BOOT_TYPE] = std::to_string (SAI_WARM_BOOT);
3564
+ } else {
3565
+ gProfileMap [SAI_KEY_BOOT_TYPE] = std::to_string (options.startType );
3566
+ }
3524
3567
3525
3568
sai_status_t status = sai_api_initialize (0 , (sai_service_method_table_t *)&test_services);
3526
3569
@@ -3574,6 +3617,7 @@ int syncd_main(int argc, char **argv)
3574
3617
s.addSelectable (restartQuery.get ());
3575
3618
s.addSelectable (flexCounter.get ());
3576
3619
s.addSelectable (flexCounterGroup.get ());
3620
+ s.addSelectable (ffb.get ());
3577
3621
3578
3622
SWSS_LOG_NOTICE (" starting main loop" );
3579
3623
@@ -3653,6 +3697,10 @@ int syncd_main(int argc, char **argv)
3653
3697
status = sai_switch_api->set_switch_attribute (gSwitchId , &attr);
3654
3698
}
3655
3699
}
3700
+ else if (sel == ffb.get ())
3701
+ {
3702
+ handleFfbEvent (*ffb);
3703
+ }
3656
3704
else if (sel == flexCounter.get ())
3657
3705
{
3658
3706
processFlexCounterEvent (*(swss::ConsumerTable*)sel);
0 commit comments