diff options
author | Eric Dumazet <edumazet@google.com> | 2018-06-20 16:07:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-22 13:59:22 +0900 |
commit | cadefe5f584abaac40dce72009e4de738cbff467 (patch) | |
tree | 1b40f040d84e576d231826bd19593918eb597d86 /net/ipv4/tcp_bbr.c | |
parent | 3f484a6e766740c9cb89cf576fdceeec49e221fd (diff) | |
download | linux-cadefe5f584abaac40dce72009e4de738cbff467.tar.gz linux-cadefe5f584abaac40dce72009e4de738cbff467.tar.bz2 linux-cadefe5f584abaac40dce72009e4de738cbff467.zip |
tcp_bbr: fix bbr pacing rate for internal pacing
This commit makes BBR use only the MSS (without any headers) to
calculate pacing rates when internal TCP-layer pacing is used.
This is necessary to achieve the correct pacing behavior in this case,
since tcp_internal_pacing() uses only the payload length to calculate
pacing delays.
Signed-off-by: Kevin Yang <yyd@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_bbr.c')
-rw-r--r-- | net/ipv4/tcp_bbr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c index 58e2f479ffb4..3b5f45b9e81e 100644 --- a/net/ipv4/tcp_bbr.c +++ b/net/ipv4/tcp_bbr.c @@ -205,7 +205,11 @@ static u32 bbr_bw(const struct sock *sk) */ static u64 bbr_rate_bytes_per_sec(struct sock *sk, u64 rate, int gain) { - rate *= tcp_mss_to_mtu(sk, tcp_sk(sk)->mss_cache); + unsigned int mss = tcp_sk(sk)->mss_cache; + + if (!tcp_needs_internal_pacing(sk)) + mss = tcp_mss_to_mtu(sk, mss); + rate *= mss; rate *= gain; rate >>= BBR_SCALE; rate *= USEC_PER_SEC; |