Skip to content

Commit 0c01fd8

Browse files
raja-rajasekarPdoijode
authored andcommitted
bgpd: [EVPN GR] add comments and trace
Added comments and trace in GR code for more clarity and easy debugging Signed-off-by: Rajasekar Raja <[email protected]> Signed-off-by: Chirag Shah <[email protected]>
1 parent 7cb8e8e commit 0c01fd8

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

bgpd/bgp_route.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4087,6 +4087,8 @@ void bgp_process_gr_deferral_complete(struct bgp *bgp, afi_t afi, safi_t safi)
40874087

40884088
if (!route_sync_pending) {
40894089
bgp->gr_route_sync_pending = false;
4090+
/* Set bgp master GR COMPLETE flag */
4091+
frrtrace(3, frr_bgp, gr_update_complete, bgp->name_pretty, afi, safi);
40904092
bgp_update_gr_completion();
40914093
}
40924094
}
@@ -4320,7 +4322,20 @@ static inline void bgp_evpn_handle_deferred_bestpath_for_vrfs(void)
43204322
}
43214323
}
43224324

4323-
/* Process the routes with the flag BGP_NODE_SELECT_DEFER set */
4325+
/*
4326+
* Process the routes with the flag BGP_NODE_SELECT_DEFER set
4327+
*
4328+
* NOTE: Few important places where bgp_do_deferred_path_selection() is
4329+
* invoked are as below
4330+
* 1) For default VRF when EORs are received.
4331+
* 2) Start of deferral time when config read is done and peers are not in
4332+
* admin down in peer_unshut_after_cfg()
4333+
* 3) Via bgp_gr_start_route_select_timer() in 2 cases
4334+
* a) When there are still routes to be processed at the end of this
4335+
* function
4336+
* b) For non default Vrfs if EVPN is enabled in default vrf via
4337+
* bgp_evpn_handle_deferred_bestpath_for_vrfs()
4338+
*/
43244339
void bgp_do_deferred_path_selection(struct bgp *bgp, afi_t afi, safi_t safi)
43254340
{
43264341
struct afi_safi_info *thread_info;
@@ -4382,6 +4397,9 @@ void bgp_do_deferred_path_selection(struct bgp *bgp, afi_t afi, safi_t safi)
43824397
* is not GR enabled. In which case, none of the GR timers will
43834398
* be started/running. So for such VRFs, this trigger will do
43844399
* the deferred bestpath selection.
4400+
*
4401+
* This also handles the case where default BGP has EVPN enabled
4402+
* and non default VRFs(Tenant VRFs) dont have any peer.
43854403
*/
43864404
bgp_evpn_handle_deferred_bestpath_for_vrfs();
43874405
} else if (safi == SAFI_UNICAST && (afi == AFI_IP || afi == AFI_IP6)) {
@@ -4409,7 +4427,7 @@ void bgp_do_deferred_path_selection(struct bgp *bgp, afi_t afi, safi_t safi)
44094427
* OR
44104428
*
44114429
* 2. GR is enabled for l2vpn evpn afi safi in EVPN
4412-
* default VRF and GR is complete
4430+
* default VRF and GR is complete for default VRF
44134431
*/
44144432
bgp_deferred_path_selection(bgp, afi, safi, bgp->rib[afi][safi], cnt, NULL,
44154433
false);

bgpd/bgp_trace.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,17 @@ TRACEPOINT_EVENT(
690690
)
691691
TRACEPOINT_LOGLEVEL(frr_bgp, gr_eors, TRACE_INFO)
692692

693+
TRACEPOINT_EVENT(
694+
frr_bgp,
695+
gr_update_complete,
696+
TP_ARGS(char *, bgp_name,uint8_t, afi, uint8_t, safi),
697+
TP_FIELDS(ctf_string(bgp_instance, bgp_name)
698+
ctf_integer(uint8_t, afi, afi)
699+
ctf_integer(uint8_t, safi, safi)
700+
)
701+
)
702+
TRACEPOINT_LOGLEVEL(frr_bgp, gr_update_complete, TRACE_INFO)
703+
693704
/*
694705
* Loc1: gr_eor_awaited_from
695706
* Loc2: gr_eor_ignore

0 commit comments

Comments
 (0)