From nobody Thu Sep 18 11:14:11 2025 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:cbb9:0:0:0:0:0 with SMTP id v25csp690116jap; Thu, 16 Dec 2021 14:24:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwoqA9zU/gKAV9JqlNBnrfxeIVkoWha5oCdtd6oetLjAfx6aOJs3Xr5/juRWiqUPOvaK7ji X-Received: by 2002:a05:622a:494:: with SMTP id p20mr87253qtx.83.1639693455681; Thu, 16 Dec 2021 14:24:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639693455; cv=none; d=google.com; s=arc-20160816; b=UAiHy4Nc/m+eE5BmqhZriiVR0dP1uBEYVShWRzgdTliAGUBmelsIFV413mZjpaYKyX L6n2b2S4y2j8JHn3E0w2WD7KcT+nyNLptVqAq3WzrPOC4YB/HWDIcXgB6/iiy4EaOy89 ArFn3aMZyyLaw1e9BqMF6G408AvmpWzuGrX8ekWaxaymv3GNayHbhWLsDfiDeiUlpwYD 5kWO4VTynAHlIxgEr7rgE9zxI5uS733aWlzOz2jiwKVUwqCgAwvCKIjwvaiVdZZ/V6dA TtlwGItFJmGXuO4N6TS6TMPp7hhG21qzDW8eTcsXfzMt1Z8XadpmZqTOxDgQrqCT5cxL OW8Q== 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=PyGeo8NalnCip7GUJElG4qxeINLj6hbRRmIpm3jbT10=; b=xo+eVdQlsjzWTQmLbwnrikyNhsaAaHMuDi0Pdm4Wsxepzzj75kZQoU9jhNrX6+3deq FOUvOls/ahokVgQy2QnQtyNfl2OXbC330PqqcHGswt3UTtuKhUg6PK20dF7H2iuKhP6r LJjEFz4MTQN+k2XYJCLYeDxI1VOJ4DiCIwAfMm9SPhPJa6jWExqqxF2i9IKg8opvqKO9 VPNZPMzw3pZ0rgm/iTLUXuJkLuMYKjxNPQDJRCHKXSZ0IX5CME3AZqv18hIZS2J6eniH UYnkf7ueFsu7I72RXVQhKDHHTDq2kT5JcA1Py7Gxdvewjh+1VelVwSJp3SeFVkkoU/I+ sHVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mJZ5Wmgv; spf=pass (google.com: domain of mptcp+bounces-2795-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) smtp.mailfrom="mptcp+bounces-2795-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 jk7si3519907qvb.460.2021.12.16.14.24.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Dec 2021 14:24:15 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2795-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=mJZ5Wmgv; spf=pass (google.com: domain of mptcp+bounces-2795-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) smtp.mailfrom="mptcp+bounces-2795-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 7C8711C0B3F for ; Thu, 16 Dec 2021 22:24:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 553962CBD; Thu, 16 Dec 2021 22:24:14 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 E1EEF2CB5 for ; Thu, 16 Dec 2021 22:24:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639693451; x=1671229451; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=RqFkuGksiI6R0XGEF4afMW+j7YKqqFmAYKoc85fXM8U=; b=mJZ5WmgvnvGkiP8RQ14fa0a8vXLdF6fbFHA7xopeqFwni7OQkLkwyhWv UZLViOsqd77DH6AmfzdDL0+1p0ZBujJKR4/NqyPtw2AEWYS04Vbx545si yTf4fhmN4LfZms1M6d+2wxlToNBEU+YShT1hQ/o3p3u9nUX5Ds7fV5FCV nN+8S/FvOslmk+42WaQRPCTV4JLkGyLU0tRYeM5HYp/oM84RCgmpR36mg Osn4dfwuLxa9tutwP4cVuWzYpOL0NT9StZ/6r/Jxdk4Xycp6s7btxJqD1 PZzDS6TqcWzINT4qhq0zDWUzWoI1tnbamPivuvS8tYrMZ7HR78isaAEm1 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10200"; a="300393155" X-IronPort-AV: E=Sophos;i="5.88,212,1635231600"; d="scan'208";a="300393155" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2021 14:24:10 -0800 X-IronPort-AV: E=Sophos;i="5.88,212,1635231600"; d="scan'208";a="519461223" 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; 16 Dec 2021 14:24:10 -0800 From: Kishen Maloor To: kishen.maloor@intel.com, mptcp@lists.linux.dev Subject: [PATCH mptcp-next 01/21] mptcp: do not restrict subflows with non-kernel PMs Date: Thu, 16 Dec 2021 17:22:54 -0500 Message-Id: <20211216222314.1244708-2-kishen.maloor@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211216222314.1244708-1-kishen.maloor@intel.com> References: <20211216222314.1244708-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" All numerical restrictions on # of addresses/subflows currently apply only to in-kernel PM managed connections. Thus this change removes limitations on adding new subflows by non-kernel (e.g. userspace) PMs. Signed-off-by: Kishen Maloor --- net/mptcp/pm.c | 7 +++++++ net/mptcp/subflow.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 1f8878cc29e3..5f35fe8a5e82 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -87,6 +87,13 @@ bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk) unsigned int subflows_max; int ret =3D 0; =20 + if (READ_ONCE(pm->pm_type) !=3D MPTCP_PM_TYPE_KERNEL) { + spin_lock_bh(&msk->pm.lock); + ++pm->subflows; + spin_unlock_bh(&msk->pm.lock); + return true; + } + subflows_max =3D mptcp_pm_get_subflows_max(msk); =20 pr_debug("msk=3D%p subflows=3D%d max=3D%d allow=3D%d", msk, pm->subflows, diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index fd5fdb639088..b009d0f7fb77 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -62,7 +62,8 @@ static void subflow_generate_hmac(u64 key1, u64 key2, u32= nonce1, u32 nonce2, static bool mptcp_can_accept_new_subflow(const struct mptcp_sock *msk) { return mptcp_is_fully_established((void *)msk) && - READ_ONCE(msk->pm.accept_subflow); + ((READ_ONCE(msk->pm.pm_type) !=3D MPTCP_PM_TYPE_KERNEL) || + READ_ONCE(msk->pm.accept_subflow)); } =20 /* validate received token and create truncated hmac and nonce for SYN-ACK= */ --=20 2.31.1