Skip to content

Commit

Permalink
fb303 support for ECC and fifo overflow error events
Browse files Browse the repository at this point in the history
Summary: As titled

Reviewed By: zechengh09

Differential Revision: D66566145

fbshipit-source-id: a21be07c4abf56236ca4fac849cca8f9477be55e
  • Loading branch information
Nivin Lawrence authored and facebook-github-bot committed Dec 5, 2024
1 parent 42faf93 commit 892d2f8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions fboss/agent/hw/HwSwitchFb303Stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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_);
}
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions fboss/agent/hw/HwSwitchFb303Stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -257,6 +265,8 @@ class HwSwitchFb303Stats {
TLTimeseries epniErrors_;
TLTimeseries alignerErrors_;
TLTimeseries reassemblyErrors_;
TLTimeseries eccErrors_;
TLTimeseries fifoOverflowErrors_;
TLTimeseries forwardingQueueProcessorErrors_;
TLTimeseries allReassemblyContextsTaken_;
TLTimeseries hwInitializedTimeMs_;
Expand Down

0 comments on commit 892d2f8

Please sign in to comment.