aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-02-04 13:31:25 -0800
committerDave Barach <openvpp@barachs.net>2022-02-05 21:19:53 +0000
commit3e157100b57237cc694ae3d002cf736b36043c3c (patch)
treeecfaa3f58fba287d3c097790c58550c7b1c418fb /src/plugins
parent6eaeea9003590ba46809c8d9f0023bbe8b78339f (diff)
session: track bytes dequeued in snd params
Also reset send params flags before calling transports to avoid explicit resets in all transports. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1da7b3fab009728e7fee4199425ced933fa8a122
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/http/http.c8
-rw-r--r--src/plugins/srtp/srtp.c5
2 files changed, 5 insertions, 8 deletions
diff --git a/src/plugins/http/http.c b/src/plugins/http/http.c
index a6a6af1f42f..574c34187cc 100644
--- a/src/plugins/http/http.c
+++ b/src/plugins/http/http.c
@@ -528,11 +528,7 @@ state_send_more_data (http_conn_t *hc, transport_send_params_t *sp)
if (sent > 0)
{
/* Ask scheduler to notify app of deq event if needed */
- sp->max_burst_size = http_buffer_drain (hb, sent);
- }
- else
- {
- sp->max_burst_size = 0;
+ sp->bytes_dequeued += http_buffer_drain (hb, sent);
}
/* Not finished sending all data */
@@ -822,8 +818,6 @@ http_app_tx_callback (void *session, transport_send_params_t *sp)
session_t *as = (session_t *) session;
http_conn_t *hc;
- sp->flags = 0;
-
hc = http_conn_get_w_thread (as->connection_index, as->thread_index);
if (hc->req_state < HTTP_REQ_STATE_WAIT_APP)
{
diff --git a/src/plugins/srtp/srtp.c b/src/plugins/srtp/srtp.c
index 62274ba635e..cc4b59de569 100644
--- a/src/plugins/srtp/srtp.c
+++ b/src/plugins/srtp/srtp.c
@@ -238,6 +238,7 @@ srtp_ctx_write (srtp_tc_t *ctx, session_t *app_session,
us = session_get_from_handle (ctx->srtp_session_handle);
to_deq = svm_fifo_max_dequeue_cons (app_session->tx_fifo);
mq = session_main_get_vpp_event_queue (us->thread_index);
+ sp->bytes_dequeued = to_deq;
while (to_deq > 0)
{
@@ -296,6 +297,9 @@ done:
session_transport_closed_notify (&ctx->connection);
}
+ ASSERT (sp->bytes_dequeued >= to_deq);
+ sp->bytes_dequeued -= to_deq;
+
return n_wrote > 0 ? clib_max (n_wrote / TRANSPORT_PACER_MIN_MSS, 1) : 0;
}
@@ -812,7 +816,6 @@ srtp_custom_tx_callback (void *session, transport_send_params_t *sp)
SESSION_STATE_TRANSPORT_CLOSED))
return 0;
- sp->flags = 0;
ctx = srtp_ctx_get_w_thread (app_session->connection_index,
app_session->thread_index);
if (PREDICT_FALSE (ctx->is_migrated))