-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[FEC] Adding support of override based on attribute query of SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE #2874
Conversation
@prgeor Can you please review? The checkers now pass |
orchagent/portsorch.cpp
Outdated
@@ -2524,6 +2554,18 @@ bool PortsOrch::setGearboxPortAttr(const Port &port, dest_port_type_t port_type, | |||
m_gearboxTable->hset(key, speed_attr, to_string(speed)); | |||
SWSS_LOG_NOTICE("BOX: Updated APPL_DB key:%s %s %d", key.c_str(), speed_attr.c_str(), speed); | |||
} | |||
else if (id == SAI_PORT_ATTR_FEC_MODE && fec_override_sup) |
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.
@dgsudharsan why are we setting this inside gerabox ?
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 FEC attribute setting API after setting for port will call gearbox API if gearbox is present. Hence this needs to be set to be in sync with Port FEC setting.
orchagent/portsorch.cpp
Outdated
attr.id = SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE; | ||
attr.value.booldata = true; | ||
|
||
status = sai_port_api->set_port_attribute(dest_port_id, &attr); |
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.
@dgsudharsan i think we should do fec override if AN is configured.
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.
@prgeor Both are independent attributes. SAI headers doesn't mandate that FEC override should need to be set only on AN. To avoid complexity in orchagent, both are set independently and vendor SAI will handle them in any order
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.
@dgsudharsan can we have a one API setPortFecOverride() and call this instead of repeating the code?
Done |
Depends on sonic-net/sonic-sairedis#1271
What I did
Providing support of FEC override functionality existing today through attribute query of SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE
Why I did it
Today when FEC is enabled by user in SONiC it should explicitly override any auto negotiated values. However when the support SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE exists in vendor SAI, it should be queried and used to get this functionality.
How I verified it
Adding UT to verify it.
Details if related