Skip to content

Commit 3a6e8fd

Browse files
edumazetkuba-moo
authored andcommitted
tcp: rename icsk_timeout() to tcp_timeout_expires()
In preparation of sk->tcp_timeout_timer introduction, rename icsk_timeout() helper and change its argument to plain 'const struct sock *sk'. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20251124175013.1473655-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 436fa8e commit 3a6e8fd

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

include/net/inet_connection_sock.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,9 @@ static inline void inet_csk_delack_init(struct sock *sk)
184184
memset(&inet_csk(sk)->icsk_ack, 0, sizeof(inet_csk(sk)->icsk_ack));
185185
}
186186

187-
static inline unsigned long
188-
icsk_timeout(const struct inet_connection_sock *icsk)
187+
static inline unsigned long tcp_timeout_expires(const struct sock *sk)
189188
{
190-
return READ_ONCE(icsk->icsk_retransmit_timer.expires);
189+
return READ_ONCE(inet_csk(sk)->icsk_retransmit_timer.expires);
191190
}
192191

193192
static inline unsigned long

net/ipv4/inet_diag.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,12 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
287287
r->idiag_timer = 1;
288288
r->idiag_retrans = READ_ONCE(icsk->icsk_retransmits);
289289
r->idiag_expires =
290-
jiffies_delta_to_msecs(icsk_timeout(icsk) - jiffies);
290+
jiffies_delta_to_msecs(tcp_timeout_expires(sk) - jiffies);
291291
} else if (icsk_pending == ICSK_TIME_PROBE0) {
292292
r->idiag_timer = 4;
293293
r->idiag_retrans = READ_ONCE(icsk->icsk_probes_out);
294294
r->idiag_expires =
295-
jiffies_delta_to_msecs(icsk_timeout(icsk) - jiffies);
295+
jiffies_delta_to_msecs(tcp_timeout_expires(sk) - jiffies);
296296
} else if (timer_pending(&sk->sk_timer)) {
297297
r->idiag_timer = 2;
298298
r->idiag_retrans = READ_ONCE(icsk->icsk_probes_out);

net/ipv4/tcp_ipv4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2869,10 +2869,10 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i)
28692869
icsk_pending == ICSK_TIME_REO_TIMEOUT ||
28702870
icsk_pending == ICSK_TIME_LOSS_PROBE) {
28712871
timer_active = 1;
2872-
timer_expires = icsk_timeout(icsk);
2872+
timer_expires = tcp_timeout_expires(sk);
28732873
} else if (icsk_pending == ICSK_TIME_PROBE0) {
28742874
timer_active = 4;
2875-
timer_expires = icsk_timeout(icsk);
2875+
timer_expires = tcp_timeout_expires(sk);
28762876
} else if (timer_pending(&sk->sk_timer)) {
28772877
timer_active = 2;
28782878
timer_expires = sk->sk_timer.expires;

net/ipv4/tcp_timer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ static bool tcp_rtx_probe0_timed_out(const struct sock *sk,
510510
* and tp->rcv_tstamp might very well have been written recently.
511511
* rcv_delta can thus be negative.
512512
*/
513-
rcv_delta = icsk_timeout(icsk) - tp->rcv_tstamp;
513+
rcv_delta = tcp_timeout_expires(sk) - tp->rcv_tstamp;
514514
if (rcv_delta <= timeout)
515515
return false;
516516

@@ -697,9 +697,9 @@ void tcp_write_timer_handler(struct sock *sk)
697697
!icsk->icsk_pending)
698698
return;
699699

700-
if (time_after(icsk_timeout(icsk), jiffies)) {
700+
if (time_after(tcp_timeout_expires(sk), jiffies)) {
701701
sk_reset_timer(sk, &icsk->icsk_retransmit_timer,
702-
icsk_timeout(icsk));
702+
tcp_timeout_expires(sk));
703703
return;
704704
}
705705
tcp_mstamp_refresh(tcp_sk(sk));

net/ipv6/tcp_ipv6.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,10 +2163,10 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
21632163
icsk_pending == ICSK_TIME_REO_TIMEOUT ||
21642164
icsk_pending == ICSK_TIME_LOSS_PROBE) {
21652165
timer_active = 1;
2166-
timer_expires = icsk_timeout(icsk);
2166+
timer_expires = tcp_timeout_expires(sp);
21672167
} else if (icsk_pending == ICSK_TIME_PROBE0) {
21682168
timer_active = 4;
2169-
timer_expires = icsk_timeout(icsk);
2169+
timer_expires = tcp_timeout_expires(sp);
21702170
} else if (timer_pending(&sp->sk_timer)) {
21712171
timer_active = 2;
21722172
timer_expires = sp->sk_timer.expires;

net/mptcp/protocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ static long mptcp_timeout_from_subflow(const struct mptcp_subflow_context *subfl
519519
const struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
520520

521521
return inet_csk(ssk)->icsk_pending && !subflow->stale_count ?
522-
icsk_timeout(inet_csk(ssk)) - jiffies : 0;
522+
tcp_timeout_expires(ssk) - jiffies : 0;
523523
}
524524

525525
static void mptcp_set_timeout(struct sock *sk)

0 commit comments

Comments
 (0)