Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tcp: tcp_time_to_recover() cleanup

tcp_time_to_recover() does not need the @flag argument.

Its first parameter can be marked const, and of tcp_sock type.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250618091246.1260322-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Dumazet and committed by
Jakub Kicinski
f64bd204 c7d78566

+3 -5
+3 -5
net/ipv4/tcp_input.c
··· 2336 2336 * Main question: may we further continue forward transmission 2337 2337 * with the same cwnd? 2338 2338 */ 2339 - static bool tcp_time_to_recover(struct sock *sk, int flag) 2339 + static bool tcp_time_to_recover(const struct tcp_sock *tp) 2340 2340 { 2341 - struct tcp_sock *tp = tcp_sk(sk); 2342 - 2343 2341 /* Has loss detection marked at least one packet lost? */ 2344 2342 return tp->lost_out != 0; 2345 2343 } ··· 3011 3013 3012 3014 tcp_identify_packet_loss(sk, ack_flag); 3013 3015 if (icsk->icsk_ca_state != TCP_CA_Recovery) { 3014 - if (!tcp_time_to_recover(sk, flag)) 3016 + if (!tcp_time_to_recover(tp)) 3015 3017 return; 3016 3018 /* Undo reverts the recovery state. If loss is evident, 3017 3019 * starts a new recovery (e.g. reordering then loss); ··· 3040 3042 tcp_try_undo_dsack(sk); 3041 3043 3042 3044 tcp_identify_packet_loss(sk, ack_flag); 3043 - if (!tcp_time_to_recover(sk, flag)) { 3045 + if (!tcp_time_to_recover(tp)) { 3044 3046 tcp_try_to_open(sk, flag); 3045 3047 return; 3046 3048 }