summaryrefslogtreecommitdiffstats
path: root/src/vnet/buffer.h
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2021-04-23 15:16:50 +0200
committerDamjan Marion <dmarion@me.com>2021-05-05 11:10:51 +0000
commita7e830ed468f35590871988e68153222325870b8 (patch)
tree6a92f425056bf061e7df502e9c6235cfaf2ca62a /src/vnet/buffer.h
parentbaa18701b9d54d8924771c25b96bd5d99472b7ad (diff)
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 <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/buffer.h')
-rw-r--r--src/vnet/buffer.h14
1 files changed, 6 insertions, 8 deletions
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;
}