Patch "tcp_bbr: introduce bbr_init_pacing_rate_from_rtt() helper" has been added to the 4.12-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
tcp_bbr: introduce bbr_init_pacing_rate_from_rtt() helper
to the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
tcp_bbr-introduce-bbr_init_pacing_rate_from_rtt-helper.patch
and it can be found in the queue-4.12 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Tue Aug 8 16:27:29 PDT 2017
From: Neal Cardwell <[email protected]>
Date: Fri, 14 Jul 2017 17:49:23 -0400
Subject: tcp_bbr: introduce bbr_init_pacing_rate_from_rtt() helper
From: Neal Cardwell <[email protected]>
[ Upstream commit 79135b89b8af304456bd67916b80116ddf03d7b6 ]
Introduce a helper to initialize the BBR pacing rate unconditionally, based on the current cwnd and RTT estimate. This is a pure refactor, but is needed for two following fixes.
--- net/ipv4/tcp_bbr.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
net/ipv4/tcp_bbr.c +18 -5
@@ -222,6 +222,23 @@ static u32 bbr_bw_to_pacing_rate(structreturn rate; } +/* Initialize pacing rate to: high_gain * init_cwnd / RTT. */ +static void bbr_init_pacing_rate_from_rtt (struct sock *sk) +{ +struct tcp_sock *tp =tcp_sk (sk); +u64 bw; +u32 rtt_us; + +if (tp->srtt_us) {/* any RTT sample yet? */ + rtt_us =max (tp->srtt_us >>3 ,1U ); + }else {/* no RTT sample yet */ + rtt_us =USEC_PER_MSEC ;/* use nominal default RTT */ + } + bw = (u64 )tp->snd_cwnd *BW_UNIT ; +do_div (bw, rtt_us); + sk->sk_pacing_rate =bbr_bw_to_pacing_rate (sk, bw, bbr_high_gain); +} +/* Pace using current bw estimate and a gain factor. In order to help drive the * network toward lower queues while maintaining high utilization and low * latency, the average pacing rate aims to be slightly (~1%) lower than the
@@ -806,7 +823,6 @@ static void bbr_init(struct sock *sk) {struct tcp_sock *tp =tcp_sk (sk);struct bbr *bbr =inet_csk_ca (sk); -u64 bw; bbr->prior_cwnd =0 ; bbr->tso_segs_goal =0 ;/* default segs per skb until first ACK */
@@ -822,11 +838,8 @@ static void bbr_init(struct sock *sk)minmax_reset (&bbr->bw, bbr->rtt_cnt,0 );/* init max bw to 0 */ -/* Initialize pacing rate to: high_gain * init_cwnd / RTT. */ - bw = (u64 )tp->snd_cwnd *BW_UNIT ; -do_div (bw, (tp->srtt_us >>3 ) ? :USEC_PER_MSEC ); sk->sk_pacing_rate =0 ;/* force an update of sk_pacing_rate */ -bbr_set_pacing_rate (sk, bw, bbr_high_gain); +bbr_init_pacing_rate_from_rtt (sk); bbr->restore_cwnd =0 ; bbr->round_start =0 ;
Patches currently in stable-queue which might be from [email protected] are
queue-4.12/tcp_bbr-remove-sk_pacing_rate-0-transient-during-init.patch queue-4.12/tcp_bbr-introduce-bbr_bw_to_pacing_rate-helper.patch queue-4.12/tcp_bbr-introduce-bbr_init_pacing_rate_from_rtt-helper.patch queue-4.12/tcp_bbr-init-pacing-rate-on-first-rtt-sample.patch queue-4.12/tcp_bbr-cut-pacing-rate-only-if-filled-pipe.patch