From nobody Tue Feb 10 03:44:30 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a50:bae3:0:0:0:0:0 with SMTP id x90csp411174ede; Wed, 16 Mar 2022 12:08:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPCJVwZ8dc3GdfCwlATTUbz4xAryeXxyurVAT2+e+h1JWHtOmVw3SALS63r7c6bszTSpfL X-Received: by 2002:a05:6512:398a:b0:448:ba48:602f with SMTP id j10-20020a056512398a00b00448ba48602fmr620995lfu.613.1647457688850; Wed, 16 Mar 2022 12:08:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647457688; cv=none; d=google.com; s=arc-20160816; b=bCKKAKAOQGRLqLkHQOaBzCg5AOgbe9NSz9gAL7YeC/ZLw07qw+V57vE34+6KlGyXXR 3koQNQvem/uhymhi2Vv48PdMBkjuTXNIp94hHT8sb2V1OdkOfuA+ls9I4+90k18Jsvbd 1AETvT+QtuQ2iYCCUhS8KVacLyn7x1VP6LVq3lnR5VNCOfcLQ6xnO+SgruFFZj9hA80F QoQyKm9vpfeUfoiBFEwx5vFOeWCGIlezSpQNeRjrWCUAFZEBB1txNizEQuydD7P0wGyP jQlDCZl33pIPGuY/4zfgZy5Eo1dqoFTWqUKlxI21fHi4KOWqEfwNOa4MnqDuV0OND4hp NUmw== 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=jbH1Wqo1tSPJa4AV3EU7gsiYJMCbBZFZiTGAWgrWeFM=; b=Xy5Nt+I+ZtCOiWCrGnsuUiDM+VzqadMFRmToq7t/hE01dykwtblpXJNWMY6Ux76YKC EHDkYqLCVqr9mOmekcGb5jo3BE2iE2ds7LbEdSnw4zQwRhD2d+rANA3Vo51LQJaCw9NC QmsIwutVYEIq69NpVaeXqzNjVsw3TNGcINmB1akvujwgqD6A6tDY86SQhp+KZU4KSwl5 RVMSL5ksOWBRfKIRmzYVNnwGtvFCPOXEiJ7n1wOmwRwOXgXHFQiqpVSoMA1kHVwJx5er HVEbUkp5ihzqCaJ1hoE6h1OAStDUBub52MGnzSp8O5gjXtMxrkhmfU9jXubqBVPTPfeX Vfrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BfdyVDOX; spf=pass (google.com: domain of mptcp+bounces-4241-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) smtp.mailfrom="mptcp+bounces-4241-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. [147.75.197.195]) by mx.google.com with ESMTPS id k3-20020a05651239c300b00449cb2f4531si492702lfu.13.2022.03.16.12.08.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2022 12:08:08 -0700 (PDT) Received-SPF: pass (google.com: domain of mptcp+bounces-4241-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) client-ip=147.75.197.195; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BfdyVDOX; spf=pass (google.com: domain of mptcp+bounces-4241-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) smtp.mailfrom="mptcp+bounces-4241-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 480391C0CBA for ; Wed, 16 Mar 2022 19:08:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 015EE38F5; Wed, 16 Mar 2022 19:08:07 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 2E2833B3A for ; Wed, 16 Mar 2022 19:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647457684; x=1678993684; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=EgtX7OdoidfI0MVW/LMhtWa08zx5ZLwz3aDUcE5kC7U=; b=BfdyVDOX039xBJNsBDWDNvt8rT8+G9QXah7Hq4nkXSEheqVapgyTuGN/ //sQjof2wUngnIKOyQQjwu4biDZp2LqlreWaaVZ4U/6bMhq4DoD0KFoI8 x6MLata8dJ4J9MRMCNgYdIWFWO+92McX+MJJ9RZ9qfCPonI41xNL9n+gN OXyX5YUNB4DgM7BtKTGdQGV0Fyu50BeK0t/0smkcdSwg1Y+qsE5aIEZOD BsgQuvR3gE0GEnqYnJO606MoA6vpKJUgw4AJwODnlixFb62lLCG/BWfGI jWKRVMtvYnNR5umtbPjiQqUdDLGOdihm7LF98WVhRF1B946sS0bt4hU// g==; X-IronPort-AV: E=McAfee;i="6200,9189,10288"; a="255521714" X-IronPort-AV: E=Sophos;i="5.90,187,1643702400"; d="scan'208";a="255521714" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2022 12:07:58 -0700 X-IronPort-AV: E=Sophos;i="5.90,187,1643702400"; d="scan'208";a="644799815" Received: from otc-tsn-4.jf.intel.com ([10.23.153.135]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2022 12:07:58 -0700 From: Kishen Maloor To: kishen.maloor@intel.com, mptcp@lists.linux.dev Subject: [PATCH mptcp-next 4/5] mptcp: establish subflows from either end of connection Date: Wed, 16 Mar 2022 15:07:46 -0400 Message-Id: <20220316190747.634325-5-kishen.maloor@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220316190747.634325-1-kishen.maloor@intel.com> References: <20220316190747.634325-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 3e5c8d5273a9..9b655d049b94 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