summaryrefslogtreecommitdiffstats
path: root/src/plugins/tlspicotls/tls_picotls.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-02-27 04:32:51 +0000
committerDave Barach <openvpp@barachs.net>2020-04-04 17:34:13 +0000
commited8db52539a8d8239a9a43bea53328d25eb47f0d (patch)
treef0bd25f356fa2f10aaab8e51eff3dfc3fd7637ec /src/plugins/tlspicotls/tls_picotls.c
parent3e07a4a1e843267892dc291a833d93bd70597011 (diff)
session tls: improve app transports tx scheduling
Type: improvement - allow apps to request rescheduling of tx events via SESSION_F_CUSTOM_TX flag - limit max burst per session custom tx dispatch In tls - use the new infra to reschedule tx events - use max burst bytes as upper limit to number of bytes to be encrypted Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I544a5a3337af7ebdff3406b776adf30cf96ebf3c
Diffstat (limited to 'src/plugins/tlspicotls/tls_picotls.c')
-rw-r--r--src/plugins/tlspicotls/tls_picotls.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/tlspicotls/tls_picotls.c b/src/plugins/tlspicotls/tls_picotls.c
index 17834e3e051..a9eea333779 100644
--- a/src/plugins/tlspicotls/tls_picotls.c
+++ b/src/plugins/tlspicotls/tls_picotls.c
@@ -410,7 +410,7 @@ picotls_content_process (picotls_ctx_t * ptls_ctx, svm_fifo_t * src_fifo,
}
static inline int
-picotls_ctx_write (tls_ctx_t * ctx, session_t * app_session)
+picotls_ctx_write (tls_ctx_t * ctx, session_t * app_session, u32 max_write)
{
picotls_ctx_t *ptls_ctx = (picotls_ctx_t *) ctx;
u32 deq_max, deq_now;
@@ -457,13 +457,15 @@ picotls_ctx_write (tls_ctx_t * ctx, session_t * app_session)
deq_max = svm_fifo_max_dequeue_cons (app_tx_fifo);
if (!deq_max)
return deq_max;
+
+ deq_max = clib_min (deq_max, max_write);
deq_now = clib_min (deq_max, svm_fifo_max_read_chunk (app_tx_fifo));
enq_max = svm_fifo_max_enqueue_prod (tls_tx_fifo);
/** There is no engough enqueue space for one record **/
if (enq_max <= record_overhead)
{
- tls_add_vpp_q_builtin_tx_evt (app_session);
+ app_session->flags |= SESSION_F_CUSTOM_TX;
return 0;
}
@@ -506,7 +508,7 @@ picotls_ctx_write (tls_ctx_t * ctx, session_t * app_session)
tls_add_vpp_q_tx_evt (tls_session);
if (from_app_len < deq_max || TLS_WRITE_IS_LEFT (ptls_ctx))
- tls_add_vpp_q_builtin_tx_evt (app_session);
+ app_session->flags |= SESSION_F_CUSTOM_TX;
if (ctx->app_closed)
picotls_app_close (ctx);