* [PATCH net-next] tcp: tcp_time_to_recover() cleanup
@ 2025-06-18 9:12 Eric Dumazet
2025-06-18 16:42 ` Simon Horman
2025-06-19 23:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2025-06-18 9:12 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell
Cc: Simon Horman, Kuniyuki Iwashima, netdev, eric.dumazet,
Eric Dumazet
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>
---
net/ipv4/tcp_input.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 05b9571c9c92599df800307afd9c655771425f1e..e5664e6131defc69f533860c480328d9ad433b37 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -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;
}
--
2.50.0.rc2.696.g1fc2a0284f-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] tcp: tcp_time_to_recover() cleanup
2025-06-18 9:12 [PATCH net-next] tcp: tcp_time_to_recover() cleanup Eric Dumazet
@ 2025-06-18 16:42 ` Simon Horman
2025-06-19 23:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-06-18 16:42 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell,
Kuniyuki Iwashima, netdev, eric.dumazet
On Wed, Jun 18, 2025 at 09:12:46AM +0000, Eric Dumazet wrote:
> 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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] tcp: tcp_time_to_recover() cleanup
2025-06-18 9:12 [PATCH net-next] tcp: tcp_time_to_recover() cleanup Eric Dumazet
2025-06-18 16:42 ` Simon Horman
@ 2025-06-19 23:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-19 23:20 UTC (permalink / raw)
To: Eric Dumazet
Cc: davem, kuba, pabeni, ncardwell, horms, kuniyu, netdev,
eric.dumazet
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
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_sock type.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> 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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-19 23:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18 9:12 [PATCH net-next] tcp: tcp_time_to_recover() cleanup Eric Dumazet
2025-06-18 16:42 ` Simon Horman
2025-06-19 23:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).