From bf49b4ae0834dc917300a4d74e17d3cf6c54093c Mon Sep 17 00:00:00 2001 From: Varun Rapelly Date: Wed, 25 Dec 2024 06:49:46 +0100 Subject: tls: async event handling enhancement This patch updates async processing logic by adding async event handlers separately for handshake, read and write events. Type: improvement Change-Id: I6366689fec7e29fa9850cb22e20ab3659bf5245a Signed-off-by: Varun Rapelly --- src/plugins/tlsopenssl/tls_openssl.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/plugins/tlsopenssl/tls_openssl.h') diff --git a/src/plugins/tlsopenssl/tls_openssl.h b/src/plugins/tlsopenssl/tls_openssl.h index 8f6c6652a52..1a566f35fa6 100644 --- a/src/plugins/tlsopenssl/tls_openssl.h +++ b/src/plugins/tlsopenssl/tls_openssl.h @@ -40,6 +40,7 @@ typedef struct tls_ctx_openssl_ SSL_CTX *client_ssl_ctx; SSL *ssl; u32 evt_index[SSL_ASYNC_EVT_MAX]; + bool evt_alloc_flag[SSL_ASYNC_EVT_MAX]; u32 total_async_write; BIO *rbio; BIO *wbio; @@ -74,15 +75,14 @@ typedef struct openssl_main_ u32 max_pipelines; } openssl_main_t; -typedef int openssl_resume_handler (tls_ctx_t * ctx, session_t * tls_session); +typedef int openssl_resume_handler (void *event, void *session); +typedef int (*async_handlers) (void *event, void *session); tls_ctx_t *openssl_ctx_get_w_thread (u32 ctx_index, u8 thread_index); -int vpp_tls_async_init_events (tls_ctx_t *ctx, openssl_resume_handler *handler, - session_t *session); -int vpp_tls_async_update_event (tls_ctx_t *ctx, int eagain, - ssl_async_evt_type_t type); -int vpp_tls_async_enqueue_event (openssl_ctx_t *ctx, int evt_type, - transport_send_params_t *sp, int size); +int vpp_tls_async_init_event (tls_ctx_t *ctx, openssl_resume_handler *handler, + session_t *session, + ssl_async_evt_type_t evt_type, + transport_send_params_t *sp, int wr_size); int tls_async_openssl_callback (SSL * s, void *evt); int openssl_evt_free (int event_idx, u8 thread_index); void openssl_polling_start (ENGINE * engine); @@ -96,6 +96,9 @@ int openssl_read_from_ssl_into_fifo (svm_fifo_t *f, tls_ctx_t *ctx, void openssl_handle_handshake_failure (tls_ctx_t *ctx); void openssl_confirm_app_close (tls_ctx_t *ctx); +int tls_async_write_event_handler (void *event, void *session); +int tls_async_read_event_handler (void *event, void *session); +int tls_async_handshake_event_handler (void *event, void *session); #endif /* SRC_PLUGINS_TLSOPENSSL_TLS_OPENSSL_H_ */ /* -- cgit 1.2.3-korg