aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/transport.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-01-09 18:18:10 -0800
committerFlorin Coras <florin.coras@gmail.com>2022-01-10 03:12:46 +0000
commit9bd71be3eef15fa7a037debf9713f7d8db62935f (patch)
treec0581e7c4907b213be82bd0bb0f0d296fc7e6d29 /src/vnet/session/transport.h
parent93dd58c8fb020870c770c2a4aa55dcc288fa2035 (diff)
session: deschedule sessions with no data to send
This ensures the scheduler always tracks sessions that are descheduled, i.e., do not have events in the old io events list. When app retries to send, clear descheduled flag and potentially the pacer. Consequently, transports no longer need to reset the pacer when sessions are rescheduled after a long app tx pause. This also fixes a tcp bug whereby the pacer was reset too often when snd_una was equal to snd_nxt as there was no way to distinguish betwen app tx breaks and congestion. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id3cc6c98cd76299e15030e504380dcf3c04c5189
Diffstat (limited to 'src/vnet/session/transport.h')
-rw-r--r--src/vnet/session/transport.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vnet/session/transport.h b/src/vnet/session/transport.h
index 2cfec06ec94..549f17957cc 100644
--- a/src/vnet/session/transport.h
+++ b/src/vnet/session/transport.h
@@ -327,6 +327,19 @@ transport_connection_is_tx_paced (transport_connection_t * tc)
return (tc->flags & TRANSPORT_CONNECTION_F_IS_TX_PACED);
}
+/**
+ * Clear descheduled flag and update pacer if needed
+ *
+ * To add session to scheduler use @ref transport_connection_reschedule
+ */
+always_inline void
+transport_connection_clear_descheduled (transport_connection_t *tc)
+{
+ tc->flags &= ~TRANSPORT_CONNECTION_F_DESCHED;
+ if (transport_connection_is_tx_paced (tc))
+ transport_connection_tx_pacer_reset_bucket (tc, 0 /* bucket */);
+}
+
u8 *format_transport_pacer (u8 * s, va_list * args);
/**