+ enq_max = svm_fifo_max_enqueue_prod (tls_tx_fifo);
+
+ if (PREDICT_FALSE (!ptls_ctx->is_write_buffer_finished))
+ {
+ int to_write = clib_min (enq_max,
+ ptls_ctx->write_buffer.off -
+ ptls_ctx->write_buffer_offset);
+ to_tls_len +=
+ svm_fifo_enqueue (tls_tx_fifo, to_write, TLS_WRITE_OFFSET (ptls_ctx));
+ ptls_ctx->write_buffer_offset += to_write;
+
+ if (TLS_WRITE_IS_LEFT (ptls_ctx))
+ {
+ tls_add_vpp_q_builtin_tx_evt (app_session);
+ return to_tls_len;
+ }
+ else
+ {
+ ptls_ctx->is_write_buffer_finished = 1;
+ ptls_ctx->write_buffer_offset = 0;
+ }
+ }
+