summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorJunfeng Wang <Drenfong.Wang@intel.com>2021-03-09 16:44:57 +0800
committerJohn Lo <lojultra2020@outlook.com>2021-03-19 21:34:16 +0000
commit290526e3c72888ac05928ed0a6dddee02f7df650 (patch)
tree5117191488c7107d6404abaaca97d76022e7e759 /src/vnet/ip
parent162b70d50aaf5daa744417818c01cae573580f6f (diff)
vxlan: add tunnel cache to graph node
Type: improvement Signed-off-by: Drenfong Wong <drenfong.wang@intel.com> Change-Id: Ia81aaa86fe071cbbed028cc85c5f3fa0f1940a0f
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/vtep.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/vnet/ip/vtep.h b/src/vnet/ip/vtep.h
index 4cb06122f46..418d8439744 100644
--- a/src/vnet/ip/vtep.h
+++ b/src/vnet/ip/vtep.h
@@ -111,6 +111,7 @@ vtep4_check (vtep_table_t * t, vlib_buffer_t * b0, ip4_header_t * ip40,
return VTEP_CHECK_PASS;
}
+#ifdef CLIB_HAVE_VEC512
typedef struct
{
vtep4_key_t vtep4_cache[8];
@@ -128,7 +129,6 @@ vtep4_check_vector (vtep_table_t * t, vlib_buffer_t * b0, ip4_header_t * ip40,
if (PREDICT_TRUE (k4.as_u64 == last_k4->as_u64))
return VTEP_CHECK_PASS_UNCHANGED;
-#ifdef CLIB_HAVE_VEC512
u64x8 k4_u64x8 = u64x8_splat (k4.as_u64);
u64x8 cache = u64x8_load_unaligned (vtep4_u512->vtep4_cache);
u8 result = u64x8_mask_is_equal (cache, k4_u64x8);
@@ -138,20 +138,18 @@ vtep4_check_vector (vtep_table_t * t, vlib_buffer_t * b0, ip4_header_t * ip40,
vtep4_u512->vtep4_cache[count_trailing_zeros (result)].as_u64;
return VTEP_CHECK_PASS_UNCHANGED;
}
-#endif
if (PREDICT_FALSE (!hash_get (t->vtep4, k4.as_u64)))
return VTEP_CHECK_FAIL;
- last_k4->as_u64 = k4.as_u64;
-
-#ifdef CLIB_HAVE_VEC512
vtep4_u512->vtep4_cache[vtep4_u512->idx].as_u64 = k4.as_u64;
vtep4_u512->idx = (vtep4_u512->idx + 1) & 0x7;
-#endif
+
+ last_k4->as_u64 = k4.as_u64;
return VTEP_CHECK_PASS;
}
+#endif
always_inline u8
vtep6_check (vtep_table_t * t, vlib_buffer_t * b0, ip6_header_t * ip60,