mbox series

[mptcp-next,v2,00/10] mptcp: add SOL_SOCKET support

Message ID 20210413155447.14043-1-fw@strlen.de
Headers show
Series mptcp: add SOL_SOCKET support | expand

Message

Florian Westphal April 13, 2021, 3:54 p.m. UTC
This patch set improves support for several SOL_SOCKET tuneables,
addressing comments received for v1 patch set.

Changes since v1:
 - In patch 1, move addition of a variable to patch 2 (Paolo)
 - In patch 2, restrict overflow of sequence count to lower 24 bits (Mat)
 - In patch 2, remove a obsolete check on msk->setsockopt_check (Paolo)

First patch adds skeleton synchronization functions to copy mptcp socket
settings to a subflow socket.

Second patch adds sequence counting scheme to avoid re-sync when subflow
and mptcp-level socket are known to have the same setting applied.

Notable changes:
I removed the sequence number from patch 1 and split it into second
patch to make those bits clearer.

TCP_CONGESTION is now applied to all subflows.

TCP_INFO retrieves info from the first subflow.  It seems better to
add MPTCP_INFO from out-of-tree patch set in a future change for
userspace that wants mptcp-level flow statistics.

I've not changed SO_LINGER either, this should be updated in a
future change to send a FASTCLOSE when mptcp socket gets closed
while the linger time is 0.

The last patch adds a simple test to check SO_MARK replication.

Florian Westphal (10):
  mptcp: add skeleton to sync msk socket options to subflows
  mptcp: tag sequence_seq with socket state
  mptcp: setsockopt: handle SO_KEEPALIVE and SO_PRIORITY
  mptcp: setsockopt: handle receive/send buffer and device bind
  mptcp: setsockopt: support SO_LINGER
  mptcp: setsockopt: add SO_MARK support
  mptcp: setsockopt: add SO_INCOMING_CPU
  mptcp: setsockopt: SO_DEBUG and no-op options
  mptcp: sockopt: add TCP_CONGESTION and TCP_INFO
  selftests: mptcp: add packet mark test case

 net/mptcp/protocol.c                          |  53 ++-
 net/mptcp/protocol.h                          |  11 +
 net/mptcp/sockopt.c                           | 404 ++++++++++++++++++
 net/mptcp/subflow.c                           |   5 +
 tools/testing/selftests/net/mptcp/Makefile    |   2 +-
 .../selftests/net/mptcp/mptcp_connect.c       |  23 +-
 .../selftests/net/mptcp/mptcp_sockopt.sh      | 276 ++++++++++++
 7 files changed, 763 insertions(+), 11 deletions(-)
 create mode 100755 tools/testing/selftests/net/mptcp/mptcp_sockopt.sh

Comments

Paolo Abeni April 13, 2021, 4:30 p.m. UTC | #1
On Tue, 2021-04-13 at 17:54 +0200, Florian Westphal wrote:
> This patch set improves support for several SOL_SOCKET tuneables,
> addressing comments received for v1 patch set.
> 
> Changes since v1:
>  - In patch 1, move addition of a variable to patch 2 (Paolo)
>  - In patch 2, restrict overflow of sequence count to lower 24 bits (Mat)
>  - In patch 2, remove a obsolete check on msk->setsockopt_check (Paolo)
> 
> First patch adds skeleton synchronization functions to copy mptcp socket
> settings to a subflow socket.
> 
> Second patch adds sequence counting scheme to avoid re-sync when subflow
> and mptcp-level socket are known to have the same setting applied.
> 
> Notable changes:
> I removed the sequence number from patch 1 and split it into second
> patch to make those bits clearer.
> 
> TCP_CONGESTION is now applied to all subflows.
> 
> TCP_INFO retrieves info from the first subflow.  It seems better to
> add MPTCP_INFO from out-of-tree patch set in a future change for
> userspace that wants mptcp-level flow statistics.
> 
> I've not changed SO_LINGER either, this should be updated in a
> future change to send a FASTCLOSE when mptcp socket gets closed
> while the linger time is 0.
> 
> The last patch adds a simple test to check SO_MARK replication.
> 
> Florian Westphal (10):
>   mptcp: add skeleton to sync msk socket options to subflows
>   mptcp: tag sequence_seq with socket state
>   mptcp: setsockopt: handle SO_KEEPALIVE and SO_PRIORITY
>   mptcp: setsockopt: handle receive/send buffer and device bind
>   mptcp: setsockopt: support SO_LINGER
>   mptcp: setsockopt: add SO_MARK support
>   mptcp: setsockopt: add SO_INCOMING_CPU
>   mptcp: setsockopt: SO_DEBUG and no-op options
>   mptcp: sockopt: add TCP_CONGESTION and TCP_INFO
>   selftests: mptcp: add packet mark test case
> 
>  net/mptcp/protocol.c                          |  53 ++-
>  net/mptcp/protocol.h                          |  11 +
>  net/mptcp/sockopt.c                           | 404 ++++++++++++++++++
>  net/mptcp/subflow.c                           |   5 +
>  tools/testing/selftests/net/mptcp/Makefile    |   2 +-
>  .../selftests/net/mptcp/mptcp_connect.c       |  23 +-
>  .../selftests/net/mptcp/mptcp_sockopt.sh      | 276 ++++++++++++
>  7 files changed, 763 insertions(+), 11 deletions(-)
>  create mode 100755 tools/testing/selftests/net/mptcp/mptcp_sockopt.sh
> 
LGTM, thanks Florian for the very quick turn-around!

/P
Matthieu Baerts April 14, 2021, 4:07 p.m. UTC | #2
Hi Florian, Paolo,

On 13/04/2021 17:54, Florian Westphal wrote:
> This patch set improves support for several SOL_SOCKET tuneables,
> addressing comments received for v1 patch set.
> 
> Changes since v1:
>   - In patch 1, move addition of a variable to patch 2 (Paolo)
>   - In patch 2, restrict overflow of sequence count to lower 24 bits (Mat)
>   - In patch 2, remove a obsolete check on msk->setsockopt_check (Paolo)

Thank you for the patches and the reviews!

Just applied in our tree with Paolo's Acked-by tags and a small conflict 
resolution:

- 6a63626d8b65: mptcp: add skeleton to sync msk socket options to subflows
- 8d64e3af6a01: mptcp: tag sequence_seq with socket state
- d3123e0f11d5: mptcp: setsockopt: handle SO_KEEPALIVE and SO_PRIORITY
- 312dafe0427f: mptcp: setsockopt: handle receive/send buffer and device 
bind
- 0c26e2e19d8c: mptcp: setsockopt: support SO_LINGER
- 796f06044fcd: mptcp: setsockopt: add SO_MARK support
- 5380a8b59dd4: mptcp: setsockopt: add SO_INCOMING_CPU
- 56063458e089: mptcp: setsockopt: SO_DEBUG and no-op options
- a403361b4aca: mptcp: sockopt: add TCP_CONGESTION and TCP_INFO
- 2857df86a4b9: selftests: mptcp: add packet mark test case
- 0d4cddd31dc4: conflict in t/DO-NOT-MERGE-mptcp-use-kmalloc-on-kasan-build
- Results: f90b3d445732..f15eff9346bc

Export + builds are in progress!

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