All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw at strlen.de>
To: mptcp at lists.01.org
Subject: [MPTCP] [PATCH net-next 3/7] mptcp: make sure timer is inited once data is pending for transmission
Date: Mon, 11 May 2020 13:55:34 +0200	[thread overview]
Message-ID: <20200511115538.6015-4-fw@strlen.de> (raw)
In-Reply-To: 20200511115538.6015-1-fw@strlen.de

[-- 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

                 reply	other threads:[~2020-05-11 11:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200511115538.6015-4-fw@strlen.de \
    --to=unknown@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.