diff options
Diffstat (limited to 'hicn-plugin/src/data_fwd_node.c')
-rw-r--r-- | hicn-plugin/src/data_fwd_node.c | 60 |
1 files changed, 16 insertions, 44 deletions
diff --git a/hicn-plugin/src/data_fwd_node.c b/hicn-plugin/src/data_fwd_node.c index 1bb064fcf..c65b62454 100644 --- a/hicn-plugin/src/data_fwd_node.c +++ b/hicn-plugin/src/data_fwd_node.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Cisco and/or its affiliates. + * Copyright (c) 2017-2020 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -37,11 +37,6 @@ drop_packet (vlib_main_t * vm, u32 bi0, u32 * n_left_to_next, u32 * next0, u32 ** to_next, u32 * next_index, vlib_node_runtime_t * node); -always_inline void -push_in_cache (vlib_main_t * vm, u32 bi0, - u32 * n_left_to_next, u32 * next0, u32 ** to_next, - u32 * next_index, vlib_node_runtime_t * node); - always_inline int hicn_satisfy_faces (vlib_main_t * vm, u32 b0, hicn_pcs_entry_t * pitp, u32 * n_left_to_next, @@ -176,21 +171,8 @@ hicn_data_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, hicn_pcs_delete (pitcs, &pitp, &node0, vm, hash_entry0, dpo_vft0, &hicn_dpo_id0); -#if HICN_FEATURE_CS - if (hicnb0->flags & HICN_BUFFER_FLAGS_FACE_IS_APP) - { - push_in_cache (vm, bi0, &n_left_to_next, &next0, &to_next, - &next_index, node); - } - else - { - drop_packet (vm, bi0, &n_left_to_next, &next0, &to_next, - &next_index, node); - } -#else drop_packet (vm, bi0, &n_left_to_next, &next0, &to_next, &next_index, node); -#endif stats.pit_expired_count++; if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) && @@ -348,21 +330,6 @@ drop_packet (vlib_main_t * vm, u32 bi0, *to_next, *n_left_to_next, bi0, *next0); } -always_inline void -push_in_cache (vlib_main_t * vm, u32 bi0, - u32 * n_left_to_next, u32 * next0, u32 ** to_next, - u32 * next_index, vlib_node_runtime_t * node) -{ - *next0 = HICN_DATA_FWD_NEXT_PUSH; - - (*to_next)[0] = bi0; - *to_next += 1; - *n_left_to_next -= 1; - - vlib_validate_buffer_enqueue_x1 (vm, node, *next_index, - *to_next, *n_left_to_next, bi0, *next0); -} - always_inline int hicn_satisfy_faces (vlib_main_t * vm, u32 bi0, hicn_pcs_entry_t * pitp, u32 * n_left_to_next, @@ -434,7 +401,7 @@ hicn_satisfy_faces (vlib_main_t * vm, u32 bi0, { vlib_buffer_t *h0, *h1; u32 hi0, hi1; - dpo_id_t *face0, *face1; + hicn_face_id_t face0, face1; /* Prefetch for next iteration. */ { @@ -458,10 +425,13 @@ hicn_satisfy_faces (vlib_main_t * vm, u32 bi0, n_left_from -= 2; clones += 2; - next0 = face0->dpoi_next_node; - next1 = face1->dpoi_next_node; - vnet_buffer (h0)->ip.adj_index[VLIB_TX] = face0->dpoi_index; - vnet_buffer (h1)->ip.adj_index[VLIB_TX] = face1->dpoi_index; + next0 = isv6 ? HICN_DATA_FWD_NEXT_IFACE6_OUT : + HICN_DATA_FWD_NEXT_IFACE4_OUT; + next1 = isv6 ? HICN_DATA_FWD_NEXT_IFACE6_OUT : + HICN_DATA_FWD_NEXT_IFACE4_OUT; + + vnet_buffer (h0)->ip.adj_index[VLIB_TX] = face0; + vnet_buffer (h1)->ip.adj_index[VLIB_TX] = face1; stats->pkts_data_count += 2; @@ -499,7 +469,7 @@ hicn_satisfy_faces (vlib_main_t * vm, u32 bi0, { vlib_buffer_t *h0; u32 hi0; - dpo_id_t *face0; + hicn_face_id_t face0; face0 = hicn_face_db_get_dpo_face (i++, &pitp->u.pit.faces); @@ -511,8 +481,9 @@ hicn_satisfy_faces (vlib_main_t * vm, u32 bi0, n_left_from -= 1; clones += 1; - next0 = face0->dpoi_next_node; - vnet_buffer (h0)->ip.adj_index[VLIB_TX] = face0->dpoi_index; + next0 = isv6 ? HICN_DATA_FWD_NEXT_IFACE6_OUT : + HICN_DATA_FWD_NEXT_IFACE4_OUT; + vnet_buffer (h0)->ip.adj_index[VLIB_TX] = face0; stats->pkts_data_count++; @@ -584,7 +555,7 @@ clone_data_to_cs (vlib_main_t * vm, hicn_pit_cs_t * pitcs, */ hicn_buffer_t *hicnb0 = hicn_get_buffer (b0); hicn_pit_to_cs (vm, pitcs, pitp, hash_entry, nodep, dpo_vft, hicn_dpo_id, - &hicnb->face_dpo_id, + hicnb->face_id, hicnb0->flags & HICN_BUFFER_FLAGS_FACE_IS_APP); pitp->shared.create_time = tnow; @@ -635,7 +606,8 @@ VLIB_REGISTER_NODE(hicn_data_fwd_node) = .next_nodes = { [HICN_DATA_FWD_NEXT_V4_LOOKUP] = "ip4-lookup", [HICN_DATA_FWD_NEXT_V6_LOOKUP] = "ip6-lookup", - [HICN_DATA_FWD_NEXT_PUSH] = "hicn-data-push", + [HICN_DATA_FWD_NEXT_IFACE4_OUT] = "hicn4-iface-output", + [HICN_DATA_FWD_NEXT_IFACE6_OUT] = "hicn6-iface-output", [HICN_DATA_FWD_NEXT_ERROR_DROP] = "error-drop", }, }; |