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

sonic-swss: Code changes for WRED and ECN statistics #2750

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion orchagent/flexcounterorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ extern sai_object_id_t gSwitchId;
#define FLOW_CNT_TRAP_KEY "FLOW_CNT_TRAP"
#define FLOW_CNT_ROUTE_KEY "FLOW_CNT_ROUTE"
#define ENI_KEY "ENI"
#define WRED_QUEUE_KEY "WRED_ECN_QUEUE"
#define WRED_PORT_KEY "WRED_ECN_PORT"

unordered_map<string, string> flexCounterGroupMap =
{
Expand All @@ -63,7 +65,9 @@ unordered_map<string, string> flexCounterGroupMap =
{"MACSEC_SA", COUNTERS_MACSEC_SA_GROUP},
{"MACSEC_SA_ATTR", COUNTERS_MACSEC_SA_ATTR_GROUP},
{"MACSEC_FLOW", COUNTERS_MACSEC_FLOW_GROUP},
{"ENI", ENI_STAT_COUNTER_FLEX_COUNTER_GROUP}
{"ENI", ENI_STAT_COUNTER_FLEX_COUNTER_GROUP},
{"WRED_ECN_PORT", WRED_PORT_STAT_COUNTER_FLEX_COUNTER_GROUP},
{"WRED_ECN_QUEUE", WRED_QUEUE_STAT_COUNTER_FLEX_COUNTER_GROUP},
};


Expand Down Expand Up @@ -187,6 +191,17 @@ void FlexCounterOrch::doTask(Consumer &consumer)
m_pg_watermark_enabled = true;
gPortsOrch->addPriorityGroupWatermarkFlexCounters(getPgConfigurations());
}
else if(key == WRED_PORT_KEY)
{
gPortsOrch->generateWredPortCounterMap();
m_wred_port_counter_enabled = true;
}
else if(key == WRED_QUEUE_KEY)
{
gPortsOrch->generateQueueMap(getQueueConfigurations());
m_wred_queue_counter_enabled = true;
gPortsOrch->addWredQueueFlexCounters(getQueueConfigurations());
}
}
if(gIntfsOrch && (key == RIF_KEY) && (value == "enable"))
{
Expand Down Expand Up @@ -292,6 +307,16 @@ bool FlexCounterOrch::getPgWatermarkCountersState() const
return m_pg_watermark_enabled;
}

bool FlexCounterOrch::getWredQueueCountersState() const
{
return m_wred_queue_counter_enabled;
}

bool FlexCounterOrch::getWredPortCountersState() const
{
return m_wred_port_counter_enabled;
}

bool FlexCounterOrch::bake()
{
/*
Expand Down
4 changes: 4 additions & 0 deletions orchagent/flexcounterorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class FlexCounterOrch: public Orch
std::map<std::string, FlexCounterPgStates> getPgConfigurations();
bool getHostIfTrapCounterState() const {return m_hostif_trap_counter_enabled;}
bool getRouteFlowCountersState() const {return m_route_flow_counter_enabled;}
bool getWredQueueCountersState() const;
bool getWredPortCountersState() const;
bool bake() override;

private:
Expand All @@ -63,6 +65,8 @@ class FlexCounterOrch: public Orch
bool m_pg_watermark_enabled = false;
bool m_hostif_trap_counter_enabled = false;
bool m_route_flow_counter_enabled = false;
bool m_wred_queue_counter_enabled = false;
bool m_wred_port_counter_enabled = false;
Table m_flexCounterConfigTable;
Table m_bufferQueueConfigTable;
Table m_bufferPgConfigTable;
Expand Down
Loading
Loading