Skip to content

fix(saiserver): skip 802.1Q ingress encap for tagged VLAN members - #750

Merged
sonikajindal merged 1 commit into
openconfig:mainfrom
mohankarthik:fix-vlan-member-tagged-mode
Oct 12, 2026
Merged

sonikajindal merged 1 commit into
openconfig:mainfrom
mohankarthik:fix-vlan-member-tagged-mode

Conversation

@mohankarthik

@mohankarthik mohankarthik commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

In CreateVlanMember (dataplane/saiserver/routing.go), VlanTable previously programmed EncapAction(PACKET_HEADER_ID_ETHERNET_VLAN) and UpdateAction(PACKET_FIELD_NUM_VLAN_TAG) unconditionally for all VLAN members regardless of VlanTaggingMode.

When an 802.1Q-tagged frame arrives on a port configured with SAI_VLAN_TAGGING_MODE_TAGGED, Ethernet.parse (dataplane/forwarding/protocol/ethernet/ethernet.go) already sets the header ID to PACKET_HEADER_ID_ETHERNET_VLAN and extracts PACKET_FIELD_NUM_VLAN_TAG. Attempting to execute EncapAction(PACKET_HEADER_ID_ETHERNET_VLAN) on an already-tagged frame fails in Ethernet.Modify (cannot add header PACKET_HEADER_ID_ETHERNET_VLAN to header PACKET_HEADER_ID_ETHERNET_VLAN) and drops the packet with COUNTER_ID_ENCAP_ERROR_PACKETS.

Changes

  • Only attach the ingress EncapAction(PACKET_HEADER_ID_ETHERNET_VLAN) and UpdateAction(PACKET_FIELD_NUM_VLAN_TAG) actions in VlanTable when r.GetVlanTaggingMode() != saipb.VlanTaggingMode_VLAN_TAGGING_MODE_TAGGED.
  • Add TestCreateVlanMemberTaggingMode in dataplane/saiserver/vlan_test.go covering both VLAN_TAGGING_MODE_UNTAGGED and VLAN_TAGGING_MODE_TAGGED.

cc @sonikajindal

In CreateVlanMember, VlanTable previously programmed
EncapAction(PACKET_HEADER_ID_ETHERNET_VLAN) and
UpdateAction(PACKET_FIELD_NUM_VLAN_TAG) unconditionally for all VLAN
members regardless of VlanTaggingMode.

When an 802.1Q-tagged frame arrives on a port configured with
SAI_VLAN_TAGGING_MODE_TAGGED, the Ethernet parser already sets the
header ID to PACKET_HEADER_ID_ETHERNET_VLAN and extracts
PACKET_FIELD_NUM_VLAN_TAG. Attempting to execute
EncapAction(PACKET_HEADER_ID_ETHERNET_VLAN) on an already-tagged frame
fails in Ethernet.Modify and drops the packet with
COUNTER_ID_ENCAP_ERROR_PACKETS.

Only program the ingress 802.1Q encapsulation and VLAN tag update
actions when VlanTaggingMode is not VLAN_TAGGING_MODE_TAGGED.
@mohankarthik
mohankarthik requested a review from a team as a code owner October 9, 2026 07:53
@mohankarthik

Copy link
Copy Markdown
Contributor Author

@marcushines for viz.

@sonikajindal

Copy link
Copy Markdown
Contributor

/gcbrun

@sonikajindal

Copy link
Copy Markdown
Contributor

cc: @hardikharti

@sonikajindal
sonikajindal merged commit 194a7d5 into openconfig:main Oct 12, 2026
15 checks passed
@mohankarthik
mohankarthik deleted the fix-vlan-member-tagged-mode branch October 13, 2026 02:59
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.

2 participants