summaryrefslogtreecommitdiffstats
path: root/src/plugins/quic/quic.c
diff options
context:
space:
mode:
authorMathiasRaoul <mathias.raoul@gmail.com>2020-03-24 09:45:55 +0000
committerDave Wallace <dwallacelf@gmail.com>2020-03-24 22:41:24 +0000
commit753b96f31b0f34983bbc213516f1a05825d868a8 (patch)
tree451ac0d69bb2a0944f3b46d8e10ae5e0ab5a6a2e /src/plugins/quic/quic.c
parent2a6642e95dc18d7c56f87b74a70658b8312b8c08 (diff)
quic: disable vnet_crypto and batching if no crypto engines are loaded
Type: fix Change-Id: I95d3f8431b468cefc8777526dd3b988a299f0687 Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
Diffstat (limited to 'src/plugins/quic/quic.c')
-rw-r--r--src/plugins/quic/quic.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c
index 31cfcced86f..8b111369fed 100644
--- a/src/plugins/quic/quic.c
+++ b/src/plugins/quic/quic.c
@@ -2180,8 +2180,11 @@ quic_process_one_rx_packet (u64 udp_session_handle, svm_fifo_t * f,
if (rv == QUIC_PACKET_TYPE_RECEIVE)
{
pctx->ptype = QUIC_PACKET_TYPE_RECEIVE;
- quic_ctx_t *qctx = quic_ctx_get (pctx->ctx_index, thread_index);
- quic_crypto_decrypt_packet (qctx, pctx);
+ if (quic_main.vnet_crypto_enabled)
+ {
+ quic_ctx_t *qctx = quic_ctx_get (pctx->ctx_index, thread_index);
+ quic_crypto_decrypt_packet (qctx, pctx);
+ }
return 0;
}
else if (rv == QUIC_PACKET_TYPE_MIGRATE)
@@ -2506,6 +2509,13 @@ quic_init (vlib_main_t * vm)
qm->default_crypto_engine = CRYPTO_ENGINE_VPP;
qm->max_packets_per_key = DEFAULT_MAX_PACKETS_PER_KEY;
clib_rwlock_init (&qm->crypto_keys_quic_rw_lock);
+
+ vnet_crypto_main_t *cm = &crypto_main;
+ if (vec_len (cm->engines) == 0)
+ qm->vnet_crypto_enabled = 0;
+ else
+ qm->vnet_crypto_enabled = 1;
+
vec_free (a->name);
return 0;
}