aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_sa.h
diff options
context:
space:
mode:
authorFan Zhang <roy.fan.zhang@intel.com>2020-04-29 14:00:03 +0100
committerDamjan Marion <dmarion@me.com>2020-04-30 14:38:33 +0000
commitf539578bac8b64886b57c460c9d74273e6613f8b (patch)
tree190e09705fe1ebb46ca86a48c19de49fcaf0cbb0 /src/vnet/ipsec/ipsec_sa.h
parent162330f25aeec09694fffaaa31ba9b318620eb9c (diff)
crypto: introduce async crypto infra
Type: feature Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com> Signed-off-by: Dariusz Kazimierski <dariuszx.kazimierski@intel.com> Signed-off-by: Piotr Kleski <piotrx.kleski@intel.com> Change-Id: I4c3fcccf55c36842b7b48aed260fef2802b5c54b
Diffstat (limited to 'src/vnet/ipsec/ipsec_sa.h')
-rw-r--r--src/vnet/ipsec/ipsec_sa.h46
1 files changed, 43 insertions, 3 deletions
diff --git a/src/vnet/ipsec/ipsec_sa.h b/src/vnet/ipsec/ipsec_sa.h
index 0997eb7d8bc..de9b51ea66a 100644
--- a/src/vnet/ipsec/ipsec_sa.h
+++ b/src/vnet/ipsec/ipsec_sa.h
@@ -127,9 +127,27 @@ typedef struct
vnet_crypto_key_index_t crypto_key_index;
vnet_crypto_key_index_t integ_key_index;
- vnet_crypto_op_id_t crypto_enc_op_id:16;
- vnet_crypto_op_id_t crypto_dec_op_id:16;
- vnet_crypto_op_id_t integ_op_id:16;
+
+ /* Union data shared by sync and async ops, updated when mode is
+ * changed. */
+ union
+ {
+ struct
+ {
+ vnet_crypto_op_id_t crypto_enc_op_id:16;
+ vnet_crypto_op_id_t crypto_dec_op_id:16;
+ vnet_crypto_op_id_t integ_op_id:16;
+ };
+
+ struct
+ {
+ vnet_crypto_async_op_id_t crypto_async_enc_op_id:16;
+ vnet_crypto_async_op_id_t crypto_async_dec_op_id:16;
+ vnet_crypto_key_index_t linked_key_index;
+ };
+
+ u64 crypto_op_data;
+ };
/* data accessed by dataplane code should be above this comment */
CLIB_CACHE_LINE_ALIGN_MARK (cacheline1);
@@ -165,6 +183,28 @@ typedef struct
/* Salt used in GCM modes - stored in network byte order */
u32 salt;
u64 gcm_iv_counter;
+
+ union
+ {
+ struct
+ {
+ vnet_crypto_op_id_t crypto_enc_op_id:16;
+ vnet_crypto_op_id_t crypto_dec_op_id:16;
+ vnet_crypto_op_id_t integ_op_id:16;
+ };
+ u64 data;
+ } sync_op_data;
+
+ union
+ {
+ struct
+ {
+ vnet_crypto_async_op_id_t crypto_async_enc_op_id:16;
+ vnet_crypto_async_op_id_t crypto_async_dec_op_id:16;
+ vnet_crypto_key_index_t linked_key_index;
+ };
+ u64 data;
+ } async_op_data;
} ipsec_sa_t;
STATIC_ASSERT_OFFSET_OF (ipsec_sa_t, cacheline1, CLIB_CACHE_LINE_BYTES);