From a7e830ed468f35590871988e68153222325870b8 Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Fri, 23 Apr 2021 15:16:50 +0200 Subject: vlib: move offload flags to 1st cacheline in vlib_buffer_t Type: improvement Some tests i.e. ipsec see performance regression when offload flags are moved to 2nd cacheline. This patch moves them back to 1st cacheline. Change-Id: I6ead45ff6d2c467b0d248f409e27c2ba31758741 Signed-off-by: Mohsin Kazmi --- src/vnet/buffer.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/vnet/buffer.h') diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h index 19585e22506..0816232aed7 100644 --- a/src/vnet/buffer.h +++ b/src/vnet/buffer.h @@ -138,7 +138,8 @@ typedef struct i16 l3_hdr_offset; i16 l4_hdr_offset; u8 feature_arc_index; - u8 dont_waste_me; + /* offload flags */ + u8 oflags; union { @@ -472,9 +473,6 @@ typedef struct u16 gso_size; /* size of L4 prototol header */ u16 gso_l4_hdr_sz; - - /* offload flags */ - u32 oflags; }; struct @@ -526,12 +524,12 @@ vnet_buffer_offload_flags_set (vlib_buffer_t *b, u32 oflags) if (b->flags & VNET_BUFFER_F_OFFLOAD) { /* add a flag to existing offload */ - vnet_buffer2 (b)->oflags |= oflags; + vnet_buffer (b)->oflags |= oflags; } else { /* no offload yet: reset offload flags to new value */ - vnet_buffer2 (b)->oflags = oflags; + vnet_buffer (b)->oflags = oflags; b->flags |= VNET_BUFFER_F_OFFLOAD; } } @@ -539,8 +537,8 @@ vnet_buffer_offload_flags_set (vlib_buffer_t *b, u32 oflags) static_always_inline void vnet_buffer_offload_flags_clear (vlib_buffer_t *b, u32 oflags) { - vnet_buffer2 (b)->oflags &= ~oflags; - if (0 == vnet_buffer2 (b)->oflags) + vnet_buffer (b)->oflags &= ~oflags; + if (0 == vnet_buffer (b)->oflags) b->flags &= ~VNET_BUFFER_F_OFFLOAD; } -- cgit 1.2.3-korg