session tls: deq notifications for custom tx 98/31598/4
authorFlorin Coras <fcoras@cisco.com>
Tue, 9 Mar 2021 16:36:25 +0000 (08:36 -0800)
committerDave Barach <openvpp@barachs.net>
Thu, 11 Mar 2021 19:30:48 +0000 (19:30 +0000)
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6ed2104e9d79c367ca36460047586f9b632c3315

src/plugins/tlsopenssl/tls_openssl.c
src/vnet/session/session_node.c
src/vnet/tls/tls.c

index 00cd462..c906d0e 100644 (file)
@@ -159,6 +159,9 @@ openssl_read_from_ssl_into_fifo (svm_fifo_t * f, SSL * ssl)
   u32 max_enq;
 
   max_enq = svm_fifo_max_enqueue_prod (f);
+  if (!max_enq)
+    return 0;
+
   n_fs = svm_fifo_provision_chunks (f, fs, n_segs, max_enq);
   if (n_fs < 0)
     return 0;
index 2e21f26..f5e8478 100644 (file)
@@ -1188,6 +1188,10 @@ session_tx_fifo_dequeue_internal (session_worker_t * wrk,
          session_evt_add_head_old (wrk, elt);
     }
 
+  if (sp->max_burst_size &&
+      svm_fifo_needs_deq_ntf (s->tx_fifo, sp->max_burst_size))
+    session_dequeue_notify (s);
+
   return n_packets;
 }
 
index 6052ca1..b9c07ff 100644 (file)
@@ -353,6 +353,7 @@ tls_ctx_write (tls_ctx_t * ctx, session_t * app_session,
 
   sp->max_burst_size = sp->max_burst_size * TRANSPORT_PACER_MIN_MSS;
   n_wrote = tls_vfts[ctx->tls_ctx_engine].ctx_write (ctx, app_session, sp);
+  sp->max_burst_size = n_wrote;
   return n_wrote > 0 ? clib_max (n_wrote / TRANSPORT_PACER_MIN_MSS, 1) : 0;
 }