Skip to content
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

Merged
merged 5 commits into from
Aug 15, 2023

Conversation

dgsudharsan
Copy link
Collaborator

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

@dgsudharsan dgsudharsan requested a review from prsunny as a code owner August 4, 2023 02:06
@dgsudharsan dgsudharsan requested a review from prgeor August 4, 2023 02:06
@dgsudharsan dgsudharsan changed the title [FEC] Adding support of override through attribute query [FEC] Adding support of override based on attribute query of SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE Aug 5, 2023
@dgsudharsan
Copy link
Collaborator Author

@prgeor Can you please review? The checkers now pass

@@ -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)
Copy link
Contributor

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 ?

Copy link
Collaborator Author

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.

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);
Copy link
Contributor

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.

Copy link
Collaborator Author

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

@dgsudharsan dgsudharsan requested a review from prgeor August 14, 2023 21:40
Copy link
Contributor

@prgeor prgeor left a 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?

@dgsudharsan
Copy link
Collaborator Author

@dgsudharsan can we have a one API setPortFecOverride() and call this instead of repeating the code?

Done

@dgsudharsan dgsudharsan requested a review from prgeor August 15, 2023 00:58
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants