From c61e2e149421b849888bea0239c50607edce35ac Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Tue, 7 Apr 2020 11:43:39 +0200 Subject: [HICN-590] Removed andjacency type specific face implementation Changes in the new implementation are: - the adjacency index is replaced with a dpo that allows the single face node to dispatch the packet to the right vlib node. - local and remote address in the face are replaced with a single nat address which is used to perform the nat operation when rewriting an interest or a data (in case of tunnels the nat address will be equal to 0) - the list of next hop in the load balance is no longer a list of dpos but a list of face id (this makes the code easier and increases the number of next hop we supports) Signed-off-by: Alberto Compagno Change-Id: I4ac2b4eb09425bfe1b3ca9f82d7d0ff564297b0d --- hicn-plugin/src/strategies/dpo_rr.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'hicn-plugin/src/strategies/dpo_rr.c') diff --git a/hicn-plugin/src/strategies/dpo_rr.c b/hicn-plugin/src/strategies/dpo_rr.c index a67b06acb..40620bb51 100644 --- a/hicn-plugin/src/strategies/dpo_rr.c +++ b/hicn-plugin/src/strategies/dpo_rr.c @@ -76,8 +76,6 @@ format_hicn_strategy_rr_ctx (u8 * s, va_list * ap) index_t index = va_arg (*ap, index_t); hicn_dpo_ctx_t *dpo_ctx = NULL; hicn_strategy_rr_ctx_t *rr_dpo_ctx = NULL; - dpo_id_t *next_hop = NULL; - hicn_face_vft_t *face_vft = NULL; u32 indent = va_arg (*ap, u32); dpo_ctx = hicn_strategy_dpo_ctx_get (index); @@ -88,7 +86,7 @@ format_hicn_strategy_rr_ctx (u8 * s, va_list * ap) s = format (s, "hicn-rr, next hop Face %d", - dpo_ctx->next_hops[rr_dpo_ctx->current_nhop].dpoi_index); + dpo_ctx->next_hops[rr_dpo_ctx->current_nhop]); for (i = 0; i < HICN_PARAM_FIB_ENTRY_NHOPS_MAX; i++) { @@ -101,23 +99,18 @@ format_hicn_strategy_rr_ctx (u8 * s, va_list * ap) else continue; - next_hop = &dpo_ctx->next_hops[i]; - face_vft = hicn_face_get_vft (next_hop->dpoi_type); - if (face_vft != NULL) - { - s = format (s, "\n"); - s = - format (s, "%U ", face_vft->format_face, next_hop->dpoi_index, - indent); - s = format (s, " %s", buf); - } + s = format (s, "\n"); + s = + format (s, "%U ", format_hicn_face, dpo_ctx->next_hops[i], + indent); + s = format (s, " %s", buf); } return (s); } void -hicn_strategy_rr_ctx_create (dpo_proto_t proto, const dpo_id_t * next_hop, +hicn_strategy_rr_ctx_create (dpo_proto_t proto, const hicn_face_id_t * next_hop, int nh_len, index_t * dpo_idx) { hicn_strategy_rr_ctx_t *hicn_strategy_rr_ctx; @@ -135,7 +128,7 @@ hicn_strategy_rr_ctx_create (dpo_proto_t proto, const dpo_id_t * next_hop, } int -hicn_strategy_rr_ctx_add_nh (const dpo_id_t * nh, index_t dpo_idx) +hicn_strategy_rr_ctx_add_nh (hicn_face_id_t nh, index_t dpo_idx) { hicn_dpo_ctx_t *hicn_strategy_dpo_ctx = hicn_strategy_dpo_ctx_get (dpo_idx); u8 pos = 0; -- cgit 1.2.3-korg