X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fplugins%2Fquic%2Fquic.c;h=03e46c60616e178fcef3f3d10b2f8dde01c5d4c0;hb=07063b8ea;hp=31cfcced86fad0c8dbe7050789e06ca6c827a0c4;hpb=f22f4e562e1b922cff036ef628b77fd2d479d015;p=vpp.git diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c index 31cfcced86f..03e46c60616 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) @@ -2395,6 +2398,8 @@ static const transport_proto_vft_t quic_proto = { .get_transport_endpoint = quic_get_transport_endpoint, .get_transport_listener_endpoint = quic_get_transport_listener_endpoint, .transport_options = { + .name = "quic", + .short_name = "Q", .tx_type = TRANSPORT_TX_INTERNAL, .service_type = TRANSPORT_SERVICE_APP, }, @@ -2506,6 +2511,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; }