Merge pull request #6833 from donaldsharp/pcount_selected

bgpd: Add to neighbor prefix-counts the count of best path selected
This commit is contained in:
Donatas Abraitis 2020-08-01 13:09:28 +03:00 committed by GitHub
commit 5a45d61308
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11651,6 +11651,7 @@ enum bgp_pcounts {
PCOUNT_VALID, PCOUNT_VALID,
PCOUNT_ALL, PCOUNT_ALL,
PCOUNT_COUNTED, PCOUNT_COUNTED,
PCOUNT_BPATH_SELECTED,
PCOUNT_PFCNT, /* the figure we display to users */ PCOUNT_PFCNT, /* the figure we display to users */
PCOUNT_MAX, PCOUNT_MAX,
}; };
@ -11664,6 +11665,7 @@ static const char *const pcount_strs[] = {
[PCOUNT_VALID] = "Valid", [PCOUNT_VALID] = "Valid",
[PCOUNT_ALL] = "All RIB", [PCOUNT_ALL] = "All RIB",
[PCOUNT_COUNTED] = "PfxCt counted", [PCOUNT_COUNTED] = "PfxCt counted",
[PCOUNT_BPATH_SELECTED] = "PfxCt Best Selected",
[PCOUNT_PFCNT] = "Useable", [PCOUNT_PFCNT] = "Useable",
[PCOUNT_MAX] = NULL, [PCOUNT_MAX] = NULL,
}; };
@ -11704,6 +11706,8 @@ static void bgp_peer_count_proc(struct bgp_dest *rn, struct peer_pcounts *pc)
pc->count[PCOUNT_VALID]++; pc->count[PCOUNT_VALID]++;
if (!CHECK_FLAG(pi->flags, BGP_PATH_UNUSEABLE)) if (!CHECK_FLAG(pi->flags, BGP_PATH_UNUSEABLE))
pc->count[PCOUNT_PFCNT]++; pc->count[PCOUNT_PFCNT]++;
if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED))
pc->count[PCOUNT_BPATH_SELECTED]++;
if (CHECK_FLAG(pi->flags, BGP_PATH_COUNTED)) { if (CHECK_FLAG(pi->flags, BGP_PATH_COUNTED)) {
pc->count[PCOUNT_COUNTED]++; pc->count[PCOUNT_COUNTED]++;