[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF0XkCAk=iXwCjiD1Ab8DtCORm_Dz+ciPqpvxqmkG-XzoU=oBw@mail.gmail.com>
Date: Sat, 27 May 2017 14:08:01 +0200
From: Lars Erik Storbukås <storbukas.dev@...il.com>
To: LKML <linux-kernel@...r.kernel.org>
Subject: TCP get SND_CWND change on loss event
I want to store the value of snd_cwnd when a congestion event occurs
(value before snd_cwnd is reduced), and the new value of snd_cwnd (the
value it has been reduced to). In other words: the congestion window
before and after a congestion event occurs.
I'm uncertain where (and how) it would be logical to implement this. I
have found two possible locations in the tcp_input.c where (I think)
it could be implemented:
static void tcp_cong_control(...) {
...
if (tcp_in_cwnd_reduction(sk)) {
struct tcp_sock *tp = tcp_sk(sk);
prior_congestion_window = tp->snd_cwnd;
/* Reduce cwnd if state mandates */
tcp_cwnd_reduction(sk, acked_sacked, flag);
reduced_congestion_window = tp->snd_cwnd;
}
...
}
or
static void tcp_fastretrans_alert(...) {
...
default:
...
struct tcp_sock *tp = tcp_sk(sk);
prior_congestion_window = tp->snd_cwnd;
/* Otherwise enter Recovery state */
tcp_enter_recovery(sk, (flag & FLAG_ECE));
fast_rexmit = 1;
reduced_congestion_window = tp->snd_cwnd;
...
}
Does anyone have advice on where (and how) to implement this? Does any
of the proposed solutions above seem logical?
/ Lars Erik Storbukås
Powered by blists - more mailing lists