diff options
author | Florin Coras <fcoras@cisco.com> | 2020-10-28 00:37:15 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-10-29 21:31:04 +0000 |
commit | d6894568709b59625f03e92595e0686b05f2167a (patch) | |
tree | bbe259235a3530043be581e5021e0e7a7b54702e /src/vnet/session/application_local.c | |
parent | 108b15b4ef4844ef782639b9d9c3c71c222b5d9f (diff) |
vcl session: minimize ct io events
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic4072fbc182fff38a28b415be0bb16f0559a4064
Diffstat (limited to 'src/vnet/session/application_local.c')
-rw-r--r-- | src/vnet/session/application_local.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/vnet/session/application_local.c b/src/vnet/session/application_local.c index 58d3789cfee..9de987d7c31 100644 --- a/src/vnet/session/application_local.c +++ b/src/vnet/session/application_local.c @@ -518,10 +518,16 @@ ct_custom_tx (void *session, transport_send_params_t * sp) session_t *s = (session_t *) session; if (session_has_transport (s)) return 0; - /* As all other sessions, cut-throughs are scheduled by vpp for tx so let - * the scheduler's custom tx logic decide when to deschedule, i.e., after - * fifo is emptied. */ - return ct_session_tx (s); + /* If event enqueued towards peer, remove from scheduler and + * remove session tx flag, i.e., accept new tx events */ + if (!ct_session_tx (s)) + { + sp->flags = TRANSPORT_SND_F_DESCHED; + svm_fifo_unset_event (s->tx_fifo); + } + /* The scheduler uses packet count as a means of upper bounding the amount + * of work done per dispatch. So make it look like we have sent something */ + return 1; } static int @@ -632,10 +638,7 @@ ct_session_tx (session_t * s) peer_s = session_get (peer_ct->c_s_index, peer_ct->c_thread_index); if (peer_s->session_state >= SESSION_STATE_TRANSPORT_CLOSING) return 0; - session_enqueue_notify (peer_s); - /* The scheduler uses packet count as a means of upper bounding the amount - * of work done per dispatch. So make it look like we have sent something */ - return 1; + return session_enqueue_notify (peer_s); } static clib_error_t * |