From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Geliang Tang <geliang.tang@suse.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [RFC mptcp-next v2 5/6] mptcp: add MP_FAIL retrans support
Date: Wed, 23 Feb 2022 17:54:09 -0800 (PST) [thread overview]
Message-ID: <9d21497c-204-32f-3b57-e68d998f85d4@linux.intel.com> (raw)
In-Reply-To: <b0f55c56cf296b360582fc54997cbb3f905c106b.1645096378.git.geliang.tang@suse.com>
On Thu, 17 Feb 2022, Geliang Tang wrote:
> Add MP_FAIL retrans support.
>
I'm still trying to figure out if retransmitting MP_FAIL is the action to
take if the MP_FAIL echo is not received. Could also just send RST, as in
the other checksum error cases. As Christoph said, this is a "best effort"
thing and I'm not sure the rare case justifies very much complexity. There
are other scenarios that arise: for example, the MP_FAIL echo from the
peer is lost, but the infinite mapping from the peer is delivered. That
implies that the peer did get the MP_FAIL, but the RFC doesn't have the
details on what to do.
What do you think about resetting the subflow if the fallback process
doesn't follow the expected steps?
- Mat
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> net/mptcp/pm.c | 1 +
> net/mptcp/protocol.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
> net/mptcp/protocol.h | 2 ++
> net/mptcp/subflow.c | 1 +
> 4 files changed, 47 insertions(+), 1 deletion(-)
>
> diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
> index 314e110588d7..ccb29b2d2075 100644
> --- a/net/mptcp/pm.c
> +++ b/net/mptcp/pm.c
> @@ -285,6 +285,7 @@ void mptcp_pm_mp_fail_received(struct sock *sk, u64 fail_seq)
> subflow->send_infinite_map = 1;
> MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPFAILECHOTX);
> } else {
> + sk_stop_timer((struct sock *)msk, &msk->sk.icsk_retransmit_timer);
> subflow->mp_fail_response_expect = 0;
> MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPFAILECHORX);
> }
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 4599bde215b2..461fd30c6b9d 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -50,6 +50,8 @@ enum {
> MPTCP_CMSG_INQ = BIT(1),
> };
>
> +#define MP_FAIL_RETRANS_MAX 3
> +
> static struct percpu_counter mptcp_sockets_allocated ____cacheline_aligned_in_smp;
>
> static void __mptcp_destroy_sock(struct sock *sk);
> @@ -860,6 +862,46 @@ static void mptcp_reset_timer(struct sock *sk)
> sk_reset_timer(sk, &icsk->icsk_retransmit_timer, jiffies + tout);
> }
>
> +static void mptcp_mp_fail_timer(struct timer_list *t)
> +{
> + struct inet_connection_sock *icsk = from_timer(icsk, t,
> + icsk_retransmit_timer);
> + struct sock *sk = &icsk->icsk_inet.sk;
> + struct mptcp_sock *msk = mptcp_sk(sk);
> + struct mptcp_subflow_context *subflow;
> +
> + if (!msk)
> + return;
> + if (inet_sk_state_load(sk) == TCP_CLOSE)
> + return;
> +
> + bh_lock_sock(sk);
> +
> + subflow = mptcp_subflow_ctx(msk->first);
> + subflow->send_mp_fail = 1;
> + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPFAILTX);
> + pr_debug("retransmit MP_FAIL %u", subflow->retrans_times++);
> +
> + if (subflow->retrans_times < MP_FAIL_RETRANS_MAX) {
> + __mptcp_set_timeout(sk, mptcp_get_mp_fail_timeout(sock_net(sk)));
> + mptcp_reset_timer(sk);
> + }
> +
> + bh_unlock_sock(sk);
> + sock_put(sk);
> +}
> +
> +void mptcp_setup_mp_fail_timer(struct mptcp_sock *msk)
> +{
> + struct sock *sk = (struct sock *)msk;
> +
> + /* re-use the csk retrans timer for MP_FAIL retrans */
> + sk_stop_timer(sk, &msk->sk.icsk_retransmit_timer);
> + timer_setup(&msk->sk.icsk_retransmit_timer, mptcp_mp_fail_timer, 0);
> + __mptcp_set_timeout(sk, mptcp_get_mp_fail_timeout(sock_net(sk)));
> + mptcp_reset_timer(sk);
> +}
> +
> bool mptcp_schedule_work(struct sock *sk)
> {
> if (inet_sk_state_load(sk) != TCP_CLOSE &&
> @@ -1598,7 +1640,7 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
>
> out:
> /* ensure the rtx timer is running */
> - if (!mptcp_timer_pending(sk))
> + if (!mptcp_timer_pending(sk) && !__mptcp_check_fallback(msk))
> mptcp_reset_timer(sk);
> if (copied)
> __mptcp_check_send_data_fin(sk);
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index c28842ab0dcc..40954f2389e8 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -467,6 +467,7 @@ struct mptcp_subflow_context {
> u8 reset_transient:1;
> u8 reset_reason:4;
> u8 stale_count;
> + u8 retrans_times;
>
> long delegated_status;
>
> @@ -669,6 +670,7 @@ void mptcp_rcv_space_init(struct mptcp_sock *msk, const struct sock *ssk);
> void mptcp_data_ready(struct sock *sk, struct sock *ssk);
> bool mptcp_finish_join(struct sock *sk);
> bool mptcp_schedule_work(struct sock *sk);
> +void mptcp_setup_mp_fail_timer(struct mptcp_sock *msk);
> int mptcp_setsockopt(struct sock *sk, int level, int optname,
> sockptr_t optval, unsigned int optlen);
> int mptcp_getsockopt(struct sock *sk, int level, int optname,
> diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
> index f06d93fce1bb..a30867f926fd 100644
> --- a/net/mptcp/subflow.c
> +++ b/net/mptcp/subflow.c
> @@ -1174,6 +1174,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
> sk_eat_skb(ssk, skb);
> } else {
> subflow->mp_fail_response_expect = 1;
> + mptcp_setup_mp_fail_timer(msk);
> }
> WRITE_ONCE(subflow->data_avail, MPTCP_SUBFLOW_NODATA);
> return true;
> --
> 2.34.1
>
>
>
--
Mat Martineau
Intel
next prev parent reply other threads:[~2022-02-24 1:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 11:23 [RFC mptcp-next v2 0/6] MP_FAIL echo and retrans Geliang Tang
2022-02-17 11:23 ` [RFC mptcp-next v2 1/6] mptcp: add MP_FAIL echo support Geliang Tang
2022-02-24 1:42 ` Mat Martineau
2022-02-17 11:23 ` [RFC mptcp-next v2 2/6] mptcp: add mibs for MP_FAIL echo Geliang Tang
2022-02-17 11:23 ` [RFC mptcp-next v2 3/6] selftests: mptcp: add MP_FAIL echo mibs check Geliang Tang
2022-02-17 11:23 ` [RFC mptcp-next v2 4/6] mptcp: add a new sysctl mp_fail_timeout Geliang Tang
2022-02-24 1:44 ` Mat Martineau
2022-02-17 11:23 ` [RFC mptcp-next v2 5/6] mptcp: add MP_FAIL retrans support Geliang Tang
2022-02-24 1:54 ` Mat Martineau [this message]
2022-02-17 11:23 ` [RFC mptcp-next v2 6/6] selftests: mptcp: MP_FAIL timeout testcases TODO 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=9d21497c-204-32f-3b57-e68d998f85d4@linux.intel.com \
--to=mathew.j.martineau@linux.intel.com \
--cc=geliang.tang@suse.com \
--cc=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 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.