From 62f7b46d4c49d6e5bfb5b3b537bfcaf6503e7bac Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Thu, 21 Nov 2019 11:59:54 +0000 Subject: [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 Change-Id: I8776c86952d50900aa504dd22aec521ed25c1dae --- hicn-plugin/src/faces/ip/dpo_ip.h | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'hicn-plugin/src/faces/ip/dpo_ip.h') 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); } -- cgit 1.2.3-korg