From nobody Mon Feb 9 07:23:49 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a05:6638:38c:0:0:0:0 with SMTP id y12csp584251jap; Wed, 5 Jan 2022 07:57:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQnVWDvv5lWk/6ug12u8m9+yyyYq2GoJhehip6Rcubkfj3clSHe6IVaXa88M/xgfmUSNqf X-Received: by 2002:a25:d844:: with SMTP id p65mr28691991ybg.714.1641398256456; Wed, 05 Jan 2022 07:57:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641398256; cv=none; d=google.com; s=arc-20160816; b=VG9ycBMMQyOSOdkyP3xIbdaWdHtl70rDqgQ6ZPOxgCKhC/q7kITIiCS8o/cA7CBPBN 17vhFGRRkomALQGv0Xs7jb6q3f5hcOZkC0h/AyWnLpCGqz/IQ5JhTYJesa/uKGl0I0dW l3Bt+LmP7Q2vF/4Cfm7tSBurm+lOnDeJ1GM4sGQtBYhNeYJNVKlZ7a5WXs8/PrTs8Lfq 8XZxr/riVhNN8xwkoxPd8CaH/MKuJZ/FH/380m55WnSEY+TB28U2I6NQNv8VHnOdBkY/ ThnX0ujfmHXHTIoTj94ZExZ89e2w6+x1QqE+k37WimkiicTGwmKn9uPm6+vDqkezvh/G O4Jg== ARC-Message-Signature: i=1; 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:message-id :date:subject:cc:to:from:dkim-signature; bh=1DYnJ6GiDDCb36cp6Mrm9pK+SQp1df2TyTcvRE0MlOc=; b=xHxPb5rimuiTzMosQsMbSArVlgXpgzNvYtv+MtfoD9hxCDT9M1T0jjBGZMzSzLvFtJ degkQu3ng9h6qerCE13aAWv6B3UuppxU7MpukmwMlNlJPYNKVOpPJPwds4Z/xLBKUrZH kZXyUci5jL8b/2C0K5KInjDmv0qIjHpmvgoPj5SVFiH/6LWdDt/MEbKhitRlbR3vQbLN tsLPWzl+/LVFmkzJ3SXlhDCOuCx4k2TsqjVB4HZfxVLffxDZxY3316UD6vK3TKfo//wr aW31mt+6NjoFkasqwk2yCpZNUzt+6yx7gWwcdrwooz4eb+vzJ21syygGs2nPhAtDqFY8 nzlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=2bZQQbMg; spf=pass (google.com: domain of mptcp+bounces-2910-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2910-wpasupplicant.patchew=gmail.com@lists.linux.dev" Return-Path: Received: from ewr.edge.kernel.org (ewr.edge.kernel.org. [2604:1380:1:3600::1]) by mx.google.com with ESMTPS id x14si16693097ybt.543.2022.01.05.07.57.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jan 2022 07:57:36 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2910-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) client-ip=2604:1380:1:3600::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=2bZQQbMg; spf=pass (google.com: domain of mptcp+bounces-2910-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2910-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 ewr.edge.kernel.org (Postfix) with ESMTPS id E22EF1C09E3 for ; Wed, 5 Jan 2022 15:57:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87C362C9D; Wed, 5 Jan 2022 15:57:33 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 890672CA0 for ; Wed, 5 Jan 2022 15:57:31 +0000 (UTC) Received: by mail-ed1-f42.google.com with SMTP id q14so156035748edi.3 for ; Wed, 05 Jan 2022 07:57:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares-net.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1DYnJ6GiDDCb36cp6Mrm9pK+SQp1df2TyTcvRE0MlOc=; b=2bZQQbMgOu1vwuqwCyg4Rlyv75t9YUQgUoWSa+m4S/fbA7VPOwOSDIF2rlvoFhEPqQ eA6qhLrXWlmcYvJlcDYtK9qF7qcYs50xnMnJ7lgxMqPPoUkm9n3ABGl++7Z3Pf0jC208 H7RWDshjO6qgPZi5vI5Dpsajr8DbMlOS8x28uCJlduSV9JDy0RQX+yj0fh+hgeG1oKSU 2FHyGHGnHmOibFRLauRdtAvOXabpf2Y6WZo+qzl5UTHRAXGFyWSSOUkmdBQMyjz5KvDk H2Io/BaCMxEBN4JHdng6U1lD+AYUMy1kFPd51/qAgFPvcy+Jc5r1UUkiiCvjaTKzdvWo HdUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1DYnJ6GiDDCb36cp6Mrm9pK+SQp1df2TyTcvRE0MlOc=; b=J+a0bnlUKechLe1SEAZZCuMMSDrhnh/ybbk0Mc70R5tPRXNqoE75EeV9+/ayb0veRv 3/VISgNlB9qBpAqPNoUpKiZHDD50QBA4SRHt5Wykwbbb6fb1/jOBhvzYiuHZEsu5Os9k d5Vgn/7WlJ43OoxizCczhNcQAzQUQZnNvr9EPg4ubcvEHrk+/fbSmOT4K/NSg/95AuzY l5sHiBlZfcmXGZ8ndVGiPMfAdvrmKi+pF9SmxsMwMotqsGWcQSHjOCfzXL3H1LvsRAfE nAUZDo1ukeDQO5h+SgXIcaPpShJ/OTgbpIJp0tvEHIpqbmmO2pDe81+GtM1zWtT4K+K1 /xJw== X-Gm-Message-State: AOAM533n9QZDTJf2b9CT27YSHgDb3JKgSrEa1fiqvHM/QvslB5KFV1vK CN/DOW39bEZyUwoGUM3HQ6JyPeLLNDLBOZEyWMg= X-Received: by 2002:aa7:c481:: with SMTP id m1mr52683100edq.204.1641398249649; Wed, 05 Jan 2022 07:57:29 -0800 (PST) Received: from tsr-vdi-mbaerts.nix.tessares.net (static.23.216.130.94.clients.your-server.de. [94.130.216.23]) by smtp.gmail.com with ESMTPSA id c30sm12399684ejj.190.2022.01.05.07.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 07:57:29 -0800 (PST) From: Matthieu Baerts To: mptcp@lists.linux.dev Cc: Geliang Tang , Paolo Abeni , Matthieu Baerts Subject: [PATCH mptcp-next v8 1/8] Squash to "mptcp: implement fastclose xmit path" Date: Wed, 5 Jan 2022 16:56:55 +0100 Message-Id: <20220105155702.165123-2-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220105155702.165123-1-matthieu.baerts@tessares.net> References: <20220105155702.165123-1-matthieu.baerts@tessares.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 Content-Type: text/plain; charset="utf-8" From: Geliang Tang MP_FAIL can be sent with RST or DSS, and FASTCLOSE can be sent with RST too. So we should use a similar xmit logic for FASTCLOSE and MP_FAIL in both mptcp_write_options() and mptcp_established_options*(). Cc: Paolo Abeni Co-developed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Geliang Tang --- Notes: v8: - 'ptr +=3D 2;' was missing for FastClose (Geliang) - moving the MP_FAIL option is now in a dedicated patch ("mptcp: reduce branching when writing MP_FAIL option") net/mptcp/options.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index c6726e8389ec..aa3ed37bc59a 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -829,8 +829,12 @@ bool mptcp_established_options(struct sock *sk, struct= sk_buff *skb, =20 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 +=3D opt_size; + remaining -=3D 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 +=3D opt_size; remaining -=3D opt_size; } @@ -1460,19 +1464,23 @@ void mptcp_write_options(__be32 *ptr, const struct = tcp_sock *tp, ptr +=3D 1; } } - } else if (unlikely(OPTION_MPTCP_RST & opts->suboptions)) { - /* RST is mutually exclusive with everything else */ - *ptr++ =3D 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++ =3D mptcp_option(MPTCPOPT_MP_FASTCLOSE, TCPOLEN_MPTCP_FASTCLOSE, 0, 0); put_unaligned_be64(opts->rcvr_key, ptr); + ptr +=3D 2; + + if (OPTION_MPTCP_RST & opts->suboptions) + goto mp_rst; + return; + } else if (unlikely(OPTION_MPTCP_RST & opts->suboptions)) { +mp_rst: + *ptr++ =3D mptcp_option(MPTCPOPT_RST, + TCPOLEN_MPTCP_RST, + opts->reset_transient, + opts->reset_reason); return; } =20 --=20 2.33.1