[PATCH mptcp-next] mptcp: sockopt: add TCP_DEFER_ACCEPT support

Florian Westphal posted 1 patch 1 week, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20220502163624.6110-1-fw@strlen.de
Maintainers: Paolo Abeni <pabeni@redhat.com>, Eric Dumazet <edumazet@google.com>, Mat Martineau <mathew.j.martineau@linux.intel.com>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Matthieu Baerts <matthieu.baerts@tessares.net>
net/mptcp/sockopt.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
[PATCH mptcp-next] mptcp: sockopt: add TCP_DEFER_ACCEPT support
Posted by Florian Westphal 1 week, 6 days ago
Support this via passthrough to the underlaying tcp listener socket.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/271
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 net/mptcp/sockopt.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
index 826b0c1dae98..423d3826ca1e 100644
--- a/net/mptcp/sockopt.c
+++ b/net/mptcp/sockopt.c
@@ -756,6 +756,18 @@ static int mptcp_setsockopt_v4(struct mptcp_sock *msk, int optname,
 	return -EOPNOTSUPP;
 }
 
+static int mptcp_setsockopt_sol_tcp_defer(struct mptcp_sock *msk, sockptr_t optval,
+					  unsigned int optlen)
+{
+	struct socket *listener;
+
+	listener = __mptcp_nmpc_socket(msk);
+	if (!listener)
+		return 0; /* TCP_DEFER_ACCEPT does not fail */
+
+	return tcp_setsockopt(listener->sk, SOL_TCP, TCP_DEFER_ACCEPT, optval, optlen);
+}
+
 static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 				    sockptr_t optval, unsigned int optlen)
 {
@@ -782,6 +794,8 @@ static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 		return mptcp_setsockopt_sol_tcp_cork(msk, optval, optlen);
 	case TCP_NODELAY:
 		return mptcp_setsockopt_sol_tcp_nodelay(msk, optval, optlen);
+	case TCP_DEFER_ACCEPT:
+		return mptcp_setsockopt_sol_tcp_defer(msk, optval, optlen);
 	}
 
 	return -EOPNOTSUPP;
@@ -1142,6 +1156,7 @@ static int mptcp_getsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 	case TCP_CONGESTION:
 	case TCP_INFO:
 	case TCP_CC_INFO:
+	case TCP_DEFER_ACCEPT:
 		return mptcp_getsockopt_first_sf_only(msk, SOL_TCP, optname,
 						      optval, optlen);
 	case TCP_INQ:
-- 
2.35.1


Re: [PATCH mptcp-next] mptcp: sockopt: add TCP_DEFER_ACCEPT support
Posted by Matthieu Baerts 1 week, 2 days ago
Hi Florian, Mat,

On 02/05/2022 18:36, Florian Westphal wrote:
> Support this via passthrough to the underlaying tcp listener socket.

Thank you for the patch and the review!

Now in our tree (feat. for net-next) with Mat's RvB tag.

New patches for t/upstream:
- 3476c1a3846c: mptcp: sockopt: add TCP_DEFER_ACCEPT support
- Results: 22856348dac5..9a52d7243fda (export)

Builds and tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20220506T191513
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] mptcp: sockopt: add TCP_DEFER_ACCEPT support
Posted by Mat Martineau 1 week, 4 days ago
On Mon, 2 May 2022, Florian Westphal wrote:

> Support this via passthrough to the underlaying tcp listener socket.
>
> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/271
> Signed-off-by: Florian Westphal <fw@strlen.de>

Looks good to me:

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>

> ---
> net/mptcp/sockopt.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
> index 826b0c1dae98..423d3826ca1e 100644
> --- a/net/mptcp/sockopt.c
> +++ b/net/mptcp/sockopt.c
> @@ -756,6 +756,18 @@ static int mptcp_setsockopt_v4(struct mptcp_sock *msk, int optname,
> 	return -EOPNOTSUPP;
> }
>
> +static int mptcp_setsockopt_sol_tcp_defer(struct mptcp_sock *msk, sockptr_t optval,
> +					  unsigned int optlen)
> +{
> +	struct socket *listener;
> +
> +	listener = __mptcp_nmpc_socket(msk);
> +	if (!listener)
> +		return 0; /* TCP_DEFER_ACCEPT does not fail */
> +
> +	return tcp_setsockopt(listener->sk, SOL_TCP, TCP_DEFER_ACCEPT, optval, optlen);
> +}
> +
> static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
> 				    sockptr_t optval, unsigned int optlen)
> {
> @@ -782,6 +794,8 @@ static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
> 		return mptcp_setsockopt_sol_tcp_cork(msk, optval, optlen);
> 	case TCP_NODELAY:
> 		return mptcp_setsockopt_sol_tcp_nodelay(msk, optval, optlen);
> +	case TCP_DEFER_ACCEPT:
> +		return mptcp_setsockopt_sol_tcp_defer(msk, optval, optlen);
> 	}
>
> 	return -EOPNOTSUPP;
> @@ -1142,6 +1156,7 @@ static int mptcp_getsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
> 	case TCP_CONGESTION:
> 	case TCP_INFO:
> 	case TCP_CC_INFO:
> +	case TCP_DEFER_ACCEPT:
> 		return mptcp_getsockopt_first_sf_only(msk, SOL_TCP, optname,
> 						      optval, optlen);
> 	case TCP_INQ:
> -- 
> 2.35.1
>
>
>

--
Mat Martineau
Intel

Re: mptcp: sockopt: add TCP_DEFER_ACCEPT support: Tests Results
Posted by MPTCP CI 1 week, 6 days ago
Hi Florian,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal:
  - Unstable: 1 failed test(s): selftest_simult_flows 🔴:
  - Task: https://cirrus-ci.com/task/5574170854555648
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5574170854555648/summary/summary.txt

- KVM Validation: debug:
  - Unstable: 3 failed test(s): selftest_diag selftest_mptcp_join selftest_simult_flows - Critical: 1 Call Trace(s) ❌:
  - Task: https://cirrus-ci.com/task/5084536747851776
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5084536747851776/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/5259e61b6ad5


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)