From nobody Thu Apr 25 20:29:02 2024 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:b119:0:0:0:0:0 with SMTP id r25csp1107719jah; Wed, 12 Jan 2022 14:16:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOOwuOV8SF6H8eg8UiI9WdLvGD0DftDniXPQ79cp5pfxUF04n2uzjCg7/xiJl56aqUJuri X-Received: by 2002:a63:f5a:: with SMTP id 26mr1492303pgp.613.1642025772587; Wed, 12 Jan 2022 14:16:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642025772; cv=none; d=google.com; s=arc-20160816; b=QoyWK4eLEymDL6cwDbJ6M/bCm6O2pCkUS8YJrJ0sdjtYj+xF6IBUYnAkOWs5mUo2ks 6OhPzAdvRut+jAdA/dgao54XWUaEAuJHJaOS627yZEZQNj0T2n0voTFZT25CIHL92wOl 6/PlhQkYrr8Up2GiVuuYOieoG2ThJwsE6QXarc7KYRz73Xm3gcOPRgLhjpxsptO3j1AN nNt1sWiFSeu9ijwI3HR7GzsVqgFMtugWyl1n9NieV76ffsDgf4Oa7tbzhY7vfcNP9gHm k6osWKPluNwXN4X2SH5TU0kxL2t7lxmELIxCS69b05GTihNujJ9Aup76+WWg1LJKsSx4 dYTg== 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=Q6BUhTaKvA5mxq9GuEuTzcE70gdFgFcT8muMBeJLC+YgvUARM4y2v1+fu7n0otzbxQ cHByP6WT34CcIgxzkvktLOozwNtsYRZZtsKJtaCFFMn+iZm+l8mO/Rxn3dT4LWzX/slb NTzUIOBxoCWZAZc6nn3lUQDGe9Sl0zy83K58utHhab+q+ijKRw8U4CJLoGNbUNeWSD0R xpk8ZgoVrLlEN95Twz/GJj96XX7clACDBt1DRzm1JyYp/4dDwkerPiQxF9BmZ3mMe62y bB/BA7YTijY2xbIiHfgpJxGT7brNY7vW3jPpHMwK9WKiMWCZgo1tcT7LTOxKDxg+jd+j /4uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SzikfJ66; spf=pass (google.com: domain of mptcp+bounces-3074-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-3074-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 z22si1131313pgu.280.2022.01.12.14.16.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jan 2022 14:16:12 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-3074-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=SzikfJ66; spf=pass (google.com: domain of mptcp+bounces-3074-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-3074-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 28A613E0F48 for ; Wed, 12 Jan 2022 22:16:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65D8F2CA4; Wed, 12 Jan 2022 22:16:11 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 04A3E2CA1 for ; Wed, 12 Jan 2022 22:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642025769; x=1673561769; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=RqFkuGksiI6R0XGEF4afMW+j7YKqqFmAYKoc85fXM8U=; b=SzikfJ66KRI1BpEfspMdWysylzbQ7eWcD469xpFSDn8rzXJ55W+ljo/B NctRh1wkpvSJ8v8LrGPVtC7ESg7JVByqk3kiCJ1yykHU/1zacljYp0UR/ Ot0AFie+psM1PBCIPsmUpkQLw+wUFXrQLUsho8hHP8njkiD/Zx/P6o3zh 2zmYPIqkO67cpz4h6s/1D+BmDvZ1dw8dJBeFHZWEqZKolzTciz7lWOLkg vf0fV3/5pgaaVy8YWWZUiJjFNinrShzYkY+VukGIe4fF1nsTJYJ8Qwtto IhKmDThLSVj+2oXOqLb2AZohQ34nmIoNZmBEJG1kTzEYFVotwnQdkVvHF Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10225"; a="307213928" X-IronPort-AV: E=Sophos;i="5.88,284,1635231600"; d="scan'208";a="307213928" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2022 14:16:07 -0800 X-IronPort-AV: E=Sophos;i="5.88,284,1635231600"; d="scan'208";a="490907330" Received: from otc-tsn-4.jf.intel.com ([10.23.153.135]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2022 14:16:07 -0800 From: Kishen Maloor To: kishen.maloor@intel.com, mptcp@lists.linux.dev Subject: [PATCH mptcp-next v2 01/21] mptcp: do not restrict subflows with non-kernel PMs Date: Wed, 12 Jan 2022 17:15:03 -0500 Message-Id: <20220112221523.1829397-2-kishen.maloor@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220112221523.1829397-1-kishen.maloor@intel.com> References: <20220112221523.1829397-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