[BMC] Add LLDP management interface tests#23471
Open
Blueve wants to merge 3 commits intosonic-net:masterfrom
Open
[BMC] Add LLDP management interface tests#23471Blueve wants to merge 3 commits intosonic-net:masterfrom
Blueve wants to merge 3 commits intosonic-net:masterfrom
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Blueve
commented
Mar 31, 2026
Blueve
commented
Mar 31, 2026
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Blueve
commented
Apr 1, 2026
Blueve
commented
Apr 1, 2026
12 tasks
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Add test_lldp_mgmt.py under tests/lldp/ with 4 test cases for LLDP on the BMC management interface (eth0): - test_lldp_mgmt_interface_enabled: verify eth0 registered in lldpd - test_lldp_tx_frame_on_mgmt: capture LLDP TX frames via tcpdump - test_lldp_neighbor_on_mgmt: inject crafted LLDP via macvlan, verify mock neighbor appears in LLDP table - test_lldp_neighbor_timeout: verify neighbor removed after TTL Uses macvlan bridge mode to inject LLDP frames into eth0 receive path since lab management infra does not forward LLDP multicast. No scapy dependency on DUT - uses Python raw sockets. Signed-off-by: Jing Kan <[email protected]> Co-authored-by: Copilot <[email protected]> Signed-off-by: Jing Kan <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Macvlan cannot deliver LLDP frames (IEEE 802.1D reserved multicast 01:80:c2:00:00:0e) from macvlan to parent interface - the Linux kernel filters these at L2 in both bridge and macvlan code paths. Use veth pair + tc mirred ingress redirect instead: - Create veth_lldp_inj <-> veth_lldp_sink pair - tc filter on veth_lldp_sink redirects ingress to eth0 RX path - Bypasses IEEE 802.1D filtering since eth0 is not bridged - tc mirred injects via netif_receive_skb() directly Also removes debug logging from test_lldp_neighbor_on_mgmt that was added during macvlan troubleshooting. Co-authored-by: Copilot <[email protected]> Signed-off-by: Jing Kan <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Only keep bmc topology marker since we cannot verify on t0 physical testbed. Co-authored-by: Copilot <[email protected]> Signed-off-by: Jing Kan <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Description of PR
Summary: Add LLDP management interface tests (
tests/lldp/test_lldp_mgmt.py).Lab management infrastructure does not forward LLDP multicast, so we use a veth pair with
tc mirredingress redirect to inject crafted LLDP frames directly intoeth0's receive path and verifylldpdprocesses them correctly.Type of change
Back port request
Approach
What is the motivation for this PR?
LLDP test coverage for management interfaces. The existing
tests/lldp/test_lldp.pydepends on ASIC front-panel ports,DEVICE_NEIGHBORconfig, and neighbor VMs. This PR adds LLDP tests that targeteth0(the management port), applicable to BMC (bmc) topologies. In future, we could extend the t0,t1 topology too.How did you do it?
Added
tests/lldp/test_lldp_mgmt.pywith 4 test cases:test_lldp_mgmt_interface_enabledeth0is registered inlldpcliwith active TXtest_lldp_tx_frame_on_mgmteth0viatcpdumptest_lldp_neighbor_on_mgmttest_lldp_neighbor_timeoutPacket injection approach: A veth pair (
veth_lldp_inj<->veth_lldp_sink) withtc mirred ingress redirectdelivers frames intoeth0's receive path vianetif_receive_skb().This bypasses the Linux kernel's IEEE 802.1D reserved multicast filtering (which blocks LLDP's
01:80:c2:00:00:0ein bridge/macvlan code paths) becauseeth0is not enslaved to any bridge, sobr_handle_framenever runs.LLDP frames are built from raw bytes using Python
struct-- no scapy dependency on the DUT. Sent viasocket.AF_PACKETraw sockets.How did you verify/test it?
Ran on VS/KVM testbed with
t0topology.Any platform specific information?
Works on any topology with an
eth0management interface andlldpdrunning.Supported testbed topology if it's a new test case?
bmcDocumentation
Part of the BMC support series: