diff options
| author | Stephen Worley <sworley@nvidia.com> | 2021-07-23 13:35:14 -0400 | 
|---|---|---|
| committer | Stephen Worley <sworley@nvidia.com> | 2022-10-11 15:18:39 -0400 | 
| commit | 34c7f35f0217e16447ca0bc6aedd8aba2e51f877 (patch) | |
| tree | 0ec904baf275d59ae7ecdd758e5f38e727f87d34 /bgpd/bgp_evpn_mh.c | |
| parent | 7d99ad7f93e42ca2f58023374843d70039a8310f (diff) | |
bgpd: rework VNI table for type2/macip routes
Use the IP addr of type2/macip routes only for the hash/key
of the VNI table and carry the MAC in a path_info_extra attribute.
There is exists situations that can be hit during extended MAC mobility events
where two MACs could be pointing to the same IP in our global table. It
is requires very specific timings.
When that happens, BPG would (because we key'd on both MAC and IP)
install both into it's VNI table as separate entries, but zebra only
knows/needs to know about a single IP -> MAC relationship for it's VNI
table's type2 routes. So it was compleletly undeterministic which one
zebra would end up with in these timing situations.
With these changes, we move BGP's VNI table to key'd the same as Zebra's
and now a single IP will have multiple path_info's with a path_info_extra
that is carrying the MAC info for each path.
BGP will then run best path to deterministically decide which one to send to
zebra during the occasions where there exist's two possible MACs.
Signed-off-by: Stephen Worley <sworley@nvidia.com>
Diffstat (limited to 'bgpd/bgp_evpn_mh.c')
| -rw-r--r-- | bgpd/bgp_evpn_mh.c | 14 | 
1 files changed, 7 insertions, 7 deletions
diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c index 1d40664aeb..a0ab0881e7 100644 --- a/bgpd/bgp_evpn_mh.c +++ b/bgpd/bgp_evpn_mh.c @@ -498,9 +498,8 @@ static int bgp_evpn_mh_route_delete(struct bgp *bgp, struct bgp_evpn_es *es,  	/* Next, locate route node in the global EVPN routing table.  	 * Note that this table is a 2-level tree (RD-level + Prefix-level)  	 */ -	global_dest = -		bgp_global_evpn_node_lookup(bgp->rib[afi][safi], afi, safi, -					    (const struct prefix_evpn *)p, prd); +	global_dest = bgp_evpn_global_node_lookup(bgp->rib[afi][safi], afi, +						  safi, p, prd, NULL);  	if (global_dest) {  		/* Delete route entry in the global EVPN table. */ @@ -675,8 +674,9 @@ static int bgp_evpn_type4_route_update(struct bgp *bgp,  	if (route_changed) {  		struct bgp_path_info *global_pi; -		dest = bgp_global_evpn_node_get(bgp->rib[afi][safi], afi, safi, -						p, &es->es_base_frag->prd); +		dest = bgp_evpn_global_node_get(bgp->rib[afi][safi], afi, safi, +						p, &es->es_base_frag->prd, +						NULL);  		bgp_evpn_mh_route_update(bgp, es, NULL, afi, safi, dest,  					 attr_new, &global_pi, &route_changed); @@ -1015,8 +1015,8 @@ static int bgp_evpn_type1_route_update(struct bgp *bgp, struct bgp_evpn_es *es,  	if (route_changed) {  		struct bgp_path_info *global_pi; -		dest = bgp_global_evpn_node_get(bgp->rib[afi][safi], afi, safi, -						p, global_rd); +		dest = bgp_evpn_global_node_get(bgp->rib[afi][safi], afi, safi, +						p, global_rd, NULL);  		bgp_evpn_mh_route_update(bgp, es, vpn, afi, safi, dest,  					 attr_new, &global_pi, &route_changed);  | 
