From: Florian Westphal <fw at strlen.de>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [PATCH mptcp 1/3] mptcp: schedule worker when subflow is closed
Date: Tue, 09 Feb 2021 00:47:51 +0100 [thread overview]
Message-ID: <20210208234751.GI16570@breakpoint.cc> (raw)
In-Reply-To: c0d75ae27fc7f93e57d470458df9e5c043e75a9a.camel@redhat.com
[-- Attachment #1: Type: text/plain, Size: 2245 bytes --]
Paolo Abeni <pabeni(a)redhat.com> wrote:
> > diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
> > index b8b670cb6116..57f6361eb07c 100644
> > --- a/net/mptcp/subflow.c
> > +++ b/net/mptcp/subflow.c
> > @@ -1413,6 +1413,13 @@ static void subflow_state_change(struct sock *sk)
> > if (mptcp_subflow_data_available(sk))
> > mptcp_data_ready(parent, sk);
> >
> > + if (sk->sk_state == TCP_CLOSE &&
> > + !test_and_set_bit(MPTCP_WORK_CLOSE_SUBFLOW, &mptcp_sk(parent)->flags)) {
> > + sock_hold(parent);
> > + if (!schedule_work(&mptcp_sk(parent)->work))
> > + sock_put(parent);
> > + }
> > +
>
> Looks like this is causing issue/154. Reverting this patch the issues
> goes away here. @Matttbe: could you please double check that?
No need, I am sure you are correct.
> In case of fallback, the subflow can be closed by the peer while there
> are data pending in the subflow receive queue. Calling
> mptcp_close_subflow() will discard such data and will corrupt the
> stream.
This.
> I think that scenario is possible even with full msk, if the peer
> closes a single subflow while the msk is still alive (before DATA_FIN).
You mean because there might be unprocessed data in subflow rx
queue?
> A possible fix could be additionally checking for empty ssk-
> >sk_recevive_queue, plush adding a similar chunk
> in __mptcp_move_skbs_from_subflow().
Yes, not nice, I don't see another solution atm though.
Will look into this tomorrow.
> That means that subflow_close even could be delayed by user-space, if
> the latter does not spool the pending ingress data.
We can decouple the event from actual close.
> Or the NL event generation cold be de-coupled from the actual subflow
> close() but I fear some side effect even there.
Hmm, why?
> Note that calling __mptcp_move_skbs_from_subflow()
> from mptcp_close_subflow() will not solve the issue, as the msk receive
> queue could be full - I think;)
Yes, it could be full.
thats possible.
> Side note: it would be nice using the deferred actions to do the
> netlink call, to avoid the workqueue usage.
Why? How many events/s do you expect?
Events try to prefer GFP_KERNEL allocations where possible.
next reply other threads:[~2021-02-08 23:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 23:47 Florian Westphal [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-02-09 12:01 [MPTCP] Re: [PATCH mptcp 1/3] mptcp: schedule worker when subflow is closed Paolo Abeni
2021-02-09 10:16 Florian Westphal
2021-02-09 9:49 Paolo Abeni
2021-02-08 23:33 Paolo Abeni
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=20210208234751.GI16570@breakpoint.cc \
--to=mptcp@lists.linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox