[PATCH mptcp-next v4 0/6] mptcp: Add userspace PM mode to bypass kernel PM

Mat Martineau posted 6 patches 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20211216003324.403195-1-mathew.j.martineau@linux.intel.com
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, Shuah Khan <shuah@kernel.org>, Jonathan Corbet <corbet@lwn.net>, Mat Martineau <mathew.j.martineau@linux.intel.com>, Jakub Kicinski <kuba@kernel.org>, "David S. Miller" <davem@davemloft.net>
Documentation/networking/mptcp-sysctl.rst     | 18 +++++
net/mptcp/ctrl.c                              | 21 ++++++
net/mptcp/pm.c                                | 50 +++++++++----
net/mptcp/pm_netlink.c                        | 30 ++++----
net/mptcp/protocol.h                          | 16 ++++-
.../testing/selftests/net/mptcp/mptcp_join.sh | 70 ++++++++++++++++++-
6 files changed, 170 insertions(+), 35 deletions(-)

[PATCH mptcp-next v4 0/6] mptcp: Add userspace PM mode to bypass kernel PM

Posted by Mat Martineau 1 month, 1 week ago
One part of supporting userspace path managers is to prevent the
in-kernel PM from acting on userspace-managed MPTCP connections.

These patches:

 * Add a per-MPTCP-socket 'pm_type'. A mix of kernel-managed and
   userspace-managed connections are supported within each namespace.

 * Conditionally decouple incoming ADD_ADDR/RM_ADDR and subflow changes
   from the in-kernel PM. Netlink events are still triggered, and ADD_ADDR
   echo handling is still in kernel code even if path management is
   otherwise handled in userspace.

 * Add a sysctl for setting the per-namespace default for in-kernel vs
   userspace path management of new MPTCP sockets. This is an integer
   value to allow extensibility.

 * Add selftests to confirm that the in-kernel PM is bypassed.

RFC -> v1: Changed sysctl from a bool to an integer, added patch 1
(cleanup) and patch 6 (selftests), fixed ADD_ADDR echo and initial
pm->subflows_allowed settings.

v1 -> v2: Rebased on latest export branch, removed extra kernel-mode
check when receiving ADD_ADDR, and fix !CONFIG_SYSCTL build.

v2 -> v3: Rebased on latest export branch, use helper function for PM
mode, clarify initialization logic for userspace vs. kernel PM,
add a Tested-by tag from v2 review.

v3 -> v4: Rebased on latest export branch and resolved conflicts

Mat Martineau (6):
  mptcp: Remove redundant assignments in path manager init
  mptcp: Add a member to mptcp_pm_data to track kernel vs userspace mode
  mptcp: Bypass kernel PM when userspace PM is enabled
  mptcp: Make kernel path manager check for userspace-managed sockets
  mptcp: Add a per-namespace sysctl to set the default path manager type
  selftests: mptcp: Add tests for userspace PM type

 Documentation/networking/mptcp-sysctl.rst     | 18 +++++
 net/mptcp/ctrl.c                              | 21 ++++++
 net/mptcp/pm.c                                | 50 +++++++++----
 net/mptcp/pm_netlink.c                        | 30 ++++----
 net/mptcp/protocol.h                          | 16 ++++-
 .../testing/selftests/net/mptcp/mptcp_join.sh | 70 ++++++++++++++++++-
 6 files changed, 170 insertions(+), 35 deletions(-)


base-commit: 81706660508b6caa94d0fbeb8875882f155c73a9
-- 
2.34.1


Re: [PATCH mptcp-next v4 0/6] mptcp: Add userspace PM mode to bypass kernel PM

Posted by Matthieu Baerts 1 month, 1 week ago
Hi Mat, Paolo,

On 16/12/2021 01:33, Mat Martineau wrote:
> One part of supporting userspace path managers is to prevent the
> in-kernel PM from acting on userspace-managed MPTCP connections.
> 
> These patches:
> 
>  * Add a per-MPTCP-socket 'pm_type'. A mix of kernel-managed and
>    userspace-managed connections are supported within each namespace.
> 
>  * Conditionally decouple incoming ADD_ADDR/RM_ADDR and subflow changes
>    from the in-kernel PM. Netlink events are still triggered, and ADD_ADDR
>    echo handling is still in kernel code even if path management is
>    otherwise handled in userspace.
> 
>  * Add a sysctl for setting the per-namespace default for in-kernel vs
>    userspace path management of new MPTCP sockets. This is an integer
>    value to allow extensibility.
> 
>  * Add selftests to confirm that the in-kernel PM is bypassed.

Thank you for the patches and the reviews!

Just applied in our tree (new feat. for net-next) with Paolo's ACK:

- b27a8a51fc93: mptcp: Remove redundant assignments in path manager init
- d9fae9ab22a1: mptcp: Add a member to mptcp_pm_data to track kernel vs
userspace mode
- 136ded889aa6: mptcp: Bypass kernel PM when userspace PM is enabled
- 08c305f2bca4: mptcp: Make kernel path manager check for
userspace-managed sockets
- 9864091e402f: mptcp: Add a per-namespace sysctl to set the default
path manager type
- 693a40231edf: selftests: mptcp: Add tests for userspace PM type
- Results: 1fdc9db07613..f83839879847

Builds and tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20211216T152900
https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

Re: [PATCH mptcp-next v4 0/6] mptcp: Add userspace PM mode to bypass kernel PM

Posted by Paolo Abeni 1 month, 1 week ago
On Wed, 2021-12-15 at 16:33 -0800, Mat Martineau wrote:
> One part of supporting userspace path managers is to prevent the
> in-kernel PM from acting on userspace-managed MPTCP connections.
> 
> These patches:
> 
>  * Add a per-MPTCP-socket 'pm_type'. A mix of kernel-managed and
>    userspace-managed connections are supported within each namespace.
> 
>  * Conditionally decouple incoming ADD_ADDR/RM_ADDR and subflow changes
>    from the in-kernel PM. Netlink events are still triggered, and ADD_ADDR
>    echo handling is still in kernel code even if path management is
>    otherwise handled in userspace.
> 
>  * Add a sysctl for setting the per-namespace default for in-kernel vs
>    userspace path management of new MPTCP sockets. This is an integer
>    value to allow extensibility.
> 
>  * Add selftests to confirm that the in-kernel PM is bypassed.
> 
> RFC -> v1: Changed sysctl from a bool to an integer, added patch 1
> (cleanup) and patch 6 (selftests), fixed ADD_ADDR echo and initial
> pm->subflows_allowed settings.
> 
> v1 -> v2: Rebased on latest export branch, removed extra kernel-mode
> check when receiving ADD_ADDR, and fix !CONFIG_SYSCTL build.
> 
> v2 -> v3: Rebased on latest export branch, use helper function for PM
> mode, clarify initialization logic for userspace vs. kernel PM,
> add a Tested-by tag from v2 review.
> 
> v3 -> v4: Rebased on latest export branch and resolved conflicts
> 
> Mat Martineau (6):
>   mptcp: Remove redundant assignments in path manager init
>   mptcp: Add a member to mptcp_pm_data to track kernel vs userspace mode
>   mptcp: Bypass kernel PM when userspace PM is enabled
>   mptcp: Make kernel path manager check for userspace-managed sockets
>   mptcp: Add a per-namespace sysctl to set the default path manager type
>   selftests: mptcp: Add tests for userspace PM type
> 
>  Documentation/networking/mptcp-sysctl.rst     | 18 +++++
>  net/mptcp/ctrl.c                              | 21 ++++++
>  net/mptcp/pm.c                                | 50 +++++++++----
>  net/mptcp/pm_netlink.c                        | 30 ++++----
>  net/mptcp/protocol.h                          | 16 ++++-
>  .../testing/selftests/net/mptcp/mptcp_join.sh | 70 ++++++++++++++++++-
>  6 files changed, 170 insertions(+), 35 deletions(-)
> 
> 
> base-commit: 81706660508b6caa94d0fbeb8875882f155c73a9

LGTM, thanks Mat!

Acked-by: Paolo Abeni <pabeni@redhat.com>