tcp: tcp_time_to_recover() cleanup
Subsystems (3)
PATCH 1/1 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 <[email protected]>
--- net/ipv4/tcp_input.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
net/ipv4/tcp_input.c +3 -5
@@ -2336,10 +2336,8 @@ static bool tcp_check_sack_reneging(struct sock *sk, int *ack_flag)* Main question: may we further continue forward transmission * with the same cwnd? */ -static bool tcp_time_to_recover (struct sock *sk,int flag) +static bool tcp_time_to_recover (const struct tcp_sock *tp) { -struct tcp_sock *tp =tcp_sk (sk); -/* Has loss detection marked at least one packet lost? */ return tp->lost_out !=0 ; }
@@ -3000,7 +2998,7 @@ static void tcp_fastretrans_alert(struct sock *sk, const u32 prior_snd_una,tcp_identify_packet_loss (sk, ack_flag);if (icsk->icsk_ca_state != TCP_CA_Recovery) { -if (!tcp_time_to_recover (sk, flag)) +if (!tcp_time_to_recover (tp))return ;/* Undo reverts the recovery state. If loss is evident, * starts a new recovery (e.g. reordering then loss);
@@ -3029,7 +3027,7 @@ static void tcp_fastretrans_alert(struct sock *sk, const u32 prior_snd_una,tcp_try_undo_dsack (sk);tcp_identify_packet_loss (sk, ack_flag); -if (!tcp_time_to_recover (sk, flag)) { +if (!tcp_time_to_recover (tp)) {tcp_try_to_open (sk, flag);return ; }
Signature · 1 line
2.50.0.rc2.696.g1fc2a0284f-goog
Quoted 5 lines · Eric Dumazet
tcp_time_to_recover()does not need the @flag argument.Its first parameter can be marked const, and of
tcp_socktype.Signed-off-by Eric Dumazet <[email protected]>
Reviewed-by Simon Horman <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Wed, 18 Jun 2025 09:12:46 +0000 you wrote:
tcp_time_to_recover()does not need the @flag argument.Its first parameter can be marked const, and of
tcp_socktype.Signed-off-by Eric Dumazet <[email protected]>--- net/ipv4/tcp_input.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
Here is the summary with links:
- [net-next] tcp: tcp_time_to_recover() cleanup
https://git.kernel.org/netdev/net-next/c/f64bd2045d62
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html