From nobody Mon Feb 9 15:11:15 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a05:6a06:1788:b0:4ac:5e5b:1ad1 with SMTP id y8csp619154piq; Mon, 28 Mar 2022 19:14:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDxcmO8Ro20t1nWUXFfFeF3hP+TGrkJihpQ4vOjpvgrhrtet0F+u134ItKpBPWymAuH2Wy X-Received: by 2002:a17:906:8a6d:b0:6e0:68ac:7197 with SMTP id hy13-20020a1709068a6d00b006e068ac7197mr32104221ejc.703.1648520058974; Mon, 28 Mar 2022 19:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648520058; cv=none; d=google.com; s=arc-20160816; b=JBMzvi93+tvh4HWf5xpzz6eJEnP+mWXe5EXo8kLYArorYYnJVZ6ycFpQ2T3zKTUp8J llxZ4Z5fvWdKoo+yl8hPwIP8OrBkS3GV+gxpITLyaoMCPv0BmCrqjxP4gqZ7l887Qbd7 Hbh9XnBzIkJb/FJ35yrx3t0ChC5OYYXV+XEhyh4GU9c42FtW+aecLPRCNP/pZ6TB7B3f z7GjweelCek+lw6pHsR2miM+AnyhqA5U3SLN4dnp9FjziSMme52HCmU+M0uDGP8W1xmo hcyRLWRU4pympJNFogd1NeSKSlCmu2P1xUwGnoxlKymkALeFMiIqDomShn7oVLrl++cX 2kbQ== 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:to:from:dkim-signature; bh=GHitLBVn8Xab6SNMfTBRPqq+E8tAYy2dlZdqCqRo7PU=; b=oXA0jE6M++NjLHwE756z3rGZ5I6VUC4YKLiBPV35dFyZFUToOTMYd6JZoBDJne7Ggj twd3/MaHj0MyLUq7cR7Ta3SUvlhz7KGH5L4JoeiqPlW2Gp9s1RlR6JlZAfSwe4Hp+6Qf ySrKR7AQlTHO9iuTB2H1yJkUMH406qq/0LwoSCR7p3WA2CZHT/KodQbDzROTAly8HvhY MSVsSSgHKqHTeepIlanGVXnPo+2RVMg2pg8zeyQAWnZOPR6UpppalGRzdSJWXar6zGZc 1zsADoggL2AC9vH5DpUwqhYncYzBpgwmrh+eRQu6qX2suT42epc0Y/FyLZqO21cxcYlo NtYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AQuU7PON; spf=pass (google.com: domain of mptcp+bounces-4492-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-4492-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ewr.edge.kernel.org (ewr.edge.kernel.org. [2604:1380:1:3600::1]) by mx.google.com with ESMTPS id cb15-20020a170906a44f00b006df76385bf2si15771220ejb.146.2022.03.28.19.14.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Mar 2022 19:14:18 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-4492-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=@intel.com header.s=Intel header.b=AQuU7PON; spf=pass (google.com: domain of mptcp+bounces-4492-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-4492-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 EF82B1C0A64 for ; Tue, 29 Mar 2022 02:14:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37A2E20E5; Tue, 29 Mar 2022 02:14:14 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 4B70720EA for ; Tue, 29 Mar 2022 02:14:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648520052; x=1680056052; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=d/xDT6btLh0ZvnslagoXCmEcD+Xgida3BERey+wbCB8=; b=AQuU7PONG3kSvKsXAF8MTTbEt6Uh+OTyao/sHgQ3B3/iHD7N8hPC7PRY PfsfQd54c3IBirZjRua/zuf1SfEu9yoaYB8uPmmJVzDCkVgnFeu7XZFli 08mBVeMi6rtT53/s7mVq8r+EyZ+zh801UW40R01EPhpigow9RV9filCUS 8c7ZDlRK8VkQX3wvFKC1maa2vtLB2nyxkQWA/mwzuR3mW4oVktYRHK9/c F78/A38gMpAIlrh+R21ELR3IDVpe7J/4F60wm2gQtzBL3lsWQ27YCWqdq 8BAxIkcDhYSZhp51iNPLbEbwB8UXM2SlU7wyhqktgkUF02E3lAGtBrMPf g==; X-IronPort-AV: E=McAfee;i="6200,9189,10300"; a="345578746" X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="345578746" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2022 19:14:08 -0700 X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="564202551" Received: from otc-tsn-4.jf.intel.com ([10.23.153.135]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2022 19:14:08 -0700 From: Kishen Maloor To: kishen.maloor@intel.com, mptcp@lists.linux.dev Subject: [PATCH mptcp-next v9 5/6] mptcp: establish subflows from either end of connection Date: Mon, 28 Mar 2022 22:14:00 -0400 Message-Id: <20220329021401.1196466-6-kishen.maloor@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220329021401.1196466-1-kishen.maloor@intel.com> References: <20220329021401.1196466-1-kishen.maloor@intel.com> 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" This change updates internal logic to permit subflows to be established from either the client or server ends of MPTCP connections. This symmetry and added flexibility may be harnessed by PM implementations running on either end in creating new subflows. The essence of this change lies in not relying on the "server_side" flag (which continues to be available if needed). Signed-off-by: Kishen Maloor --- net/mptcp/options.c | 2 +- net/mptcp/protocol.c | 5 +---- net/mptcp/protocol.h | 8 ++++++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index c9625fea3ef9..e05d9458a025 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -931,7 +931,7 @@ static bool check_fully_established(struct mptcp_sock *= msk, struct sock *ssk, if (TCP_SKB_CB(skb)->seq =3D=3D subflow->ssn_offset + 1 && TCP_SKB_CB(skb)->end_seq =3D=3D TCP_SKB_CB(skb)->seq && subflow->mp_join && (mp_opt->suboptions & OPTIONS_MPTCP_MPJ) && - READ_ONCE(msk->pm.server_side)) + !subflow->request_join) tcp_send_ack(ssk); goto fully_established; } diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index d3887f628b54..b2c654992de0 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -3327,15 +3327,12 @@ bool mptcp_finish_join(struct sock *ssk) return false; } =20 - if (!msk->pm.server_side) + if (!list_empty(&subflow->node)) goto out; =20 if (!mptcp_pm_allow_new_subflow(msk)) goto err_prohibited; =20 - if (WARN_ON_ONCE(!list_empty(&subflow->node))) - goto err_prohibited; - /* active connections are already on conn_list. * If we can't acquire msk socket lock here, let the release callback * handle it diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index a762b789f5ab..187c932deef0 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -911,13 +911,17 @@ static inline bool mptcp_check_infinite_map(struct sk= _buff *skb) return false; } =20 +static inline bool is_active_ssk(struct mptcp_subflow_context *subflow) +{ + return (subflow->request_mptcp || subflow->request_join); +} + static inline bool subflow_simultaneous_connect(struct sock *sk) { struct mptcp_subflow_context *subflow =3D mptcp_subflow_ctx(sk); - struct sock *parent =3D subflow->conn; =20 return sk->sk_state =3D=3D TCP_ESTABLISHED && - !mptcp_sk(parent)->pm.server_side && + is_active_ssk(subflow) && !subflow->conn_finished; } =20 --=20 2.31.1