From b03eec969f3db186fc354c3e885e51c0b24803f0 Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Wed, 8 Jun 2022 10:49:17 +0200 Subject: classify: use 32 bits hash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit classify hash used to be stored as u64 in buffer metadata, use 32 bits instead: - on almost all our supported arch (x86 and arm64) we use crc32c intrinsics to compute the final hash: we really get a 32-bits hash - the hash itself is used to compute a 32-bits bucket index by masking upper bits: we always discard the higher 32-bits - this allows to increase the l2 classify buffer metadata padding such as it does not overlap with the ip fib_index metadata anymore. This overlap is an issue when using the 'set metadata' action in the ip ACL node which updates both fields Type: fix Change-Id: I5d35bdae97b96c3cae534e859b63950fb500ff50 Signed-off-by: Benoît Ganne --- src/vnet/buffer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vnet/buffer.h') diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h index 2f2524590e9..144f62ac17a 100644 --- a/src/vnet/buffer.h +++ b/src/vnet/buffer.h @@ -320,13 +320,13 @@ typedef struct /* L2 classify */ struct { - struct opaque_l2 pad; + u32 pad[4]; /* do not overlay w/ ip.fib_index nor l2 */ union { u32 table_index; u32 opaque_index; }; - u64 hash; + u32 hash; } l2_classify; /* vnet policer */ -- cgit 1.2.3-korg