summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Kinsella <mdr@ashroe.eu>2020-04-07 07:51:23 +0100
committerDamjan Marion <dmarion@me.com>2020-09-28 16:40:56 +0000
commit7741afaf5c66a5d7ed1d2d76ae36a81ec24fdaaa (patch)
treed849fb554a328c340d0f42264f0cb3597ea25bd3
parent8899ce08bbe345b9c178ab1ffbfec2cd7d132e8f (diff)
classify: use clib_crc32c on supporting uarch
Use clib_crc32c in place of clib_xxhash on supporting uarch. Type: improvement Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: Icdfb4ffa92c2c9e7aebc3ec99f20e91392a103ab
-rw-r--r--src/vnet/classify/vnet_classify.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vnet/classify/vnet_classify.h b/src/vnet/classify/vnet_classify.h
index c08cedf6b03..db3821b7c77 100644
--- a/src/vnet/classify/vnet_classify.h
+++ b/src/vnet/classify/vnet_classify.h
@@ -21,6 +21,7 @@
#include <vppinfra/error.h>
#include <vppinfra/hash.h>
#include <vppinfra/cache.h>
+#include <vppinfra/crc32.h>
#include <vppinfra/xxhash.h>
extern vlib_node_registration_t ip4_classify_node;
@@ -280,7 +281,11 @@ vnet_classify_hash_packet_inline (vnet_classify_table_t * t, u8 * h)
}
#endif /* CLIB_HAVE_VEC128 */
+#ifdef clib_crc32c_uses_intrinsics
+ return clib_crc32c ((u8 *) & xor_sum, sizeof (xor_sum));
+#else
return clib_xxhash (xor_sum.as_u64[0] ^ xor_sum.as_u64[1]);
+#endif
}
static inline void