From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Geliang Tang <geliang.tang@suse.com>, Paolo Abeni <pabeni@redhat.com>
Cc: mptcp@lists.linux.dev, Matthieu Baerts <matthieu.baerts@tessares.net>
Subject: Re: [PATCH mptcp-next v6 1/2] Squash to "mptcp: implement fastclose xmit path"
Date: Tue, 7 Dec 2021 19:00:12 -0800 (PST) [thread overview]
Message-ID: <c487e4-2a79-6049-5dad-18cfceae3b0@linux.intel.com> (raw)
In-Reply-To: <9b7f1f42a7f25006e09e2484bee5643bbb13568b.1638762825.git.geliang.tang@suse.com>
On Mon, 6 Dec 2021, Geliang Tang wrote:
> MP_FAIL could be sent with RST or DSS, and FASTCLOSE could be sent with
> RST or DSS too. So we should use the same xmit logic for FASTCLOSE as
> MP_FAIL.
>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: Matthieu Baerts <matthieu.baerts@tessares.net>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> net/mptcp/options.c | 28 ++++++++++++++++------------
> 1 file changed, 16 insertions(+), 12 deletions(-)
>
> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index 8a1020e4285c..c5c0dd983ad6 100644
> --- a/net/mptcp/options.c
> +++ b/net/mptcp/options.c
> @@ -828,9 +828,12 @@ bool mptcp_established_options(struct sock *sk, struct sk_buff *skb,
> return false;
>
> 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)) {
> + if (mptcp_established_options_mp_fail(sk, &opt_size, remaining, opts) ||
> + mptcp_established_options_fastclose(sk, &opt_size, remaining, opts)) {
> + *size += opt_size;
> + remaining -= opt_size;
> + }
> + if (mptcp_established_options_rst(sk, skb, &opt_size, remaining, opts)) {
> *size += opt_size;
> remaining -= opt_size;
> }
> @@ -842,7 +845,8 @@ bool mptcp_established_options(struct sock *sk, struct sk_buff *skb,
> ret = true;
> else if (mptcp_established_options_dss(sk, skb, snd_data_fin, &opt_size, remaining, opts)) {
> ret = true;
> - if (mptcp_established_options_mp_fail(sk, &opt_size, remaining, opts)) {
> + if (mptcp_established_options_mp_fail(sk, &opt_size, remaining, opts) ||
> + mptcp_established_options_fastclose(sk, &opt_size, remaining, opts)) {
Geliang -
Did you see a case where the stack attempted to send both DSS and
FASTCLOSE? If so, was it just a DSS_ACK or was there a mapping and data
payload?
From the RFC, it seems like FASTCLOSE is only expected on a TCP ACK or TCP
RST. When the FASTCLOSE is sent on all subflows (like the only code path
that sets send_fastclose does), it is only expected on a TCP RST. If
FASTCLOSE is showing up on something other than a TCP RST packet I think
that's a different bug that this patch doesn't address.
The patch has changed a lot since Paolo said "LGTM" so hopefully he can
comment again!
-Mat
> *size += opt_size;
> remaining -= opt_size;
> return true;
> @@ -1269,9 +1273,16 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
> 0, 0);
> put_unaligned_be64(opts->fail_seq, ptr);
> ptr += 2;
> + } else if (unlikely(OPTION_MPTCP_FASTCLOSE & opts->suboptions)) {
> + /* FASTCLOSE is mutually exclusive with others except DSS and RST */
> + *ptr++ = mptcp_option(MPTCPOPT_MP_FASTCLOSE,
> + TCPOLEN_MPTCP_FASTCLOSE,
> + 0, 0);
> + put_unaligned_be64(opts->rcvr_key, ptr);
> + ptr += 2;
> }
>
> - /* DSS, MPC, MPJ, ADD_ADDR, FASTCLOSE and RST are mutually exclusive,
> + /* DSS, MPC, MPJ, ADD_ADDR and RST are mutually exclusive,
> * see mptcp_established_options*()
> */
> if (likely(OPTION_MPTCP_DSS & opts->suboptions)) {
> @@ -1465,13 +1476,6 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
> opts->reset_transient,
> opts->reset_reason);
> return;
> - } else if (unlikely(OPTION_MPTCP_FASTCLOSE & opts->suboptions)) {
> - /* FASTCLOSE is mutually exclusive with everything else */
> - *ptr++ = mptcp_option(MPTCPOPT_MP_FASTCLOSE,
> - TCPOLEN_MPTCP_FASTCLOSE,
> - 0, 0);
> - put_unaligned_be64(opts->rcvr_key, ptr);
> - return;
> }
>
> if (OPTION_MPTCP_PRIO & opts->suboptions) {
> --
> 2.31.1
>
>
>
--
Mat Martineau
Intel
next prev parent reply other threads:[~2021-12-08 3:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-06 3:59 [PATCH mptcp-next v6 0/2] send MP_FAIL with MP_RST and others Geliang Tang
2021-12-06 3:59 ` [PATCH mptcp-next v6 1/2] Squash to "mptcp: implement fastclose xmit path" Geliang Tang
2021-12-08 3:00 ` Mat Martineau [this message]
2021-12-06 3:59 ` [PATCH mptcp-next v6 2/2] mptcp: print out reset infos of MP_RST Geliang Tang
2021-12-06 3:59 ` [PATCH mptcp-next v4] selftests: mptcp: add mp_fail testcases Geliang Tang
2021-12-08 1:54 ` Mat Martineau
2021-12-08 13:27 ` Matthieu Baerts
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=c487e4-2a79-6049-5dad-18cfceae3b0@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.