Repository navigation
fix(saiserver): skip 802.1Q ingress encap for tagged VLAN members - #750
Merged
sonikajindal merged 1 commit intoOct 12, 2026
Merged
Conversation
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.
Contributor
Author
|
@marcushines for viz. |
Contributor
|
/gcbrun |
sonikajindal
approved these changes
Oct 12, 2026
Contributor
|
cc: @hardikharti |
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.
Summary
In
CreateVlanMember(dataplane/saiserver/routing.go),VlanTablepreviously programmedEncapAction(PACKET_HEADER_ID_ETHERNET_VLAN)andUpdateAction(PACKET_FIELD_NUM_VLAN_TAG)unconditionally for all VLAN members regardless ofVlanTaggingMode.When an
802.1Q-tagged frame arrives on a port configured withSAI_VLAN_TAGGING_MODE_TAGGED,Ethernet.parse(dataplane/forwarding/protocol/ethernet/ethernet.go) already sets the header ID toPACKET_HEADER_ID_ETHERNET_VLANand extractsPACKET_FIELD_NUM_VLAN_TAG. Attempting to executeEncapAction(PACKET_HEADER_ID_ETHERNET_VLAN)on an already-tagged frame fails inEthernet.Modify(cannot add header PACKET_HEADER_ID_ETHERNET_VLAN to header PACKET_HEADER_ID_ETHERNET_VLAN) and drops the packet withCOUNTER_ID_ENCAP_ERROR_PACKETS.Changes
EncapAction(PACKET_HEADER_ID_ETHERNET_VLAN)andUpdateAction(PACKET_FIELD_NUM_VLAN_TAG)actions inVlanTablewhenr.GetVlanTaggingMode() != saipb.VlanTaggingMode_VLAN_TAGGING_MODE_TAGGED.TestCreateVlanMemberTaggingModeindataplane/saiserver/vlan_test.gocovering bothVLAN_TAGGING_MODE_UNTAGGEDandVLAN_TAGGING_MODE_TAGGED.cc @sonikajindal