Conversation
…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
|
/azp run |
|
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
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.
| 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>
|
/azp run |
|
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
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azpw run |
|
Retrying failed(or canceled) jobs... |
|
Retrying failed(or canceled) stages in build 1198203: ✅Stage Build:
|
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azpw run |
|
Retrying failed(or canceled) jobs... |
|
Retrying failed(or canceled) stages in build 1198203: ✅Stage Build:
|
|
/azpw run |
|
Retrying failed(or canceled) jobs... |
|
Retrying failed(or canceled) stages in build 1198203: ✅Stage BuildTrixie:
|
|
/azpw run |
|
Retrying failed(or canceled) jobs... |
|
Retrying failed(or canceled) stages in build 1198203: ✅Stage Test:
|
|
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. |
Description of PR
Summary:
Manual 202605 backport of #1981.
This is a delivery prerequisite for the
dhcp_serversyslog repair on 202605. The initial syslog solution allowed the legacy UDP/514 path, butdhcp_serverswitched 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 tocaclmgrd, but that backport chain cannot complete while the requiredt0-vppDHCP-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
Approach
What is the motivation for this PR?
On 202605 VPP images, DHCP client broadcasts entering a VLAN bridge domain are not delivered to
dhcrelaythrough the physical PortChannel member interface. Thet0-vppDHCP relay test consequently receives zero of four expected relayed DHCPDISCOVER packets. This blocks the otherwise unrelateddhcp_serversyslog 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
How did you do it?
Cherry-picked #1981 onto
202605and resolved the three release-branch conflicts:BondEthernetparent for LAG subinterfaces and explicitly created/deleted the LCP pair becauselcp-auto-subintis 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
202605with:2e297e93668c2a791fba6a590befa8eb15bb5ca9;1196355;202605,t0-vpp, one KVM;dhcp_relay/test_dhcp_relay.py::test_dhcp_relay_default[isc-relay-agent]passed; the module completed with 14 passed and 2 skipped, pretest with 9 passed and 3 skipped, and posttest with 5 passed.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.