summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_path.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-10-08 14:51:11 +0000
committerFlorin Coras <florin.coras@gmail.com>2018-10-16 01:39:50 +0000
commitac64b71b2893341b2e342865c209ee63c2dc3138 (patch)
tree30d38ed27ab74df23018b94fe5c479e8652a9c44 /src/vnet/fib/fib_path.c
parenta23caded85ebc754b8e355d04cc747adfde5d467 (diff)
Sticky Load-balance
keep the number of buckets in the load-balanced fixed. If a path goes dwon fill its buckets with those from the next available up path. Change-Id: I15603ccb899fa9b77556b898c99136379cf32eae Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib/fib_path.c')
-rw-r--r--src/vnet/fib/fib_path.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/vnet/fib/fib_path.c b/src/vnet/fib/fib_path.c
index 4c93f732b72..4ec04f5b950 100644
--- a/src/vnet/fib/fib_path.c
+++ b/src/vnet/fib/fib_path.c
@@ -2521,15 +2521,20 @@ fib_path_append_nh_for_multipath_hash (fib_node_index_t path_index,
ASSERT(path);
+ vec_add2(hash_key, mnh, 1);
+
+ mnh->path_weight = path->fp_weight;
+ mnh->path_index = path_index;
+
if (fib_path_is_resolved(path_index))
{
- vec_add2(hash_key, mnh, 1);
-
- mnh->path_weight = path->fp_weight;
- mnh->path_index = path_index;
- fib_path_contribute_forwarding(path_index, fct, &mnh->path_dpo);
+ fib_path_contribute_forwarding(path_index, fct, &mnh->path_dpo);
+ }
+ else
+ {
+ dpo_copy(&mnh->path_dpo,
+ drop_dpo_get(fib_forw_chain_type_to_dpo_proto(fct)));
}
-
return (hash_key);
}