-
Notifications
You must be signed in to change notification settings - Fork 522
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
[orchagent]: Support LAG/VLAN with SAI 1.0 #250
Conversation
orchagent/portsorch.cpp
Outdated
@@ -965,6 +965,7 @@ bool PortsOrch::initializePort(Port &p) | |||
#endif | |||
|
|||
/* Set default port admin status to DOWN */ | |||
/* XXX: Do we need this? The default port admin status is false */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XXX [](start = 7, length = 3)
XXX [](start = 7, length = 3)
What is XXX? Also other places. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://softwareengineering.stackexchange.com/questions/65467/what-does-xxx-mean-in-a-comment
In reply to: 126577048 [](ancestors = 126577048)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comments
@@ -365,8 +360,11 @@ void IntfsOrch::addIp2MeRoute(const IpPrefix &ip_prefix) | |||
attr.value.s32 = SAI_PACKET_ACTION_FORWARD; | |||
attrs.push_back(attr); | |||
|
|||
Port cpu_port; | |||
gPortsOrch->getCpuPort(cpu_port); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getCpuPort [](start = 16, length = 10)
check return value #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the function is void. if CPU port is not get successfully, portsOrch class is not initialized and orchagent will throw exception.
In reply to: 126777033 [](ancestors = 126777033)
orchagent/port.h
Outdated
@@ -21,6 +21,8 @@ class Port | |||
PHY, | |||
MGMT, | |||
LOOPBACK, | |||
DOT1D_BRIDGE, // XXX: Not supported right now | |||
DOT1Q_BRIDGE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOT1Q_BRIDGE [](start = 8, length = 12)
DOT1Q_BRIDGE [](start = 8, length = 12)
It is really confusing that DOT1Q bridge is a port. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orchagent/port.h
Outdated
@@ -55,6 +57,8 @@ class Port | |||
int m_ifindex = 0; | |||
sai_object_id_t m_port_id = 0; | |||
sai_object_id_t m_vlan_oid = 0; | |||
sai_object_id_t m_bridge_id = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_bridge_id [](start = 24, length = 11)
m_bridge_id [](start = 24, length = 11)
Suggest abstract bridge port as standalone class:
BridgePort := (Port, VLAN)
#Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not exactly, there is .1q bridge port which is 1:1 mapping to the physical port/lag. there is .1d bridge which is (port, vlan) tuple.
In reply to: 126781483 [](ancestors = 126781483)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so a port could have multiple bridge port IDs as well as multiple VLAN IDs.
In reply to: 126867393 [](ancestors = 126867393,126781483)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orchagent/portsorch.cpp
Outdated
bridge_attr.value.objlist.count = bp_list.size(); | ||
m_default1QBridge = Port("1QBridge", Port::DOT1Q_BRIDGE); | ||
m_default1QBridge.m_bridge_id = attrs[0].value.oid; | ||
m_portList[m_default1QBridge.m_alias] = m_default1QBridge; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why treat default bridge as a port? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orchagent/portsorch.cpp
Outdated
m_defaultVlan = Port("Vlan1", Port::VLAN); | ||
m_defaultVlan.m_vlan_oid = attrs[1].value.oid; | ||
m_defaultVlan.m_vlan_id = 1; | ||
m_portList[m_defaultVlan.m_alias] = m_defaultVlan; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default vlan should not be considered as a port. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default bridge and default vlan should be own their own, should not be in port class.
1. Change the initialization order After switch initialization, remove all VLAN members from the default VLAN and all bridge ports from the default .1Q bridge. Later, router interfaces and LAG members could be created directly upon the raw ports. 2. VLAN members are created by first creating the corresponding .1Q bridge ports and then using the bridge ports to create VLAN members. 3. Remove bimap data structure as bridge port ID is not one to one mapping to port ID. Further work is needed to support multiple bridge port per port scenarios. 4. Fix ECMP group member removal issue. Use set to store member IDs per next hop group.
updated #Closed |
void PortsOrch::setPort(string alias, Port p) | ||
{ | ||
m_portList[alias] = p; | ||
} | ||
|
||
sai_object_id_t PortsOrch::getCpuPort() | ||
void PortsOrch::getCpuPort(Port &port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getCpuPort [](start = 16, length = 10)
get*Port*
functions could just return const Port&. It will save one object copy. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i want to align with the rest of the getPort functions as the same format.
In reply to: 127010996 [](ancestors = 127010996)
* msft_github/master: [swssconfig]: Update Mellanox buffer profile template to work with an incomplete minigraph (sonic-net#332) [portsyncd]: Remove deprecated sample file port_config.ini (sonic-net#330) [portsyncd]: Remove unused LAG related tables (sonic-net#329) [tunnelorch]: Minor comment update [aclorch]: Fix crashing when removing ACL table that has associated ACL rules (sonic-net#322) [pfcwdorch]: Initial support (sonic-net#317) [swssconfig]: Update buffer profile template to work with CONF_DB (sonic-net#319) [aclorch]: Refactor doAclTableTask and doAclRuleTask (sonic-net#318) [swssconfig]: Add Mellanox PG buffer profiles based on port configuration (sonic-net#301) [switchorch]: Add SwitchOrch to deal with switch attributes changes (sonic-net#314) [github]: Update pull request template comments [github]: Add pull request template (sonic-net#313) Optimize orch performance by pops() (sonic-net#312) Refactor TableConsumable (sonic-net#291) [buffer]: Remove failed tasks from the m_toSync queue (sonic-net#308) [qos]: Remove failed tasks from the m_toSync queue (sonic-net#306) [aclorch]: Add match TC support for ACL rule (sonic-net#302) [orchagent]: Set log recording directory before enable recording (sonic-net#300) [orchagent]: Remove duplicate SwSS recording file set code (sonic-net#298) Fix port speed validation (sonic-net#288) [fdborch]: Fix FdbOrch code to work upon SAI v1.0 (sonic-net#284) [config]: Add BGPv6 COPP in 00-copp.config.json (sonic-net#281) [aclorch]: Fix match DSCP attribute value mask length to 0x3F [mirrororch]: Set the VLAN header only when the packet is mirrored to a VLAN (sonic-net#282) [swssconfig]: Log errors instead of throwing exception when file open fails (sonic-net#277) [aclorch]: Remove wrong table attribute (sonic-net#280) [aclorch]: Fix remove_acl_counter function to remove the counter (sonic-net#274) [copporch]: Add SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY support and refactor code (sonic-net#270) [mirrororch]: Add SAI_MIRROR_SESSION_ATTR_VLAN_HEADER_VALID (sonic-net#269) [bufferorch]: Add SAI_BUFFER_PROFILE_THRESHOLD_MODE_* (sonic-net#271) [aclorch]: Minor logs fix [orchagent]: Update recording file name to swss.rec [Make]: Fix type conversions and add more warnings (sonic-net#267) [aclorch]: Fix ACL table group attribute type issue (sonic-net#268) [portsorch]: Update default bridge port removal logic (sonic-net#263) [routeorch]: Need to set drop route next hop ID to NULL (sonic-net#261) [portsorch]: Remove SAI_PORT_ATTR_BIND_MODE (sonic-net#262) [portsorch]: Create a bridge port with admin status set to UP (sonic-net#259) Revert "[portsorch]: Set port bind mode after adding VLAN member" (sonic-net#258) [orchagent]: Temporarily fix pre-allocated bridge_port_list size (sonic-net#256) [saihelper]: Create initSaiRedis function and put related code inside it (sonic-net#254) [portsorch]: Set port bind mode after adding VLAN member (sonic-net#251) [orchagent]: Create the switch with source MAC address (sonic-net#253) [copporch]: Add UDLD entry in COPP (sonic-net#252) [orchagent]: Support LAG/VLAN with SAI 1.0 (sonic-net#250) use vlan oid instead of vlan id (sonic-net#247) Fix getBridgePort: handle non existing bridge_port_id Integration for SAI v1.0.1 Remove vlan member before removing bridge port Fix SAI functional calls Fix: store bridge ports at initialization Refactor vector<attr> Resolve review comments Implement bridge port in portsorch Fix initSystemAclTable: bind system ACL to each port Refactor: port owns acl table group Resolve code review comments Resolve code review comments Adpat SAIv1.0 headers and fix compilation errors
The title shall be : Table instead of Rule ID Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
The title shall be : Table instead of Rule ID Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
After switch initialization, remove all VLAN members from the default
VLAN and all bridge ports from the default .1Q bridge. Later, router
interfaces and LAG members could be created directly upon the raw ports.
ports and then using the bridge ports to create VLAN members.
to port ID. Further work is needed to support multiple bridge port per
port scenarios.
next hop group.