Skip to content

Commit 300b655

Browse files
David Morleydavem330
authored andcommitted
tcp: fix rate_app_limited to default to 1
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: eb8329e ("tcp: export data delivery rate") Suggested-by: Yuchung Cheng <[email protected]> Signed-off-by: David Morley <[email protected]> Signed-off-by: Neal Cardwell <[email protected]> Tested-by: David Morley <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d3e599c commit 300b655

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ipv4/tcp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ void tcp_init_sock(struct sock *sk)
435435

436436
/* There's a bubble in the pipe until at least the first ACK. */
437437
tp->app_limited = ~0U;
438+
tp->rate_app_limited = 1;
438439

439440
/* See draft-stevens-tcpca-spec-01 for discussion of the
440441
* initialization of these values.
@@ -3178,6 +3179,7 @@ int tcp_disconnect(struct sock *sk, int flags)
31783179
tp->plb_rehash = 0;
31793180
/* There's a bubble in the pipe until at least the first ACK. */
31803181
tp->app_limited = ~0U;
3182+
tp->rate_app_limited = 1;
31813183
tp->rack.mstamp = 0;
31823184
tp->rack.advanced = 0;
31833185
tp->rack.reo_wnd_steps = 1;

0 commit comments

Comments
 (0)