Skip to content

CP-312083: Implement API for exposing received LLDP TLVs - #7231

Open
changlei-li wants to merge 4 commits into
xapi-project:feature/lldpfrom
changlei-li:private/changleli/lldp-neighbors
Open

CP-312083: Implement API for exposing received LLDP TLVs#7231
changlei-li wants to merge 4 commits into
xapi-project:feature/lldpfrom
changlei-li:private/changleli/lldp-neighbors

Conversation

@changlei-li

@changlei-li changlei-li commented Aug 18, 2026

Copy link
Copy Markdown
Member

PIF_metrics.lldp_neighbor, Map (String, String), the received LLDP TLVs from the corresponding PIF

Example:
“state”: “enabled”, “system_name”: “EU1-ESWA04-7”, “port_id”: “ifname Eth1/8/3”, “port_description”: “genuk-37-13-nap/eth2_(nsec)”

Add a DynamicRO map(string, string) field that exposes the effective
LLDP state (enabled/disabled/blocked) and the received neighbour TLVs
(system_name, port_id, port_description) of the physical NIC. Pass it
at the PIF_metrics create sites, show it via the xe CLI, and document
the field in the LLDP design doc.

Signed-off-by: Changlei Li <changlei.li@citrix.com>
Add lldp_rx (LLDP state plus neighbour fields) to the shared network
stats. networkd parses `lldpcli -f json0 show neighbors` for the
neighbour and `show interfaces` for the state (rx-and-tx is Enabled,
otherwise Blocked when the driver is in the blocklist, else Disabled),
and records both in /dev/shm/network_stats.

Signed-off-by: Changlei Li <changlei.li@citrix.com>
@changlei-li
changlei-li marked this pull request as draft August 18, 2026 09:42
Cover Lldp.parse_neighbors, parse_enabled_interfaces and state_of.

Signed-off-by: Changlei Li <changlei.li@citrix.com>
@changlei-li
changlei-li force-pushed the private/changleli/lldp-neighbors branch from 1192a79 to 861910e Compare August 18, 2026 09:48
@changlei-li
changlei-li marked this pull request as ready for review August 19, 2026 03:00
@changlei-li

Copy link
Copy Markdown
Member Author

self test:

[root@nkg-dt16 ~]# xe pif-list params=device,lldp-mode,lldp-neighbor,VLAN,physical
device ( RO)           : eno8303
         physical ( RO): true
             VLAN ( RO): -1
        lldp-mode ( RO): inherited
    lldp-neighbor (MRO): state: blocked


device ( RO)           : eno12399np0
         physical ( RO): true
             VLAN ( RO): -1
        lldp-mode ( RO): inherited
    lldp-neighbor (MRO): state: enabled; system_name: NKG-ESWA07-1.eng.citrite.net; port_id: Ethernet1/16; port_description: nkg-dt16/eth0_(npri)


device ( RO)           : eno12409np1
         physical ( RO): true
             VLAN ( RO): -1
        lldp-mode ( RO): disabled
    lldp-neighbor (MRO): state: disabled


device ( RO)           : bond0
         physical ( RO): false
             VLAN ( RO): -1
        lldp-mode ( RO): inherited
    lldp-neighbor (MRO):


device ( RO)           : eno8303
         physical ( RO): false
             VLAN ( RO): 916
        lldp-mode ( RO): inherited
    lldp-neighbor (MRO): state: blocked

The VLAN PIF shares PIF_metrices of its underlying physical PIF. If lldp_neighbor is inquired for a VLAN PIF, it will show the same lldp_neighbor with its underlying physical PIF.

Monitor_dbcalls reads lldp_rx from the network stats and writes
it to PIF_metrics.lldp_neighbor as a string map (state plus neighbour
keys), with change detection to avoid redundant database writes.

Signed-off-by: Changlei Li <changlei.li@citrix.com>
@changlei-li
changlei-li force-pushed the private/changleli/lldp-neighbors branch from 861910e to a711edd Compare August 19, 2026 04:57
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.

1 participant