[code sync] Merge code from sonic-net/sonic-swss:202605 to 202606 - #294
Merged
Merged
Conversation
mssonicbld
commented
Sep 3, 2026
Collaborator
**What I did**
Add `tx_precoding` and `rx_precoding` as per-lane SerDes attributes parsed from `APP_DB:PORT_TABLE` and programmed via `SAI_PORT_SERDES_ATTR_{TX,RX}_PRECODING`:
- `orchagent/port/portschema.h` — `PORT_TX_PRECODING` / `PORT_RX_PRECODING` field names
- `orchagent/port/portcnt.h` — storage + `is_set` flag on `PortSerdes_t`
- `orchagent/port/porthlpr.cpp` — parser branches in `parsePortConfig` + template instantiations of `parsePortSerdes`
- `orchagent/portsorch.cpp::getPortSerdesAttr` — emits the two SAI attrs into the attribute map consumed by `create_port_serdes()`
- `tests/mock_tests/portsorch_ut.cpp` — extends `PortAdvancedConfig` with asymmetric per-lane values and asserts SAI attr mapping
**Work item tracking**
- Microsoft ADO **(number only)**:
**How I did it**
1. Defined the new `tx_precoding` / `rx_precoding` field names in `portschema.h`.
2. Added storage for the per-lane values and an `is_set` flag on `PortSerdes_t` in `portcnt.h`, so a value is only programmed when explicitly configured.
3. Added parser branches in `porthlpr.cpp::parsePortConfig` and instantiated `parsePortSerdes` for the new fields, so the comma-separated per-lane values from `APP_DB:PORT_TABLE` are parsed into the `PortSerdes_t` structure.
4. In `portsorch.cpp::getPortSerdesAttr`, emitted `SAI_PORT_SERDES_ATTR_TX_PRECODING` / `SAI_PORT_SERDES_ATTR_RX_PRECODING` into the attribute map consumed by `create_port_serdes()`, gated on the corresponding `is_set` flag.
**How to verify it**
- Unit test: `tests/mock_tests/portsorch_ut.cpp` `PortAdvancedConfig` was extended with asymmetric per-lane `tx_precoding` / `rx_precoding` values and asserts that the correct `SAI_PORT_SERDES_ATTR_{TX,RX}_PRECODING` values are passed to SAI. Run the mock tests.
- Manual: set `tx_precoding` / `rx_precoding` (comma-separated per-lane values) on a port in `APP_DB:PORT_TABLE`, then confirm via the SAI/syncd logs that the corresponding `SAI_PORT_SERDES_ATTR_{TX,RX}_PRECODING` attributes are created with the expected per-lane values.
**Description for the changelog**
orchagent: add per-lane tx_precoding / rx_precoding SerDes support programmed via SAI.
Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
Author
|
/azp run |
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. |
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.