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/mapme_ctrl_node.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'hicn-plugin/src/mapme_ctrl_node.c') diff --git a/hicn-plugin/src/mapme_ctrl_node.c b/hicn-plugin/src/mapme_ctrl_node.c index ed25a31b0..1708f2b2d 100644 --- a/hicn-plugin/src/mapme_ctrl_node.c +++ b/hicn-plugin/src/mapme_ctrl_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: @@ -74,7 +74,7 @@ preprocess_in_face (hicn_type_t type, dpo_id_t * in, dpo_id_t * out) */ static_always_inline bool hicn_mapme_process_ctrl (vlib_main_t * vm, vlib_buffer_t * b, - dpo_id_t * in_face) + hicn_face_id_t in_face) { seq_t fib_seq; const dpo_id_t *dpo; @@ -158,19 +158,21 @@ hicn_mapme_process_ctrl (vlib_main_t * vm, vlib_buffer_t * b, /* Move next hops to TFIB... but in_face... */ for (u8 pos = 0; pos < tfib->entry_count; pos++) { - if (dpo_cmp (&tfib->next_hops[pos], in_face) == 0) + if (tfib->next_hops[pos] == in_face) { tfib->entry_count = 0; break; } DEBUG ("Adding nexthop to the tfib, dpo index in_face %d, dpo index tfib %d", - in_face->dpoi_index, tfib->next_hops[pos].dpoi_index); - hicn_mapme_tfib_add (tfib, &tfib->next_hops[pos]); + in_face, tfib->next_hops[pos]); + hicn_mapme_tfib_add (tfib, tfib->next_hops[pos]); } /* ... and set ingress face as next_hop */ in_face->dpoi_next_node = hicn_mapme_get_dpo_vlib_edge (in_face); + + /* Convert possible iFate into a face TODO!!!*/ hicn_mapme_nh_set (tfib, in_face); /* We transmit both the prefix and the full dpo (type will be needed to pick the right transmit node */ @@ -273,7 +275,7 @@ hicn_mapme_ctrl_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, hb = hicn_get_buffer (b0); /* This determines the next node on which the ack will be sent back */ - u32 next0 = hicn_mapme_get_dpo_iface_node (&hb->face_dpo_id); + u32 next0 = hicn_mapme_get_dpo_iface_node (&hb->face_id); /* Preprocessing is needed to precompute in the dpo the next node * that will have to be followed by regular interests when being -- cgit 1.2.3-korg