aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/quic/quic.h
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2019-11-07 13:52:09 +0100
committerFlorin Coras <florin.coras@gmail.com>2019-12-17 17:03:50 +0000
commitd1b9e706841150d0da042a05aab51f19fa804192 (patch)
tree340bcbdd128ff86323eb963631f9f3f018328a67 /src/plugins/quic/quic.h
parent70ae4efaa9b719a0bc84345143a1a4d3944a70fe (diff)
quic: Implement crypto contexts
Type: feature Make quic use the crypto contexts. This introduces a crypto context pool backed by a hashtable giving ctx indexes by connect params (ckpair, engine, rx & tx fifo sizes). Applications keep the initialization vector common. Change-Id: I22ed6711196cd70a2f2f74240f12113c7af8dfcd Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/quic/quic.h')
-rw-r--r--src/plugins/quic/quic.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/quic/quic.h b/src/plugins/quic/quic.h
index dcdb6cf8e24..5921f3aad8c 100644
--- a/src/plugins/quic/quic.h
+++ b/src/plugins/quic/quic.h
@@ -40,6 +40,7 @@
#define QUIC_INT_MAX 0x3FFFFFFFFFFFFFFF
#define QUIC_DEFAULT_FIFO_SIZE (64 << 10)
#define QUIC_SEND_PACKET_VEC_SIZE 16
+#define QUIC_IV_LEN 17
#define QUIC_SEND_MAX_BATCH_PACKETS 16
#define QUIC_RCV_MAX_BATCH_PACKETS 16
@@ -152,7 +153,8 @@ typedef struct quic_ctx_
u32 parent_app_wrk_id;
u32 parent_app_id;
u32 ckpair_index;
- quicly_context_t *quicly_ctx;
+ u32 crypto_engine;
+ u32 crypto_context_index;
u8 flags;
} quic_ctx_t;
@@ -182,12 +184,21 @@ typedef struct quic_stream_data_
u32 app_tx_data_len; /**< bytes sent */
} quic_stream_data_t;
+typedef struct quic_crypto_context_data_
+{
+ quicly_context_t quicly_ctx;
+ char cid_key[QUIC_IV_LEN];
+ ptls_context_t ptls_ctx;
+} quic_crypto_context_data_t;
+
typedef struct quic_worker_ctx_
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
int64_t time_now; /**< worker time */
tw_timer_wheel_1t_3w_1024sl_ov_t timer_wheel; /**< worker timer wheel */
quicly_cid_plaintext_t next_cid;
+ crypto_context_t *crypto_ctx_pool; /**< per thread pool of crypto contexes */
+ clib_bihash_24_8_t crypto_context_hash; /**< per thread [params:crypto_ctx_index] hash */
} quic_worker_ctx_t;
typedef struct quic_rx_packet_ctx_
@@ -206,13 +217,6 @@ typedef struct quic_rx_packet_ctx_
session_dgram_hdr_t ph;
} quic_rx_packet_ctx_t;
-typedef struct quicly_ctx_data_
-{
- quicly_context_t quicly_ctx;
- char cid_key[17];
- ptls_context_t ptls_ctx;
-} quicly_ctx_data_t;
-
typedef struct quic_main_
{
u32 app_index;