Skip to content

feat(lldp-mib): add SNMP subagent handlers for lldpPortConfigTable, lldpStats scalars, lldpStatsTxPortTable, lldpStatsRxPortTable#378

Closed
shongal-uai wants to merge 2 commits into
sonic-net:202511from
upscale-ai-network:shongal/upsw-lldp-gap-005-lldp-mib-handlers
Closed

feat(lldp-mib): add SNMP subagent handlers for lldpPortConfigTable, lldpStats scalars, lldpStatsTxPortTable, lldpStatsRxPortTable#378
shongal-uai wants to merge 2 commits into
sonic-net:202511from
upscale-ai-network:shongal/upsw-lldp-gap-005-lldp-mib-handlers

Conversation

@shongal-uai

@shongal-uai shongal-uai commented Jun 1, 2026

Copy link
Copy Markdown

Problem

In the current `sonic_ax_impl/mibs/ieee802_1ab.py` implementation, the following LLDP-MIB subtrees have no registered handler and return empty responses:

  • `lldpPortConfigTable` (`.1.0.8802.1.1.2.1.1.7`) — per-port admin status configuration
  • `lldpStatistics` scalars (`.1.0.8802.1.1.2.1.2.1–5`) — remote table change counters and last-change time
  • `lldpStatsTxPortTable` (`.1.0.8802.1.1.2.1.2.6`) — per-port TX statistics
  • `lldpStatsRxPortTable` (`.1.0.8802.1.1.2.1.2.7`) — per-port RX statistics

Verified on `upscaleai-202511` (Mellanox SN5610, 130 ports): `snmpwalk 1.0.8802.1.1.2.1.1.7` and `snmpwalk 1.0.8802.1.1.2.1.2` return no data.

Fix

`src/sonic_ax_impl/mibs/ieee802_1ab.py`

Adds four new handler classes:

Class MIB table OID root Data source
`LLDPPortConfigTable` `lldpPortConfigTable` `1.0.8802.1.1.2.1.1.7` `APPL_DB LLDP_ENTRY_TABLE` (per-port admin status)
`LLDPStatisticsGroup` `lldpStatistics` scalars `1.0.8802.1.1.2.1.2.1–5` `APPL_DB LLDP_LOC_COUNTERS`
`LLDPStatsTxPortTable` `lldpStatsTxPortTable` `1.0.8802.1.1.2.1.2.6` `APPL_DB LLDP_LOC_COUNTERS` (per-port TX frames)
`LLDPStatsRxPortTable` `lldpStatsRxPortTable` `1.0.8802.1.1.2.1.2.7` `APPL_DB LLDP_LOC_COUNTERS` (per-port RX frames, discards, errors, TLVs, ageouts)

`src/sonic_ax_impl/main.py`

Registers the four new handler classes in the MIB instance map.

Test evidence

fanout7 — upscaleai-202511 (Mellanox SN5610, 130 ports)

Without patch (base image):

```
snmpwalk -v2c -c public 1.0.8802.1.1.2.1.1.7 # endOfMibView
snmpwalk -v2c -c public 1.0.8802.1.1.2.1.2 # endOfMibView
```

Automated test result: 15 tests xfail (UPSW-LLDP-GAP-005)

With patch applied:

```
snmpwalk -v2c -c public 1.0.8802.1.1.2.1.1.7 # → 130 rows (lldpPortConfigAdminStatus per port)
snmpwalk -v2c -c public 1.0.8802.1.1.2.1.2.1 # → Timeticks scalar
snmpwalk -v2c -c public 1.0.8802.1.1.2.1.2.6 # → 130 rows (TX frames per port)
snmpwalk -v2c -c public 1.0.8802.1.1.2.1.2.7 # → 780 rows (6 RX columns × 130 ports)
```

Automated test result: 15 xpassed, 0 failed

Note: `lldpStatistics` scalars (`lldpStatsRemTablesInserts`, `Deletes`, `Drops`, `Ageouts`) are also used as varbinds in `lldpRemTablesChange` SNMP trap notifications — the notification implementation (upscale-ai-network/ucli#351) reads these counters from `LLDP_LOC_COUNTERS` and includes them in each trap PDU.

Data availability note

`lldpPortConfigTable` reads admin status from `APPL_DB LLDP_ENTRY_TABLE` (present on any SONiC build with lldpd running). `lldpStats*` counters read from `APPL_DB LLDP_LOC_COUNTERS` (written by lldpd-syncd). Both sources are present on standard SONiC builds.

References

  • Tracked in: UPSW-LLDP-GAP-005
  • SNMP test framework: upscale-ai-network/ucli#340 (workaround patches), upscale-ai-network/ucli#351 (lldpRemTablesChange notifications that use lldpStatistics counters as varbinds)
  • Test file: `NetworkManagementStack/snmp_tests/tests/ieee8021ab_lldp_mib/test_ieee8021ab_lldp_stats_config.py`

Made with Cursor

@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@shongal-uai

Copy link
Copy Markdown
Author

Closing for now — will revisit when upstream fix is prioritized (UPSW-LLDP-GAP-005).

@shongal-uai shongal-uai closed this Jun 1, 2026
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.

2 participants