aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_sa.h
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2021-02-10 08:42:49 +0000
committerMatthew Smith <mgsmith@netgate.com>2021-02-12 20:09:28 +0000
commitaa7d7662f63bfe6643b193f74288aea67f883744 (patch)
treebc69b3a3be3aed942548247a19735471a0b95db9 /src/vnet/ipsec/ipsec_sa.h
parent088bf1dcc32fcd26dac312a5561e0f263fa401d9 (diff)
ipsec: Store thread-index in buffer meta-data during SA handoff
Type: improvement negates the need to load the SA in the handoff node. don't prefetch the packet data, it's not needed. Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I340472dc437f050cc1c3c11dfeb47ab09c609624
Diffstat (limited to 'src/vnet/ipsec/ipsec_sa.h')
-rw-r--r--src/vnet/ipsec/ipsec_sa.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vnet/ipsec/ipsec_sa.h b/src/vnet/ipsec/ipsec_sa.h
index 84abd6ef4b4..a5756f556f9 100644
--- a/src/vnet/ipsec/ipsec_sa.h
+++ b/src/vnet/ipsec/ipsec_sa.h
@@ -223,6 +223,14 @@ typedef struct
STATIC_ASSERT_OFFSET_OF (ipsec_sa_t, cacheline1, CLIB_CACHE_LINE_BYTES);
STATIC_ASSERT_OFFSET_OF (ipsec_sa_t, cacheline2, 2 * CLIB_CACHE_LINE_BYTES);
+/*
+ * Ensure that the IPsec data does not overlap with the IP data in
+ * the buffer meta data
+ */
+STATIC_ASSERT (STRUCT_OFFSET_OF (vnet_buffer_opaque_t, ipsec.sad_index) ==
+ STRUCT_OFFSET_OF (vnet_buffer_opaque_t, ip.save_protocol),
+ "IPSec data is overlapping with IP data");
+
#define _(a,v,s) \
always_inline int \
ipsec_sa_is_set_##v (const ipsec_sa_t *sa) { \