From 290526e3c72888ac05928ed0a6dddee02f7df650 Mon Sep 17 00:00:00 2001 From: Junfeng Wang Date: Tue, 9 Mar 2021 16:44:57 +0800 Subject: vxlan: add tunnel cache to graph node Type: improvement Signed-off-by: Drenfong Wong Change-Id: Ia81aaa86fe071cbbed028cc85c5f3fa0f1940a0f --- src/vnet/vxlan/decap.c | 17 ++++++----------- src/vnet/vxlan/vxlan.h | 6 ++++++ 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'src/vnet/vxlan') diff --git a/src/vnet/vxlan/decap.c b/src/vnet/vxlan/decap.c index 4678aa31219..2ba24d881af 100644 --- a/src/vnet/vxlan/decap.c +++ b/src/vnet/vxlan/decap.c @@ -469,11 +469,6 @@ ip_vxlan_bypass_inline (vlib_main_t * vm, last_tunnel_cache4 last4; last_tunnel_cache6 last6; -#ifdef CLIB_HAVE_VEC512 - vtep4_cache_t vtep4_u512; - clib_memset (&vtep4_u512, 0, sizeof (vtep4_u512)); -#endif - from = vlib_frame_vector_args (frame); n_left_from = frame->n_vectors; next_index = node->cached_next_index; @@ -584,8 +579,8 @@ ip_vxlan_bypass_inline (vlib_main_t * vm, if (is_ip4) { #ifdef CLIB_HAVE_VEC512 - if (!vtep4_check_vector - (&vxm->vtep_table, b0, ip40, &last_vtep4, &vtep4_u512)) + if (!vtep4_check_vector (&vxm->vtep_table, b0, ip40, &last_vtep4, + &vxm->vtep4_u512)) #else if (!vtep4_check (&vxm->vtep_table, b0, ip40, &last_vtep4)) #endif @@ -672,8 +667,8 @@ ip_vxlan_bypass_inline (vlib_main_t * vm, if (is_ip4) { #ifdef CLIB_HAVE_VEC512 - if (!vtep4_check_vector - (&vxm->vtep_table, b1, ip41, &last_vtep4, &vtep4_u512)) + if (!vtep4_check_vector (&vxm->vtep_table, b1, ip41, &last_vtep4, + &vxm->vtep4_u512)) #else if (!vtep4_check (&vxm->vtep_table, b1, ip41, &last_vtep4)) #endif @@ -799,8 +794,8 @@ ip_vxlan_bypass_inline (vlib_main_t * vm, if (is_ip4) { #ifdef CLIB_HAVE_VEC512 - if (!vtep4_check_vector - (&vxm->vtep_table, b0, ip40, &last_vtep4, &vtep4_u512)) + if (!vtep4_check_vector (&vxm->vtep_table, b0, ip40, &last_vtep4, + &vxm->vtep4_u512)) #else if (!vtep4_check (&vxm->vtep_table, b0, ip40, &last_vtep4)) #endif diff --git a/src/vnet/vxlan/vxlan.h b/src/vnet/vxlan/vxlan.h index 48c61461e7c..129bb43291b 100644 --- a/src/vnet/vxlan/vxlan.h +++ b/src/vnet/vxlan/vxlan.h @@ -189,6 +189,12 @@ typedef struct /* Record used instances */ uword *instance_used; u32 flow_id_start; + + /* cache for last 8 vxlan tunnel */ +#ifdef CLIB_HAVE_VEC512 + vtep4_cache_t vtep4_u512; +#endif + } vxlan_main_t; extern vxlan_main_t vxlan_main; -- cgit 1.2.3-korg