Skip to content

Commit

Permalink
Plumb HwSwitchDropStats through HwSwitchHandlers
Browse files Browse the repository at this point in the history
Summary:
As titled. This api will be needed to collect stats
on mono switch architecture

Reviewed By: srikrishnagopu

Differential Revision: D50779572

fbshipit-source-id: cb52f36fef0a8fd164e85eee95f09e2fb4fd5bce
  • Loading branch information
Jasmeet Bagga authored and facebook-github-bot committed Oct 30, 2023
1 parent 33dc48a commit 4782b3b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions fboss/agent/HwSwitchHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class HwSwitchHandler {

virtual std::map<std::string, HwSysPortStats> getSysPortStats() const = 0;

virtual HwSwitchDropStats getSwitchDropStats() const = 0;
virtual void updateStats() = 0;

virtual std::map<PortID, phy::PhyInfo> updateAllPhyInfo() = 0;
Expand Down
5 changes: 5 additions & 0 deletions fboss/agent/mnpu/NonMonolithicHwSwitchHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ NonMonolithicHwSwitchHandler::getSysPortStats() const {
return {};
}

HwSwitchDropStats NonMonolithicHwSwitchHandler::getSwitchDropStats() const {
// TODO: implement this
return HwSwitchDropStats{};
}

// not used in split
void NonMonolithicHwSwitchHandler::updateStats() {}

Expand Down
1 change: 1 addition & 0 deletions fboss/agent/mnpu/NonMonolithicHwSwitchHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class NonMonolithicHwSwitchHandler : public HwSwitchHandler {
folly::F14FastMap<std::string, HwPortStats> getPortStats() const override;

std::map<std::string, HwSysPortStats> getSysPortStats() const override;
HwSwitchDropStats getSwitchDropStats() const override;

void updateStats() override;

Expand Down
4 changes: 4 additions & 0 deletions fboss/agent/single/MonolithicHwSwitchHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ void MonolithicHwSwitchHandler::updateStats() {
return hw_->updateStats();
}

HwSwitchDropStats MonolithicHwSwitchHandler::getSwitchDropStats() const {
return hw_->getSwitchDropStats();
}

std::map<PortID, phy::PhyInfo> MonolithicHwSwitchHandler::updateAllPhyInfo() {
return hw_->updateAllPhyInfo();
}
Expand Down
1 change: 1 addition & 0 deletions fboss/agent/single/MonolithicHwSwitchHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class MonolithicHwSwitchHandler : public HwSwitchHandler {
folly::F14FastMap<std::string, HwPortStats> getPortStats() const override;

std::map<std::string, HwSysPortStats> getSysPortStats() const override;
HwSwitchDropStats getSwitchDropStats() const override;

void updateStats() override;

Expand Down

0 comments on commit 4782b3b

Please sign in to comment.