From 50346a989ffa2554caa36df131caf72a0750a675 Mon Sep 17 00:00:00 2001 From: vivek Date: Tue, 24 Mar 2020 12:19:37 -0700 Subject: [PATCH] bgpd: Add link-bandwidth fields for multipath calc Introduce fields in the multipath structure for link bandwidth handling. In the process, the mp_count field is changed to a uint16 as that is the value set anyway. Signed-off-by: Vivek Venkatraman --- bgpd/bgp_mpath.c | 2 +- bgpd/bgp_mpath.h | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c index cbef41bafd..fb0613ebb7 100644 --- a/bgpd/bgp_mpath.c +++ b/bgpd/bgp_mpath.c @@ -390,7 +390,7 @@ uint32_t bgp_path_info_mpath_count(struct bgp_path_info *path) * Sets the count of multipaths into bestpath's mpath element */ static void bgp_path_info_mpath_count_set(struct bgp_path_info *path, - uint32_t count) + uint16_t count) { struct bgp_path_info_mpath *mpath; if (!count && !path->mpath) diff --git a/bgpd/bgp_mpath.h b/bgpd/bgp_mpath.h index d15f3c9035..ea82d0c444 100644 --- a/bgpd/bgp_mpath.h +++ b/bgpd/bgp_mpath.h @@ -36,10 +36,18 @@ struct bgp_path_info_mpath { struct bgp_path_info *mp_info; /* When attached to best path, the number of selected multipaths */ - uint32_t mp_count; + uint16_t mp_count; + + /* Flags - relevant as noted. */ + uint16_t mp_flags; +/* Attached to best path, indicates that all multipaths have link-bandwidth */ +#define BGP_MP_LB_ALL 0x1 /* Aggregated attribute for advertising multipath route */ struct attr *mp_attr; + + /* Cumulative bandiwdth of all multipaths - attached to best path. */ + uint64_t cum_bw; }; /* Functions to support maximum-paths configuration */ -- 2.39.5