Skip to content

[FEC] Design for auto-fec #1416

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

Merged
merged 13 commits into from
Sep 27, 2023
Merged

Conversation

dgsudharsan
Copy link
Contributor

@dgsudharsan dgsudharsan commented Jul 6, 2023

This HLD introduces design for auto fec. This document tries to bring in a deterministic approach when FEC and autoneg are configured together which is currently left to vendor implementation.

Repo PR title State
sonic-swss [FEC]Auto FEC initial changes(sonic-net/sonic-swss#2874) GitHub issue/pull request detail
sonic-sairedis [FEC]Auto FEC initial changes(sonic-net/sonic-sairedis#1271) GitHub issue/pull request detail
sonic-swss [FEC]Auto FEC initial changes(sonic-net/sonic-swss#2893) GitHub issue/pull request detail
sonic-utilities [portconfig]Auto FEC initial changes(sonic-net/sonic-utilities#2965 ) GitHub issue/pull request detail
sonic-buildimage [yang] Update sonic-port yang model to support auto FEC (sonic-net/sonic-buildimage#16389) GitHub issue/pull request detail

@dgsudharsan
Copy link
Contributor Author

@prgeor @ridahanif96 Please review this HLD

@dgsudharsan
Copy link
Contributor Author

@venkatmahalingam @ridahanif96 @madhupalu @prgeor Can you please review and sign off?

@dgsudharsan
Copy link
Contributor Author

@venkatmahalingam @prgeor @ridahanif96 @madhupalu Gentle reminder to review and signoff the HLD

@prgeor
Copy link
Contributor

prgeor commented Sep 11, 2023

@dgsudharsan can you attach the code PRs in the description. @yutongzhang-microsoft FYI

### Requirements

Primary requirements for configuring FEC are
- Honor the backward compatibility.
Copy link
Contributor

Choose a reason for hiding this comment

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

@dgsudharsan can you provide more context on the backward compatibility

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Backward compatibility means if an image upgrade is done from an image without the feature to image with the feature, there should be no issues. E.g a port with 'rs' fec and AN enabled should work the same before and after the upgrade to image with the feature.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dgsudharsan thanks. can you capture this in the doc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

/**
* @brief Operational FEC mode
*
* If port is down, the returned value should be zero.
Copy link
Contributor

Choose a reason for hiding this comment

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

@dgsudharsan return value zero or none?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated from latest SAI headers

| 2 | False | False | auto | CLI will throw error. No FEC attributes will be set |
| 3 | False | False | N/A | No FEC attributes will be set |
| 4 | False | True | none/rs/fc | SAI_PORT_ATTR_FEC_MODE=none/rs/fc. Behavior is undeterministic when AN is enabled and user has configured FEC |
| 5 | False | True | auto | No FEC attributes will be set |
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 not throw the error if the platform does not support auto?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

| 6 | False | True | N/A | No FEC attributes will be set |
| 7 | True | True | none/rs/fc | SAI_PORT_ATTR_FEC_MODE=none/rs/fc SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE=True |
| 8 | True | True | auto | SAI_PORT_ATTR_FEC_MODE=none, SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE=False |
| 9 | True | True | N/A | SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE will not be set |
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 not set override = False. What is the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the case when there is no fec config. N/A means not available. FEC override will be set only when FEC is configured.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dgsudharsan FEC override = False or FEC override not set aren't the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FEC override attribute will be set only in the flow of setting FEC. When FEC itself is not set there will be no override attribute that needs to be programmed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In addition by default the attribute is false, so if not set the default value expected from SAI is false. However the table is to capture what is programmed from orchagent perspective on specific combinations

@dgsudharsan dgsudharsan requested a review from prgeor September 12, 2023 03:13
| 6 | False | True | N/A | No FEC attributes will be set |
| 7 | True | True | none/rs/fc | SAI_PORT_ATTR_FEC_MODE=none/rs/fc SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE=True |
| 8 | True | True | auto | SAI_PORT_ATTR_FEC_MODE=none, SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE=False |
| 9 | True | True | N/A | SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE will not be set |
Copy link
Contributor

Choose a reason for hiding this comment

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

@dgsudharsan FEC override = False or FEC override not set aren't the same?

| 8 | True | True | auto | SAI_PORT_ATTR_FEC_MODE=none, SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE=False |
| 9 | True | True | N/A | SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE will not be set |
| 10 | True | False | None/rs/fc | SAI_PORT_ATTR_FEC_MODE=none/rs/fc |
| 11 | True | False | auto | SAI_PORT_ATTR_FEC_MODE=none, SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE=False. However the auto will take effect only when AN is enabled and until then the mode will be none. |
Copy link
Contributor

Choose a reason for hiding this comment

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

@dgsudharsan ok. please add notice log


### Restrictions/Limitations

Since previously the behavior of FEC with autoneg is undefined, if a vendor always gives precedence for auto negotiated FEC over user configured FEC, implementing the new attribute may lead to backward incompatibility issues when SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE is implemented. Since orchagent will always set SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE to true when FEC is explicitly configured and the attribute is supported by SAI, there will be difference in behavior before and after upgrade.
Copy link
Contributor

Choose a reason for hiding this comment

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

SAI_PORT_ATTR_AUTO_NEG_FEC_MODE_OVERRIDE support by the platform itself means that the platform is going to OVERRIDE its existing behavior. isn't it? If so, the difference in behavior is expected...i mean it will be a breaking change though...If the platform choose to keep the original behavior, then it means the platform is not supporting the override SAI attribute in which case why support override attribute?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there is difference in behavior, it should be also made backward compatible through db_migrator. It is upto the vendors to decide whether they want to support new attribute and introduce db_migrator if they need it for solving the backward incompatibility or avoid introducing the attribute altogether.

@dgsudharsan dgsudharsan requested a review from prgeor September 25, 2023 17:53
@liat-grozovik liat-grozovik merged commit 5cfdfbb into sonic-net:master Sep 27, 2023
prsunny pushed a commit to sonic-net/sonic-swss that referenced this pull request Oct 5, 2023
* [FEC]Auto FEC initial changes
Initial Changes to support Auto FEC feature. Added support for mode "auto" in FEC

Why I did it
To implement auto FEC feature HLD: sonic-net/SONiC#1416
@skg-net
Copy link
Member

skg-net commented Feb 6, 2024

@dgsudharsan Can you please update the Quality Metric (Alpha/Beta/GA) for the feature either in this PR comments or in HLD itself based on https://github.com/sonic-net/SONiC/blob/master/doc/SONiC%20feature%20quality%20definition.md
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants