mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Geliang Tang <geliangtang@gmail.com>
To: mptcp@lists.linux.dev
Cc: Geliang Tang <geliangtang@gmail.com>
Subject: [MPTCP][PATCH v2 mptcp-next 01/10] mptcp: add a new sysctl fullmesh_enabled
Date: Wed, 21 Jul 2021 22:31:25 +0800	[thread overview]
Message-ID: <b5f63eb4ad680a99fc806d2406968a6a5f272f01.1626877655.git.geliangtang@gmail.com> (raw)
In-Reply-To: <cover.1626877655.git.geliangtang@gmail.com>

This patch added a new sysctl, named fullmesh_enabled, to control whether
the fullmesh path manager mode can be enabled.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 Documentation/networking/mptcp-sysctl.rst |  8 ++++++++
 net/mptcp/ctrl.c                          | 16 ++++++++++++++++
 net/mptcp/protocol.h                      |  1 +
 3 files changed, 25 insertions(+)

diff --git a/Documentation/networking/mptcp-sysctl.rst b/Documentation/networking/mptcp-sysctl.rst
index b0d4da71e68e..7e8350cbb042 100644
--- a/Documentation/networking/mptcp-sysctl.rst
+++ b/Documentation/networking/mptcp-sysctl.rst
@@ -57,3 +57,11 @@ stale_loss_cnt - INTEGER
 	This is a per-namespace sysctl.
 
 	Default: 4
+
+fullmesh_enabled - BOOLEAN
+	Control whether the fullmesh path manager mode can be enabled.
+
+	The fullmesh path manager mode can be enabled if the value it nonzero.
+	This is a per-namespace sysctl.
+
+	Default: 0
diff --git a/net/mptcp/ctrl.c b/net/mptcp/ctrl.c
index 8b235468c88f..432a859e9153 100644
--- a/net/mptcp/ctrl.c
+++ b/net/mptcp/ctrl.c
@@ -26,6 +26,7 @@ struct mptcp_pernet {
 	u8 mptcp_enabled;
 	u8 checksum_enabled;
 	u8 allow_join_initial_addr_port;
+	u8 fullmesh_enabled;
 };
 
 static struct mptcp_pernet *mptcp_get_pernet(const struct net *net)
@@ -58,6 +59,11 @@ unsigned int mptcp_stale_loss_cnt(const struct net *net)
 	return mptcp_get_pernet(net)->stale_loss_cnt;
 }
 
+int mptcp_is_fullmesh_enabled(struct net *net)
+{
+	return mptcp_get_pernet(net)->fullmesh_enabled;
+}
+
 static void mptcp_pernet_set_defaults(struct mptcp_pernet *pernet)
 {
 	pernet->mptcp_enabled = 1;
@@ -65,6 +71,7 @@ static void mptcp_pernet_set_defaults(struct mptcp_pernet *pernet)
 	pernet->checksum_enabled = 0;
 	pernet->allow_join_initial_addr_port = 1;
 	pernet->stale_loss_cnt = 4;
+	pernet->fullmesh_enabled = 0;
 }
 
 #ifdef CONFIG_SYSCTL
@@ -108,6 +115,14 @@ static struct ctl_table mptcp_sysctl_table[] = {
 		.mode = 0644,
 		.proc_handler = proc_douintvec_minmax,
 	},
+	{
+		.procname	= "fullmesh_enabled",
+		.maxlen		= sizeof(u8),
+		.mode		= 0644,
+		.proc_handler	= proc_dou8vec_minmax,
+		.extra1		= SYSCTL_ZERO,
+		.extra2		= SYSCTL_ONE
+	},
 	{}
 };
 
@@ -128,6 +143,7 @@ static int mptcp_pernet_new_table(struct net *net, struct mptcp_pernet *pernet)
 	table[2].data = &pernet->checksum_enabled;
 	table[3].data = &pernet->allow_join_initial_addr_port;
 	table[4].data = &pernet->stale_loss_cnt;
+	table[5].data = &pernet->fullmesh_enabled;
 
 	hdr = register_net_sysctl(net, MPTCP_SYSCTL_PATH, table);
 	if (!hdr)
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 8bdd038def38..ce972edc7bbe 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -562,6 +562,7 @@ unsigned int mptcp_get_add_addr_timeout(const struct net *net);
 int mptcp_is_checksum_enabled(const struct net *net);
 int mptcp_allow_join_id0(const struct net *net);
 unsigned int mptcp_stale_loss_cnt(const struct net *net);
+int mptcp_is_fullmesh_enabled(struct net *net);
 void mptcp_subflow_fully_established(struct mptcp_subflow_context *subflow,
 				     struct mptcp_options_received *mp_opt);
 bool __mptcp_retransmit_pending_data(struct sock *sk);
-- 
2.31.1


  reply	other threads:[~2021-07-21 14:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 14:31 [MPTCP][PATCH v2 mptcp-next 00/10] fullmesh path manager support Geliang Tang
2021-07-21 14:31 ` Geliang Tang [this message]
2021-07-21 14:31   ` [MPTCP][PATCH v2 mptcp-next 02/10] mptcp: register ipv4 addr notifier Geliang Tang
2021-07-21 14:31     ` [MPTCP][PATCH v2 mptcp-next 03/10] mptcp: register ipv6 " Geliang Tang
2021-07-21 14:31       ` [MPTCP][PATCH v2 mptcp-next 04/10] mptcp: add netdev up event handler Geliang Tang
2021-07-21 14:31         ` [MPTCP][PATCH v2 mptcp-next 05/10] mptcp: invoke mptcp_nl_remove_subflow_and_signal_addr in rcu_work Geliang Tang
2021-07-21 14:31           ` [MPTCP][PATCH v2 mptcp-next 06/10] mptcp: add netdev down event handler Geliang Tang
2021-07-21 14:31             ` [MPTCP][PATCH v2 mptcp-next 07/10] mptcp: add proc file local_addr_list Geliang Tang
2021-07-21 14:31               ` [MPTCP][PATCH v2 mptcp-next 08/10] selftests: mptcp: print the fullmesh flag Geliang Tang
2021-07-21 14:31                 ` [MPTCP][PATCH v2 mptcp-next 09/10] selftests: mptcp: add fullmesh testcases Geliang Tang
2021-07-21 14:31                   ` [MPTCP][PATCH v2 mptcp-next 10/10] selftests: mptcp: del uncontinuous removing ids Geliang Tang
2021-07-22 13:34                     ` Matthieu Baerts
2021-07-22 13:33               ` [MPTCP][PATCH v2 mptcp-next 07/10] mptcp: add proc file local_addr_list Matthieu Baerts
2021-07-22 13:33         ` [MPTCP][PATCH v2 mptcp-next 04/10] mptcp: add netdev up event handler Matthieu Baerts
2021-07-21 17:08     ` [MPTCP][PATCH v2 mptcp-next 02/10] mptcp: register ipv4 addr notifier Paolo Abeni
2021-07-22 13:33       ` Matthieu Baerts
2021-07-22 13:33   ` [MPTCP][PATCH v2 mptcp-next 01/10] mptcp: add a new sysctl fullmesh_enabled Matthieu Baerts
2021-07-22 15:30 ` [MPTCP][PATCH v2 mptcp-next 00/10] fullmesh path manager support Matthieu Baerts

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=b5f63eb4ad680a99fc806d2406968a6a5f272f01.1626877655.git.geliangtang@gmail.com \
    --to=geliangtang@gmail.com \
    --cc=mptcp@lists.linux.dev \
    --subject='Re: [MPTCP][PATCH v2 mptcp-next 01/10] mptcp: add a new sysctl fullmesh_enabled' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).