[PATCH net-next 00/14] mptcp: get rid of msk->subflow

Matthieu Baerts posted 14 patches 9 months, 2 weeks ago
Failed in applying to current master (apply log)
There is a newer version of this series
include/net/inet_common.h |   2 +
include/net/ipv6.h        |   1 +
net/ipv4/af_inet.c        |  46 ++++++-----
net/ipv6/af_inet6.c       |  10 ++-
net/mptcp/pm_netlink.c    |  30 +++----
net/mptcp/protocol.c      | 194 ++++++++++++++++++++++------------------------
net/mptcp/protocol.h      |  15 ++--
net/mptcp/sockopt.c       |  65 ++++++++--------
8 files changed, 186 insertions(+), 177 deletions(-)
[PATCH net-next 00/14] mptcp: get rid of msk->subflow
Posted by Matthieu Baerts 9 months, 2 weeks ago
The MPTCP protocol maintains an additional struct socket per connection,
mainly to be able to easily use tcp-level struct socket operations.

This leads to several side effects, beyond the quite unfortunate /
confusing 'subflow' field name:

- active and passive sockets behaviour is inconsistent: only active ones
  have a not NULL msk->subflow, leading to different error handling and
  different error code returned to the user-space in several places.

- active sockets uses an unneeded, larger amount of memory

- passive sockets can't successfully go through accept(), disconnect(),
  accept() sequence, see [1] for more details.

The 13 first patches of this series are from Paolo and address all the
above, finally getting rid of the blamed field:

- The first patch is a minor clean-up.

- In the next 11 patches, msk->subflow usage is systematically removed
  from the MPTCP protocol, replacing it with direct msk->first usage,
  eventually introducing new core helpers when needed.

- The 13th patch finally disposes the field, and it's the only patch in
  the series intended to produce functional changes.

The last and 14th patch is from Kuniyuki and it is not linked to the
previous ones: it is a small clean-up to get rid of an unnecessary check
in mptcp_init_sock().

[1] https://github.com/multipath-tcp/mptcp_net-next/issues/290

Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
Kuniyuki Iwashima (1):
      mptcp: Remove unnecessary test for __mptcp_init_sock()

Paolo Abeni (13):
      mptcp: avoid unneeded mptcp_token_destroy() calls
      mptcp: avoid additional __inet_stream_connect() call
      mptcp: avoid subflow socket usage in mptcp_get_port()
      net: factor out inet{,6}_bind_sk helpers
      mptcp: mptcp: avoid additional indirection in mptcp_bind()
      net: factor out __inet_listen_sk() helper
      mptcp: avoid additional indirection in mptcp_listen()
      mptcp: avoid additional indirection in mptcp_poll()
      mptcp: avoid unneeded indirection in mptcp_stream_accept()
      mptcp: avoid additional indirection in sockopt
      mptcp: avoid ssock usage in mptcp_pm_nl_create_listen_socket()
      mptcp: change the mpc check helper to return a sk
      mptcp: get rid of msk->subflow

 include/net/inet_common.h |   2 +
 include/net/ipv6.h        |   1 +
 net/ipv4/af_inet.c        |  46 ++++++-----
 net/ipv6/af_inet6.c       |  10 ++-
 net/mptcp/pm_netlink.c    |  30 +++----
 net/mptcp/protocol.c      | 194 ++++++++++++++++++++++------------------------
 net/mptcp/protocol.h      |  15 ++--
 net/mptcp/sockopt.c       |  65 ++++++++--------
 8 files changed, 186 insertions(+), 177 deletions(-)
---
base-commit: 80f9ad046052509d0eee9b72e11d0e8ae31b665f
change-id: 20230811-upstream-net-next-20230811-mptcp-get-rid-of-msk-subflow-9ad15cd9cdcb

Best regards,
-- 
Matthieu Baerts <matthieu.baerts@tessares.net>
Re: [PATCH net-next 00/14] mptcp: get rid of msk->subflow
Posted by patchwork-bot+netdevbpf@kernel.org 9 months, 2 weeks ago
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 11 Aug 2023 17:57:13 +0200 you wrote:
> The MPTCP protocol maintains an additional struct socket per connection,
> mainly to be able to easily use tcp-level struct socket operations.
> 
> This leads to several side effects, beyond the quite unfortunate /
> confusing 'subflow' field name:
> 
> - active and passive sockets behaviour is inconsistent: only active ones
>   have a not NULL msk->subflow, leading to different error handling and
>   different error code returned to the user-space in several places.
> 
> [...]

Here is the summary with links:
  - [net-next,01/14] mptcp: avoid unneeded mptcp_token_destroy() calls
    https://git.kernel.org/netdev/net-next/c/131a627751e3
  - [net-next,02/14] mptcp: avoid additional __inet_stream_connect() call
    https://git.kernel.org/netdev/net-next/c/ccae357c1c6a
  - [net-next,03/14] mptcp: avoid subflow socket usage in mptcp_get_port()
    https://git.kernel.org/netdev/net-next/c/cfb63e50d319
  - [net-next,04/14] net: factor out inet{,6}_bind_sk helpers
    https://git.kernel.org/netdev/net-next/c/e6d360ff87f0
  - [net-next,05/14] mptcp: mptcp: avoid additional indirection in mptcp_bind()
    https://git.kernel.org/netdev/net-next/c/8cf2ebdc0078
  - [net-next,06/14] net: factor out __inet_listen_sk() helper
    https://git.kernel.org/netdev/net-next/c/71a9a874cd6b
  - [net-next,07/14] mptcp: avoid additional indirection in mptcp_listen()
    https://git.kernel.org/netdev/net-next/c/40f56d0c7043
  - [net-next,08/14] mptcp: avoid additional indirection in mptcp_poll()
    https://git.kernel.org/netdev/net-next/c/5426a4ef6455
  - [net-next,09/14] mptcp: avoid unneeded indirection in mptcp_stream_accept()
    https://git.kernel.org/netdev/net-next/c/1f6610b92ac3
  - [net-next,10/14] mptcp: avoid additional indirection in sockopt
    https://git.kernel.org/netdev/net-next/c/f0bc514bd5c1
  - [net-next,11/14] mptcp: avoid ssock usage in mptcp_pm_nl_create_listen_socket()
    https://git.kernel.org/netdev/net-next/c/3aa362494170
  - [net-next,12/14] mptcp: change the mpc check helper to return a sk
    https://git.kernel.org/netdev/net-next/c/3f326a821b99
  - [net-next,13/14] mptcp: get rid of msk->subflow
    https://git.kernel.org/netdev/net-next/c/39880bd808ad
  - [net-next,14/14] mptcp: Remove unnecessary test for __mptcp_init_sock()
    https://git.kernel.org/netdev/net-next/c/e263691773cd

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html