Closed dgsudharsan closed 1 year ago
Besides the bug fix, we should also add one test case for vxlan tunnel deletion
@dgsudharsan Please describe the exact sequence which leads to the Tunnel object creation in the SAI ? As far as I see it happens only as part of the vlan-vni or vrf-vni map creation. Similarly deletion should happen after the last mapping entry is removed.
@srj102 I see. In case of VNET deleting the VNET before VxLAN tunnel will clear the tunnel from the hardware. However the problem here I see is the CLI command to remove the VxLAN tunnel succeeds without throwing any dependency errors whether a tunnel map or VNET is associated with it. This needs to be fixed.
@dgsudharsan the foll is the snippet for vxlan deletion. Here the vlan vni mappings are handled.
vxlan_keys = db.cfgdb.get_keys("VXLAN_TUNNEL_MAP|*")
if not vxlan_keys:
vxlan_count = 0
else:
vxlan_count = len(vxlan_keys)
if(vxlan_count > 0):
ctx.fail("Please delete all VLAN VNI mappings.")
w.r.t VNET, If the user is going to add/remove vnet and vnet to vni mappings without using the CLI, wouldn't the user prefer the same for the VXLAN_TUNNEL table as well ? In which case how useful would it be to add this check in the "config vxlan del" CLI handler ?
Today vxlanmgr has checks for vlan vni mappings to take care of usecases without CLI, So I think the check can be put here.
doVxlanTunnelDeleteTask() ..
// If there are mappings still against this tunnel then hold on.
if (m_vxlanTunnelCache[vxlanTunnelName].vlan_vni_refcnt)
{
SWSS_LOG_WARN("Tunnel %s deletion failed. Need to delete mapping entries", vxlanTunnelName.c_str());
return false;
}
An additional check for m_vnetCache.size() can be added in vxlanmgr as part of doVxlanTunnelDeleteTask() and return false if it is a non-zero size ?
@srj102 I believe handling in CLI should be good enough as CLI is the only flow for delete. I have raised a fix https://github.com/sonic-net/sonic-utilities/pull/2404
Closing this issue, #2404 already merged
Description
After configuring a static VxLAN and VNET, trying to remove vxlan using CLI will result in successfully removing it in the application but not in the hardware. The reason is the delete task doesn't call any SAI API. (https://github.com/sonic-net/sonic-swss/blob/fd0c585d34de63dc9cca57bb7d508cadfe1125d4/orchagent/vxlanorch.cpp#L1536)
Previously the delete task had the flow of removing the tunnels https://github.com/sonic-net/sonic-swss/pull/931. However this flow was modified in the commit https://github.com/sonic-net/sonic-swss/commit/095f481e63997b64392bc46c2f176a04b8889667 due to which delete vxlan will not make any SAI calls
Steps to reproduce the issue:
Describe the results you received:
Delete vxlan returns successfully without any errors but leaving the hardware tunnel intact
Describe the results you expected:
Delete should return success or show throw error if there are any references
Output of
show version
:Output of
show techsupport
:Additional information you deem important (e.g. issue happens only occasionally):