@@ -274,7 +274,7 @@ void DashVnetOrch::doTaskVnetTable(ConsumerBase& consumer)
274274 }
275275}
276276
277- void DashVnetOrch::addOutboundCaToPa (const string& key, VnetMapBulkContext& ctxt)
277+ bool DashVnetOrch::addOutboundCaToPa (const string& key, VnetMapBulkContext& ctxt)
278278{
279279 SWSS_LOG_ENTER ();
280280
@@ -291,6 +291,7 @@ void DashVnetOrch::addOutboundCaToPa(const string& key, VnetMapBulkContext& ctxt
291291 if (!dash_orch->getRouteTypeActions (ctxt.metadata .routing_type (), route_type_actions))
292292 {
293293 SWSS_LOG_INFO (" Failed to get route type actions for %s" , key.c_str ());
294+ return false ;
294295 }
295296
296297 for (auto action: route_type_actions.items ())
@@ -309,7 +310,7 @@ void DashVnetOrch::addOutboundCaToPa(const string& key, VnetMapBulkContext& ctxt
309310 else
310311 {
311312 SWSS_LOG_ERROR (" Invalid encap type %d for %s" , action.encap_type (), key.c_str ());
312- return ;
313+ return false ;
313314 }
314315 outbound_ca_to_pa_attrs.push_back (outbound_ca_to_pa_attr);
315316
@@ -359,9 +360,10 @@ void DashVnetOrch::addOutboundCaToPa(const string& key, VnetMapBulkContext& ctxt
359360 object_statuses.emplace_back ();
360361 outbound_ca_to_pa_bulker_.create_entry (&object_statuses.back (), &outbound_ca_to_pa_entry,
361362 (uint32_t )outbound_ca_to_pa_attrs.size (), outbound_ca_to_pa_attrs.data ());
363+ return true ;
362364}
363365
364- void DashVnetOrch::addPaValidation (const string& key, VnetMapBulkContext& ctxt)
366+ bool DashVnetOrch::addPaValidation (const string& key, VnetMapBulkContext& ctxt)
365367{
366368 SWSS_LOG_ENTER ();
367369
@@ -380,7 +382,7 @@ void DashVnetOrch::addPaValidation(const string& key, VnetMapBulkContext& ctxt)
380382 SWSS_LOG_INFO (" Increment PA refcount to %u for PA IP %s" ,
381383 pa_refcount_table_[pa_ref_key],
382384 underlay_ip_str.c_str ());
383- return ;
385+ return true ;
384386 }
385387
386388 uint32_t attr_count = 1 ;
@@ -399,6 +401,7 @@ void DashVnetOrch::addPaValidation(const string& key, VnetMapBulkContext& ctxt)
399401 pa_refcount_table_[pa_ref_key] = 1 ;
400402 SWSS_LOG_INFO (" Initialize PA refcount to 1 for PA IP %s" ,
401403 underlay_ip_str.c_str ());
404+ return true ;
402405}
403406
404407bool DashVnetOrch::addVnetMap (const string& key, VnetMapBulkContext& ctxt)
@@ -408,17 +411,14 @@ bool DashVnetOrch::addVnetMap(const string& key, VnetMapBulkContext& ctxt)
408411 bool exists = (vnet_map_table_.find (key) != vnet_map_table_.end ());
409412 if (!exists)
410413 {
414+
411415 bool vnet_exists = (gVnetNameToId .find (ctxt.vnet_name ) != gVnetNameToId .end ());
412- if (vnet_exists)
413- {
414- addOutboundCaToPa (key, ctxt);
415- addPaValidation (key, ctxt);
416- }
417- else
416+ if (!vnet_exists)
418417 {
419418 SWSS_LOG_INFO (" Not creating VNET map for %s since VNET %s doesn't exist" , key.c_str (), ctxt.vnet_name .c_str ());
419+ return false ;
420420 }
421- return false ;
421+ return addOutboundCaToPa (key, ctxt) && addPaValidation (key, ctxt) ;
422422 }
423423 /*
424424 * If the VNET map is already added, don't add it to the bulker and
0 commit comments