[portsorch] Expose supported FEC modes to STABE_DB and check whether FEC mode is supported before setting it#2333
Merged
liat-grozovik merged 3 commits intosonic-net:masterfrom Jul 24, 2022
Conversation
Collaborator
Author
|
vstest failure is under investigation. |
Collaborator
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
Author
|
@bingwang-ms |
Collaborator
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
5db9249 to
944d3ad
Compare
Collaborator
dgsudharsan
requested changes
Jun 28, 2022
Collaborator
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
dgsudharsan
previously approved these changes
Jul 1, 2022
Collaborator
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
Author
|
None of the failures is caused by the PR itself. Retried |
Collaborator
Author
|
failure is tracked by issue #2365 |
prgeor
reviewed
Jul 5, 2022
|
Azure Pipelines successfully started running 1 pipeline(s). |
…FEC mode is supported before setting it <!-- Please make sure you have read and understood the contribution guildlines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md 1. Make sure your commit includes a signature generted with `git commit -s` 2. Make sure your commit title follows the correct format: [component]: description 3. Make sure your commit message contains enough details about the change and related tests 4. Make sure your pull request adds related reviewers, asignees, labels Please also provide the following information in this pull request: --> **What I did** Expose supported FEC modes to `STATE_DB.PORT_TABLE|<port>.supported_fecs`. The orchagent calls `get_port_attribute` to get attribute `SAI_PORT_ATTR_SUPPORTED_FEC_MODE` during initialization and then records it into internal data. - By default, the supported FEC modes will be returned by SAI and exposed to `STATE_DB`. Eg. `rs,none` means only `rs` and `none` is supported on the port. - The orchagent will check whether the FEC mode is supported on the port before calling the SAI API to set it. - The CLI will check whether the FEC mode is in `supported_fecs` before setting FEC mode on a port to the `CONFIG_DB` - In case the SAI API does not support any FEC mode on the port, `N/A` will be exposed to `STATE_DB` - The orchagent will deny any FEC setting and prints log. - The CLI will deny FEC setting. - In case the SAI API `get_port_attribute` returns `Not implemented` - No check will be performed before setting a FEC mode to SAI on the port. - The CLI will check whether the FEC mode is defined before setting it to `CONFIG_DB`. **Why I did it** It is not supported to set FEC mode on some platforms. To avoid error, we need to expose the supported FEC list. **How I verified it** Manually test and mock test. **Details if related**
dgsudharsan
previously approved these changes
Jul 10, 2022
Collaborator
prgeor
reviewed
Jul 18, 2022
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
prgeor
approved these changes
Jul 21, 2022
dgsudharsan
approved these changes
Jul 21, 2022
stephenxs
added a commit
to stephenxs/sonic-swss
that referenced
this pull request
Jul 27, 2022
…d check whether FEC mode is supported before setting it (sonic-net#2333)" (sonic-net#2396)" This reverts commit 6565b50.
Contributor
|
@stephenxs this change is an empty cherry-pick for 202205. Can you double check? |
Collaborator
Author
Thanks @yxieca. |
stephenxs
added a commit
to stephenxs/sonic-swss
that referenced
this pull request
Aug 4, 2022
…d check whether FEC mode is supported before setting it (sonic-net#2333)" (sonic-net#2396)" This reverts commit 6565b50.
preetham-singh
pushed a commit
to preetham-singh/sonic-swss
that referenced
this pull request
Aug 6, 2022
…FEC mode is supported before setting it (sonic-net#2333) - What I did Expose supported FEC modes to STATE_DB.PORT_TABLE|<port>.supported_fecs. The orchagent calls get_port_attribute to get attribute SAI_PORT_ATTR_SUPPORTED_FEC_MODE during initialization and then records it into internal data. 1. By default, the supported FEC modes will be returned by SAI and exposed to STATE_DB. Eg. rs,none means only rs and none is supported on the port. The orchagent will check whether the FEC mode is supported on the port before calling the SAI API to set it. The CLI will check whether the FEC mode is in supported_fecs before setting FEC mode on a port to the CONFIG_DB 2. In case the SAI API does not support any FEC mode on the port, N/A will be exposed to STATE_DB The orchagent will deny any FEC setting and prints log. The CLI will deny FEC setting. 3. In case the SAI API get_port_attribute returns Not implemented No check will be performed before setting a FEC mode to SAI on the port. The CLI will check whether the FEC mode is defined before setting it to CONFIG_DB. - Why I did it It is not supported to set FEC mode on some platforms. To avoid error, we need to expose the supported FEC list. - How I verified it Manually test and mock test.
preetham-singh
pushed a commit
to preetham-singh/sonic-swss
that referenced
this pull request
Aug 6, 2022
…whether FEC mode is supported before setting it (sonic-net#2333)" (sonic-net#2396) This reverts commit dc8bc1c. *Revert "[portsorch] Expose supported FEC modes to STABE_DB and check whether FEC mode is supported before setting it"
prgeor
pushed a commit
that referenced
this pull request
Aug 8, 2022
…FEC mode is supported before setting it (#2400) * Revert "Revert "[portsorch] Expose supported FEC modes to STABE_DB and check whether FEC mode is supported before setting it (#2333)" (#2396)" This reverts commit 6565b50. * Adjust the prototype of setPortFec Signed-off-by: Stephen Sun <[email protected]>
7 tasks
yxieca
pushed a commit
that referenced
this pull request
Aug 11, 2022
…FEC mode is supported before setting it (#2400) * Revert "Revert "[portsorch] Expose supported FEC modes to STABE_DB and check whether FEC mode is supported before setting it (#2333)" (#2396)" This reverts commit 6565b50. * Adjust the prototype of setPortFec Signed-off-by: Stephen Sun <[email protected]>
Janetxxx
pushed a commit
to Janetxxx/sonic-swss
that referenced
this pull request
Nov 10, 2025
…FEC mode is supported before setting it (sonic-net#2333) - What I did Expose supported FEC modes to STATE_DB.PORT_TABLE|<port>.supported_fecs. The orchagent calls get_port_attribute to get attribute SAI_PORT_ATTR_SUPPORTED_FEC_MODE during initialization and then records it into internal data. 1. By default, the supported FEC modes will be returned by SAI and exposed to STATE_DB. Eg. rs,none means only rs and none is supported on the port. The orchagent will check whether the FEC mode is supported on the port before calling the SAI API to set it. The CLI will check whether the FEC mode is in supported_fecs before setting FEC mode on a port to the CONFIG_DB 2. In case the SAI API does not support any FEC mode on the port, N/A will be exposed to STATE_DB The orchagent will deny any FEC setting and prints log. The CLI will deny FEC setting. 3. In case the SAI API get_port_attribute returns Not implemented No check will be performed before setting a FEC mode to SAI on the port. The CLI will check whether the FEC mode is defined before setting it to CONFIG_DB. - Why I did it It is not supported to set FEC mode on some platforms. To avoid error, we need to expose the supported FEC list. - How I verified it Manually test and mock test.
Janetxxx
pushed a commit
to Janetxxx/sonic-swss
that referenced
this pull request
Nov 10, 2025
…whether FEC mode is supported before setting it (sonic-net#2333)" (sonic-net#2396) This reverts commit dc8bc1c. *Revert "[portsorch] Expose supported FEC modes to STABE_DB and check whether FEC mode is supported before setting it"
Janetxxx
pushed a commit
to Janetxxx/sonic-swss
that referenced
this pull request
Nov 10, 2025
…FEC mode is supported before setting it (sonic-net#2400) * Revert "Revert "[portsorch] Expose supported FEC modes to STABE_DB and check whether FEC mode is supported before setting it (sonic-net#2333)" (sonic-net#2396)" This reverts commit 6565b50. * Adjust the prototype of setPortFec Signed-off-by: Stephen Sun <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Expose supported FEC modes to
STATE_DB.PORT_TABLE|<port>.supported_fecs.The orchagent calls
get_port_attributeto get attributeSAI_PORT_ATTR_SUPPORTED_FEC_MODEduring initialization and then records it into internal data.STATE_DB. Eg.rs,nonemeans onlyrsandnoneis supported on the port.supported_fecsbefore setting FEC mode on a port to theCONFIG_DBN/Awill be exposed toSTATE_DBget_port_attributereturnsNot implementedCONFIG_DB.Why I did it
It is not supported to set FEC mode on some platforms. To avoid error, we need to expose the supported FEC list.
How I verified it
Manually test and mock test.
Details if related