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/data_fwd_node.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'hicn-plugin/src/data_fwd_node.c') diff --git a/hicn-plugin/src/data_fwd_node.c b/hicn-plugin/src/data_fwd_node.c index 1bb064fcf..2737d1d62 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: @@ -434,7 +434,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 +458,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 +502,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 +514,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 +588,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; @@ -636,6 +640,8 @@ VLIB_REGISTER_NODE(hicn_data_fwd_node) = [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", }, }; -- cgit 1.2.3-korg