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

[VRF]When assigning a loopback interface to Vrf, the ip2me route gets added in default VRF #3339

Open
dgsudharsan opened this issue Oct 23, 2024 · 0 comments

Comments

@dgsudharsan
Copy link
Collaborator

dgsudharsan commented Oct 23, 2024

Description

Sometimes when adding a loopback interface to a non default VRF ip2me route gets added in default VRF. This is due to the below handling

In normal scenario when VRF is bound to interface, there will be an interface del followed by setting VRF. Below is an example

2024-10-13.20:17:22.950331|INTF_TABLE:Loopback3|SET|NULL:NULL|mac_addr:00:00:00:00:00:00
2024-10-13.20:17:35.237876|INTF_TABLE:Loopback3|DEL
2024-10-13.20:17:35.291212|INTF_TABLE:Loopback3|SET|vrf_name:Vrf_0003|mac_addr:00:00:00:00:00:00
2024-10-13.20:17:42.787366|INTF_TABLE:Loopback3:2.2.2.2/32|SET|scope:global|family:IPv4

However in some scenarios the DEL message is missed.

2024-10-13.20:41:58.482724|INTF_TABLE:Loopback3|SET|NULL:NULL|mac_addr:00:00:00:00:00:00
2024-10-13.20:41:59.997430|INTF_TABLE:Loopback3|SET|vrf_name:Vrf_0003|mac_addr:00:00:00:00:00:00
2024-10-13.20:42:02.151584|INTF_TABLE:Loopback3:2.2.2.2/32|SET|scope:global|family:IPv4

Due to the below check the VRF for the interface is not updated

if (m_syncdIntfses.find(alias) == m_syncdIntfses.end())

Intfmgrd when it receives del it updates appl_db and state_db

m_stateIntfTable.del(alias);

Due to intfmgr removing del from state_db, the CLI proceeds to do set command

https://github.com/nvidia-sonic/sonic-utilities/blob/649e76192a23d4c1ff22d752000a9229b8ffbb9d/config/main.py#L5671

However orchagent might not have processed the previous DEL message. Thus when a SET comes the optimization results in DEL getting ignored and thus VRF not getting updated.

This results in the ip2me route for the Loopback getting programmed in the default vrf

2024-10-13.20:42:02.151879|c|SAI_OBJECT_TYPE_ROUTE_ENTRY:{"dest":"2.2.2.2/32","switch_id":"oid:0x21000000000000","vr":"oid:0x3000000000002"}|SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION=SAI_PACKET_ACTION_FORWARD|SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID=oid:0x1000000000001

Steps to reproduce the issue:

  1. config loopback add Loopback2
  2. attach gdb to orchagent. don't press continue so it is stalled.
  3. config interface vrf bind Loopback2
  4. press continue in GDB
  5. Assign ip address to Loopback2. The route would be created in default vrf

Describe the results you received:

Describe the results you expected:

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

@lguohan lguohan transferred this issue from sonic-net/sonic-buildimage Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants