From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Matthieu Baerts <matthieu.baerts@tessares.net>
Cc: Paolo Abeni <pabeni@redhat.com>,
Geliang Tang <geliang.tang@suse.com>,
mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next] Squash to "mptcp: implement fastclose xmit path"
Date: Wed, 1 Dec 2021 10:34:42 -0800 (PST) [thread overview]
Message-ID: <6cdf99-1cbd-baca-4dc1-2d7149f9a9d9@linux.intel.com> (raw)
In-Reply-To: <bc4304c9-12f3-3961-de6a-7549034eb932@tessares.net>
On Wed, 1 Dec 2021, Matthieu Baerts wrote:
> Hi Paolo, Geliang,
>
> On 01/12/2021 11:40, Paolo Abeni wrote:
>> On Tue, 2021-11-30 at 17:55 +0100, Matthieu Baerts wrote:
>>> This is linked to Geliang's patch with the same title.
>>>
>>> If I understand the RFC properly, we can use MP_RST with an MP_FASTCLOSE
>>> and an MP_FAIL (or none of them) but we cannot use MP_FASTCLOSE and
>>> MP_FAIL together.
>>>
>>> This patch implements this logic in both mptcp_established_options() and
>>> mptcp_write_options(). Before this patch, the first function was not
>>> allowing any of these 3 options to be used at the same time while the
>>> second one was allowing MP_FAIL to be used with either MP_FASTCLOSE or
>>> MP_RST.
>>>
>>> Small note: I tried to keep Paolo's idea of reducing conditions for
>>> "normal" options by moving MP_RST at the end and allow to jump there
>>> from MP_FAIL and MP_FASTCLOSE but I'm not sure it makes it easy to read
>>> and really improves perfs. We can also move MP_RST check at the
>>> beginning.
>>>
>>> @Geliang: feel free to re-use this patch if it looks OK to you.
>>>
>>> PS: I didn't try this patch, just quickly wrote it to better explain
>>> what I had in mind.
>>>
>>> Cc: Paolo Abeni <pabeni@redhat.com>
>>> Cc: Geliang Tang <geliang.tang@suse.com>
>>> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
>>> ---
>>>
>>> Notes:
>>> to be squashed in "mptcp: implement fastclose xmit path"
>>>
>>> net/mptcp/options.c | 62 +++++++++++++++++++++++++++------------------
>>> 1 file changed, 37 insertions(+), 25 deletions(-)
>>>
>>> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
>>> index 8a1020e4285c..07091971a51a 100644
>>> --- a/net/mptcp/options.c
>>> +++ b/net/mptcp/options.c
>>> @@ -829,11 +829,17 @@ bool mptcp_established_options(struct sock *sk, struct sk_buff *skb,
>>>
>>> if (unlikely(skb && TCP_SKB_CB(skb)->tcp_flags & TCPHDR_RST)) {
>>> if (mptcp_established_options_fastclose(sk, &opt_size, remaining, opts) ||
>>> - mptcp_established_options_mp_fail(sk, &opt_size, remaining, opts) ||
>>> - mptcp_established_options_rst(sk, skb, &opt_size, remaining, opts)) {
>>> + mptcp_established_options_mp_fail(sk, &opt_size, remaining, opts)) {
>>> *size += opt_size;
>>> remaining -= opt_size;
>>> }
>>> +
>>> + /* MP_RST can be used with MP_FASTCLOSE and MP_FAIL if there is room */
>>> + if (mptcp_established_options_rst(sk, skb, &opt_size, remaining, opts)) {
>>> + *size += opt_size;
>>> + remaining -= opt_size;
>>> + }
>>> +
>>> return true;
>>> }
>>>
>>> @@ -1257,21 +1263,7 @@ static u16 mptcp_make_csum(const struct mptcp_ext *mpext)
>>> void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
>>> struct mptcp_out_options *opts)
>>> {
>>> - if (unlikely(OPTION_MPTCP_FAIL & opts->suboptions)) {
>>> - const struct sock *ssk = (const struct sock *)tp;
>>> - struct mptcp_subflow_context *subflow;
>>> -
>>> - subflow = mptcp_subflow_ctx(ssk);
>>> - subflow->send_mp_fail = 0;
>>> -
>>> - *ptr++ = mptcp_option(MPTCPOPT_MP_FAIL,
>>> - TCPOLEN_MPTCP_FAIL,
>>> - 0, 0);
>>> - put_unaligned_be64(opts->fail_seq, ptr);
>>> - ptr += 2;
>>> - }
>>> -
>>> - /* DSS, MPC, MPJ, ADD_ADDR, FASTCLOSE and RST are mutually exclusive,
>>> + /* DSS, MPC, MPJ, ADD_ADDR, FASTCLOSE and FAIL are mutually exclusive,
>>> * see mptcp_established_options*()
>>> */
>>> if (likely(OPTION_MPTCP_DSS & opts->suboptions)) {
>>> @@ -1458,19 +1450,39 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
>>> ptr += 1;
>>> }
>>> }
>>> - } else if (unlikely(OPTION_MPTCP_RST & opts->suboptions)) {
>>> - /* RST is mutually exclusive with everything else */
>>> - *ptr++ = mptcp_option(MPTCPOPT_RST,
>>> - TCPOLEN_MPTCP_RST,
>>> - opts->reset_transient,
>>> - opts->reset_reason);
>>> - return;
>>> } else if (unlikely(OPTION_MPTCP_FASTCLOSE & opts->suboptions)) {
>>> - /* FASTCLOSE is mutually exclusive with everything else */
>>> + /* FASTCLOSE is mutually exclusive with others except RST */
>>> *ptr++ = mptcp_option(MPTCPOPT_MP_FASTCLOSE,
>>> TCPOLEN_MPTCP_FASTCLOSE,
>>> 0, 0);
>>> put_unaligned_be64(opts->rcvr_key, ptr);
>>> +
>>> + if (OPTION_MPTCP_RST & opts->suboptions)
>>> + goto mp_rst;
>>> + return;
>>> + } else if (unlikely(OPTION_MPTCP_FAIL & opts->suboptions)) {
>>> + /* MP_FAIL is mutually exclusive with others except RST */
>>> + const struct sock *ssk = (const struct sock *)tp;
>>> + struct mptcp_subflow_context *subflow;
>>> +
>>> + subflow = mptcp_subflow_ctx(ssk);
>>> + subflow->send_mp_fail = 0;
>>> +
>>> + *ptr++ = mptcp_option(MPTCPOPT_MP_FAIL,
>>> + TCPOLEN_MPTCP_FAIL,
>>> + 0, 0);
>>> + put_unaligned_be64(opts->fail_seq, ptr);
>>> + ptr += 2;
>>> +
>>> + if (OPTION_MPTCP_RST & opts->suboptions)
>>> + goto mp_rst;
>>> + return
>>
>> As the CI spotted, missing ';' here.
>
> Yes sorry, I quickly did it before having to go.
>
>> Otherwise LGTM!
>
> Thank you for the review!
>
> @Geliang: do you prefer to use this diff -- without the missing ';' --
> in a new version or do you prefer if I apply it with the fix directly?
>
Matthieu -
Since you were handling Geliang's revisions of this series while I was
away, I assume you are not waiting to hear from me, but anyway: these
changes (plus ';') combined with Geliang's v3 all look good to me too.
--
Mat Martineau
Intel
next prev parent reply other threads:[~2021-12-01 18:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 3:21 [PATCH mptcp-next v3 0/2] send MP_FAIL with MP_RST and others Geliang Tang
2021-11-30 3:21 ` [PATCH mptcp-next v3 1/2] Squash to "mptcp: implement fastclose xmit path" Geliang Tang
2021-11-30 16:52 ` Matthieu Baerts
2021-11-30 16:55 ` [PATCH mptcp-next] " Matthieu Baerts
2021-11-30 17:02 ` Squash to "mptcp: implement fastclose xmit path": Build Failure MPTCP CI
2021-12-01 10:40 ` [PATCH mptcp-next] Squash to "mptcp: implement fastclose xmit path" Paolo Abeni
2021-12-01 11:23 ` Matthieu Baerts
2021-12-01 18:34 ` Mat Martineau [this message]
2021-11-30 3:21 ` [PATCH mptcp-next v3 2/2] mptcp: print out reset infos of MP_RST Geliang Tang
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=6cdf99-1cbd-baca-4dc1-2d7149f9a9d9@linux.intel.com \
--to=mathew.j.martineau@linux.intel.com \
--cc=geliang.tang@suse.com \
--cc=matthieu.baerts@tessares.net \
--cc=mptcp@lists.linux.dev \
--cc=pabeni@redhat.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.