Skip to content

Change VLAN_TABLE priority as same as VLAN_MEMBER_TABLE.#3537

Draft
liuh-80 wants to merge 4 commits intosonic-net:masterfrom
liuh-80:dev/liuh/fix_vlan_priority
Draft

Change VLAN_TABLE priority as same as VLAN_MEMBER_TABLE.#3537
liuh-80 wants to merge 4 commits intosonic-net:masterfrom
liuh-80:dev/liuh/fix_vlan_priority

Conversation

@liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Feb 27, 2025

Change VLAN_TABLE priority as same as VLAN_MEMBER_TABLE.

Why I did it

Fix issue sonic-net/sonic-buildimage#20941

VLAN_TABLE has higher priority than VLAN_MEMBER_TABLE, which means when when delete VLAN_MEMBER and delete VLAN happened in short time, the VLAN delete event will be pop before VLAN_MEMBER delete event.

How I did it

Change VLAN_TABLE has same priority with VLAN_MEMBER_TABLE

Work item tracking
  • Microsoft ADO: 30468564

How to verify it

Pass all test cases.
Pass all sonic-mgmt test with this PR: sonic-net/sonic-buildimage#21875

Manually build a POC and verify with following test steps:

sudo config vlan add 4094
sudo config vlan member add 4094 Ethernet64

sudo kill -s SIGSTOP $(pgrep -f /usr/bin/orchagent)

sudo config vlan member del 4094 Ethernet64
sudo config vlan del 4094

sudo truncate -s 0 /var/log/syslog
sudo kill -s SIGCONT $(pgrep -f /usr/bin/orchagent)
sudo cat /var/log/syslog

Result:

// VLAN_MEMBER delete event happen first and pop first:
2025 Feb 27 02:06:51.606321 vlab-01 NOTICE swss#orchagent: :- removeVlanMember: Remove member Ethernet64 from VLAN Vlan4094 lid:ffe vmid:2700000000069e
2025 Feb 27 02:06:51.606687 vlab-01 NOTICE swss#orchagent: :- flushFdbEntries: flush key: SAI_OBJECT_TYPE_FDB_FLUSH:oid:0x21000000000000, fields: 3
2025 Feb 27 02:06:51.606769 vlab-01 NOTICE swss#orchagent: :- recordFlushFdbEntries: flush key: SAI_OBJECT_TYPE_FDB_FLUSH:oid:0x21000000000000, fields: 3

2025 Feb 27 02:06:51.689459 vlab-01 NOTICE swss#orchagent: :- removeVlan: Remove VLAN Vlan4094 vid:4094

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Change VLAN_TABLE priority as same as VLAN_MEMBER_TABLE.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80 liuh-80 changed the title Change VLAN_TABLE priority as same as VLAN_MEMBER_TABLE. [POC] Change VLAN_TABLE priority as same as VLAN_MEMBER_TABLE. Feb 27, 2025
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80 liuh-80 changed the title [POC] Change VLAN_TABLE priority as same as VLAN_MEMBER_TABLE. Change VLAN_TABLE priority as same as VLAN_MEMBER_TABLE. Apr 2, 2025
@liuh-80 liuh-80 marked this pull request as ready for review April 3, 2025 05:13
@liuh-80 liuh-80 requested a review from prsunny as a code owner April 3, 2025 05:13
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80 liuh-80 requested a review from qiluo-msft April 3, 2025 05:13
@liuh-80
Copy link
Contributor Author

liuh-80 commented Apr 5, 2025

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

{ APP_PORT_TABLE_NAME, portsorch_base_pri + 5 },
{ APP_SEND_TO_INGRESS_PORT_TABLE_NAME, portsorch_base_pri + 5 },
{ APP_VLAN_TABLE_NAME, portsorch_base_pri + 2 },
{ APP_VLAN_TABLE_NAME, portsorch_base_pri },
Copy link
Collaborator

@prsunny prsunny Apr 8, 2025

Choose a reason for hiding this comment

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

Priority is needed for create operation. Agree delete has a dependency but this can now impact create operation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This won't impact create operation, because VLAN and VLAN member have same priority, and in create operation VLAN create will happen before VLAN_MEMBER create.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80 liuh-80 marked this pull request as draft August 26, 2025 00:58
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.

3 participants