-
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
[orchagent] Put port configuration to APPL_DB according to autoneg mode #1769
Conversation
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.
Looks good to me. @prsunny to review as well.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@jleveque , there is a build failure while downloading swss-common. Tracking it with build team. |
attrs.insert(attrs.end(), autoneg_attrs.begin(), autoneg_attrs.end()); | ||
attrs.insert(attrs.end(), force_attrs.begin(), force_attrs.end()); | ||
} | ||
p.set(key, attrs); |
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.
How is this handled during warmboot?
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.
No special treatment for warmboot
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Hi @prsunny , it seems 2 test cases related to flex counter failed which should not relate to my change. Could you please help re-trigger the test? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@prsunny can you approve the PR so once the tests are passing we can merge? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@prsunny kindly reminder, can you please approve and merge? now that is is passing the tests. |
…de (#1769) *Before puting port related configuration to APPL_DB, check autoneg mode first. If autoneg mode is enabled, "speed" and "interface_type" will not be put into APPL_DB; if autoneg mode is disabled, "adv_speeds" and "adv_interface_types" will not be put into APPL_DB; else all configuration will be put to APPL_DB for backward compatible.
…de (sonic-net#1769) *Before puting port related configuration to APPL_DB, check autoneg mode first. If autoneg mode is enabled, "speed" and "interface_type" will not be put into APPL_DB; if autoneg mode is disabled, "adv_speeds" and "adv_interface_types" will not be put into APPL_DB; else all configuration will be put to APPL_DB for backward compatible.
* Put port operational speed to STATE DB * Remove previous workaround [orchagent] Put port configuration to APPL_DB according to autoneg mode #1769
* Put port operational speed to STATE DB * Remove previous workaround [orchagent] Put port configuration to APPL_DB according to autoneg mode #1769
* Put port operational speed to STATE DB * Remove previous workaround [orchagent] Put port configuration to APPL_DB according to autoneg mode sonic-net#1769
What I did
Before puting port related configuration to APPL_DB, check autoneg mode first. If autoneg mode is enabled, "speed" and "interface_type" will not be put into APPL_DB; if autoneg mode is disabled, "adv_speeds" and "adv_interface_types" will not be put into APPL_DB; else all configuration will be put to APPL_DB for backward compatible.
Why I did it
The field "speed" in PORT_TABLE of APPL_DB has two meanings:
This is all right when SONiC has no auto negotiation feature because the actual speed must equal to the configured speed or the operational status is down. However, with port auto negotiation feature, if autoneg mode is enabled, the actual speed could be a value of adv_speeds which might not equal to field "speed". Now port auto negotiation feature handle it this way:
For case#2, there is an issue. Think about following flow:
Step#3 won't affect the auto negotiation status because the autoneg mode is enabled, force interface type will not be applied to SAI. But it triggers PORT_TABLE change and portsyncd will push all Ethernet0 related configuration to APPL_DB. So, speed of Ethernet0 in "show interface status" changed to 400G.
This PR is to fix the issue.
How I verified it
Manual test
Details if related