C-CMIS PM API and memory map support - #719
Conversation
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Nikhil Kanchi <nkanchi@nexthop.ai>
b9cf5ea to
08d58a9
Compare
|
/azp run |
|
Commenter does not have sufficient privileges for PR 719 in repo sonic-net/sonic-platform-common |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks! ---Powered by SONiC BuildBot
|
| (byte 142, bit 4). For modules complying with CMIS 5.3 or | ||
| later, that bit is used for checking C-CMIS support. | ||
| ''' | ||
| cmis_major = self.xcvr_eeprom.read(consts.CMIS_MAJOR_REVISION) |
There was a problem hiding this comment.
Why not just use get_cmis_rev?
There was a problem hiding this comment.
Pull request overview
This PR extends the SONiC CMIS/C-CMIS transceiver support by adding missing C-CMIS 1.4 performance-monitoring (PM) memory-map pages/fields and wiring them into the C-CMIS API so callers can retrieve additional coherent and host-interface PM counters, with Page 42h-based gating for newly introduced optional Page 35h monitors.
Changes:
- Add new CMIS page implementations for C-CMIS Page 3Ah (host-interface PM) and Page 42h (PM advertisement bits) and register them in the C-CMIS memory map.
- Extend Page 35h with additional PM fields, and gate only the newly added Page 35h monitor groups behind Page 42h “implemented” advertisement bits.
- Expand
CCmisApi.get_pm_all()/get_transceiver_pm()to include Page 3Ah host counters and expose raw Page 34h counters alongside derived ratios; update unit tests accordingly.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sonic_xcvr/test_cmis.py | Adds CMIS 5.3+ coherent-pages advertisement test coverage for is_coherent_module(). |
| tests/sonic_xcvr/test_ccmis.py | Adds/updates tests for new PM pages, gating behavior, and raw counter exposure. |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/page42.py | Introduces Page 42h PM advertisement bit memory map. |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/page3a.py | Introduces Page 3Ah host-interface PM counter memory map. |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/page35.py | Adds the missing C-CMIS 1.4 Page 35h PM fields. |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/page01.py | Adds the coherent-pages support advertisement bit definition. |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/init.py | Exports the new Page 3Ah and Page 42h classes. |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/c_cmis.py | Wires new pages into the C-CMIS memory map registry. |
| sonic_platform_base/sonic_xcvr/fields/consts.py | Adds new field constants for Page 35h additions, Page 3Ah counters, and Page 42h advertisement bits. |
| sonic_platform_base/sonic_xcvr/api/xcvr_api.py | Documents additional PM keys surfaced via transceiver PM APIs. |
| sonic_platform_base/sonic_xcvr/api/public/cmis.py | Updates is_coherent_module() to use CMIS 5.3+ coherent-pages advertisement bit when available. |
| sonic_platform_base/sonic_xcvr/api/public/c_cmis.py | Adds Page 42h-gated logic for new Page 35h monitors and adds Page 3Ah/34h raw counters to PM output. |
| CMIS 5.3 introduced an C-CMIS advertisement bit on Page 01h | ||
| (byte 142, bit 4). For modules complying with CMIS 5.3 or | ||
| later, that bit is used for checking C-CMIS support. |
| RX_SOPROC_IMPL = "rxSopcrImpl" | ||
| RX_AVG_SOPROC_PM_IMPL = "rxAvgSopcrPmImpl" | ||
| RX_MIN_SOPROC_PM_IMPL = "rxMinSopcrPmImpl" | ||
| RX_MAX_SOPROC_PM_IMPL = "rxMaxSopcrPmImpl" |
| RX_MAX_SNR_MARGIN_PM = "rxMaxSNRMarginPm" | ||
| RX_AVG_QFACTOR_PM = "rxAvgQFactorPm" | ||
| RX_MIN_QFACTOR_PM = "rxMinQFactorPm" | ||
| RX_MAX_PM_QFACTOR = "rxMaxPmQFactor" |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
@nkanchi-nexthop you need to sign the DCO agreement for checker to pass |
Signed-off-by: Nikhil Kanchi <nkanchi@nexthop.ai>
ab75e03 to
516b88f
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Description
3Ahsupport and completes the missing Page35hfields following C-CMIS 1.4.fields/consts.py, a newpage3a.pymemory map page, and wires it into the page registry.42h"Performance Monitoring Advertisement" memory map page and constants, and wires it intoCCmisApi.get_pm_all()/get_transceiver_pm()so the newly-added Page35hmonitors are only read when the module advertises them as implemented.3Ahhost-interface PM fields.34hraw counters are used to derive PM fields that populate the dict. Now added the raw counters from34hinto the dict as well.Motivation and Context
34hand35hmonitors as optional and gates them behind Page42hadvertisement bits and the original Page34h/35hfields are left ungated since existing consumers depend on those keys always being populated.35hneed the new advertisement check.3Ahcounters have no corresponding Page42hadvertisement in the spec, so they're always read.How Has This Been Tested?
tests/sonic_xcvr/test_ccmis.py. Verified each new register's byte offset, size, signedness, and scale factor against the corresponding tables (Table 15, Table 18) in C-CMIS 1.4.