From nobody Mon Feb 9 11:30:27 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:aa7:c50d:0:0:0:0:0 with SMTP id o13csp43858edq; Thu, 17 Mar 2022 16:05:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtZ9F2LfADf6Y1kUI4w4/ZdEfFw6vM9vWfxiBZYd68sd2N4MEMNnhk2YjHL4N/ghn3YLgX X-Received: by 2002:a17:902:b941:b0:14d:af72:3f23 with SMTP id h1-20020a170902b94100b0014daf723f23mr7286536pls.6.1647558304143; Thu, 17 Mar 2022 16:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647558304; cv=none; d=google.com; s=arc-20160816; b=OxBNzjPRqjOum6BuAUOXYAEw3Lf+9e7oZIP4Zig7XeafEjQ/NAI5P1LuTPPObgfQyw 8dmNq/wpBQ5/d7zic/P9jRideSogm+z0mDv62zRfoHzfSi/fzu0ZvBgNllJq2H/YfGy7 efZrnT9WCHRR2sIY+Wh03xnctPdgVhCS/i7Ngt8boNKbZbUHeOongaVCLN9kSlNnb23Y PN1lNNfHKEe2FoIzc/rgk9gsOqLknIsLnjpJDGTaFmsqqEtbUqyxKRzGs7JZRi35+oeg xT+5gV7q10JotaVIYU8DgJqVIY0yMY9P3t/GSoGOrbQo53dH1sdM01kRXLNKOv9UBwwg tErA== 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=BW3npWSNynY4BuGTXXPLYM5p/K/Z8RTuvS3XCo1whjk=; b=Bai7yLVMMo3lgBoFxOhbvGLZfIEn19gBEZg/+jHb/NS0H7OjhaKY0MnZRkdyrfaL+I b8DXWn8DpENkGMYnKKUh7uk8jRl/SF7j9Gdm43aR42RB+cx21ayaSGzyfkS4ri7olrP2 mSz8AmWy402cKy6fz8zacS9qnggro+ySkK18MlM3daRrmSsad3gnCcW063ElxFAKQfr+ y4/ddBJywh0XE6cl4eHE8d7iBfT/TB59R7iSGam0AeJZlblbNdrgEJA9A7EjxgsyI3mQ u8hpwPXrenqNxzX4a49OmxsBf+fnjq5fS5Yt2aM1rNO4BkBkf0mMRehs8Nt46xJ9X/la i6IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=H85aLYko; spf=pass (google.com: domain of mptcp+bounces-4298-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-4298-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [2604:1380:1000:8100::1]) by mx.google.com with ESMTPS id v4-20020a654604000000b003816043ef30si3680299pgq.293.2022.03.17.16.05.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Mar 2022 16:05:04 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-4298-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) client-ip=2604:1380:1000:8100::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=H85aLYko; spf=pass (google.com: domain of mptcp+bounces-4298-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-4298-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 sjc.edge.kernel.org (Postfix) with ESMTPS id A58DF3E1044 for ; Thu, 17 Mar 2022 23:05:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7796D4C6A; Thu, 17 Mar 2022 23:05:01 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 497224C64 for ; Thu, 17 Mar 2022 23:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647558300; x=1679094300; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=/xPbAi1jCbfxHo9tJixyuRDjS5Ie944qB24/RGfadxA=; b=H85aLYkokgMcrKZ3IGMdIPcOLxnzfCyckwho83sIvhxJaR5exZT8QYAB sr3D+tDD8sVj1TS2jb0sH98pnAOmuuOaCJdjf5tMOzjMCi9Ti8llTHNN0 sk/b7l7sJVWZiNv3kj6HqeDbVMweiN1te4F6UAlSfeQCqivFe9EEh6Lol sVlShe5cp3UN1cct+7HbDarVpnsUXG5InsTJ8EPr3TgxoomklD7ZzeVZ1 asx8D5UHcDlguHfHBJIPStSqhjHeRwj63exK3zpawIrzz/r+5LKUvf/+Y xLiak4/XtDHVTd3iQKxT0mnwgvz2hjHeu9MjWp9SWGupwm3psQTUDNeyn w==; X-IronPort-AV: E=McAfee;i="6200,9189,10289"; a="257189955" X-IronPort-AV: E=Sophos;i="5.90,190,1643702400"; d="scan'208";a="257189955" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2022 16:04:56 -0700 X-IronPort-AV: E=Sophos;i="5.90,190,1643702400"; d="scan'208";a="499015063" Received: from otc-tsn-4.jf.intel.com ([10.23.153.135]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2022 16:04:55 -0700 From: Kishen Maloor To: kishen.maloor@intel.com, mptcp@lists.linux.dev Subject: [PATCH mptcp-next v8 5/6] mptcp: establish subflows from either end of connection Date: Thu, 17 Mar 2022 19:04:48 -0400 Message-Id: <20220317230449.763778-6-kishen.maloor@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220317230449.763778-1-kishen.maloor@intel.com> References: <20220317230449.763778-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 fbb14dfe62b3..97b0338fe96f 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -3263,15 +3263,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 4047d081b119..d121dfdde616 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -908,13 +908,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