Conversation
orchagent/vnetorch.cpp
Outdated
|
|
||
| VNetVrfObject::VNetVrfObject(const std::string& vnet, string& tunnel, set<string>& peer, | ||
| vector<sai_attribute_t>& attrs) : VNetObject(tunnel, peer) | ||
| VNetVrfObject::VNetVrfObject(const std::string& vnet, string& tunnel, set<string>& peer, uint32_t vni, |
There was a problem hiding this comment.
Maybe it is worth considering grouping all these parameters into a single struct VnetInfo?
|
|
||
| if (!vxlan_orch->removeVxlanTunnelMap(vrf_obj->getTunnelName(), vrf_obj->getVni())) | ||
| { | ||
| SWSS_LOG_ERROR("VNET '%s' map delete failed", vnet_name.c_str()); |
There was a problem hiding this comment.
SWSS_LOG_ERROR("VNET '%s' map delete failed", vnet_name.c_str()); [](start = 16, length = 65)
why no return false here?
orchagent/vnetorch.cpp
Outdated
| return true; | ||
| } | ||
|
|
||
| bool subnet = (!nh.ips.getSize())?true:false; |
There was a problem hiding this comment.
subnet [](start = 9, length = 6)
->isSubnet
| throw std::runtime_error("Route add failed"); | ||
| throw std::runtime_error("Route update failed"); | ||
| } | ||
| } |
There was a problem hiding this comment.
what is else condition? do we need to print warning, log, ???
There was a problem hiding this comment.
The else case is handled by the Bitmap implementation. So it is left intentionally.
orchagent/vnetorch.cpp
Outdated
| if (!doRouteTask<VNetVrfObject>(vnet_name, ip_pfx, nh, op)) | ||
| { | ||
| throw std::runtime_error("Route add failed"); | ||
| throw std::runtime_error("Route update failed"); |
There was a problem hiding this comment.
throw std::runtime_error("Route update failed"); [](start = 10, length = 50)
it looks to me it is dangerous to crash here. what if the nexthop interface is not created yet in the doRouteTask.
There was a problem hiding this comment.
I checked the routeorch.cpp, it does not throw error, if add or delete route fails.
In reply to: 253250419 [](ancestors = 253250419)
There was a problem hiding this comment.
orchagent/vnetorch.cpp
Outdated
| return (routes_.size() + tunnels_.size()); | ||
| } | ||
|
|
||
| bool VNetVrfObject::getRouteNH(IpPrefix& ipPrefix, nextHop& nh) |
orchagent/vnetorch.cpp
Outdated
| return true; | ||
| } | ||
|
|
||
| sai_object_id_t VNetVrfObject::getNextHop(tunnelEndpoint& endp) |
There was a problem hiding this comment.
getNextHop [](start = 31, length = 10)
-> getTunnelNexthop
orchagent/vnetorch.cpp
Outdated
| return nh_id; | ||
| } | ||
|
|
||
| bool VNetVrfObject::removeNextHop(tunnelEndpoint& endp) |
orchagent/vnetorch.cpp
Outdated
|
|
||
| if (!vxlan_orch->removeNextHopTunnel(tun_name, endp.ip, endp.mac, endp.vni)) | ||
| { | ||
| SWSS_LOG_ERROR("VNET %s NH remove failed for '%s'", vnet_name_.c_str(), endp.ip.to_string().c_str()); |
There was a problem hiding this comment.
NH [](start = 32, length = 2)
-> tunnel nexthop
orchagent/vxlanorch.cpp
Outdated
| auto tunnel_obj = getVxlanTunnel(tunnelName); | ||
|
|
||
| //Delete request for the nh tunnel id | ||
| return tunnel_obj->removeNHTunnel(ipAddr, macAddress, vni); |
There was a problem hiding this comment.
removeNHTunnel [](start = 23, length = 14)
since it is already a tunnel object, you do not need tunnel in the function name. -> removeNexthop
orchagent/vxlanorch.h
Outdated
| return ids_.tunnel_encap_id; | ||
| } | ||
|
|
||
| void updateNHTunnel(IpAddress& ipAddr, MacAddress macAddress, uint32_t vni, sai_object_id_t nh_id); |
we should probably increase the crm counter. 823 { Refers to: orchagent/vnetorch.cpp:484 in 91d77df. [](commit_id = 91d77df, deletion_comment = False) |
Added breakout subcommand in config command Signed-off-by: Sangita Maity <[email protected]>
Signed-off-by: Guohan Lu <[email protected]>
* Route/NH and VNet delete handling * Handle VNET Route with Nexthop IP, fix route remove * Address review comments, increment CRM counters,
…et#766) This is to support adding custom observers to the swss logger. With restartLogger, now applications could start logger with the following lines: linkToDb(demoDb, myCustomPrioNotify, defaultPrio); restartLogger() Signed-off-by: Longxiang Lyu [email protected]
What I did
Delete handling for VNet Routes, NH tunnels and VNets
Why I did it
To support deletion scenarios
How I verified it
Tested on DUT. VS test case would be added subsequently
Details if related
Based on design sonic-net/SONiC#324