Skip to content

Commit f6909dc

Browse files
Paolo Abenidavem330
authored andcommitted
mptcp: rename timer related helper to less confusing names
The msk socket uses to different timeout to track close related events and retransmissions. The existing helpers do not indicate clearly which timer they actually touch, making the related code quite confusing. Change the existing helpers name to avoid such confusion. No functional change intended. This patch is linked to the next one ("mptcp: fix dangling connection hang-up"). The two patches are supposed to be backported together. Cc: [email protected] # v5.11+ Signed-off-by: Paolo Abeni <[email protected]> Reviewed-by: Matthieu Baerts <[email protected]> Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9f1a988 commit f6909dc

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

net/mptcp/protocol.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ static bool __mptcp_move_skb(struct mptcp_sock *msk, struct sock *ssk,
405405
return false;
406406
}
407407

408-
static void mptcp_stop_timer(struct sock *sk)
408+
static void mptcp_stop_rtx_timer(struct sock *sk)
409409
{
410410
struct inet_connection_sock *icsk = inet_csk(sk);
411411

@@ -911,12 +911,12 @@ static void __mptcp_flush_join_list(struct sock *sk, struct list_head *join_list
911911
}
912912
}
913913

914-
static bool mptcp_timer_pending(struct sock *sk)
914+
static bool mptcp_rtx_timer_pending(struct sock *sk)
915915
{
916916
return timer_pending(&inet_csk(sk)->icsk_retransmit_timer);
917917
}
918918

919-
static void mptcp_reset_timer(struct sock *sk)
919+
static void mptcp_reset_rtx_timer(struct sock *sk)
920920
{
921921
struct inet_connection_sock *icsk = inet_csk(sk);
922922
unsigned long tout;
@@ -1050,10 +1050,10 @@ static void __mptcp_clean_una(struct sock *sk)
10501050
out:
10511051
if (snd_una == READ_ONCE(msk->snd_nxt) &&
10521052
snd_una == READ_ONCE(msk->write_seq)) {
1053-
if (mptcp_timer_pending(sk) && !mptcp_data_fin_enabled(msk))
1054-
mptcp_stop_timer(sk);
1053+
if (mptcp_rtx_timer_pending(sk) && !mptcp_data_fin_enabled(msk))
1054+
mptcp_stop_rtx_timer(sk);
10551055
} else {
1056-
mptcp_reset_timer(sk);
1056+
mptcp_reset_rtx_timer(sk);
10571057
}
10581058
}
10591059

@@ -1626,8 +1626,8 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
16261626
mptcp_push_release(ssk, &info);
16271627

16281628
/* ensure the rtx timer is running */
1629-
if (!mptcp_timer_pending(sk))
1630-
mptcp_reset_timer(sk);
1629+
if (!mptcp_rtx_timer_pending(sk))
1630+
mptcp_reset_rtx_timer(sk);
16311631
if (do_check_data_fin)
16321632
mptcp_check_send_data_fin(sk);
16331633
}
@@ -1690,8 +1690,8 @@ static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk, bool
16901690
if (copied) {
16911691
tcp_push(ssk, 0, info.mss_now, tcp_sk(ssk)->nonagle,
16921692
info.size_goal);
1693-
if (!mptcp_timer_pending(sk))
1694-
mptcp_reset_timer(sk);
1693+
if (!mptcp_rtx_timer_pending(sk))
1694+
mptcp_reset_rtx_timer(sk);
16951695

16961696
if (msk->snd_data_fin_enable &&
16971697
msk->snd_nxt + 1 == msk->write_seq)
@@ -2260,7 +2260,7 @@ static void mptcp_retransmit_timer(struct timer_list *t)
22602260
sock_put(sk);
22612261
}
22622262

2263-
static void mptcp_timeout_timer(struct timer_list *t)
2263+
static void mptcp_tout_timer(struct timer_list *t)
22642264
{
22652265
struct sock *sk = from_timer(sk, t, sk_timer);
22662266

@@ -2629,14 +2629,14 @@ static void __mptcp_retrans(struct sock *sk)
26292629
reset_timer:
26302630
mptcp_check_and_set_pending(sk);
26312631

2632-
if (!mptcp_timer_pending(sk))
2633-
mptcp_reset_timer(sk);
2632+
if (!mptcp_rtx_timer_pending(sk))
2633+
mptcp_reset_rtx_timer(sk);
26342634
}
26352635

26362636
/* schedule the timeout timer for the relevant event: either close timeout
26372637
* or mp_fail timeout. The close timeout takes precedence on the mp_fail one
26382638
*/
2639-
void mptcp_reset_timeout(struct mptcp_sock *msk, unsigned long fail_tout)
2639+
void mptcp_reset_tout_timer(struct mptcp_sock *msk, unsigned long fail_tout)
26402640
{
26412641
struct sock *sk = (struct sock *)msk;
26422642
unsigned long timeout, close_timeout;
@@ -2669,7 +2669,7 @@ static void mptcp_mp_fail_no_response(struct mptcp_sock *msk)
26692669
WRITE_ONCE(mptcp_subflow_ctx(ssk)->fail_tout, 0);
26702670
unlock_sock_fast(ssk, slow);
26712671

2672-
mptcp_reset_timeout(msk, 0);
2672+
mptcp_reset_tout_timer(msk, 0);
26732673
}
26742674

26752675
static void mptcp_do_fastclose(struct sock *sk)
@@ -2758,7 +2758,7 @@ static void __mptcp_init_sock(struct sock *sk)
27582758

27592759
/* re-use the csk retrans timer for MPTCP-level retrans */
27602760
timer_setup(&msk->sk.icsk_retransmit_timer, mptcp_retransmit_timer, 0);
2761-
timer_setup(&sk->sk_timer, mptcp_timeout_timer, 0);
2761+
timer_setup(&sk->sk_timer, mptcp_tout_timer, 0);
27622762
}
27632763

27642764
static void mptcp_ca_reset(struct sock *sk)
@@ -2849,8 +2849,8 @@ void mptcp_subflow_shutdown(struct sock *sk, struct sock *ssk, int how)
28492849
} else {
28502850
pr_debug("Sending DATA_FIN on subflow %p", ssk);
28512851
tcp_send_ack(ssk);
2852-
if (!mptcp_timer_pending(sk))
2853-
mptcp_reset_timer(sk);
2852+
if (!mptcp_rtx_timer_pending(sk))
2853+
mptcp_reset_rtx_timer(sk);
28542854
}
28552855
break;
28562856
}
@@ -2933,7 +2933,7 @@ static void __mptcp_destroy_sock(struct sock *sk)
29332933

29342934
might_sleep();
29352935

2936-
mptcp_stop_timer(sk);
2936+
mptcp_stop_rtx_timer(sk);
29372937
sk_stop_timer(sk, &sk->sk_timer);
29382938
msk->pm.status = 0;
29392939
mptcp_release_sched(msk);
@@ -3053,7 +3053,7 @@ bool __mptcp_close(struct sock *sk, long timeout)
30533053
__mptcp_destroy_sock(sk);
30543054
do_cancel_work = true;
30553055
} else {
3056-
mptcp_reset_timeout(msk, 0);
3056+
mptcp_reset_tout_timer(msk, 0);
30573057
}
30583058

30593059
return do_cancel_work;
@@ -3116,7 +3116,7 @@ static int mptcp_disconnect(struct sock *sk, int flags)
31163116
mptcp_check_listen_stop(sk);
31173117
inet_sk_state_store(sk, TCP_CLOSE);
31183118

3119-
mptcp_stop_timer(sk);
3119+
mptcp_stop_rtx_timer(sk);
31203120
sk_stop_timer(sk, &sk->sk_timer);
31213121

31223122
if (msk->token)

net/mptcp/protocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ void mptcp_get_options(const struct sk_buff *skb,
718718

719719
void mptcp_finish_connect(struct sock *sk);
720720
void __mptcp_set_connected(struct sock *sk);
721-
void mptcp_reset_timeout(struct mptcp_sock *msk, unsigned long fail_tout);
721+
void mptcp_reset_tout_timer(struct mptcp_sock *msk, unsigned long fail_tout);
722722
static inline bool mptcp_is_fully_established(struct sock *sk)
723723
{
724724
return inet_sk_state_load(sk) == TCP_ESTABLISHED &&

net/mptcp/subflow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ static void mptcp_subflow_fail(struct mptcp_sock *msk, struct sock *ssk)
12261226
WRITE_ONCE(subflow->fail_tout, fail_tout);
12271227
tcp_send_ack(ssk);
12281228

1229-
mptcp_reset_timeout(msk, subflow->fail_tout);
1229+
mptcp_reset_tout_timer(msk, subflow->fail_tout);
12301230
}
12311231

12321232
static bool subflow_check_data_avail(struct sock *ssk)

0 commit comments

Comments
 (0)