All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kishen Maloor <kishen.maloor@intel.com>
To: kishen.maloor@intel.com, mptcp@lists.linux.dev
Subject: [PATCH mptcp-next v3 1/8] mptcp: do not restrict subflows with non-kernel PMs
Date: Thu, 27 Jan 2022 19:38:05 -0500	[thread overview]
Message-ID: <20220128003812.2732609-2-kishen.maloor@intel.com> (raw)
In-Reply-To: <20220128003812.2732609-1-kishen.maloor@intel.com>

Current limits on the # of subflows must apply only to in-kernel
PM managed sockets. Thus this change bypasses such limitations for
connections overseen by non-kernel (e.g. userspace) PMs.

Signed-off-by: Kishen Maloor <kishen.maloor@intel.com>
---
 net/mptcp/pm.c      | 3 +++
 net/mptcp/subflow.c | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 1f8878cc29e3..6b6220895929 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -87,6 +87,9 @@ bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk)
 	unsigned int subflows_max;
 	int ret = 0;
 
+	if (READ_ONCE(pm->pm_type) != MPTCP_PM_TYPE_KERNEL)
+		return true;
+
 	subflows_max = mptcp_pm_get_subflows_max(msk);
 
 	pr_debug("msk=%p subflows=%d max=%d allow=%d", msk, pm->subflows,
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index c8126986793e..a7b2d6fd1c1e 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) != MPTCP_PM_TYPE_KERNEL) ||
+		READ_ONCE(msk->pm.accept_subflow));
 }
 
 /* validate received token and create truncated hmac and nonce for SYN-ACK */
-- 
2.31.1


  reply	other threads:[~2022-01-28  0:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28  0:38 [PATCH mptcp-next v3 0/8] mptcp: fixes and enhancements related to path management Kishen Maloor
2022-01-28  0:38 ` Kishen Maloor [this message]
2022-01-28  0:38 ` [PATCH mptcp-next v3 2/8] mptcp: store remote id from MP_JOIN SYN/ACK in local ctx Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 3/8] mptcp: reflect remote port (not 0) in ANNOUNCED events Kishen Maloor
2022-01-28  4:07   ` Geliang Tang
2022-01-31 22:22     ` Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 4/8] mptcp: establish subflows from either end of connection Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 5/8] mptcp: netlink: store per namespace list of refcounted listen socks Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 6/8] mptcp: netlink: store lsk ref in mptcp_pm_addr_entry Kishen Maloor
2022-02-01 11:31   ` Paolo Abeni
2022-02-01 21:19     ` Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 7/8] mptcp: attempt to add listening sockets for announced addrs Kishen Maloor
2022-02-01 11:42   ` Paolo Abeni
2022-02-01 17:25     ` Matthieu Baerts
2022-02-01 21:21       ` Kishen Maloor
2022-02-02  1:18         ` Mat Martineau
2022-01-28  0:38 ` [PATCH mptcp-next v3 8/8] mptcp: expose server_side attribute in MPTCP netlink events Kishen Maloor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220128003812.2732609-2-kishen.maloor@intel.com \
    --to=kishen.maloor@intel.com \
    --cc=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.