@@ -913,10 +913,20 @@ void PfcWdSwOrch<DropHandler, ForwardHandler>::doTask(swss::NotificationConsumer
913
913
914
914
wdNotification.pop (queueIdStr, event, values);
915
915
916
+ string info;
917
+ for (auto &fv : values)
918
+ {
919
+ info += fvField (fv) + " :" + fvValue (fv) + " |" ;
920
+ }
921
+ if (!info.empty ())
922
+ {
923
+ info.pop_back ();
924
+ }
925
+
916
926
sai_object_id_t queueId = SAI_NULL_OBJECT_ID;
917
927
sai_deserialize_object_id (queueIdStr, queueId);
918
928
919
- if (!startWdActionOnQueue (event, queueId))
929
+ if (!startWdActionOnQueue (event, queueId, info ))
920
930
{
921
931
SWSS_LOG_ERROR (" Failed to start PFC watchdog %s event action on queue %s" , event.c_str (), queueIdStr.c_str ());
922
932
}
@@ -939,26 +949,40 @@ void PfcWdSwOrch<DropHandler, ForwardHandler>::doTask(SelectableTimer &timer)
939
949
940
950
template <typename DropHandler, typename ForwardHandler>
941
951
void PfcWdSwOrch<DropHandler, ForwardHandler>::report_pfc_storm(
942
- sai_object_id_t id, const PfcWdQueueEntry *entry)
952
+ sai_object_id_t id, const PfcWdQueueEntry *entry, const string &info )
943
953
{
944
954
event_params_t params = {
945
955
{ " ifname" , entry->portAlias },
946
956
{ " queue_index" , to_string (entry->index ) },
947
957
{ " queue_id" , to_string (id) },
948
958
{ " port_id" , to_string (entry->portId ) }};
949
959
950
- SWSS_LOG_NOTICE (
951
- " PFC Watchdog detected PFC storm on port %s, queue index %d, queue id 0x%" PRIx64 " and port id 0x%" PRIx64 " ." ,
960
+ if (info.empty ())
961
+ {
962
+ SWSS_LOG_NOTICE (
963
+ " PFC Watchdog detected PFC storm on port %s, queue index %d, queue id 0x%" PRIx64 " and port id 0x%" PRIx64,
952
964
entry->portAlias .c_str (),
953
965
entry->index ,
954
966
id,
955
967
entry->portId );
968
+ }
969
+ else
970
+ {
971
+ SWSS_LOG_NOTICE (
972
+ " PFC Watchdog detected PFC storm on port %s, queue index %d, queue id 0x%" PRIx64 " and port id 0x%" PRIx64 " , additional info: %s." ,
973
+ entry->portAlias .c_str (),
974
+ entry->index ,
975
+ id,
976
+ entry->portId ,
977
+ info.c_str ());
978
+ params[" additional_info" ] = info;
979
+ }
956
980
957
981
event_publish (g_events_handle, " pfc-storm" , ¶ms);
958
982
}
959
983
960
984
template <typename DropHandler, typename ForwardHandler>
961
- bool PfcWdSwOrch<DropHandler, ForwardHandler>::startWdActionOnQueue(const string &event, sai_object_id_t queueId)
985
+ bool PfcWdSwOrch<DropHandler, ForwardHandler>::startWdActionOnQueue(const string &event, sai_object_id_t queueId, const string &info )
962
986
{
963
987
auto entry = m_entryMap.find (queueId);
964
988
if (entry == m_entryMap.end ())
@@ -979,7 +1003,7 @@ bool PfcWdSwOrch<DropHandler, ForwardHandler>::startWdActionOnQueue(const string
979
1003
{
980
1004
if (entry->second .handler == nullptr )
981
1005
{
982
- report_pfc_storm (entry->first , &entry->second );
1006
+ report_pfc_storm (entry->first , &entry->second , info );
983
1007
984
1008
entry->second .handler = make_shared<PfcWdActionHandler>(
985
1009
entry->second .portId ,
@@ -996,7 +1020,7 @@ bool PfcWdSwOrch<DropHandler, ForwardHandler>::startWdActionOnQueue(const string
996
1020
{
997
1021
if (entry->second .handler == nullptr )
998
1022
{
999
- report_pfc_storm (entry->first , &entry->second );
1023
+ report_pfc_storm (entry->first , &entry->second , info );
1000
1024
1001
1025
entry->second .handler = make_shared<DropHandler>(
1002
1026
entry->second .portId ,
@@ -1013,7 +1037,7 @@ bool PfcWdSwOrch<DropHandler, ForwardHandler>::startWdActionOnQueue(const string
1013
1037
{
1014
1038
if (entry->second .handler == nullptr )
1015
1039
{
1016
- report_pfc_storm (entry->first , &entry->second );
1040
+ report_pfc_storm (entry->first , &entry->second , info );
1017
1041
1018
1042
entry->second .handler = make_shared<ForwardHandler>(
1019
1043
entry->second .portId ,
0 commit comments