-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an API to fill extension queue stats from SaiQueueManager
Summary: Extension queue stats to be filled in HwPortStats for queue. Reviewed By: jasmeetbagga Differential Revision: D61809753 fbshipit-source-id: 774742dabdcbed89feb05c28c7c54a5b04171346
- Loading branch information
1 parent
440502c
commit 0667edc
Showing
6 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2004-present Facebook. All Rights Reserved. | ||
|
||
#include "fboss/agent/hw/sai/switch/SaiQueueManager.h" | ||
|
||
#if defined(BRCM_SAI_SDK_DNX) && defined(BRCM_SAI_SDK_GTE_11_0) | ||
extern "C" { | ||
#include <brcm_sai_extensions.h> | ||
} | ||
#endif | ||
|
||
namespace facebook::fboss { | ||
|
||
#if defined(BRCM_SAI_SDK_DNX) && defined(BRCM_SAI_SDK_GTE_11_0) | ||
bool fillQueueExtensionStats( | ||
const uint8_t queueId, | ||
const sai_stat_id_t& counterId, | ||
const uint64_t& counterValue, | ||
HwPortStats& hwPortStats) { | ||
bool counterHandled = true; | ||
switch (counterId) { | ||
case SAI_QUEUE_STAT_EGRESS_GVOQ_THRESHOLD_WM: | ||
// There are a few limitations w.r.t. GVOQ watermarks | ||
// 1. Granularity of this counter is 8K bytes as of now | ||
// 2. Max VoQ watermark that can be reported per VoQ is 16M | ||
// 3. Max GVOQ watermark that can be reported per EGQ is 256M | ||
hwPortStats.egressGvoqWatermarkBytes_()[queueId] = counterValue; | ||
break; | ||
default: | ||
throw FbossError("Got unexpected queue counter id: ", counterId); | ||
} | ||
return counterHandled; | ||
} | ||
#else | ||
bool fillQueueExtensionStats( | ||
const uint8_t /*queueId*/, | ||
const sai_stat_id_t& /*counterId*/, | ||
const uint64_t& /*counterValue*/, | ||
HwPortStats& /*hwPortStats*/) { | ||
// No extension stat ID for Queue | ||
return false; | ||
} | ||
#endif | ||
|
||
} // namespace facebook::fboss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2004-present Facebook. All Rights Reserved. | ||
|
||
#include "fboss/agent/hw/sai/switch/SaiQueueManager.h" | ||
|
||
namespace facebook::fboss { | ||
|
||
bool fillQueueExtensionStats( | ||
const uint8_t /*queueId*/, | ||
const sai_stat_id_t& /*counterId*/, | ||
const uint64_t& /*counterValue*/, | ||
HwPortStats& /*hwPortStats*/) { | ||
// No extension stat ID for Queue | ||
return false; | ||
} | ||
|
||
} // namespace facebook::fboss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters