aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--src/plugins/http/http.c8
-rw-r--r--src/plugins/srtp/srtp.c5
-rw-r--r--src/vnet/session/session_node.c6
-rw-r--r--src/vnet/session/transport.h1
-rw-r--r--src/vnet/tls/tls.c3
5 files changed, 11 insertions, 12 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))
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 162d54e7697..35ce091bc5a 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -1441,6 +1441,8 @@ session_tx_fifo_dequeue_internal (session_worker_t * wrk,
/* Clear custom-tx flag used to request reschedule for tx */
s->flags &= ~SESSION_F_CUSTOM_TX;
+ sp->flags = 0;
+ sp->bytes_dequeued = 0;
sp->max_burst_size = clib_min (SESSION_NODE_FRAME_SIZE - *n_tx_packets,
TRANSPORT_PACER_MAX_BURST_PKTS);
@@ -1459,8 +1461,8 @@ 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))
+ if (sp->bytes_dequeued &&
+ svm_fifo_needs_deq_ntf (s->tx_fifo, sp->bytes_dequeued))
session_dequeue_notify (s);
return n_packets;
diff --git a/src/vnet/session/transport.h b/src/vnet/session/transport.h
index 4edc281ff9c..02ab540f6a2 100644
--- a/src/vnet/session/transport.h
+++ b/src/vnet/session/transport.h
@@ -57,6 +57,7 @@ typedef struct transport_send_params_
struct
{
u32 max_burst_size;
+ u32 bytes_dequeued;
};
};
transport_snd_flags_t flags;
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index 9cf10086a91..01849178644 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -365,7 +365,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;
+ sp->bytes_dequeued = n_wrote;
return n_wrote > 0 ? clib_max (n_wrote / TRANSPORT_PACER_MIN_MSS, 1) : 0;
}
@@ -942,7 +942,6 @@ tls_custom_tx_callback (void *session, transport_send_params_t * sp)
>= SESSION_STATE_TRANSPORT_CLOSED))
return 0;
- sp->flags = 0;
ctx = tls_ctx_get (app_session->connection_index);
return tls_ctx_write (ctx, app_session, sp);
}
class='inline' src='//seccdn.libravatar.org/avatar/df12e07d9afc269a9f3f1e96d24c5e67?s=13&d=retro' />Neale Ranns7 years stable/1701Fix pretty-printing in "api trace custom-dump" (VPP-683)Andrew Yourtchenko8 years stable/1609Vhost: Add thread sync while receiving vhost messagePierre Pfister8 years stable/1606Fix generate-deb-changelog to handle YY.MM releaseEd Warnicke8 years stable/testWhitespace probe for CIEd Warnicke9 years  TagDownloadAuthorAge v24.10commit cfa0953251...Andrew Yourtchenko3 weeks v24.10-rc2commit 466b350538...Andrew Yourtchenko4 weeks v24.10-rc1commit b91e15387d...Andrew Yourtchenko7 weeks v25.02-rc0commit 8f989630b0...Andrew Yourtchenko7 weeks v24.06commit 6e8b350a01...Andrew Yourtchenko5 months v24.06-rc2commit 55457075d9...Andrew Yourtchenko5 months v24.06-rc1commit b3304b2b76...Andrew Yourtchenko6 months v24.10-rc0commit 71e0902454...Andrew Yourtchenko6 months v24.02commit 455960759b...Andrew Yourtchenko9 months v24.02-rc2commit 8cbf84dce0...Andrew Yourtchenko9 months v24.02-rc1commit 3a56e86a73...Andrew Yourtchenko10 months v24.06-rc0commit 6fb2b3dc72...Andrew Yourtchenko10 months v23.10commit 7c4027fa5e...Andrew Yourtchenko13 months v23.10-rc2commit 015a6f7f17...Andrew Yourtchenko13 months v23.10-rc1commit 14df6fc1ea...Andrew Yourtchenko14 months v24.02-rc0commit 7419bede7a...Andrew Yourtchenko14 months v23.06commit 493b8990d1...Andrew Yourtchenko17 months v23.06-rc2commit 5e6bc730ef...Andrew Yourtchenko17 months v23.06-rc1commit b60a6477eb...Andrew Yourtchenko18 months v23.10-rc0commit a7dd04d73b...Andrew Yourtchenko18 months v23.02commit 5516fc0f3b...Andrew Yourtchenko21 months v22.10.1commit 57302fe52f...Dave Wallace21 months v22.06.1commit 1513b381d8...Dave Wallace21 months v23.02-rc2commit be1b844214...Andrew Yourtchenko21 months v23.02-rc1commit 42b5a8767c...Andrew Yourtchenko22 months v23.06-rc0commit 2ebb95228f...Andrew Yourtchenko22 months v22.10commit 07e0c05e69...Andrew Yourtchenko2 years v22.10-rc2commit 61bae8a54d...Andrew Yourtchenko2 years v22.10-rc1commit f845abb5dd...Andrew Yourtchenko2 years v23.02-rc0commit a2a7a4031b...Andrew Yourtchenko2 years v22.06commit 0d352a97c5...Andrew Yourtchenko2 years v22.06-rc2commit ea4bcec987...Andrew Yourtchenko2 years v22.06-rc1commit 211fa4748c...Andrew Yourtchenko2 years v22.10-rc0commit e0301eeb7b...Andrew Yourtchenko2 years v22.02commit 7911f29c51...Andrew Yourtchenko3 years v22.02-rc2commit 9d2db2eb2e...Andrew Yourtchenko3 years v22.02-rc1commit 93e5bea2d3...Andrew Yourtchenko3 years v22.06-rc0commit 017a676654...Andrew Yourtchenko3 years v21.10.1commit 0385458a56...Andrew Yourtchenko3 years v21.10commit 0e0384cde9...Andrew Yourtchenko3 years v21.10-rc2commit c1931b2f09...Andrew Yourtchenko3 years v21.10-rc1commit fd9d936b3c...Andrew Yourtchenko3 years v22.02-rc0commit 192c55f2e7...Andrew Yourtchenko3 years v21.01.1commit 54f8aff02a...Andrew Yourtchenko3 years v21.06commit fc83f8cc67...Andrew Yourtchenko3 years v21.06-rc2commit 8b297dbceb...Andrew Yourtchenko3 years v21.06-rc1commit e82d59f381...Andrew Yourtchenko3 years v21.10-rc0commit 91d6a94845...Andrew Yourtchenko3 years v21.01commit 3d2d96e554...Andrew Yourtchenko4 years v21.01-rc2commit 15db851d93...Andrew Yourtchenko4 years v21.01-rc1commit 9dab7b9416...Andrew Yourtchenko4 years v21.06-rc0commit 7742d5b355...Andrew Yourtchenko4 years v20.09commit 072def4738...Andrew Yourtchenko4 years v20.09-rc2commit a87deb77da...Andrew Yourtchenko4 years v20.09-rc1commit fb6d768419...Andrew Yourtchenko4 years v21.01-rc0commit 0b31630ce7...Andrew Yourtchenko4 years v19.08.3commit 37e99c22df...Andrew Yourtchenko4 years v20.05.1commit b1500e9fff...Andrew Yourtchenko4 years v20.05commit ab572152d9...Andrew Yourtchenko4 years v20.05-rc2commit 63f9e7cc0e...Andrew Yourtchenko4 years v20.05-rc1commit b8e9009400...Andrew Yourtchenko5 years v20.09-rc0commit b163bbb748...Andrew Yourtchenko5 years v19.08.2commit ec9ce338f0...Andrew Yourtchenko5 years v20.01commit fce396738f...Andrew Yourtchenko5 years v20.01-rc2commit 29acfa2ad5...Andrew Yourtchenko5 years v20.01-rc1commit c7fe31cfff...Andrew Yourtchenko5 years v20.05-rc0commit 8ad070e102...Andrew Yourtchenko5 years v19.04.4-rc0commit dfec10d137...Dave Wallace5 years v19.04.3commit bdb89b9897...Dave Wallace5 years v19.08.1commit f4dcae4164...Andrew Yourtchenko5 years v19.08commit 1c586de48c...Andrew Yourtchenko5 years v19.08-rc2commit 2f51729bb3...Andrew Yourtchenko5 years v19.08-rc1commit 23526f78a8...Andrew Yourtchenko5 years v20.01-rc0commit e41fd65381...Andrew Yourtchenko5 years v19.04.2commit d95a226047...Dave Wallace5 years v19.01.3commit bef25c30a1...Andrew Yourtchenko5 years v19.04.2-rc0commit e4a0f9fdc0...Dave Wallace5 years v19.01.3-rc0commit 6af8243814...Dave Wallace5 years v19.04.1commit 1662c9cd23...Dave Wallace5 years v19.01.2commit fa63602fcb...Andrew Yourtchenko6 years v19.01.2-rc0commit 67a3e2d130...Dave Wallace6 years v19.04.1-rc0commit 873b9ed405...Dave Wallace6 years v19.04commit 3d18a191aa...Dave Wallace6 years v19.04-rc2commit 0d7332e43f...Dave Wallace6 years v19.08-rc0commit 40fd1f3dfd...Dave Wallace6 years v19.04-rc1commit e29b8228a2...Dave Wallace6 years v19.01.1commit cbd68cb711...Dave Wallace6 years v19.01commit 67d9475ae3...Andrew Yourtchenko6 years v19.01-rc2commit 0cb68778ec...Andrew Yourtchenko6 years v19.01-rc1commit 3e2bc759f4...Damjan Marion6 years v19.04-rc0commit ef080e1f9b...Andrew Yourtchenko6 years v18.10commit 3a9a6f72d1...Marco Varlese6 years v18.10-rc2commit b3aff922ff...Marco Varlese6 years v19.01-rc0commit 4f611176e9...Marco Varlese6 years v18.10-rc1commit 90395743d3...Marco Varlese6 years v18.07.1commit 55fbdb9941...Ed Warnicke6 years v18.07commit db6d6b3058...Ed Warnicke6 years v18.07-rc2commit c16a23c596...Ed Warnicke6 years v18.10-rc0commit 0e6f4d6af4...Ed Warnicke6 years v18.07-rc0commit 3e21eba4d2...Ed Warnicke6 years v18.07-rc1commit e400a6d1a5...Ed Warnicke6 years v18.01.2commit 540b31ac8f...Dave Wallace7 years v18.04commit ac2b7363f4...Chris Luke7 years v18.04-rc2commit 18744ee680...Chris Luke7 years v18.04-rc1commit 7ace56b9d8...Chris Luke7 years v18.01.1commit f13bac295d...Dave Wallace7 years v18.01commit 9d21268d0a...Dave Wallace7 years v18.01-rc2commit bbdfeaebf2...Dave Wallace7 years v18.01-rc1commit 8c2bacde4f...Dave Wallace7 years v18.04-rc0commit a3a6ec63d3...Dave Wallace7 years v17.10commit 116af2170e...Florin Coras7 years v17.10-rc2commit cf6c343710...Florin Coras7 years v18.01-rc0commit 75a17ecddc...Florin Coras7 years v17.10-rc1commit 7ea28045aa...Florin Coras7 years v17.07.01commit 839fa732c1...Neale Ranns7 years v17.07commit f4f635e7c0...Neale Ranns7 years v17.07-rc2commit 01d2b4b13a...Neale Ranns7 years v17.10-rc0commit cdc74273df...Neale Ranns7 years v17.07-rc1commit ea89b8cf66...Neale Ranns7 years v17.04.2commit fc69a97116...Ole Troan7 years v17.04.1commit 7d68ec6134...Ole Troan7 years v17.04commit 511ee63cbb...Ole Troan8 years v17.04-rc2commit 92bcecfdcc...Ole Troan8 years v17.07-rc0commit 87edd671d7...Ole Troan8 years v17.04-rc1commit cb92fc6edc...Ole Troan8 years v17.01.1commit 8099e90346...Damjan Marion8 years v17.01commit cd111b2228...Damjan Marion8 years v17.01-rc2commit 235c64f067...Damjan Marion8 years v17.04-rc0commit 2e70d8b31d...Damjan Marion8 years v17.01-rc1commit 436b319354...Damjan Marion8 years v17.01-rc0commit 931be3aca2...Ed Warnicke8 years v16.09commit 21bc8624f5...Keith Burns (alagalah)8 years v16.09-rc2commit 08377f8ff7...Keith Burns (alagalah)8 years v16.12-rc0commit 694265d4f1...Dave Barach8 years v16.09-rc1commit dbc6e3f0bb...Dave Barach8 years v16.06commit 693f4358de...Ed Warnicke8 years v16.06-rc3commit cf6511560e...Dave Barach8 years v16.06-rc2commit b98a3a87a9...Dave Barach8 years v16.09-rc0commit 862623da6e...Ed Warnicke9 years v16.06-rc1commit 826d4f7b1f...Ed Warnicke9 years v1.0.0commit cb9cadad57...Ed Warnicke9 years