tcp: avoid fr segments less than mss if possible
[vpp.git] / src / vnet / ip / vtep.h
index 345b6db..97e7442 100644 (file)
@@ -18,8 +18,7 @@
 
 #include <vppinfra/hash.h>
 #include <vnet/ip/ip.h>
-#include <vnet/ip/ip4.h>
-#include <vnet/ip/ip6.h>
+#include <vnet/ip/ip46_address.h>
 
 /**
  * @brief Tunnel endpoint key (IPv4)
@@ -30,7 +29,6 @@
  * processing and go directly to the tunnel protocol handler node.
  */
 
-/* *INDENT-OFF* */
 typedef CLIB_PACKED
 (struct {
   union {
@@ -41,7 +39,6 @@ typedef CLIB_PACKED
     u64 as_u64;
   };
 }) vtep4_key_t;
-/* *INDENT-ON* */
 
 /**
  * @brief Tunnel endpoint key (IPv6)
@@ -52,13 +49,11 @@ typedef CLIB_PACKED
  * processing and go directly to the tunnel protocol handler node.
  */
 
-/* *INDENT-OFF* */
 typedef CLIB_PACKED
 (struct {
   ip6_address_t addr;
   u32 fib_index;
 }) vtep6_key_t;
-/* *INDENT-ON* */
 
 typedef struct
 {
@@ -118,6 +113,7 @@ typedef struct
   int idx;
 } vtep4_cache_t;
 
+#ifdef CLIB_HAVE_VEC512
 always_inline u8
 vtep4_check_vector (vtep_table_t * t, vlib_buffer_t * b0, ip4_header_t * ip40,
                    vtep4_key_t * last_k4, vtep4_cache_t * vtep4_u512)
@@ -129,30 +125,27 @@ 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_aligned (vtep4_u512->vtep4_cache);
-  u8 result = u64x8_mask_is_equal (cache, k4_u64x8);
+  u64x8 cache = u64x8_load_unaligned (vtep4_u512->vtep4_cache);
+  u8 result = u64x8_is_equal_mask (cache, k4_u64x8);
   if (PREDICT_TRUE (result != 0))
     {
-      k4.as_u64 =
+      last_k4->as_u64 =
        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,