summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-01-05 09:48:36 -0800
committerDave Barach <openvpp@barachs.net>2022-01-06 23:09:00 +0000
commit8e1ada3a615f47d318586add8a4358ea50a10695 (patch)
treeab6e7592dfe50910e0567448447ee579239bca67 /src/vnet/tcp
parent8e76dfa7582ddc0396fa4c4fb0c61fed0a02c890 (diff)
tcp: handle start tx event in cubic
If app was idle update start time of current congestion avoidance phase unless tcp connection was not idle. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Idf6a03a9ef96c409462de9f9cb19df609f730afe
Diffstat (limited to 'src/vnet/tcp')
-rw-r--r--src/vnet/tcp/tcp_cubic.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp_cubic.c b/src/vnet/tcp/tcp_cubic.c
index 3160e528e6d..85c311bb631 100644
--- a/src/vnet/tcp/tcp_cubic.c
+++ b/src/vnet/tcp/tcp_cubic.c
@@ -232,6 +232,23 @@ cubic_unformat_config (unformat_input_t * input)
return 1;
}
+void
+cubic_event (tcp_connection_t *tc, tcp_cc_event_t evt)
+{
+ cubic_data_t *cd;
+ f64 now;
+
+ if (evt != TCP_CC_EVT_START_TX)
+ return;
+
+ /* App was idle so update t_start to avoid artificially
+ * inflating cwnd if nothing recently sent and acked */
+ cd = (cubic_data_t *) tcp_cc_data (tc);
+ now = cubic_time (tc->c_thread_index);
+ if (now > tc->mrtt_us + 1)
+ cd->t_start = now;
+}
+
const static tcp_cc_algorithm_t tcp_cubic = {
.name = "cubic",
.unformat_cfg = cubic_unformat_config,
@@ -240,6 +257,7 @@ const static tcp_cc_algorithm_t tcp_cubic = {
.recovered = cubic_recovered,
.rcv_ack = cubic_rcv_ack,
.rcv_cong_ack = newreno_rcv_cong_ack,
+ .event = cubic_event,
.init = cubic_conn_init,
};