Skip to content

Commit

Permalink
Remove *_LEFT fields to allow PFC watchdog to enter fresh into the (s…
Browse files Browse the repository at this point in the history
…onic-net#897)

operational/storm state

Signed-off-by: Wenda Ni <wenni@microsoft.com>
  • Loading branch information
wendani committed Jun 4, 2019
1 parent 7f87260 commit 1ebe89a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion orchagent/pfc_detect_broadcom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ for i = n, 1, -1 do
end
end

-- Save values for next run
-- Save values for next run
redis.call('HSET', counters_table_name .. ':' .. KEYS[i], 'SAI_QUEUE_ATTR_PAUSE_STATUS_last', queue_pause_status)
redis.call('HSET', counters_table_name .. ':' .. KEYS[i], 'SAI_QUEUE_STAT_PACKETS_last', packets)
redis.call('HSET', counters_table_name .. ':' .. KEYS[i], 'PFC_WD_DETECTION_TIME_LEFT', time_left)
Expand Down
4 changes: 2 additions & 2 deletions orchagent/pfcwdorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ bool PfcWdSwOrch<DropHandler, ForwardHandler>::startWdActionOnQueue(const string
template <typename DropHandler, typename ForwardHandler>
bool PfcWdSwOrch<DropHandler, ForwardHandler>::bake()
{
// clean all *_last fields in COUNTERS_TABLE
// clean all *_last and *_LEFT fields in COUNTERS_TABLE
// to allow warm-reboot pfc detect & restore state machine to enter the same init state as cold-reboot
RedisClient redisClient(this->getCountersDb().get());

Expand All @@ -1004,7 +1004,7 @@ bool PfcWdSwOrch<DropHandler, ForwardHandler>::bake()
vector<string> wLasts;
for (const auto &fv : fvTuples)
{
if (fvField(fv).find("_last") != string::npos)
if ((fvField(fv).find("_last") != string::npos) || (fvField(fv).find("_LEFT") != string::npos))
{
wLasts.push_back(fvField(fv));
}
Expand Down
2 changes: 1 addition & 1 deletion orchagent/pfcwdorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class PfcWdSwOrch: public PfcWdOrch<DropHandler, ForwardHandler>
shared_ptr<DBConnector> m_applDb = nullptr;
// Track queues in storm
shared_ptr<Table> m_applTable = nullptr;
// used for hdel
// used for hset and hdel
RedisClient m_applDbRedisClient;
};

Expand Down

0 comments on commit 1ebe89a

Please sign in to comment.