All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH net-next 3/7] mptcp: make sure timer is inited once data is pending for transmission
@ 2020-05-11 11:55 Florian Westphal
  0 siblings, 0 replies; only message in thread
From: Florian Westphal @ 2020-05-11 11:55 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]

The mptcp_connect self-tests with additional '-m mmap' argument triggers a
(harmless) WARN_ON_ONCE splat in mptcp_reset_timer() as the msk sockets
timer_ival is still 0.

This is because the timer is only set up after the transmit loop, but
the splat can be triggered once the first mptcp-level ACK is processed.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/3
Signed-off-by: Florian Westphal <fw(a)strlen.de>
---
 net/mptcp/protocol.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 13fb04d45083..3e8117837b41 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -647,6 +647,9 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
 out:
 	if (!retransmission)
 		pfrag->offset += frag_truesize;
+
+	mptcp_set_timeout(sk, ssk);
+
 	*write_seq += ret;
 	mptcp_subflow_ctx(ssk)->rel_write_seq += ret;
 
@@ -829,7 +832,6 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 		}
 	}
 
-	mptcp_set_timeout(sk, ssk);
 	if (copied) {
 		ret = copied;
 		tcp_push(ssk, msg->msg_flags, mss_now, tcp_sk(ssk)->nonagle,
@@ -1195,7 +1197,6 @@ static void mptcp_worker(struct work_struct *work)
 	dfrag->offset = orig_offset;
 	dfrag->data_len = orig_len;
 
-	mptcp_set_timeout(sk, ssk);
 	release_sock(ssk);
 
 reset_unlock:
-- 
2.26.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-11 11:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 11:55 [MPTCP] [PATCH net-next 3/7] mptcp: make sure timer is inited once data is pending for transmission Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.