summaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/faces/app
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-12-11 09:57:58 +0100
committerAberto Compagno <acompagn+fdio@cisco.com>2020-01-30 08:21:50 +0000
commit38682396416f315fb5c5b0f8c25beb7a6a909d4f (patch)
tree9b56f4835a8936252f87bc19a27432b4bb8587c0 /hicn-plugin/src/faces/app
parentfa11d711aaab5e4cba7e89dcc896866f3e73db3f (diff)
[HICN-445] Update to vpp 20.01
Change-Id: I19a442080b6ca8b0477a8f92f161282288c395ee Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'hicn-plugin/src/faces/app')
-rw-r--r--hicn-plugin/src/faces/app/address_mgr.c26
-rw-r--r--hicn-plugin/src/faces/app/face_prod_node.c19
2 files changed, 20 insertions, 25 deletions
diff --git a/hicn-plugin/src/faces/app/address_mgr.c b/hicn-plugin/src/faces/app/address_mgr.c
index 76a7e0f6d..1674379c4 100644
--- a/hicn-plugin/src/faces/app/address_mgr.c
+++ b/hicn-plugin/src/faces/app/address_mgr.c
@@ -25,7 +25,7 @@
#include <vnet/ip/ip4.h> //ip4_add_del_ip_address
#include <vnet/ip/ip6.h> //ip6_add_del_ip_address
#include <vnet/fib/fib_types.h> //FIB_PROTOCOL_IP4/6, FIB_NODE_INDEX_INVALID
-#include <vnet/fib/fib_entry.h> //FIB_SOURCE_PLUGIN_HI
+#include <vnet/fib/fib_entry.h> //FIB_SOURCE_PRIORITY_HI
#include <vnet/fib/fib_table.h>
#include <vppinfra/format.h>
#include <vnet/interface.h> //appif_flags
@@ -89,19 +89,19 @@ get_two_ip4_addresses (ip4_address_t * appif_addr, ip4_address_t * nh_addr)
fib_pfx.fp_addr = to_ip46 ( /* is_v6 */ 0, appif_addr->as_u8);
fib_index = fib_table_find_or_create_and_lock (fib_pfx.fp_proto,
HICN_FIB_TABLE,
- FIB_SOURCE_PLUGIN_HI);
+ FIB_SOURCE_PRIORITY_HI);
fib_entry_index = fib_table_lookup_exact_match (fib_index, &fib_pfx);
- fib_table_unlock (fib_index, fib_pfx.fp_proto, FIB_SOURCE_PLUGIN_HI);
+ fib_table_unlock (fib_index, fib_pfx.fp_proto, FIB_SOURCE_PRIORITY_HI);
if (fib_entry_index != FIB_NODE_INDEX_INVALID)
{
fib_pfx.fp_addr = to_ip46 ( /* is_v6 */ 0, nh_addr->as_u8);
fib_index = fib_table_find_or_create_and_lock (fib_pfx.fp_proto,
HICN_FIB_TABLE,
- FIB_SOURCE_PLUGIN_HI);
+ FIB_SOURCE_PRIORITY_HI);
fib_entry_index =
fib_table_lookup_exact_match (fib_index, &fib_pfx);
fib_table_unlock (fib_index, fib_pfx.fp_proto,
- FIB_SOURCE_PLUGIN_HI);
+ FIB_SOURCE_PRIORITY_HI);
}
if (fib_entry_index != FIB_NODE_INDEX_INVALID)
{
@@ -141,19 +141,19 @@ get_two_ip6_addresses (ip6_address_t * appif_addr, ip6_address_t * nh_addr)
fib_pfx.fp_addr = to_ip46 ( /* is_v6 */ 1, appif_addr->as_u8);
fib_index = fib_table_find_or_create_and_lock (fib_pfx.fp_proto,
HICN_FIB_TABLE,
- FIB_SOURCE_PLUGIN_HI);
+ FIB_SOURCE_PRIORITY_HI);
fib_entry_index = fib_table_lookup_exact_match (fib_index, &fib_pfx);
- fib_table_unlock (fib_index, fib_pfx.fp_proto, FIB_SOURCE_PLUGIN_HI);
+ fib_table_unlock (fib_index, fib_pfx.fp_proto, FIB_SOURCE_PRIORITY_HI);
if (fib_entry_index != FIB_NODE_INDEX_INVALID)
{
fib_pfx.fp_addr = to_ip46 ( /* is_v6 */ 0, nh_addr->as_u8);
fib_index = fib_table_find_or_create_and_lock (fib_pfx.fp_proto,
HICN_FIB_TABLE,
- FIB_SOURCE_PLUGIN_HI);
+ FIB_SOURCE_PRIORITY_HI);
fib_entry_index =
fib_table_lookup_exact_match (fib_index, &fib_pfx);
fib_table_unlock (fib_index, fib_pfx.fp_proto,
- FIB_SOURCE_PLUGIN_HI);
+ FIB_SOURCE_PRIORITY_HI);
}
if (fib_entry_index != FIB_NODE_INDEX_INVALID)
{
@@ -184,9 +184,9 @@ get_ip4_address ()
fib_pfx.fp_addr = to_ip46 ( /* is_v6 */ 0, prefix->as_u8);
fib_index = fib_table_find_or_create_and_lock (fib_pfx.fp_proto,
HICN_FIB_TABLE,
- FIB_SOURCE_PLUGIN_HI);
+ FIB_SOURCE_PRIORITY_HI);
fib_entry_index = fib_table_lookup_exact_match (fib_index, &fib_pfx);
- fib_table_unlock (fib_index, fib_pfx.fp_proto, FIB_SOURCE_PLUGIN_HI);
+ fib_table_unlock (fib_index, fib_pfx.fp_proto, FIB_SOURCE_PRIORITY_HI);
increment_v4_address (prefix, 1);
}
while (fib_entry_index != FIB_NODE_INDEX_INVALID);
@@ -211,9 +211,9 @@ get_ip6_address ()
fib_pfx.fp_addr = to_ip46 ( /* is_v6 */ 1, prefix->as_u8);
fib_index = fib_table_find_or_create_and_lock (fib_pfx.fp_proto,
HICN_FIB_TABLE,
- FIB_SOURCE_PLUGIN_HI);
+ FIB_SOURCE_PRIORITY_HI);
fib_entry_index = fib_table_lookup_exact_match (fib_index, &fib_pfx);
- fib_table_unlock (fib_index, fib_pfx.fp_proto, FIB_SOURCE_PLUGIN_HI);
+ fib_table_unlock (fib_index, fib_pfx.fp_proto, FIB_SOURCE_PRIORITY_HI);
increment_v6_address (prefix, 1);
}
while (fib_entry_index != FIB_NODE_INDEX_INVALID);
diff --git a/hicn-plugin/src/faces/app/face_prod_node.c b/hicn-plugin/src/faces/app/face_prod_node.c
index 48e7c4259..e2967bf39 100644
--- a/hicn-plugin/src/faces/app/face_prod_node.c
+++ b/hicn-plugin/src/faces/app/face_prod_node.c
@@ -80,7 +80,7 @@ match_ip4_name (u32 * name, fib_prefix_t * prefix)
}
static_always_inline int
-match_ip6_name (u32x4 * name, fib_prefix_t * prefix)
+match_ip6_name (u8 * name, fib_prefix_t * prefix)
{
union
{
@@ -90,18 +90,13 @@ match_ip6_name (u32x4 * name, fib_prefix_t * prefix)
} xor_sum __attribute__ ((aligned (sizeof (u32x4))));
#ifdef CLIB_HAVE_VEC128
- if (U32X4_ALIGNED (name))
- { //SSE can't handle unaligned data
- xor_sum.as_u32x4 = *((u32x4 *) name) &
- UNION_CAST (prefix->fp_addr.ip6.as_u64[0], u32x4);
- }
- else
-#endif /* CLIB_HAVE_VEC128 */
- {
+ u32x4u *data = (u32x4u *)name;
+ xor_sum.as_u32x4 = *(data) &
+ UNION_CAST (prefix->fp_addr.ip6.as_u64[0], u32x4);
+#else
xor_sum.as_u64[0] = ((u64 *) name)[0] & prefix->fp_addr.ip6.as_u64[0];
xor_sum.as_u64[1] = ((u64 *) name)[1] & prefix->fp_addr.ip6.as_u64[1];
- }
-
+#endif /* CLIB_HAVE_VEC128 */
return (xor_sum.as_u64[0] == prefix->fp_addr.ip6.as_u64[0]) &&
(xor_sum.as_u64[1] == prefix->fp_addr.ip6.as_u64[1]);
}
@@ -120,7 +115,7 @@ hicn_face_prod_next_from_data_hdr (vlib_node_runtime_t * node,
}
else if (PREDICT_TRUE (v == 0x60 && !ip46_address_is_ip4 (&prefix->fp_addr)))
{
- match_res = match_ip6_name ((u32x4 *) & (ptr[8]), prefix);
+ match_res = match_ip6_name (& (ptr[8]), prefix);
}
return match_res ? HICN_FACE_PROD_NEXT_DATA_IP4 + (v ==