From 892d2f890d2b76f5163827ec8eb6d0f7c1b3351a Mon Sep 17 00:00:00 2001 From: Nivin Lawrence Date: Wed, 4 Dec 2024 17:47:46 -0800 Subject: [PATCH] fb303 support for ECC and fifo overflow error events Summary: As titled Reviewed By: zechengh09 Differential Revision: D66566145 fbshipit-source-id: a21be07c4abf56236ca4fac849cca8f9477be55e --- fboss/agent/hw/HwSwitchFb303Stats.cpp | 16 ++++++++++++++++ fboss/agent/hw/HwSwitchFb303Stats.h | 10 ++++++++++ 2 files changed, 26 insertions(+) diff --git a/fboss/agent/hw/HwSwitchFb303Stats.cpp b/fboss/agent/hw/HwSwitchFb303Stats.cpp index d9e80a8b77be7..4d88fe8c71a70 100644 --- a/fboss/agent/hw/HwSwitchFb303Stats.cpp +++ b/fboss/agent/hw/HwSwitchFb303Stats.cpp @@ -201,6 +201,12 @@ HwSwitchFb303Stats::HwSwitchFb303Stats( getCounterPrefix() + vendor + ".reassembly.errors", SUM, RATE), + eccErrors_(map, getCounterPrefix() + vendor + ".ecc.errors", SUM, RATE), + fifoOverflowErrors_( + map, + getCounterPrefix() + vendor + ".fifo_overflow.errors", + SUM, + RATE), forwardingQueueProcessorErrors_( map, getCounterPrefix() + vendor + ".forwardingQueueProcessor.errors", @@ -389,6 +395,14 @@ int64_t HwSwitchFb303Stats::getReassemblyErrors() const { return getCumulativeValue(reassemblyErrors_); } +int64_t HwSwitchFb303Stats::getEccErrors() const { + return getCumulativeValue(eccErrors_); +} + +int64_t HwSwitchFb303Stats::getFifoOverflowErrors() const { + return getCumulativeValue(fifoOverflowErrors_); +} + int64_t HwSwitchFb303Stats::getForwardingQueueProcessorErrors() const { return getCumulativeValue(forwardingQueueProcessorErrors_); } @@ -452,6 +466,8 @@ HwAsicErrors HwSwitchFb303Stats::getHwAsicErrors() const { asicErrors.forwardingQueueProcessorErrors() = getForwardingQueueProcessorErrors(); asicErrors.reassemblyErrors() = getReassemblyErrors(); + asicErrors.eccErrors() = getEccErrors(); + asicErrors.fifoOverflowErrors() = getFifoOverflowErrors(); asicErrors.allReassemblyContextsTaken() = getAllReassemblyContextsTakenError(); return asicErrors; diff --git a/fboss/agent/hw/HwSwitchFb303Stats.h b/fboss/agent/hw/HwSwitchFb303Stats.h index 0d9a81ef039b7..f3e226641ea0e 100644 --- a/fboss/agent/hw/HwSwitchFb303Stats.h +++ b/fboss/agent/hw/HwSwitchFb303Stats.h @@ -83,6 +83,12 @@ class HwSwitchFb303Stats { void reassemblyError() { reassemblyErrors_.addValue(1); } + void eccError() { + eccErrors_.addValue(1); + } + void fifoOverflowError() { + fifoOverflowErrors_.addValue(1); + } void hwInitializedTime(uint64_t ms) { hwInitializedTimeMs_.addValue(ms); } @@ -167,6 +173,8 @@ class HwSwitchFb303Stats { int64_t getEpniErrors() const; int64_t getAlignerErrors() const; int64_t getReassemblyErrors() const; + int64_t getEccErrors() const; + int64_t getFifoOverflowErrors() const; int64_t getForwardingQueueProcessorErrors() const; int64_t getAllReassemblyContextsTakenError() const; @@ -257,6 +265,8 @@ class HwSwitchFb303Stats { TLTimeseries epniErrors_; TLTimeseries alignerErrors_; TLTimeseries reassemblyErrors_; + TLTimeseries eccErrors_; + TLTimeseries fifoOverflowErrors_; TLTimeseries forwardingQueueProcessorErrors_; TLTimeseries allReassemblyContextsTaken_; TLTimeseries hwInitializedTimeMs_;