Skip to content

[code sync] Merge code from sonic-net/sonic-swss:202605 to 202606 - #294

Merged
mssonicbld merged 2 commits into
Azure:202606from
mssonicbld:sonicbld/202606-merge
Sep 3, 2026
Merged

mssonicbld merged 2 commits into
Azure:202606from
mssonicbld:sonicbld/202606-merge

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator
* 33f9ada4 - (origin/202605) orchagent: add tx_precoding / rx_precoding support using SAI (#4861) (2026-09-03) [mssonicbld]<br>```

mssonicbld and others added 2 commits September 3, 2026 11:44
**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

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

@mssonicbld
mssonicbld merged commit 9c3360d into Azure:202606 Sep 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant