aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/strategies
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-02-19 18:46:36 +0100
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-02-20 18:03:16 +0100
commit1c5106f66a6749266cb1d228eda98413c80cbf1f (patch)
tree40bd4c7c42eaabd3fd038caa8f9e2fe432f9a434 /hicn-plugin/src/strategies
parent286fd55fc0cf620747209570a32b79d97d50d9b4 (diff)
[HICN-71]
- Handling the case in which a pushed data hit an existing pit entry (created after the data has gone through the data_pcslookup_node). In this case the data packet is forwarded to the data_fwd_node - Handling the case in which the hash table (in pcs) is full and it is not possible to allocate another bucket. In this case the packet is dropped. - Copying packets whose length is less than 128B. VPP prevents to create a chain of vlib_buffer where the first, or middle, vlib_buffer are holding less then 128B. [HICN-72] - Assign a /128 subnet to the producer app face. Change-Id: I6c19d6d127774a7f59ac69ac965d4bcd6a72becc Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'hicn-plugin/src/strategies')
-rw-r--r--hicn-plugin/src/strategies/dpo_mw.c32
-rw-r--r--hicn-plugin/src/strategies/strategy_mw.c6
2 files changed, 23 insertions, 15 deletions
diff --git a/hicn-plugin/src/strategies/dpo_mw.c b/hicn-plugin/src/strategies/dpo_mw.c
index 882368e6e..80cbcf2ee 100644
--- a/hicn-plugin/src/strategies/dpo_mw.c
+++ b/hicn-plugin/src/strategies/dpo_mw.c
@@ -95,21 +95,27 @@ hicn_dpo_strategy_mw_get_type (void)
void
hicn_strategy_mw_ctx_lock (dpo_id_t * dpo)
{
- hicn_strategy_mw_ctx_t *hicn_strategy_mw_ctx =
- (hicn_strategy_mw_ctx_t *) hicn_strategy_mw_ctx_get (dpo->dpoi_index);
- hicn_strategy_mw_ctx->default_ctx.locks++;
+ if (dpo->dpoi_index != 0)
+ {
+ hicn_strategy_mw_ctx_t *hicn_strategy_mw_ctx =
+ (hicn_strategy_mw_ctx_t *) hicn_strategy_mw_ctx_get (dpo->dpoi_index);
+ hicn_strategy_mw_ctx->default_ctx.locks++;
+ }
}
void
hicn_strategy_mw_ctx_unlock (dpo_id_t * dpo)
{
- hicn_strategy_mw_ctx_t *hicn_strategy_mw_ctx =
- (hicn_strategy_mw_ctx_t *) hicn_strategy_mw_ctx_get (dpo->dpoi_index);
- hicn_strategy_mw_ctx->default_ctx.locks--;
-
- if (0 == hicn_strategy_mw_ctx->default_ctx.locks)
+ if (dpo->dpoi_index != 0)
{
- pool_put (hicn_strategy_mw_ctx_pool, hicn_strategy_mw_ctx);
+ hicn_strategy_mw_ctx_t *hicn_strategy_mw_ctx =
+ (hicn_strategy_mw_ctx_t *) hicn_strategy_mw_ctx_get (dpo->dpoi_index);
+ hicn_strategy_mw_ctx->default_ctx.locks--;
+
+ if (0 == hicn_strategy_mw_ctx->default_ctx.locks)
+ {
+ pool_put (hicn_strategy_mw_ctx_pool, hicn_strategy_mw_ctx);
+ }
}
}
@@ -213,8 +219,8 @@ hicn_strategy_mw_ctx_add_nh (const dpo_id_t * nh, index_t dpo_idx)
{
/* If face is marked as deleted, ignore it */
hicn_face_t *face =
- hicn_dpoi_get_from_idx (hicn_strategy_mw_ctx->
- default_ctx.next_hops[i].dpoi_index);
+ hicn_dpoi_get_from_idx (hicn_strategy_mw_ctx->default_ctx.
+ next_hops[i].dpoi_index);
if (face->shared.flags & HICN_FACE_FLAGS_DELETED)
{
continue;
@@ -259,8 +265,8 @@ hicn_strategy_mw_ctx_del_nh (hicn_face_id_t face_id, index_t dpo_idx,
face_id)
{
nh_id = i;
- hicn_face_unlock (&hicn_strategy_mw_ctx->default_ctx.
- next_hops[i]);
+ hicn_face_unlock (&hicn_strategy_mw_ctx->
+ default_ctx.next_hops[i]);
hicn_strategy_mw_ctx->default_ctx.next_hops[i] = invalid;
hicn_strategy_mw_ctx->default_ctx.entry_count--;
}
diff --git a/hicn-plugin/src/strategies/strategy_mw.c b/hicn-plugin/src/strategies/strategy_mw.c
index fc7ef47fc..77a7d16a8 100644
--- a/hicn-plugin/src/strategies/strategy_mw.c
+++ b/hicn-plugin/src/strategies/strategy_mw.c
@@ -91,8 +91,8 @@ hicn_select_next_hop_mw (index_t dpo_idx, int *nh_idx, dpo_id_t ** outface)
return HICN_ERROR_MW_STRATEGY_NH_NOT_FOUND;
*outface =
- (dpo_id_t *) & hicn_strategy_mw_ctx->default_ctx.
- next_hops[next_hop_index];
+ (dpo_id_t *) & hicn_strategy_mw_ctx->
+ default_ctx.next_hops[next_hop_index];
return HICN_ERROR_NONE;
}
@@ -158,7 +158,9 @@ VLIB_REGISTER_NODE (hicn_mw_strategy_node) =
.n_next_nodes = HICN_STRATEGY_N_NEXT,
.next_nodes = {
[HICN_STRATEGY_NEXT_INTEREST_HITPIT] = "hicn-interest-hitpit",
+ [HICN_STRATEGY_NEXT_INTEREST_HITCS] = "hicn-interest-hitcs",
[HICN_STRATEGY_NEXT_ERROR_DROP] = "error-drop",
+ [HICN_STRATEGY_NEXT_EMPTY] = "ip4-lookup",
},
};
/* *INDENT-ON* */