tls: add async processing support
Adds support for tls async processing using OpenSSL.
Adds new CLI command to configure OpenSSL TLS configurations used by
OpenSSL context and session. New CLI format is:
tls openssl set-tls [record-size <size>]
[record-split-size <size>]
[max-pipelines <size>]
Sets default values to below TLS configuration parameters:
- first_seg_size: 32MB
- add_seg_size: 256MB
Type: feature
Signed-off-by: Varun Rapelly <vrapelly@marvell.com>
Change-Id: I990be31fced9e258fdb036f5751cd67594b0bce7
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index 12dcbb4..b9ff30b 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -1258,6 +1258,10 @@
vec_validate (tm->rx_bufs, num_threads - 1);
vec_validate (tm->tx_bufs, num_threads - 1);
+ /*
+ * first_seg_size default value 32MB
+ * add_seg_size default value 256 MB
+ */
tm->first_seg_size = 32 << 20;
tm->add_seg_size = 256 << 20;
diff --git a/src/vnet/tls/tls.h b/src/vnet/tls/tls.h
index e56c4c0..244e204 100644
--- a/src/vnet/tls/tls.h
+++ b/src/vnet/tls/tls.h
@@ -40,6 +40,19 @@
#define TLS_DBG(_lvl, _fmt, _args...)
#endif
+#define foreach_ssl_async_evt_type \
+ _ (INIT, "SSL_in_init async event") \
+ _ (RD, "Read async event") \
+ _ (WR, "Write async event") \
+ _ (MAX, "Maximum async event")
+
+typedef enum ssl_async_evt_type_
+{
+#define _(sym, str) SSL_ASYNC_EVT_##sym,
+ foreach_ssl_async_evt_type
+#undef _
+} ssl_async_evt_type_t;
+
typedef struct tls_cxt_id_
{
session_handle_t app_session_handle;
@@ -66,7 +79,8 @@
_ (MIGRATED, "migrated") \
_ (NO_APP_SESSION, "no-app-session") \
_ (RESUME, "resume") \
- _ (HS_DONE, "handshake-done")
+ _ (HS_DONE, "handshake-done") \
+ _ (ASYNC_RD, "async-read")
typedef enum tls_conn_flags_bit_
{
@@ -105,7 +119,6 @@
u32 ts_app_index;
tls_conn_flags_t flags;
u8 *srv_hostname;
- u32 evt_index;
u32 ckpair_index;
transport_proto_t tls_type;
} tls_ctx_t;