Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVPN Multihoming, EVPN re-factoring for MPLS and L3 Nexthop Group enhancements #6515

Closed
wants to merge 162 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
4109281
[mh-prep 1/9] evpn-netns: Revert PR5077, has been re-worked post-refa…
pjdruddy Jun 3, 2020
14acd64
[mh-prep 2/9] bgpd: pull the multihoming code out to a separate file
AnuradhaKaruppiah Mar 27, 2020
ef5a5ff
[mh-prep 3/9] lib: bitfield: new macros for bit processing
AnuradhaKaruppiah Mar 25, 2020
9f6764d
[mh-prep 4/9] lib: allow listnode memory to be managed by the app
AnuradhaKaruppiah Mar 27, 2020
08c1c8b
[mh-prep 5/9] lib: prefix: Add VTEP-IP to the EAD route prefix
AnuradhaKaruppiah Mar 25, 2020
694a841
[mh-prep 6/9] lib: timer: move the timer string api to lib
AnuradhaKaruppiah Mar 27, 2020
4fd0b1d
[mh-prep 7/9] linux: UAPI for L2-NHG and MAC-ECMP
AnuradhaKaruppiah Mar 25, 2020
5e84979
[mh-prep 8/9] bgpd: debug flags for MH
AnuradhaKaruppiah Mar 27, 2020
c007576
[mh-prep 9/9] bgpd: new memory types for MH
AnuradhaKaruppiah Mar 25, 2020
f3e94aa
[EAD 1/11] bgpd: extended community for EAD routes
AnuradhaKaruppiah Mar 27, 2020
5e420c5
[EAD 2/11] bgpd: attr changes for EAD routes
AnuradhaKaruppiah Mar 27, 2020
d111101
[EAD 3/11] bgpd: support for Ethernet Segments and Type-1/EAD routes
AnuradhaKaruppiah Mar 27, 2020
fca57aa
[EAD 4/11] bgpd: CLI changes for EAD routes and ES/ES-EVI display
AnuradhaKaruppiah Mar 28, 2020
9fc176f
[EAD 5/11] zebra: debug flags for evpn-mh ES and MAC-ECMP
AnuradhaKaruppiah Mar 27, 2020
46b3499
[EAD 6/11] zebra: support for adding L2NHG and mac-ecmp in the linux …
AnuradhaKaruppiah Mar 27, 2020
e063d7f
[EAD 7/11] zebra: Ethernet segment management and support for MAC-ECMP
AnuradhaKaruppiah Mar 28, 2020
bbeb1ce
[EAD 8/11] zebra: triggers for maintaining a list of access vlans per-ES
AnuradhaKaruppiah Mar 28, 2020
bb66fab
[EAD 9/11] zebra: CLI commands to display ethernet segments
AnuradhaKaruppiah Mar 28, 2020
b456ecf
[EAD 10/11] zebra: Stub rt_socket functions for L2 NHG programming
AnuradhaKaruppiah Apr 17, 2020
413d501
[EAD 11/11] lib, bgpd: Remove unused variable from structure
donaldsharp Jun 13, 2020
fb0e142
[SYNC 1/10] linux: UAPI for MAC sync
AnuradhaKaruppiah Mar 25, 2020
af56655
[SYNC 2/10] lib: MAC-IP flags used by zebra and BGP for SYNC route ha…
AnuradhaKaruppiah Mar 26, 2020
171326d
[SYNC 3/10] bgpd: extended-community and attrs for MAC-IP SYNC route …
AnuradhaKaruppiah Mar 28, 2020
35b817c
[SYNC 4/10] bgpd: evpn path selection changes for MAC-IP SYNC route h…
AnuradhaKaruppiah Mar 28, 2020
9c97f19
[SYNC 5/10] bgpd: Type-2/MAC-IP SYNC route handling
AnuradhaKaruppiah Mar 28, 2020
8cda2e7
[SYNC 6/10] bgpd: local path changes to display the SYNC info
AnuradhaKaruppiah Mar 28, 2020
30b9565
[SYNC 7/10] zebra: debug flags for MAC-IP sync
AnuradhaKaruppiah Mar 28, 2020
732cd36
[SYNC 8/10] zebra: netlink changes for programming MAC-IP SYNC routes…
AnuradhaKaruppiah Mar 29, 2020
3ed60bf
[SYNC 9/10] zebra: support for MAC-IP sync routes
AnuradhaKaruppiah Mar 29, 2020
6535725
[SYNC 10/10] zebra: remove linux/ifbridge.h from rt_netlink.c
AnuradhaKaruppiah Apr 17, 2020
27f2493
[refactor-prep 1/2] tests: add EVPN IP learning tests
pjdruddy Apr 17, 2020
25436a4
[refactor-prep 2/2] tests: remove ifindex from VNI JSON comparison
pjdruddy Jun 2, 2020
63f5e23
[refactor 1/16] zebra: rename vni to evpn where appropriate
pjdruddy Apr 17, 2020
d778c6a
[refactor 2/16] zebra: clone zebra_vxlan.c to zebra_evpn_mac.c
pjdruddy Apr 21, 2020
d0a7b98
[refactor 3/16] zebra: extract evpn mac functions from zebra_vxlan.c
pjdruddy Apr 22, 2020
ea23fe4
[refactor 4/16] zebra: split out mac_add code from process_remote_mac…
pjdruddy Apr 22, 2020
2c21502
[refactor 5/16] zebra: extract local mac add code from vxlan
pjdruddy Apr 22, 2020
6dfb1c6
[refactor 6/16] zebra: extract local mac del from zebra_vxlan.c
pjdruddy Apr 22, 2020
2952ebe
[refactor 7/16] zebra: extract gateway mac add from zebra_vxlan.c
pjdruddy Apr 22, 2020
f3d846d
[refactor 8/16] zebra: clone zebra_vxlan.c to zebra_evpn_neigh.c
pjdruddy Apr 23, 2020
0af2b74
[refactor 9/16] zebra: extract neighbor functions from zebra_vxlan.c
pjdruddy Apr 23, 2020
becdc86
[refactor 10/16] zebra: extract neigbor processing from remote_macip_add
pjdruddy Apr 24, 2020
ba37474
[refactor 11/16] zebra: extract neigbor processing from zevpn_gw_maci…
pjdruddy Apr 24, 2020
5cb4130
[refactor 12/16] zebra: extract neighbor processing from process_remo…
pjdruddy Apr 24, 2020
fe28703
[refactor 13/16] zebra: extract neighbor processing from kernel_neigh…
pjdruddy Apr 24, 2020
a122417
[refactor 14/16] zebra: clone zebra_vxlan.c to zebra_evpn.c
pjdruddy Apr 27, 2020
cd97568
[refactor 15/16] zebra: extract core EVPN functions from zebra_vxlan.c
pjdruddy Apr 28, 2020
615cb92
[refactor 16/16] zebra: remove a stray comment
AnuradhaKaruppiah May 13, 2020
29a2fea
[SYNC-2 1/3] zebra: changes for configuring mac and neigh holdtime
AnuradhaKaruppiah May 8, 2020
b1e16ec
[SYNC-2 2/3]linux: UAPI for neigh sync
AnuradhaKaruppiah Apr 1, 2020
9c2cf6e
[SYNC-2 3/3] zebra: setup static neigh flag in the dataplane
AnuradhaKaruppiah May 8, 2020
e002e1a
[EAD-2 1/3] zebra: remove FDB entries before de-activating a L2-NHG
AnuradhaKaruppiah May 8, 2020
788fe49
[DF 1/5] bgpd: changes for DF election
AnuradhaKaruppiah May 8, 2020
7c46196
[DF 2/5] zebra: changes to run DF election
AnuradhaKaruppiah May 8, 2020
bf74d4a
[EAD-2 2/3] zebra: fix misc problems with ES management
AnuradhaKaruppiah Apr 8, 2020
598e61b
[DF 3/5] zebra: dplane APIs for programming evpn-mh access port attri…
AnuradhaKaruppiah May 8, 2020
f1f3bc9
[DF 4/5] zebra: changes for programming SPH, non-DF and backup NHG br…
AnuradhaKaruppiah Apr 13, 2020
862be7f
[DF 5/5] zebra: handle local-es bridge port association
AnuradhaKaruppiah Apr 14, 2020
3455438
[failover] zebra: support for slow-failover of local MACs on an ES
AnuradhaKaruppiah May 9, 2020
bc0cfb4
[core-tracking] zebra: uplink tracking and startup delay for EVPN-MH
AnuradhaKaruppiah May 9, 2020
939b695
[EAD-2 3/3] zebra: free up the L2 NHG bitmap as a part of shutdown
AnuradhaKaruppiah May 9, 2020
fae8465
[IRB 1/10] bgpd: skip VRF import of MAC-IP routes that belong to loca…
AnuradhaKaruppiah May 9, 2020
f0e89a8
[IRB 2/10] bgpd: L3NHG infrastructure for host routes in EVPN
AnuradhaKaruppiah May 9, 2020
f6c1a59
[IRB 3/10] bgpd: Handle ES VTEP add/del to a host route
AnuradhaKaruppiah May 9, 2020
14057fe
[IRB 4/10] bgpd: use L3NHG while installing EVPN host routes in zebra
AnuradhaKaruppiah May 9, 2020
1f612c3
[IRB 5/10] bgpd: commands to display L3 NHGs and MAC-IP paths linked …
AnuradhaKaruppiah May 9, 2020
7cb5d02
zebra: Set NUD_NOARP on sticky MAC entries in addition to NTF_STICKY
AnuradhaKaruppiah May 9, 2020
3508931
zebra: fixup to uplink tracking
AnuradhaKaruppiah May 9, 2020
4dd48cb
[IRB 6/10] bgpd: Free up the NHG id resources last
AnuradhaKaruppiah May 10, 2020
71c2538
bgpd, zebra: Keep DAD disabled if EVPN MH is turned on
AnuradhaKaruppiah May 11, 2020
f5e2372
bgpd: fixup CLANG warnings
AnuradhaKaruppiah May 11, 2020
f949486
zebra: fixup clang warnings
AnuradhaKaruppiah May 11, 2020
0f2aab3
zebra: fixup a neigh del bug introduced by a previous commit for MAC-…
AnuradhaKaruppiah May 12, 2020
bcbb5fa
bgpd: fix ecom leak handling l3vni update
qlyoung May 14, 2020
7303def
lib, bgpd: move json_array_string_add to lib
AnuradhaKaruppiah May 17, 2020
5422798
zebra: add json output for zebra ES, ES-EVI and access vlan dumps
AnuradhaKaruppiah May 17, 2020
97e9f30
zebra: fixup problem with neigh "sync" flag setting
AnuradhaKaruppiah May 18, 2020
19111a5
zebra: skip NDA_DST attr if NHG is present
AnuradhaKaruppiah May 19, 2020
0c14388
zebra: change the nhg format from hex to dec for easy match up with t…
AnuradhaKaruppiah May 19, 2020
cfd7631
[L3NHG 1/40] zebra: fix fdb netlink update handler
AnuradhaKaruppiah May 19, 2020
dfca67c
[L3NHG 2/40] zebra: Convert zserv_nexthop_num_warn to return bool
donaldsharp Jan 9, 2020
b446293
[L3NHG 3/40] lib: Add the ability to grab a nhg starting id
donaldsharp Apr 22, 2020
edc610b
[L3NHG 4/40] zebra: Refactor nexthop reading from zapi messages
donaldsharp Apr 29, 2020
c3e7ae0
[L3NHG 5/40] lib, zebra: Add ZAPI_NHG_ADD|DELETE
donaldsharp Apr 29, 2020
8dca987
[L3NHG 6/40] lib, zebra: Add ability to send down a nhgid over route …
donaldsharp May 1, 2020
8b8da8e
[L3NHG 7/40] sharpd: add abilty to send a nhg to zebra
donaldsharp Apr 29, 2020
220dbd6
[L3NHG 8/40] zebra: remove NHG unhashable flag and its code
sworleys Apr 30, 2020
30bc91d
[L3NHG 9/40] zebra: implement protocol NHG Add/Del
sworleys May 5, 2020
bd61221
[L3NHG 10/40] zebra,lib: command to only install proto-based nexthops
sworleys May 13, 2020
f7e1747
[L3NHG 11/40] zebra: hash proto-created but zebra ID spaced NHGS
sworleys May 10, 2020
4350545
[L3NHG 12/40] zebra: implement NHG proto replace
sworleys May 10, 2020
3f3d679
[L3NHG 13/40] zebra: handle zapi routes with NHG ID set
sworleys May 10, 2020
01d0740
[L3NHG 14/40] zebra: special handling for proto-NHG-based routes
sworleys May 10, 2020
6c160ad
[L3NHG 15/40] zebra: dont update counter if outside of zebra ID range
sworleys May 10, 2020
5176a00
[L3NHG 16/40] zebra: NHG ID bounds macros
sworleys May 13, 2020
108e520
[L3NHG 17/40] sharpd: print the correct ID the NHG is using
sworleys May 13, 2020
c04c02c
[L3NHG 18/40] zebra: make NHG ID allocation smarter
sworleys May 13, 2020
3075310
[L3NHG 19/40] zebra: use the passed proto from zapi
sworleys May 13, 2020
bc65785
[L3NHG 20/40] zebra: fix route validity check with NHG ID
sworleys May 14, 2020
99d8279
[L3NHG 21/40] lib: add onlink flag to zapi_nh conversion helper
sworleys May 18, 2020
9a35bd3
[L3NHG 22/40] lib,doc: add `onlink` flag to nexthop group config
sworleys May 18, 2020
6349cae
[L3NHG 23/40] zebra: Prevent duplicate re-install
donaldsharp May 17, 2020
476bc0f
[L3NHG 24/40] zebra: remove unneeded nhg repalce boilerplate
sworleys May 20, 2020
804f194
[L3NHG 25/40] zebra: inc/dec refcount on add/del NHG proto
sworleys May 20, 2020
5005441
[L3NHG 26/40] zebra: handle proto NHG uninstall client disconnect
sworleys May 20, 2020
5283268
[L3NHG 27/40] zebra: warn if zapi NHG add has no nexthops
sworleys May 20, 2020
022071e
[L3NHG 28/40] zebra: fix refcnt/rib issues in NHG replace/delete
sworleys May 20, 2020
983b810
[L3NHG 29/40] zebra: increment the nhg proto score iterator
sworleys May 20, 2020
516396d
[L3NHG 30/40] zebra: fix releasing proto-owned singletons
sworleys May 24, 2020
dbe0af9
[L3NHG 31/40] zebra: return the proto nhe on del even with refs
sworleys May 24, 2020
501a9ad
[L3NHG 32/40] lib,sharpd,pbrd: `set installable` nhg command
sworleys May 27, 2020
ee9b6f4
[L3NHG 33/40] lib: add logging for ZEBRA_NHG_ADD[DEL]
sworleys May 28, 2020
818bc3a
[L3NHG 34/40] zebra: add logging for NHG ignoring in netlink
sworleys May 28, 2020
e436743
zebra: change the L2 NHG id format to co-exist with the L3NHG ids
AnuradhaKaruppiah May 15, 2020
280a14b
bgpd: Use L3NHGs for symmetric IRB host routes
AnuradhaKaruppiah May 15, 2020
0bc2912
bgpd: add a config knob to enable use of L3 NHG for EVPN host routes
AnuradhaKaruppiah May 18, 2020
1c733b9
zebra: fixup pending items
AnuradhaKaruppiah May 20, 2020
800db83
zebra: stop neigh hold timer when the neigh is deleted
AnuradhaKaruppiah May 26, 2020
6978138
zebra: debug logs to detect incorrect mac deletions
AnuradhaKaruppiah May 26, 2020
021f3c5
zebra: dup detected mac avoid update to bgpd
chiragshah6 May 26, 2020
9403e4b
zebra: allocate one nexthop id per-VTEP instead of one per-ES-VTEP
AnuradhaKaruppiah May 27, 2020
239fa58
zebra: fix incorrect uplink oper count update
AnuradhaKaruppiah May 29, 2020
6cd7b46
zebra: check if es is present before attempting slow failover
AnuradhaKaruppiah May 31, 2020
446bdd0
zebra: fix sanitizer report of freed es use during zebra shutdown
AnuradhaKaruppiah May 31, 2020
76b9877
zebra: re-name some mh functions to make the code more readable
AnuradhaKaruppiah May 31, 2020
da6f530
sharpd: replace strncpy with strlcpy
pjdruddy Jun 1, 2020
790fcf5
[refactor-2] zebra: resolve multiple functions for local MAC delete
pjdruddy Jun 1, 2020
10038bd
[netns 1/21] zebra: importation of bgp evpn rt5 from vni with other n…
pguibert6WIND Sep 26, 2019
b4a2e10
[netns 2/21] zebra: zvni_from_svi() adaptation for other network name…
pguibert6WIND Sep 27, 2019
77ae363
[netns 3/21] zebra: zvni_map_to_svi() adaptation for other network na…
pguibert6WIND Sep 27, 2019
eec86ea
[netns 4/21] zebra: display interface slave type
pguibert6WIND Sep 27, 2019
3de2f88
[netns 5/21] zebra: map vxlan interface to bridge interface with corr…
pguibert6WIND Oct 1, 2019
1013be8
[netns 6/21] zebra, lib: add an internal API to get relative default …
pguibert6WIND Oct 2, 2019
93b9a7c
[netns 7/21] zebra, lib: store relative default ns id in each namespace
pguibert6WIND Oct 2, 2019
d0e52d3
[netns 8/21] zebra, lib: new API to get absolute netns val from relat…
pguibert6WIND Oct 2, 2019
e25bf88
[netns 9/21] zebra: bridge layer2 information records ns_id where bri…
pguibert6WIND Oct 3, 2019
b5fc8d9
[netns 10/21] zebra: add ns_id attribute to mac structure
pguibert6WIND Oct 9, 2019
1b48c56
[netns 11/21] zebra: fdb and neighbor table are read for all zns
pguibert6WIND Sep 27, 2019
e2cf41d
[netns 12/21] zebra: zvni_map_to_vlan() adaptation for all namespaces
pguibert6WIND Oct 9, 2019
cd048d9
[netns 13/21] bgpd: evpn nexthop can be changed by default
pguibert6WIND Oct 11, 2019
3d7e9de
[netns 14/21] zebra: when parsing local entry against dad, retrieve c…
pguibert6WIND Oct 25, 2019
14997be
[netns 15/21] zebra: local mac entries populated in correct netnamespace
pguibert6WIND Oct 28, 2019
95d0826
[netns 16/21] lib, zebra: reuse and adapt ns_list walk functionality
pguibert6WIND Dec 20, 2019
5e43d7b
[netns 17/21] bgpd: sanity check when updating nexthop from bgp to zebra
pguibert6WIND Jan 3, 2020
780cead
[netns 18/21] zebra: dynamically detect vxlan link interfaces in othe…
pguibert6WIND Jan 6, 2020
4147374
[netns 19/21] doc: add some documentation about bgp evpn netns support
pguibert6WIND Feb 6, 2020
c9d56f1
[netns 20/21] zebra: support for macvlan interfaces
pguibert6WIND Feb 6, 2020
9ae9523
[netns 21/21] topotests: add bgp_evpn_rt5 test with vrf netns backend
pguibert6WIND Mar 3, 2020
dc46a93
zebra: fix deletion of evpn mh neigh-holdtime
dslicenc Jun 4, 2020
6adcb54
[L3NHG 35/40] Revert "lib,sharpd,pbrd: `set installable` nhg command"
donaldsharp Jun 4, 2020
0d452d6
doc: Add documentation for EVPN Multihoming
AnuradhaKaruppiah Jun 4, 2020
3d41a8c
topotests: bgp_evpn_rt5 test uses ip link instead of bridge-utils
pguibert6WIND Jun 5, 2020
0e01e5d
zebra: set inactive bit when zebra re-installs the MAC on dplane del
AnuradhaKaruppiah Jun 7, 2020
24263b2
zebra: on local mac add from the dplane a re-install maybe need as st…
AnuradhaKaruppiah Jun 8, 2020
6c76433
test: topotest bgp_evpn_rt5 runs on kernel > 4.18
pguibert6WIND Jun 9, 2020
7d3e232
bgp: remove duplicate command installs
pjdruddy Jun 10, 2020
6db37b0
bgpd, zebra: remove strcpy, strlen and sprintf calls
pjdruddy Jun 10, 2020
f3eef01
[L3NHG 36/40] zebra: Only install a minimal amount of times
donaldsharp Jun 11, 2020
be3dc92
[L3NHG 37/40] zebra: Properly set NEXTHOP_FLAG_FIB when skipping install
donaldsharp Jun 11, 2020
dc9a1a5
[L3NHG 38/40] lib,zebra: fixup NHG notify zapi messaging
sworleys Jun 11, 2020
cfe4599
[L3NHG 39/40] zebra: reply fail on NHG add if not ifindex/onlink
sworleys Jun 11, 2020
98203bf
[L3NHG 40/40] sharpd: implement NHG notification handling
sworleys Jun 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[SYNC 4/10] bgpd: evpn path selection changes for MAC-IP SYNC route h…
…andling

When a SYNC route i.e. a route with a local ES as destination is
rxed on a switch (say L11) from an ES peer (say L12) a local
MAC/neigh entry is created on L11 with the local access port
as dest port.

Creation of the local entry triggers a local path advertisement from
L11. This could be a "locally-active" path or a "locally-inactive"
path. Inactive paths are advertised with the proxy bit.

To ensure that the local entry is not deleted by a SYNC route it is
given absolute precedence over peer-paths.

If there are two non-local paths with the same dest ES and same MM
seq number the non-proxy path is preferred. This is done to ensure
that we don't lose track of the peer-activity.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
  • Loading branch information
AnuradhaKaruppiah committed Jun 15, 2020
commit 35b817cd3e77e248d8bb3a55f0739c5d11bbca57
89 changes: 87 additions & 2 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,11 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
uint32_t new_mm_seq;
uint32_t exist_mm_seq;
int nh_cmp;
esi_t *exist_esi;
esi_t *new_esi;
bool same_esi;
bool old_proxy;
bool new_proxy;

*paths_eq = 0;

Expand Down Expand Up @@ -621,6 +626,47 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
}
}

new_esi = bgp_evpn_attr_get_esi(newattr);
exist_esi = bgp_evpn_attr_get_esi(existattr);
if (bgp_evpn_is_esi_valid(new_esi) &&
!memcmp(new_esi, exist_esi, sizeof(esi_t))) {
same_esi = true;
} else {
same_esi = false;
}

/* If both paths have the same non-zero ES and
* one path is local it wins.
* PS: Note the local path wins even if the remote
* has the higher MM seq. The local path's
* MM seq will be fixed up to match the highest
* rem seq, subsequently.
*/
if (same_esi) {
char esi_buf[ESI_STR_LEN];

if (bgp_evpn_is_path_local(bgp, new)) {
*reason = bgp_path_selection_evpn_local_path;
if (debug)
zlog_debug(
"%s: %s wins over %s as ES %s is same and local",
pfx_buf, new_buf, exist_buf,
esi_to_str(new_esi, esi_buf,
sizeof(esi_buf)));
return 1;
}
if (bgp_evpn_is_path_local(bgp, exist)) {
*reason = bgp_path_selection_evpn_local_path;
if (debug)
zlog_debug(
"%s: %s loses to %s as ES %s is same and local",
pfx_buf, new_buf, exist_buf,
esi_to_str(new_esi, esi_buf,
sizeof(esi_buf)));
return 0;
}
}

new_mm_seq = mac_mobility_seqnum(newattr);
exist_mm_seq = mac_mobility_seqnum(existattr);

Expand All @@ -644,6 +690,30 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
return 0;
}

/* if the sequence numbers and ESI are the same and one path
* is non-proxy it wins (over proxy)
*/
new_proxy = bgp_evpn_attr_is_proxy(newattr);
old_proxy = bgp_evpn_attr_is_proxy(existattr);
if (same_esi && bgp_evpn_attr_is_local_es(newattr) &&
old_proxy != new_proxy) {
if (!new_proxy) {
*reason = bgp_path_selection_evpn_non_proxy;
if (debug)
zlog_debug(
"%s: %s wins over %s, same seq/es and non-proxy",
pfx_buf, new_buf, exist_buf);
return 1;
}

*reason = bgp_path_selection_evpn_non_proxy;
if (debug)
zlog_debug(
"%s: %s loses to %s, same seq/es and non-proxy",
pfx_buf, new_buf, exist_buf);
return 0;
}

/*
* if sequence numbers are the same path with the lowest IP
* wins
Expand Down Expand Up @@ -1176,6 +1246,17 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
return 1;
}


int bgp_evpn_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
struct bgp_path_info *exist, int *paths_eq)
{
enum bgp_path_selection_reason reason;
char pfx_buf[PREFIX2STR_BUFFER];

return bgp_path_info_cmp(bgp, new, exist, paths_eq, NULL, 0, pfx_buf,
AFI_L2VPN, SAFI_EVPN, &reason);
}

/* Compare two bgp route entity. Return -1 if new is preferred, 1 if exist
* is preferred, or 0 if they are the same (usually will only occur if
* multipath is enabled
Expand Down Expand Up @@ -7893,7 +7974,7 @@ void route_vty_out(struct vty *vty, const struct prefix *p,
vty_out(vty, "%s", bgp_origin_str[attr->origin]);

if (json_paths) {
if (memcmp(&attr->esi, zero_esi, sizeof(esi_t))) {
if (bgp_evpn_is_esi_valid(&attr->esi)) {
json_object_string_add(json_path, "esi",
esi_to_str(&attr->esi,
esi_buf, sizeof(esi_buf)));
Expand Down Expand Up @@ -7944,7 +8025,7 @@ void route_vty_out(struct vty *vty, const struct prefix *p,
vty_out(vty, "\n");

if (safi == SAFI_EVPN) {
if (memcmp(&attr->esi, zero_esi, sizeof(esi_t))) {
if (bgp_evpn_is_esi_valid(&attr->esi)) {
vty_out(vty, "%*s", 20, " ");
vty_out(vty, "ESI:%s\n",
esi_to_str(&attr->esi,
Expand Down Expand Up @@ -8562,6 +8643,10 @@ static const char *bgp_path_selection_reason2str(
return "EVPN sequence number";
case bgp_path_selection_evpn_lower_ip:
return "EVPN lower IP";
case bgp_path_selection_evpn_local_path:
return "EVPN local ES path";
case bgp_path_selection_evpn_non_proxy:
return "EVPN non poxy";
case bgp_path_selection_weight:
return "Weight";
case bgp_path_selection_local_pref:
Expand Down
2 changes: 2 additions & 0 deletions bgpd/bgp_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -681,4 +681,6 @@ extern int bgp_best_path_select_defer(struct bgp *bgp, afi_t afi, safi_t safi);
extern bool bgp_update_martian_nexthop(struct bgp *bgp, afi_t afi, safi_t safi,
uint8_t type, uint8_t stype,
struct attr *attr, struct bgp_node *rn);
extern int bgp_evpn_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
struct bgp_path_info *exist, int *paths_eq);
#endif /* _QUAGGA_BGP_ROUTE_H */
2 changes: 2 additions & 0 deletions bgpd/bgp_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ enum bgp_path_selection_reason {
bgp_path_selection_first,
bgp_path_selection_evpn_sticky_mac,
bgp_path_selection_evpn_seq,
bgp_path_selection_evpn_local_path,
bgp_path_selection_evpn_non_proxy,
bgp_path_selection_evpn_lower_ip,
bgp_path_selection_weight,
bgp_path_selection_local_pref,
Expand Down