Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Flex Counters support for tunnel counters #886

Merged
merged 12 commits into from
Nov 2, 2021
Merged
Prev Previous commit
Merge branch 'master' of github.com:Azure/sonic-sairedis into evpn_vl…
…an_tun_cntrs
dgsudharsan committed Oct 28, 2021
commit 4f6ae077612098d16c01bb50e7b2de761d21eed7
27 changes: 27 additions & 0 deletions syncd/FlexCounter.cpp
Original file line number Diff line number Diff line change
@@ -1137,6 +1137,15 @@ bool FlexCounter::isTunnelCounterSupported(
return m_supportedTunnelCounters.count(counter) != 0;
}

bool FlexCounter::isStatsModeSupported(
_In_ uint32_t statsMode,
_In_ sai_stats_mode_t statCapability)
{
SWSS_LOG_ENTER();

return statsMode & statCapability;
}

void FlexCounter::collectCounters(
_In_ swss::Table &countersTable)
{
@@ -2503,6 +2512,24 @@ void FlexCounter::updateSupportedTunnelCounters(
}
}

void FlexCounter::updateSupportedBufferPoolCounters(
_In_ sai_object_id_t bufferPoolId,
_In_ const std::vector<sai_buffer_pool_stat_t> &counterIds,
_In_ sai_stats_mode_t statsMode)
{
SWSS_LOG_ENTER();

m_supportedBufferPoolCounters.clear();

/* Query SAI supported buffer pool counters */
sai_status_t status = querySupportedBufferPoolCounters(bufferPoolId, statsMode);
if (status != SAI_STATUS_SUCCESS)
{
/* Fallback to legacy approach */
getSupportedBufferPoolCounters(bufferPoolId, counterIds, statsMode);
}
}

std::vector<sai_switch_stat_t> FlexCounter::saiCheckSupportedSwitchDebugCounters(
_In_ sai_object_id_t switchId,
_In_ const std::vector<sai_switch_stat_t> &counterIds)
5 changes: 5 additions & 0 deletions syncd/FlexCounter.h
Original file line number Diff line number Diff line change
@@ -197,6 +197,11 @@ namespace syncd

bool isTunnelCounterSupported(
_In_ sai_tunnel_stat_t counter) const;

bool isStatsModeSupported(
_In_ uint32_t statsMode,
_In_ sai_stats_mode_t statCapability);

private: // update supported counters

sai_status_t querySupportedPortCounters(
You are viewing a condensed version of this merge commit. You can view the full changes here.