1
1
#include " syncd.h"
2
2
#include " syncd_saiswitch.h"
3
3
#include " sairedis.h"
4
- #include " syncd_pfc_watchdog .h"
4
+ #include " syncd_flex_counter .h"
5
5
#include " swss/tokenize.h"
6
6
#include < limits.h>
7
7
@@ -2352,7 +2352,7 @@ sai_status_t processEvent(
2352
2352
return status;
2353
2353
}
2354
2354
2355
- void processPfcWdEvent (
2355
+ void processFlexCounterEvent (
2356
2356
_In_ swss::ConsumerStateTable &consumer)
2357
2357
{
2358
2358
std::lock_guard<std::mutex> lock (g_mutex);
@@ -2380,11 +2380,11 @@ void processPfcWdEvent(
2380
2380
{
2381
2381
if (objectType == SAI_OBJECT_TYPE_PORT)
2382
2382
{
2383
- PfcWatchdog ::removePort (vid);
2383
+ FlexCounter ::removePort (vid);
2384
2384
}
2385
2385
else if (objectType == SAI_OBJECT_TYPE_QUEUE)
2386
2386
{
2387
- PfcWatchdog ::removeQueue (vid);
2387
+ FlexCounter ::removeQueue (vid);
2388
2388
}
2389
2389
else
2390
2390
{
@@ -2404,7 +2404,7 @@ void processPfcWdEvent(
2404
2404
sai_deserialize_port_stat (str, stat);
2405
2405
portCounterIds.push_back (stat);
2406
2406
}
2407
- PfcWatchdog ::setPortCounterList (vid, rid, portCounterIds);
2407
+ FlexCounter ::setPortCounterList (vid, rid, portCounterIds);
2408
2408
}
2409
2409
else if (objectType == SAI_OBJECT_TYPE_QUEUE && field == PFC_WD_QUEUE_COUNTER_ID_LIST)
2410
2410
{
@@ -2415,7 +2415,7 @@ void processPfcWdEvent(
2415
2415
sai_deserialize_queue_stat (str, stat);
2416
2416
queueCounterIds.push_back (stat);
2417
2417
}
2418
- PfcWatchdog ::setQueueCounterList (vid, rid, queueCounterIds);
2418
+ FlexCounter ::setQueueCounterList (vid, rid, queueCounterIds);
2419
2419
}
2420
2420
else if (objectType == SAI_OBJECT_TYPE_QUEUE && field == PFC_WD_QUEUE_ATTR_ID_LIST)
2421
2421
{
@@ -2427,7 +2427,7 @@ void processPfcWdEvent(
2427
2427
queueAttrIds.push_back (attr);
2428
2428
}
2429
2429
2430
- PfcWatchdog ::setQueueAttrList (vid, rid, queueAttrIds);
2430
+ FlexCounter ::setQueueAttrList (vid, rid, queueAttrIds);
2431
2431
}
2432
2432
else
2433
2433
{
@@ -2437,7 +2437,7 @@ void processPfcWdEvent(
2437
2437
}
2438
2438
}
2439
2439
2440
- void processPfcWdPluginEvent (
2440
+ void processFlexCounterPluginEvent (
2441
2441
_In_ swss::ConsumerStateTable &consumer)
2442
2442
{
2443
2443
std::lock_guard<std::mutex> lock (g_mutex);
@@ -2452,7 +2452,7 @@ void processPfcWdPluginEvent(
2452
2452
2453
2453
if (op == DEL_COMMAND)
2454
2454
{
2455
- PfcWatchdog ::removeCounterPlugin (key);
2455
+ FlexCounter ::removeCounterPlugin (key);
2456
2456
return ;
2457
2457
}
2458
2458
@@ -2469,11 +2469,11 @@ void processPfcWdPluginEvent(
2469
2469
2470
2470
if (value == sai_serialize_object_type (SAI_OBJECT_TYPE_PORT))
2471
2471
{
2472
- PfcWatchdog ::addPortCounterPlugin (key);
2472
+ FlexCounter ::addPortCounterPlugin (key);
2473
2473
}
2474
2474
else if (value == sai_serialize_object_type (SAI_OBJECT_TYPE_QUEUE))
2475
2475
{
2476
- PfcWatchdog ::addQueueCounterPlugin (key);
2476
+ FlexCounter ::addQueueCounterPlugin (key);
2477
2477
}
2478
2478
else
2479
2479
{
@@ -3055,14 +3055,14 @@ int syncd_main(int argc, char **argv)
3055
3055
3056
3056
std::shared_ptr<swss::DBConnector> dbAsic = std::make_shared<swss::DBConnector>(ASIC_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0 );
3057
3057
std::shared_ptr<swss::DBConnector> dbNtf = std::make_shared<swss::DBConnector>(ASIC_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0 );
3058
- std::shared_ptr<swss::DBConnector> dbPfcWatchdog = std::make_shared<swss::DBConnector>(PFC_WD_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0 );
3058
+ std::shared_ptr<swss::DBConnector> dbFlexCounter = std::make_shared<swss::DBConnector>(PFC_WD_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0 );
3059
3059
3060
3060
g_redisClient = std::make_shared<swss::RedisClient>(dbAsic.get ());
3061
3061
3062
3062
std::shared_ptr<swss::ConsumerTable> asicState = std::make_shared<swss::ConsumerTable>(dbAsic.get (), ASIC_STATE_TABLE);
3063
3063
std::shared_ptr<swss::NotificationConsumer> restartQuery = std::make_shared<swss::NotificationConsumer>(dbAsic.get (), " RESTARTQUERY" );
3064
- std::shared_ptr<swss::ConsumerStateTable> pfcWdState = std::make_shared<swss::ConsumerStateTable>(dbPfcWatchdog .get (), PFC_WD_STATE_TABLE);
3065
- std::shared_ptr<swss::ConsumerStateTable> pfcWdPlugin = std::make_shared<swss::ConsumerStateTable>(dbPfcWatchdog .get (), PLUGIN_TABLE);
3064
+ std::shared_ptr<swss::ConsumerStateTable> flexCounterState = std::make_shared<swss::ConsumerStateTable>(dbFlexCounter .get (), PFC_WD_STATE_TABLE);
3065
+ std::shared_ptr<swss::ConsumerStateTable> flexCounterPlugin = std::make_shared<swss::ConsumerStateTable>(dbFlexCounter .get (), PLUGIN_TABLE);
3066
3066
3067
3067
/*
3068
3068
* At the end we cant use producer consumer concept since if one proces
@@ -3158,8 +3158,8 @@ int syncd_main(int argc, char **argv)
3158
3158
3159
3159
s.addSelectable (asicState.get ());
3160
3160
s.addSelectable (restartQuery.get ());
3161
- s.addSelectable (pfcWdState .get ());
3162
- s.addSelectable (pfcWdPlugin .get ());
3161
+ s.addSelectable (flexCounterState .get ());
3162
+ s.addSelectable (flexCounterPlugin .get ());
3163
3163
3164
3164
SWSS_LOG_NOTICE (" starting main loop" );
3165
3165
@@ -3184,13 +3184,13 @@ int syncd_main(int argc, char **argv)
3184
3184
warmRestartHint = handleRestartQuery (*restartQuery);
3185
3185
break ;
3186
3186
}
3187
- else if (sel == pfcWdState .get ())
3187
+ else if (sel == flexCounterState .get ())
3188
3188
{
3189
- processPfcWdEvent (*(swss::ConsumerStateTable*)sel);
3189
+ processFlexCounterEvent (*(swss::ConsumerStateTable*)sel);
3190
3190
}
3191
- else if (sel == pfcWdPlugin .get ())
3191
+ else if (sel == flexCounterPlugin .get ())
3192
3192
{
3193
- processPfcWdPluginEvent (*(swss::ConsumerStateTable*)sel);
3193
+ processFlexCounterPluginEvent (*(swss::ConsumerStateTable*)sel);
3194
3194
}
3195
3195
else if (result == swss::Select::OBJECT)
3196
3196
{
0 commit comments