aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_cubic.c
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2015-12-06 18:40:28 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2015-12-06 18:40:28 +0100
commit10a8113dfbfaf19d69eca171b96e451f5221cc2b (patch)
tree0ce8d433d5ef608526edf0ab0d7cedb68d68d460 /net/ipv4/tcp_cubic.c
parent5e64624059d6f984f4304abf336cce05cdb0212f (diff)
parente34b930b3ae085850e7d04e6f6f9c5578c0caf9d (diff)
downloadkernel_samsung_smdk4412-10a8113dfbfaf19d69eca171b96e451f5221cc2b.zip
kernel_samsung_smdk4412-10a8113dfbfaf19d69eca171b96e451f5221cc2b.tar.gz
kernel_samsung_smdk4412-10a8113dfbfaf19d69eca171b96e451f5221cc2b.tar.bz2
Merge branch 'master' into upstreaming
Diffstat (limited to 'net/ipv4/tcp_cubic.c')
-rw-r--r--net/ipv4/tcp_cubic.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
index b78eac2..ceb6362 100644
--- a/net/ipv4/tcp_cubic.c
+++ b/net/ipv4/tcp_cubic.c
@@ -151,6 +151,21 @@ static void bictcp_init(struct sock *sk)
tcp_sk(sk)->snd_ssthresh = initial_ssthresh;
}
+static void bictcp_cwnd_event(struct sock *sk, enum tcp_ca_event event)
+{
+ if (event == CA_EVENT_TX_START) {
+ s32 delta = tcp_time_stamp - tcp_sk(sk)->lsndtime;
+ struct bictcp *ca = inet_csk_ca(sk);
+
+ /* We were application limited (idle) for a while.
+ * Shift epoch_start to keep cwnd growth to cubic curve.
+ */
+ if (ca->epoch_start && delta > 0)
+ ca->epoch_start += delta;
+ return;
+ }
+}
+
/* calculate the cubic root of x using a table lookup followed by one
* Newton-Raphson iteration.
* Avg err ~= 0.195%
@@ -437,6 +452,7 @@ static struct tcp_congestion_ops cubictcp __read_mostly = {
.cong_avoid = bictcp_cong_avoid,
.set_state = bictcp_state,
.undo_cwnd = bictcp_undo_cwnd,
+ .cwnd_event = bictcp_cwnd_event,
.pkts_acked = bictcp_acked,
.owner = THIS_MODULE,
.name = "cubic",