Skip to content

Comments

[202503] Add fec: rs to port config for ports with >=50G per lane#2007

Open
sdszhang wants to merge 1 commit intoAzure:202503from
sdszhang:fec_rs_202503
Open

[202503] Add fec: rs to port config for ports with >=50G per lane#2007
sdszhang wants to merge 1 commit intoAzure:202503from
sdszhang:fec_rs_202503

Conversation

@sdszhang
Copy link

cherry-pick #1950 to 202503.

Why I did it

Ports with lane speed >=50G use PAM4 modulation and should indicate "fec": "rs" in the port config.

Work item tracking

How I did it

Check the lane speed and add "fec": "rs" for lanes with speed at least 50G.

How to verify it

sonic-cfggen -k <device-name> --print-data | grep Ethernet0 -C 10 Make sure that fec rs is there by default if it's a PAM4 speed. Otherwise don’t insert anything To verify whether “fec”: “rs” is only being added for lane speeds above 50G, we used these 3 test inputs and show their respective outputs. Test Input 1:

        "Ethernet0": {
            "autoneg": "off",
            "default_brkout_mode": "1x800G"
        },

Should have fec because the lane speed is greater than 50G. Output:

        "Ethernet0": {
            "alias": "Port1",
            "lanes": "9,10,11,12,13,14,15,16",
            "speed": "800000",
            "index": "1",
            "subport": "0",
            "fec": "rs",
            "autoneg": "off"
        },

Test Input 2:

        "Ethernet0": {
            "autoneg": "off",
            "default_brkout_mode": "4x25G"
        },

Should not have fec because the lane speed is less than 50G. Output:

        "Ethernet0": {
            "alias": "Port1/1",
            "lanes": "9,10",
            "speed": "25000",
            "index": "1",
            "subport": "1",
            "autoneg": "off"
        },

Test Input 3:

        "Ethernet0": {
            "autoneg": "off",
            "default_brkout_mode": "8x50G"
        },

Should have fec because lane speed is 50G. Output:

        "Ethernet0": {
            "alias": "Port1/1",
            "lanes": "9",
            "speed": "50000",
            "index": "1",
            "subport": "1",
            "fec": "rs",
            "autoneg": "off"
        }

Which release branch to backport (provide reason below if selected)

  • 202205
  • 202211
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Tested branch (Please provide the tested image version)

  • [ ]
  • [ ]

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Why I did it
Ports with lane speed >=50G use PAM4 modulation and should indicate
"fec": "rs" in the port config.

This fixes issue Enhancement:FEC not configured for PAM4 speeds #23561


#### Why I did it

Ports with lane speed >=50G use PAM4 modulation and should indicate
"fec": "rs" in the port config. Without this, the FEC configuration is
missing for PAM4 speeds, which can lead to link stability issues.

##### Work item tracking
- Microsoft ADO **(number only)**:

#### How I did it
Modified `portconfig.py` to automatically set `"fec": "rs"` for ports
where the lane speed is >=50G (PAM4 modulation). Updated the logic to
detect lane speed based on port speed and number of lanes, and apply the
appropriate FEC configuration.

#### How to verify it
1. Generate port configuration for platforms with ports using >=50G per
lane (e.g., 400G ports with 8 lanes, 200G ports with 4 lanes)
2. Verify that the generated config includes `"fec": "rs"` for these
ports
3. Run the updated unit tests: `test_cfggen_platformJson.py`

#### Which release branch to backport (provide reason below if selected)

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211

#### Tested branch (Please provide the tested image version)
- [x] 202412 branch 

#### Description for the changelog
Add automatic FEC RS configuration for ports with lane speed >=50G (PAM4
modulation)

<!--
Ensure to add label/tag for the feature raised. example - PR#2174 under
sonic-utilities repo. where, Generic Config and Update feature has been
labelled as GCU.
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on
https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
@sdszhang
Copy link
Author

sdszhang commented Feb 21, 2026

original PR #1950 and
sonic-net/sonic-buildimage#23978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants