diff options
author | vivek <vivek@cumulusnetworks.com> | 2016-09-05 19:53:06 +0200 |
---|---|---|
committer | vivek <vivek@cumulusnetworks.com> | 2016-09-05 19:53:06 +0200 |
commit | a6086ad4084a9dfbf930ef48e2987772767063bd (patch) | |
tree | 9db832ac4dd0d2cee7e50355f8f6004b36096b78 /bgpd/bgp_route.c | |
parent | bgpd: Fix route install upon multipath nexthop change (diff) | |
download | frr-a6086ad4084a9dfbf930ef48e2987772767063bd.tar.xz frr-a6086ad4084a9dfbf930ef48e2987772767063bd.zip |
bgpd: Enhance path selection logs
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-12390
Reviewed By: CCR-5136
Testing Done: Manual
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r-- | bgpd/bgp_route.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index af8c2cf70..7295ff147 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -376,7 +376,11 @@ bgp_info_cmp (struct bgp *bgp, struct bgp_info *new, struct bgp_info *exist, } if (debug) - bgp_info_path_with_addpath_rx_str (exist, exist_buf); + { + bgp_info_path_with_addpath_rx_str (exist, exist_buf); + zlog_debug("%s: Comparing %s flags 0x%x with %s flags 0x%x", + pfx_buf, new_buf, new->flags, exist_buf, exist->flags); + } newattr = new->attr; existattr = exist->attr; @@ -705,6 +709,15 @@ bgp_info_cmp (struct bgp *bgp, struct bgp_info *new, struct bgp_info *exist, * TODO: If unequal cost ibgp multipath is enabled we can * mark the paths as equal here instead of returning */ + if (debug) + { + if (ret == 1) + zlog_debug("%s: %s wins over %s after IGP metric comparison", + pfx_buf, new_buf, exist_buf); + else + zlog_debug("%s: %s loses to %s after IGP metric comparison", + pfx_buf, new_buf, exist_buf); + } return ret; } @@ -1638,14 +1651,19 @@ bgp_best_selection (struct bgp *bgp, struct bgp_node *rn, /* Now that we know which path is the bestpath see if any of the other paths * qualify as multipaths */ - if (do_mpath && new_select) + if (debug) { - if (debug) - { - bgp_info_path_with_addpath_rx_str (new_select, path_buf); - zlog_debug("%s: %s is the bestpath, now find multipaths", pfx_buf, path_buf); - } + if (new_select) + bgp_info_path_with_addpath_rx_str (new_select, path_buf); + else + sprintf (path_buf, "NONE"); + zlog_debug("%s: After path selection, newbest is %s oldbest was %s", + pfx_buf, path_buf, + old_select ? old_select->peer->host : "NONE"); + } + if (do_mpath && new_select) + { for (ri = rn->info; (ri != NULL) && (nextri = ri->next, 1); ri = nextri) { |