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/strategy_dpo_ctx.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'hicn-plugin/src/strategy_dpo_ctx.h') diff --git a/hicn-plugin/src/strategy_dpo_ctx.h b/hicn-plugin/src/strategy_dpo_ctx.h index 737071766..2a534c4dc 100644 --- a/hicn-plugin/src/strategy_dpo_ctx.h +++ b/hicn-plugin/src/strategy_dpo_ctx.h @@ -25,7 +25,7 @@ //FIB table for hicn. 0 is the default one used by ip #define HICN_FIB_TABLE 0 -#define NEXT_HOP_INVALID DPO_INVALID +#define NEXT_HOP_INVALID ~0 #define INIT_SEQ 0 @@ -41,8 +41,8 @@ typedef struct __attribute__ ((packed)) hicn_dpo_ctx_s { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); - /* 8B*5 = 40B */ - dpo_id_t next_hops[HICN_PARAM_FIB_ENTRY_NHOPS_MAX]; + /* 4B*10 = 40B */ + hicn_face_id_t next_hops[HICN_PARAM_FIB_ENTRY_NHOPS_MAX]; /* 40B + 4B = 44B */ u32 locks; /* 44B + 1B = 45B */ @@ -55,7 +55,7 @@ typedef struct __attribute__ ((packed)) hicn_dpo_ctx_s u16 padding; /* To align to 8B */ /* 48 + 4B = 52; last sequence number */ - seq_t seq; + u32 seq; /* 48 + 1B = 53; last sequence number */ dpo_type_t dpo_type; @@ -76,10 +76,10 @@ extern hicn_dpo_ctx_t *hicn_strategy_dpo_ctx_pool; * @param dpo_type Type of dpo. It identifies the strategy. */ always_inline void -init_dpo_ctx (hicn_dpo_ctx_t * dpo_ctx, const dpo_id_t * next_hop, +init_dpo_ctx (hicn_dpo_ctx_t * dpo_ctx, const hicn_face_id_t * next_hop, int nh_len, dpo_type_t dpo_type) { - dpo_id_t invalid = NEXT_HOP_INVALID; + hicn_face_id_t invalid = NEXT_HOP_INVALID; dpo_ctx->entry_count = 0; dpo_ctx->locks = 0; @@ -91,7 +91,7 @@ init_dpo_ctx (hicn_dpo_ctx_t * dpo_ctx, const dpo_id_t * next_hop, for (int i = 0; i < HICN_PARAM_FIB_ENTRY_NHOPS_MAX && i < nh_len; i++) { - clib_memcpy (&dpo_ctx->next_hops[i], &next_hop[i], sizeof (dpo_id_t)); + dpo_ctx->next_hops[i] = next_hop[i]; dpo_ctx->entry_count++; } @@ -151,7 +151,7 @@ void hicn_strategy_dpo_ctx_unlock (dpo_id_t * dpo); * otherwise HICN_ERROR_DPO_CTX_NOT_FOUND */ int -hicn_strategy_dpo_ctx_add_nh (const dpo_id_t * nh, hicn_dpo_ctx_t * dpo_ctx, +hicn_strategy_dpo_ctx_add_nh (hicn_face_id_t nh, hicn_dpo_ctx_t * dpo_ctx, u8 * pos); /** -- cgit 1.2.3-korg