diff options
| author | Geliang Tang <[email protected]> | 2025-03-13 10:21:00 +0000 |
|---|---|---|
| committer | Paolo Abeni <[email protected]> | 2025-03-20 09:14:49 +0000 |
| commit | fa3ee9dd8067e178b459f1df3081fd25fc03c4b5 (patch) | |
| tree | bb3d32d090a009a6dcdffd7ed147c6656c963558 /net/mptcp/pm.c | |
| parent | mptcp: sysctl: map pm_type to path_manager (diff) | |
| download | kernel-fa3ee9dd8067e178b459f1df3081fd25fc03c4b5.tar.gz kernel-fa3ee9dd8067e178b459f1df3081fd25fc03c4b5.zip | |
mptcp: sysctl: add available_path_managers
Similarly to net.mptcp.available_schedulers, this patch adds a new one
net.mptcp.available_path_managers to list the available path managers.
Signed-off-by: Geliang Tang <[email protected]>
Reviewed-by: Matthieu Baerts (NGI0) <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://patch.msgid.link/20250313-net-next-mptcp-pm-ops-intro-v1-11-f4e4a88efc50@kernel.org
Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'net/mptcp/pm.c')
| -rw-r--r-- | net/mptcp/pm.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 3896f21a46bd..18b19dbccbba 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -1070,3 +1070,22 @@ void mptcp_pm_unregister(struct mptcp_pm_ops *pm_ops) list_del_rcu(&pm_ops->list); spin_unlock(&mptcp_pm_list_lock); } + +/* Build string with list of available path manager values. + * Similar to tcp_get_available_congestion_control() + */ +void mptcp_pm_get_available(char *buf, size_t maxlen) +{ + struct mptcp_pm_ops *pm_ops; + size_t offs = 0; + + rcu_read_lock(); + list_for_each_entry_rcu(pm_ops, &mptcp_pm_list, list) { + offs += snprintf(buf + offs, maxlen - offs, "%s%s", + offs == 0 ? "" : " ", pm_ops->name); + + if (WARN_ON_ONCE(offs >= maxlen)) + break; + } + rcu_read_unlock(); +} |
