diff options
author | Benoît Ganne <bganne@cisco.com> | 2022-06-08 10:49:17 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@0xa5.net> | 2022-06-29 21:23:38 +0000 |
commit | b03eec969f3db186fc354c3e885e51c0b24803f0 (patch) | |
tree | 54871a6dc00bad0644f75755d616f10ad67de6c2 /src/vnet/policer/node_funcs.c | |
parent | b0057282d64a4f9ac5966fceb427057b0665b772 (diff) |
classify: use 32 bits hash
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 <bganne@cisco.com>
Diffstat (limited to 'src/vnet/policer/node_funcs.c')
-rw-r--r-- | src/vnet/policer/node_funcs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vnet/policer/node_funcs.c b/src/vnet/policer/node_funcs.c index 5fa0c8563be..efa2f830f8c 100644 --- a/src/vnet/policer/node_funcs.c +++ b/src/vnet/policer/node_funcs.c @@ -527,7 +527,7 @@ policer_classify_inline (vlib_main_t * vm, u32 table_index0; vnet_classify_table_t *t0; vnet_classify_entry_t *e0; - u64 hash0; + u32 hash0; u8 *h0; u8 act0; @@ -537,7 +537,7 @@ policer_classify_inline (vlib_main_t * vm, vlib_buffer_t *p1 = vlib_get_buffer (vm, from[3]); vnet_classify_table_t *tp1; u32 table_index1; - u64 phash1; + u32 phash1; table_index1 = vnet_buffer (p1)->l2_classify.table_index; |