提交 e0799082 编写于 作者: D David Morley 提交者: sanglipeng

tcp: fix rate_app_limited to default to 1

stable inclusion
from stable-v5.10.166
commit d79e700680f9407abc8aa43e7bb758f94ccfecbf
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7TH9O

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d79e700680f9407abc8aa43e7bb758f94ccfecbf

--------------------------------

[ Upstream commit 300b655d ]

The initial default value of 0 for tp->rate_app_limited was incorrect,
since a flow is indeed application-limited until it first sends
data. Fixing the default to be 1 is generally correct but also
specifically will help user-space applications avoid using the initial
tcpi_delivery_rate value of 0 that persists until the connection has
some non-zero bandwidth sample.

Fixes: eb8329e0 ("tcp: export data delivery rate")
Suggested-by: NYuchung Cheng <ycheng@google.com>
Signed-off-by: NDavid Morley <morleyd@google.com>
Signed-off-by: NNeal Cardwell <ncardwell@google.com>
Tested-by: NDavid Morley <morleyd@google.com>
Reviewed-by: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 2cc193eb
...@@ -436,6 +436,7 @@ void tcp_init_sock(struct sock *sk) ...@@ -436,6 +436,7 @@ void tcp_init_sock(struct sock *sk)
/* There's a bubble in the pipe until at least the first ACK. */ /* There's a bubble in the pipe until at least the first ACK. */
tp->app_limited = ~0U; tp->app_limited = ~0U;
tp->rate_app_limited = 1;
/* See draft-stevens-tcpca-spec-01 for discussion of the /* See draft-stevens-tcpca-spec-01 for discussion of the
* initialization of these values. * initialization of these values.
...@@ -2842,6 +2843,7 @@ int tcp_disconnect(struct sock *sk, int flags) ...@@ -2842,6 +2843,7 @@ int tcp_disconnect(struct sock *sk, int flags)
tp->last_oow_ack_time = 0; tp->last_oow_ack_time = 0;
/* There's a bubble in the pipe until at least the first ACK. */ /* There's a bubble in the pipe until at least the first ACK. */
tp->app_limited = ~0U; tp->app_limited = ~0U;
tp->rate_app_limited = 1;
tp->rack.mstamp = 0; tp->rack.mstamp = 0;
tp->rack.advanced = 0; tp->rack.advanced = 0;
tp->rack.reo_wnd_steps = 1; tp->rack.reo_wnd_steps = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册