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

[portsorch] Expose supported FEC modes to STABE_DB and check whether FEC mode is supported before setting it #2333

Merged
merged 3 commits into from
Jul 24, 2022

Commits on Jul 8, 2022

  1. [portsorch] Expose supported FEC modes to STABE_DB and check whether …

    …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**
    stephenxs committed Jul 8, 2022
    Configuration menu
    Copy the full SHA
    2398069 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2022

  1. Add comments

    Signed-off-by: Stephen Sun <[email protected]>
    stephenxs committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    723b5bd View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2022

  1. Simplify the comment

    Signed-off-by: Stephen Sun <[email protected]>
    stephenxs committed Jul 20, 2022
    Configuration menu
    Copy the full SHA
    8e41b57 View commit details
    Browse the repository at this point in the history