Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SWSS:portsorch] fix child_ports checking in addLagMember and removeLagMember for strip tag #3343

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

baorliu
Copy link
Contributor

@baorliu baorliu commented Oct 28, 2024

What I did
Added child_ports check in addLagMember and removeLagMember for strip tag

Why I did it
portorch sets LAG member's strip tag when adding subport:

    // Change hostif vlan tag for the parent port only when a first subport is created
    if (parentPort.m_child_ports.empty())
    {
        if (!setHostIntfsStripTag(parentPort, SAI_HOSTIF_VLAN_TAG_KEEP))

but if a new member is added later, in addLagMember function, it does not handle strip tag anymore. Cause the new added lag member has wrong tag mode.

How I verified it
without this fix, I observed that addLagMember happened after addSubPort, the strip tag was not set to the LAG members.

~$ grep PortChannel01 h
2024 Sep 27 19:20:33.184213 sfd-t2-lc2 INFO kernel: [394515.489800] PortChannel01: Port device Ethernet-BP232 added
2024 Sep 27 19:20:33.280190 sfd-t2-lc2 INFO kernel: [394515.586016] PortChannel01: Port device Ethernet-BP236 added
2024 Sep 27 19:20:37.040919 sfd-t2-lc2 WARNING swss0#orchagent: :- addSubPort: DEBUG: set SAI_HOSTIF_VLAN_TAG_ORIGINAL for hostif of port PortChannel01
2024 Sep 27 19:20:51.310876 sfd-t2-lc2 NOTICE swss0#orchagent: :- addLagMember: Add member Ethernet-BP232 to LAG PortChannel01 lid:2000000000688 pid:1000000000028
2024 Sep 27 19:20:51.322898 sfd-t2-lc2 NOTICE swss0#orchagent: :- addLagMember: Add member Ethernet-BP236 to LAG PortChannel01 lid:2000000000688 pid:1000000000029

~$ grep PortChannel17 h
2024 Sep 27 19:20:33.160208 sfd-t2-lc2 INFO kernel: [394515.465774] PortChannel17: Port device Ethernet-BP496 added
2024 Sep 27 19:20:33.196199 sfd-t2-lc2 INFO kernel: [394515.504327] PortChannel17: Port device Ethernet-BP500 added
2024 Sep 27 19:20:36.855791 sfd-t2-lc2 WARNING swss1#orchagent: :- addSubPort: DEBUG: set SAI_HOSTIF_VLAN_TAG_ORIGINAL for hostif of port PortChannel17
2024 Sep 27 19:20:51.206028 sfd-t2-lc2 NOTICE swss1#orchagent: :- addLagMember: Add member Ethernet-BP496 to LAG PortChannel17 lid:200000000068a pid:100000000002a
2024 Sep 27 19:20:51.210702 sfd-t2-lc2 NOTICE swss1#orchagent: :- addLagMember: Add member Ethernet-BP500 to LAG PortChannel17 lid:200000000068a pid:100000000002b
~$  

Build the image with the fix, confirmed that the strip tag is set correctly even the addLagMember called after assSubPort.
(will add a testcase for this before convert it to formal PR)
Details if related

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.

1 participant