Skip to content

[202605] Backport VPP VLAN member DHCP punt support - #2048

Closed
Xichen96 wants to merge 3 commits into
sonic-net:202605from
Xichen96:dev/xichenlin/backport-1981-202605
Closed

Xichen96 wants to merge 3 commits into
sonic-net:202605from
Xichen96:dev/xichenlin/backport-1981-202605

Conversation

@Xichen96

Copy link
Copy Markdown
Contributor

Description of PR

Summary:

Manual 202605 backport of #1981.

This is a delivery prerequisite for the dhcp_server syslog repair on 202605. The initial syslog solution allowed the legacy UDP/514 path, but dhcp_server switched its host logging transport to RELP over TCP/2514. The previous iptables rule therefore no longer matched the actual syslog traffic. The product fix moves ownership of the TCP/2514 exception to caclmgrd, but that backport chain cannot complete while the required t0-vpp DHCP-relay validation is broken.

This PR does not change the syslog firewall rule itself. It restores the VPP VLAN/LAG DHCP trap and member-interface punt behavior required for the 202605 CI lane to validate and deliver the actual caclmgrd/TCP-2514 syslog fix.

Fixes #26936

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation update
  • Test improvement

Approach

What is the motivation for this PR?

On 202605 VPP images, DHCP client broadcasts entering a VLAN bridge domain are not delivered to dhcrelay through the physical PortChannel member interface. The t0-vpp DHCP relay test consequently receives zero of four expected relayed DHCPDISCOVER packets. This blocks the otherwise unrelated dhcp_server syslog backport chain.

PR #1981 adds the missing SAI/VPP plumbing to trap DHCP before L2 flooding and punt control traffic through the correct tagged or untagged VLAN/LAG member interface.

Work item tracking
  • Microsoft ADO (number only): 39310227

How did you do it?

Cherry-picked #1981 onto 202605 and resolved the three release-branch conflicts:

  • retained only the classify and VLIB API wiring required by vpp: support punting ARP, LLDP, LACP, DHCP via member interface in VLAN (re-opened) #1981, without importing unrelated newer-master sFlow or BFD API changes;
  • adapted tagged and untagged VLAN member handling to the 202605 bridge-domain implementation;
  • selected the correct BondEthernet parent for LAG subinterfaces and explicitly created/deleted the LCP pair because lcp-auto-subint is disabled.

The manual PR intentionally carries no release-workflow labels. The approval and inclusion decision remains recorded on original PR #1981.

How did you verify/test it?

The target behavior was validated on 202605 with:

The exact conflict-resolved backport head is also subject to this PR's build and static CI.

Any platform specific information?

VPP only.

Documentation

Not applicable; this is a release backport of existing behavior.

…AN (re-opened) (sonic-net#1981)

Description of PR
Summary:
Fixes #26936

Opening PR for sonic-net#1959 while original owner is out of office.

Type of change
 Bug fix
 New feature
 Refactor / cleanup
 Documentation update
 Test improvement
Approach
What is the motivation for this PR?
SONiC on the VPP virtual-switch platform needs L2 bridging with an L3 SVI (VLAN interface) for both tagged and untagged VLAN members. The standard SONiC data model (VLAN + VLAN_INTERFACE with an IP + VLAN_MEMBER tagged/untagged) maps to a VPP bridge-domain (BD) with a Bridge Virtual Interface (BVI), but VPP does not wire this up to SONiC's punt model out of the box. Two problems had to be solved:

No per-member control-plane punt. SONiC expects the NPU to punt control traffic (ARP, LLDP, LACP, DHCP, and L3-to-SVI) to the member interface so Linux sees frames on the same netdev it would on real hardware — never on a virtual Vlan/PortChannel netdev directly. VPP's BVI is a purely internal L3 endpoint with no kernel-facing punt path, so the original member ingress (and its wire VLAN tag) is lost once a frame is bridged/flooded.

DHCP must be trapped, not flooded. A DHCP client broadcast (dst=ff:ff:ff:ff:ff:ff) entering the BD would hit l2-flood and fan out to every other member port, which sonic-mgmt's DHCPBroadcastNotFloodedTest forbids — a real ASIC traps DHCP to the CPU and removes it from the forwarding pipeline (SAI_PACKET_ACTION_TRAP). Routing DHCP through the BVI/L3 path is also wrong: it can't disambiguate which bridge the discover came from, and the L3 path subjects DHCP to IP/UDP checksum validation that drops malformed frames the control plane is supposed to count.

This PR implements the VPP-VS data path for VLAN BVI plus the SAI/classify plumbing needed to punt control traffic to the correct member interface. Design details are in vlan-bvi-hld.md (sonic-buildimage).

Work item tracking
Microsoft ADO (number only):
How did you do it?
VLAN BVI + members (SwitchVppFdb.cpp, SwitchVppRif.cpp, SwitchVppHostif.cpp): create a BVI per SVI and add it to the bridge domain. Tagged members join via a dot1q sub-interface with symmetric VTR (pop 1/push); untagged members join the BD directly. Explicit LCP pairs are created for sub-port RIFs (since lcp-auto-subint is disabled), and promiscuous mode is enabled on each phy so tagged frames reach VPP.

L2 classifier punt (SwitchVppFdb.cpp): attach l2-input-classify tables to each member that match LLDP and DHCPv4 client broadcasts before l2-flood, so they are trapped to the CPU instead of flooded (emulating SAI_PACKET_ACTION_TRAP). Untagged DHCP punts straight to linux-cp-punt; tagged DHCP goes through sonic-ext-l2-trap-fixup to reach the parent phy's host tap with its .1Q tag intact.

New VPP API wrappers (SaiVppXlate.c/.h): classify table create/delete, session add/del, set-interface-l2-tables, add-node-next, and set-promiscuous.

WR macro timeout change. The previous WR macro waited up to a fixed 1 second for a reply. Under bursts of unsolicited events (link state, counters, etc.) the reply-queue can be saturated long enough for that budget to elapse before our reply is drained, producing spurious -99 failures in unrelated call sites. The macro now uses a 10s hard cap with a 1s idle cap that resets on each processed message.

How did you verify/test it?
Verified on the sonic-vpp platform with sonic-mgmt DHCP relay tests (DHCP punted to the member tap, not flooded — DHCPBroadcastNotFloodedTest) and LLDP/ARP punt landing on the correct member netdev for both tagged and untagged members.

Signed-off-by: dypet <dypeters@cisco.com>
(cherry picked from commit cfe265d)
Signed-off-by: Xichen96 <lukelin0907@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f34adeaf-e3b4-4c07-9391-6c62427d8a7c

# Conflicts:
#	vslib/vpp/SwitchVppFdb.cpp
#	vslib/vpp/SwitchVppRif.cpp
#	vslib/vpp/vppxlate/SaiVppXlate.c
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@Xichen96
Xichen96 requested a lite review from Copilot August 20, 2026 14:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Backport to the 202605 branch that restores VPP VLAN/LAG member-interface DHCP (and LLDP) punt behavior needed for t0-vpp DHCP relay validation by adding VPP classify-based trapping and the necessary VPP API plumbing in vslib.

Changes:

  • Add VPP classify + vlib API wrappers (and a more resilient synchronous API wait loop) in SaiVppXlate.*.
  • Implement L2 classify-based punt infrastructure to trap DHCP broadcasts pre-flood and punt LLDP/DHCP via the correct VLAN/LAG member interface.
  • Adjust SUB_PORT RIF and hostif setup for LAG subinterfaces and ensure member interfaces receive tagged traffic (promiscuous mode).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vslib/vpp/vppxlate/SaiVppXlate.h Exposes new VPP API wrapper declarations (promisc, classify, node-next).
vslib/vpp/vppxlate/SaiVppXlate.c Implements new VPP API wrappers/handlers (classify/vlib/promisc), updates WR timeout behavior, and improves subinterface index caching.
vslib/vpp/SwitchVppRif.cpp Creates/deletes explicit LCP pairs for SUB_PORT RIFs (incl. LAG parent handling) when auto-subint is disabled.
vslib/vpp/SwitchVppHostif.cpp Enables promiscuous mode on created host interfaces to ensure expected frame delivery into VPP.
vslib/vpp/SwitchVppFdb.cpp Adds L2 classify-based punt logic and applies/removes it for tagged/untagged VLAN members; updates VLAN member/BVI behavior accordingly.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +4215 to +4218
M (ADD_NODE_NEXT, mp);
strncpy((char *)mp->node_name, node_name, sizeof(mp->node_name) - 1);
strncpy((char *)mp->next_name, next_name, sizeof(mp->next_name) - 1);
mp->context = store_ptr(next_index);
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f34adeaf-e3b4-4c07-9391-6c62427d8a7c
Signed-off-by: Xichen96 <lukelin0907@gmail.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Signed-off-by: Xichen96 <lukelin0907@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f34adeaf-e3b4-4c07-9391-6c62427d8a7c
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@Xichen96

Copy link
Copy Markdown
Contributor Author

/azpw run

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1198203:

✅Stage Build:

  • Job amd64: retried.

@Xichen96
Xichen96 marked this pull request as ready for review August 20, 2026 16:22
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@Xichen96

Copy link
Copy Markdown
Contributor Author

/azpw run

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1198203:

✅Stage Build:

  • Job amd64: retried.

@Xichen96

Copy link
Copy Markdown
Contributor Author

/azpw run

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1198203:

✅Stage BuildTrixie:

  • Job amd64: retried.

@Xichen96

Copy link
Copy Markdown
Contributor Author

/azpw run

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1198203:

✅Stage Test:

  • Job vstest: retried.

@Xichen96

Copy link
Copy Markdown
Contributor Author

Closing per Xichen’s decision to drop the 202605 VPP prerequisite backport. Future buildimage backports blocked solely by the known t0-vpp baseline issue will use the documented Storm force-merge path instead. Tracking task 39310228 is complete.

@Xichen96 Xichen96 closed this Aug 24, 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.

4 participants