diff --git a/orchagent/orchdaemon.cpp b/orchagent/orchdaemon.cpp index c747c33db4d7..9dfae2556adc 100644 --- a/orchagent/orchdaemon.cpp +++ b/orchagent/orchdaemon.cpp @@ -177,7 +177,7 @@ bool OrchDaemon::init() SAI_QUEUE_ATTR_PAUSE_STATUS, }; - m_orchList.push_back(new PfcWdSwOrch( + m_orchList.push_back(new PfcWdSwOrch( m_configDb, pfc_wd_tables, portStatIds, diff --git a/orchagent/pfcwdorch.cpp b/orchagent/pfcwdorch.cpp index d3f624f7be3f..3e3106136696 100644 --- a/orchagent/pfcwdorch.cpp +++ b/orchagent/pfcwdorch.cpp @@ -481,19 +481,25 @@ void PfcWdSwOrch::doTask(swss::NotificationConsumer } else if (entry->second.action == PfcWdAction::PFC_WD_ACTION_DROP) { - entry->second.handler = make_shared( - entry->second.portId, - entry->first, - entry->second.index, - PfcWdOrch::getCountersTable()); + if (entry->second.handler == nullptr) + { + entry->second.handler = make_shared( + entry->second.portId, + entry->first, + entry->second.index, + PfcWdOrch::getCountersTable()); + } } else if (entry->second.action == PfcWdAction::PFC_WD_ACTION_FORWARD) { - entry->second.handler = make_shared( - entry->second.portId, - entry->first, - entry->second.index, - PfcWdOrch::getCountersTable()); + if (entry->second.handler == nullptr) + { + entry->second.handler = make_shared( + entry->second.portId, + entry->first, + entry->second.index, + PfcWdOrch::getCountersTable()); + } } else { @@ -512,4 +518,4 @@ void PfcWdSwOrch::doTask(swss::NotificationConsumer // Trick to keep member functions in a separate file template class PfcWdSwOrch; -template class PfcWdSwOrch; +template class PfcWdSwOrch;