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

[swss] L2 Forwarding Enhancements #1716

Merged
merged 15 commits into from
Nov 20, 2021
27 changes: 18 additions & 9 deletions orchagent/fdborch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,16 +686,15 @@ void FdbOrch::doTask(NotificationConsumer& consumer)
std::string data;
std::vector<swss::FieldValueTuple> values;

Port vlan;
Port port;

consumer.pop(op, data, values);

if (&consumer == m_flushNotificationsConsumer)
{
if (op == "ALL")
{
/*
* so far only support flush all the FDB entries
* flush per port and flush per vlan will be added later.
*/
status = sai_fdb_api->flush_fdb_entries(gSwitchId, 0, NULL);
if (status != SAI_STATUS_SUCCESS)
{
Expand All @@ -706,14 +705,22 @@ void FdbOrch::doTask(NotificationConsumer& consumer)
}
else if (op == "PORT")
{
/*place holder for flush port fdb*/
SWSS_LOG_ERROR("Received unsupported flush port fdb request");
if (!m_portsOrch->getPort(data, port))
{
SWSS_LOG_ERROR("could not locate port from data %s", data.c_str());
return;
}
flushFDBEntries(port.m_bridge_port_id, SAI_NULL_OBJECT_ID);
return;
}
else if (op == "VLAN")
{
/*place holder for flush vlan fdb*/
SWSS_LOG_ERROR("Received unsupported flush vlan fdb request");
if (!m_portsOrch->getPort(data, vlan))
{
SWSS_LOG_ERROR("could not locate vlan from data %s", data.c_str());
return;
}
flushFDBEntries(SAI_NULL_OBJECT_ID, vlan.m_vlan_info.vlan_oid);
return;
}
else
Expand Down Expand Up @@ -839,7 +846,9 @@ void FdbOrch::updatePortOperState(const PortOperStateUpdate& update)

// Get BVID of each VLAN that this port is a member of
// and call notifyObserversFDBFlush
for (const auto& vlan_member: p.m_vlan_members)
vlan_members_t vlan_members;
m_portsOrch->getPortVlanMembers(p, vlan_members);
for (const auto& vlan_member: vlan_members)
{
swss::Port vlan;
string vlan_alias = VLAN_PREFIX + to_string(vlan_member.first);
Expand Down
11 changes: 10 additions & 1 deletion orchagent/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class Port
VlanInfo m_vlan_info;
MacAddress m_mac;
sai_object_id_t m_bridge_port_id = 0; // TODO: port could have multiple bridge port IDs
sai_object_id_t m_bridge_port_admin_state = 0; // TODO: port could have multiple bridge port IDs
sai_vlan_id_t m_port_vlan_id = DEFAULT_PORT_VLAN_ID; // Port VLAN ID
sai_object_id_t m_rif_id = 0;
sai_object_id_t m_vr_id = 0;
Expand All @@ -117,7 +118,15 @@ class Port
sai_object_id_t m_tunnel_id = 0;
sai_object_id_t m_ingress_acl_table_group_id = 0;
sai_object_id_t m_egress_acl_table_group_id = 0;
vlan_members_t m_vlan_members;
/* there can be a large number of vlan members
* which will cause performance impact, as
* getPort copies the whole structure.
* Performance issue are seen during mac event
* processing with large number of vlans on a
* port. Large data should not be added to this
* structure.
*/
//vlan_members_t m_vlan_members;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove the commented section. You can mention it in the PR description.

Copy link
Contributor

Choose a reason for hiding this comment

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

done

sai_object_id_t m_parent_port_id = 0;
uint32_t m_dependency_bitmap = 0;
sai_port_oper_status_t m_oper_status = SAI_PORT_OPER_STATUS_UNKNOWN;
Expand Down
Loading