[dhcpmon] Classify nested VLAN members as downlinks - #28625
Conversation
Expand VLAN-backed PortChannels to their physical members when displaying dhcpmon counters so the new hierarchy is not mislabeled as uplink traffic. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 39f979be-d826-4d5c-949a-f20abb58bb83 Signed-off-by: Xichen96 <lukelin0907@gmail.com>
|
/azp run Azure.sonic-buildimage |
|
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). |
There was a problem hiding this comment.
Pull request overview
This PR updates the docker-dhcp-relay CLI plugin so that show dhcp_relay ipv4/ipv6 counters correctly classifies physical interfaces beneath a VLAN-backed PortChannel as Downlink (e.g., Ethernet -> PortChannel -> Vlan), aligning the CLI output with new nested counter rows produced by dhcpmon.
Changes:
- Add parsing of
PORTCHANNEL_MEMBERentries from CONFIG_DB to expand VLAN downlink membership to include physical PortChannel children. - Extend the focused CLI unit test to cover a VLAN-backed PortChannel and ensure only the correct physical children are included.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py | Expands VLAN downlink set to include physical members of VLAN-member PortChannels by reading PORTCHANNEL_MEMBER keys. |
| dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcpmon_counters.py | Updates unit test expectations to include PortChannel physical children as VLAN downlinks. |
|
/azpw run |
|
Retrying failed(or canceled) jobs... |
|
Retrying failed(or canceled) stages in build 1174830: ✅Stage Build:
|
Ignore malformed VLAN_MEMBER keys before classifying counter interfaces. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 39f979be-d826-4d5c-949a-f20abb58bb83 Signed-off-by: Xichen96 <lukelin0907@gmail.com>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Closing per maintainer direction: keep the Fungible F2 repair entirely in dhcpmon/dhcp6relay and preserve the existing CLI unchanged. |
Why I did it
sonic-dhcpmon PR sonic-net/sonic-dhcpmon#89 adds
counter rows for physical members beneath a PortChannel that belongs to the
downstream VLAN:
Ethernet312 -> PortChannel1005 -> Vlan1000The current
show dhcp_relay ipv4/ipv6 countersimplementation classifiesdownlinks from direct
VLAN_MEMBERentries only. The nested Ethernet membersexist in
PORTCHANNEL_MEMBER, so the CLI would incorrectly display their newcounter rows as
Uplink.Work item tracking
How I did it
PORTCHANNEL_MEMBERkeys once and build a parent-to-children map.existing VLAN downlink set.
direct VLAN members, uplinks, and management interfaces.
unrelated PortChannel to verify that only the correct children are included.
How to verify it
show dhcp_relay ipv4 counters Vlan1000show dhcp_relay ipv6 counters Vlan1000members display as
Downlink, while unrelated interfaces remainUplink.Which release branch to backport (provide reason below if selected)
No backport is requested. This repair targets master only.
Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO):
Failure type:
Tested branch
Test result
Pending this PR's Azure CI and combined master hardware validation with
sonic-dhcpmon PR #89.
Description for the changelog
Classify physical members of a VLAN-backed PortChannel as downlinks in dhcpmon
counter output.
Link to config_db schema for YANG module changes
N/A - no YANG or CONFIG_DB schema changes.
A picture of a cute animal (not mandatory but encouraged)
N/A.