summaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/faces/ip/dpo_ip.h
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-11-21 11:59:54 +0000
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-11-22 12:47:14 +0000
commit62f7b46d4c49d6e5bfb5b3b537bfcaf6503e7bac (patch)
tree35e206900cf6a1535df2b3439a55e0fdd9091a7f /hicn-plugin/src/faces/ip/dpo_ip.h
parentae6f3b8e1f55fc4bb7807c293850d3cb46cab1fd (diff)
[HICN-405] Added application face delete
Added two new messages in the binary api: - hicn_api_face_cons_del to delete a consumer face - hicn_api_face_prod_del to delete a producer face Added the corresponding commands in the vpp_api_test for debugging and testing Reworked the cache policy structure to add a new function that flash the content store from the content coming from the destroyed producer face. This is required since the CS while each producer face has its own lru list. Removing only the producer face without flushing the CS from the content coming from the producer face will lead to a segfault in case there is a hit in the CS as the lru no longer exists and it won't be possible to update the head of the lru. Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com> Change-Id: I8776c86952d50900aa504dd22aec521ed25c1dae
Diffstat (limited to 'hicn-plugin/src/faces/ip/dpo_ip.h')
-rw-r--r--hicn-plugin/src/faces/ip/dpo_ip.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/hicn-plugin/src/faces/ip/dpo_ip.h b/hicn-plugin/src/faces/ip/dpo_ip.h
index d6b4f5f7e..c893c8be4 100644
--- a/hicn-plugin/src/faces/ip/dpo_ip.h
+++ b/hicn-plugin/src/faces/ip/dpo_ip.h
@@ -41,11 +41,15 @@ void hicn_dpo_ip_module_init (void);
*/
always_inline int
hicn_dpo_ip4_lock_from_local (dpo_id_t * dpo,
- u32 * in_faces_vec_id,
+ u32 * in_faces_vec_id,
u8 * hicnb_flags,
const ip4_address_t * local_addr, u32 sw_if)
{
- hicn_face_ip_input_faces_t * in_faces_vec =
+ dpo->dpoi_type = DPO_FIRST;
+ dpo->dpoi_proto = DPO_PROTO_NONE;
+ dpo->dpoi_index = INDEX_INVALID;
+ dpo->dpoi_next_node = 0;
+ hicn_face_ip_input_faces_t *in_faces_vec =
hicn_face_ip4_get_vec (local_addr, sw_if, &hicn_face_ip_local_hashtb);
if (PREDICT_FALSE (in_faces_vec == NULL))
@@ -61,7 +65,7 @@ hicn_dpo_ip4_lock_from_local (dpo_id_t * dpo,
dpo_set (dpo, hicn_face_ip_type, DPO_PROTO_IP4, in_faces_vec->face_id);
dpo->dpoi_next_node = ~0;
- dpo_lock (dpo);
+ dpo_unlock (dpo);
return HICN_ERROR_NONE;
}
@@ -80,11 +84,15 @@ hicn_dpo_ip4_lock_from_local (dpo_id_t * dpo,
*/
always_inline int
hicn_dpo_ip6_lock_from_local (dpo_id_t * dpo,
- u32 * in_faces_vec_id,
+ u32 * in_faces_vec_id,
u8 * hicnb_flags,
const ip6_address_t * local_addr, u32 sw_if)
{
- hicn_face_ip_input_faces_t * in_faces_vec =
+ dpo->dpoi_type = DPO_FIRST;
+ dpo->dpoi_proto = DPO_PROTO_NONE;
+ dpo->dpoi_index = INDEX_INVALID;
+ dpo->dpoi_next_node = 0;
+ hicn_face_ip_input_faces_t *in_faces_vec =
hicn_face_ip6_get_vec (local_addr, sw_if, &hicn_face_ip_local_hashtb);
if (PREDICT_FALSE (in_faces_vec == NULL))
@@ -100,7 +108,7 @@ hicn_dpo_ip6_lock_from_local (dpo_id_t * dpo,
dpo_set (dpo, hicn_face_ip_type, DPO_PROTO_IP6, in_faces_vec->face_id);
dpo->dpoi_next_node = ~0;
- dpo_lock (dpo);
+ dpo_unlock (dpo);
return HICN_ERROR_NONE;
}
@@ -144,7 +152,7 @@ hicn_dpo_ip4_add_and_lock_from_remote (dpo_id_t * dpo,
dpo_set (dpo, hicn_face_ip_type, DPO_PROTO_IP4, dpoi_index);
dpo->dpoi_next_node = node_index;
- dpo_lock (dpo);
+ dpo_unlock (dpo);
return;
}
@@ -158,7 +166,7 @@ hicn_dpo_ip4_add_and_lock_from_remote (dpo_id_t * dpo,
hicn_face_id_t dpoi_index = hicn_dpoi_get_index (face);
dpo_set (dpo, hicn_face_ip_type, DPO_PROTO_IP4, dpoi_index);
dpo->dpoi_next_node = node_index;
- dpo_lock (dpo);
+ dpo_unlock (dpo);
}
/**
@@ -198,7 +206,7 @@ hicn_dpo_ip6_add_and_lock_from_remote (dpo_id_t * dpo,
dpo_set (dpo, hicn_face_ip_type, DPO_PROTO_IP4, dpoi_index);
dpo->dpoi_next_node = node_index;
- dpo_lock (dpo);
+ dpo_unlock (dpo);
return;
}
@@ -211,7 +219,7 @@ hicn_dpo_ip6_add_and_lock_from_remote (dpo_id_t * dpo,
index_t dpoi_index = hicn_dpoi_get_index (face);
dpo_set (dpo, hicn_face_ip_type, DPO_PROTO_IP6, dpoi_index);
dpo->dpoi_next_node = node_index;
- dpo_lock (dpo);
+ dpo_unlock (dpo);
}