From nobody Tue Feb 10 01:31:17 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:ab0:32da:0:0:0:0:0 with SMTP id f26csp607157uao; Sat, 17 Sep 2022 15:29:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5D17nVxiqdJv8lY4dAyxJbXxH6G5jx6f5J26Ga2+BCN3z6kXaWAOjQCR3jaHPlTie39mGz X-Received: by 2002:a05:6214:1cc9:b0:496:aa2c:c927 with SMTP id g9-20020a0562141cc900b00496aa2cc927mr8874960qvd.15.1663453780598; Sat, 17 Sep 2022 15:29:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663453780; cv=pass; d=google.com; s=arc-20160816; b=GFSN/GMvpFOvGTb7wjG9hm/W117EMsXVKsPXvypKmj7nDewGGkUxsvr3ktciH7K8st TUs0Vm4OtslHLnyDIyNycq8l641+6hlYqr06Pqn/f2no5DulPOz3+i1RE1Gkpdo+ZyUs OtXrgSnuF6T9+N8jSrB5tELvbJxeWEP3Dj3iT4mSBlF4+hw3fGgkpDsQ9z9RF79ki8Ff HyxqfU3yFB4fv5w1ZSzko8GgFxfUgc39RFn1GUqB3vafRmdy4FUTnVb8WWnxsWi5VrBp CxdN6xJJcRap3tNiSciqa3AkrN59hmjcr7AzC+BJXqdaISsxGYxeP1jjgMn/jKz6V9Wy AuXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:date :subject:message-id:cc:to:from:dkim-signature; bh=bRLvB8X3nZZqZQeW0nlDsooMgFLChvaIezA0PVqeJdg=; b=Jdt1/6bltoos/zfaYQ8xF4SkQgH61RzH6ynmJ4m8FrsNN72iHR/u1EuPtdErKV3Q+l Ns0XW5s+Lknq3JA5Aq+urnL7pa0Ui7p7CpiGJxTATfVxvVVBdHESV7suP+Rl8nm48oqk iVLYu5X5kWUGqTCn4QPoa0ceaNnfqriXJMBVAf+4Ik/cYqgIS+BX/zr1Kc0nDvqxlfZt ZNVGTL3N3IGN664XkTt5UX4HWsiKpTGOQVvnkfnly2/6ArBd1yiyaaJFMPLFmDKXdztc UGFdlPsJXmykAANpoY3KIhO3f3QsAWj0jL7xxxr3ozwcHDtYNNS1VrV8WZQhuimXq/xu lXfg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@shytyi.net header.s=hs header.b=Pcv1rqGJ; arc=pass (i=1 spf=pass spfdomain=shytyi.net dkim=pass dkdomain=shytyi.net dmarc=pass fromdomain=shytyi.net>); spf=pass (google.com: domain of mptcp+bounces-6300-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="mptcp+bounces-6300-wpasupplicant.patchew=gmail.com@lists.linux.dev" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c24-20020a05620a269800b006c095f4f235si8011084qkp.705.2022.09.17.15.29.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Sep 2022 15:29:40 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-6300-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@shytyi.net header.s=hs header.b=Pcv1rqGJ; arc=pass (i=1 spf=pass spfdomain=shytyi.net dkim=pass dkdomain=shytyi.net dmarc=pass fromdomain=shytyi.net>); spf=pass (google.com: domain of mptcp+bounces-6300-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="mptcp+bounces-6300-wpasupplicant.patchew=gmail.com@lists.linux.dev" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 442001C209B3 for ; Sat, 17 Sep 2022 22:29:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B0EC5CB2; Sat, 17 Sep 2022 22:29:33 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from sender11-of-o51.zoho.eu (sender11-of-o51.zoho.eu [31.186.226.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86E165CA8 for ; Sat, 17 Sep 2022 22:29:30 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1663453761; cv=none; d=zohomail.eu; s=zohoarc; b=XjCR8AGSmRjgsmyBHuSU5bf9nMVVhIAbKIbI7iEq7qKTcU8cXKal0JNER5r0K2gi6uS4t7KbbBawhMF7fYX37aeJlF4A27tUOqk2iC/UIIjtNhEinokXj6zUt/6a+Cm+uQHtdPXuv+Hjp8fE++8wfoBoiDdENjLwbwGONj9KLN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1663453761; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=bRLvB8X3nZZqZQeW0nlDsooMgFLChvaIezA0PVqeJdg=; b=ZKxMetxICSIW9tdCuWTboiMJDajulcwyKJKNyCtL4KzYgyXgjd0bwFd1mvRvo4XsnEw9eTpyYJAZoOatDTJgIV4KUGcihofuClAOTjeP6fLoxM2MHc7cCRz5QPBdGlpK1MTwOBaHof85UFhjyz1NoQ8AF8y1apKUkudKod+mqlo= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=shytyi.net; spf=pass smtp.mailfrom=dmytro@shytyi.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1663453761; s=hs; d=shytyi.net; i=dmytro@shytyi.net; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=bRLvB8X3nZZqZQeW0nlDsooMgFLChvaIezA0PVqeJdg=; b=Pcv1rqGJOKzGa0Rl9JriXuGQL9RElqjJjKBGnv92JNfIez5gB9r8068iIZuufn5B 1ioYBw++p1MhupmqHebDOqDhp7r1bA16BY3VHWtgAa6km334sMtq1+4/grHcHJu5Ybj DOrGyaJ7kzpUfY64vbH5Atn3eEyXbMYQ0Ei05QF0= Received: from doris.localdomain (243.34.22.93.rev.sfr.net [93.22.34.243]) by mx.zoho.eu with SMTPS id 1663453758974307.86487598948486; Sun, 18 Sep 2022 00:29:18 +0200 (CEST) From: Dmytro Shytyi To: mptcp@lists.linux.dev Cc: Dmytro Shytyi Message-ID: <20220917222853.2406-8-dmytro@shytyi.net> Subject: [RFC PATCH mptcp-next v7 07/11] mptfo variables for msk, options. Fix loop retrans Date: Sun, 18 Sep 2022 00:28:49 +0200 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220917222853.2406-1-dmytro@shytyi.net> References: <20220917222853.2406-1-dmytro@shytyi.net> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" Introduce mptfo variables for msk and options. Also fixe the infinite retransmissions in the end of second session. Suggestion @palbeni (SEP 1) during the meting to 'look at ack' Signed-off-by: Dmytro Shytyi --- net/mptcp/fastopen.c | 16 ++++++++++++++++ net/mptcp/options.c | 3 +++ net/mptcp/protocol.h | 6 +++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/net/mptcp/fastopen.c b/net/mptcp/fastopen.c index 436e773d798a..149a4b1d3dac 100644 --- a/net/mptcp/fastopen.c +++ b/net/mptcp/fastopen.c @@ -91,3 +91,19 @@ int mptcp_setsockopt_sol_tcp_fastopen(struct mptcp_sock = *msk, sockptr_t optval, =20 return ret; } + +void mptcp_treat_hshake_ack_fastopen(struct mptcp_sock *msk, struct mptcp_= subflow_context *subflow, + struct mptcp_options_received mp_opt) +{ + u64 ack_seq; + + if (mp_opt.suboptions & OPTIONS_MPTCP_MPC && mp_opt.is_mptfo && msk->is_m= ptfo) { + msk->can_ack =3D true; + msk->remote_key =3D mp_opt.sndr_key; + mptcp_crypto_key_sha(msk->remote_key, NULL, &ack_seq); + ack_seq++; + WRITE_ONCE(msk->ack_seq, ack_seq); + pr_debug("ack_seq=3D%llu sndr_key=3D%llu", msk->ack_seq, mp_opt.sndr_key= ); + atomic64_set(&msk->rcv_wnd_sent, ack_seq); + } +} diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 30d289044e71..185b069e57f4 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -91,6 +91,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, ptr +=3D 8; } if (opsize >=3D TCPOLEN_MPTCP_MPC_ACK) { + mp_opt->is_mptfo =3D 1; mp_opt->rcvr_key =3D get_unaligned_be64(ptr); ptr +=3D 8; } @@ -1124,6 +1125,8 @@ bool mptcp_incoming_options(struct sock *sk, struct s= k_buff *skb) return sk->sk_state !=3D TCP_CLOSE; =20 if (unlikely(mp_opt.suboptions !=3D OPTION_MPTCP_DSS)) { + mptcp_treat_hshake_ack_fastopen(msk, subflow, mp_opt); + if ((mp_opt.suboptions & OPTION_MPTCP_FASTCLOSE) && msk->local_key =3D=3D mp_opt.rcvr_key) { WRITE_ONCE(msk->rcv_fastclose, true); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 8caaeeedb9da..b90279c734ae 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -155,7 +155,8 @@ struct mptcp_options_received { echo:1, backup:1, deny_join_id0:1, - __unused:2; + is_mptfo:1, + __unused:1; u8 join_id; u64 thmac; u8 hmac[MPTCPOPT_HMAC_LEN]; @@ -282,6 +283,7 @@ struct mptcp_sock { bool use_64bit_ack; /* Set when we received a 64-bit DSN */ bool csum_enabled; bool allow_infinite_fallback; + bool is_mptfo; u8 mpc_endpoint_id; u8 recvmsg_inq:1, cork:1, @@ -845,6 +847,8 @@ int mptcp_sendmsg_fastopen(struct sock *sk, struct msgh= dr *msg, size_t *copied); int mptcp_setsockopt_sol_tcp_fastopen(struct mptcp_sock *msk, sockptr_t op= tval, unsigned int optlen); +void mptcp_treat_hshake_ack_fastopen(struct mptcp_sock *msk, struct mptcp_= subflow_context *subflow, + struct mptcp_options_received mp_opt); // Fast Open Mechanism functions end =20 static inline bool mptcp_pm_should_add_signal(struct mptcp_sock *msk) --=20 2.25.1