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

[Portsorch]: Add lag-name and oid map to counter table COUNTERS_PORT_NAME_MAP #510

Closed
wants to merge 10 commits into from
8 changes: 8 additions & 0 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2748,6 +2748,12 @@ bool PortsOrch::addLag(string lag_alias)
lag.m_members = set<string>();
m_portList[lag_alias] = lag;


/* Add lag name map to counter table */
FieldValueTuple tuple(lag_alias, sai_serialize_object_id(lag_id));
vector<FieldValueTuple> fields;
fields.push_back(tuple);
m_counterTable->set("", fields);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need the remove part as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The modification has been uploaded, please take a moment to review it. I want to continue uploading code here(sonic-swss), thanks.

PortUpdate update = { lag, true };
notify(SUBJECT_TYPE_PORT_CHANGE, static_cast<void *>(&update));

Expand Down Expand Up @@ -2779,6 +2785,8 @@ bool PortsOrch::removeLag(Port lag)

SWSS_LOG_NOTICE("Remove LAG %s lid:%lx", lag.m_alias.c_str(), lag.m_lag_id);

m_counterTable->del(lag.m_alias);

m_portList.erase(lag.m_alias);

PortUpdate update = { lag, false };
Expand Down