From 5e52417a2aa3b2063a811c6a9f293a79d73bcb43 Mon Sep 17 00:00:00 2001 From: Zhiyong Yang Date: Wed, 8 Jul 2020 20:28:36 +0000 Subject: ip: enhance vtep4_check of tunnel by vector way This patch aims to improve decap performance by reducing expensive hash_get callings as less as possible using AVX512 on XEON. e.g. vxlan, vxlan_gpe, geneve, gtpu. For the existing code, if vtep4 of the current packet match the last vtep4_key_t well, expensive hash computation can be avoided and the code returns directly. This patch improves tunnel decap multiple flows case greatly by leveraging 512bit vector register on XEON accommodating 8 vtep4_keys. It enhances the possiblity of avoiding unnecessary hash computing once hash key of the current packet hits any one of 8 in the 512bit cache. The oldest element in vtep4_cache_t is updated in round-robin order. vlib_get_buffers is also leveraged in the meanwhile. Type: improvement Signed-off-by: Zhiyong Yang Signed-off-by: Ray Kinsella Signed-off-by: Junfeng Wang Change-Id: I313103202bd76f2dd638cd942554721b37ddad60 --- src/vppinfra/vector_avx512.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/vppinfra/vector_avx512.h') diff --git a/src/vppinfra/vector_avx512.h b/src/vppinfra/vector_avx512.h index 6eb7c5eaa4d..a51644be1db 100644 --- a/src/vppinfra/vector_avx512.h +++ b/src/vppinfra/vector_avx512.h @@ -246,6 +246,12 @@ u8x64_mask_blend (u8x64 a, u8x64 b, u64 mask) return (u8x64) _mm512_mask_blend_epi8 (mask, (__m512i) a, (__m512i) b); } +static_always_inline u8 +u64x8_mask_is_equal (u64x8 a, u64x8 b) +{ + return _mm512_cmpeq_epu64_mask ((__m512i) a, (__m512i) b); +} + static_always_inline void u32x16_transpose (u32x16 m[16]) { -- cgit 1.2.3-korg