[PATCH mptcp-next] mptcp: add support for TCP_FASTOPEN_KEY sockopt

Matthieu Baerts posted 1 patch 1 year, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20221125145257.123844-1-matthieu.baerts@tessares.net
Maintainers: Mat Martineau <mathew.j.martineau@linux.intel.com>, Matthieu Baerts <matthieu.baerts@tessares.net>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
net/mptcp/sockopt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH mptcp-next] mptcp: add support for TCP_FASTOPEN_KEY sockopt
Posted by Matthieu Baerts 1 year, 5 months ago
The goal of this socket option is to set different keys per listener,
see commit 1fba70e5b6be ("tcp: socket option to set TCP fast open key")
for more details about this socket option.

The only thing to do here with MPTCP is to relay the request to the
first subflow like it is already done for the other TCP_FASTOPEN* socket
options.

Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---

Notes:
    This has been validated with packetdrill tests:
    
      https://github.com/multipath-tcp/packetdrill/pull/106

 net/mptcp/sockopt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
index c1bca711c35c..a47423ebb33a 100644
--- a/net/mptcp/sockopt.c
+++ b/net/mptcp/sockopt.c
@@ -561,6 +561,7 @@ static bool mptcp_supported_sockopt(int level, int optname)
 		case TCP_INQ:
 		case TCP_FASTOPEN:
 		case TCP_FASTOPEN_CONNECT:
+		case TCP_FASTOPEN_KEY:
 		case TCP_FASTOPEN_NO_COOKIE:
 			return true;
 		}
@@ -570,9 +571,6 @@ static bool mptcp_supported_sockopt(int level, int optname)
 		/* TCP_REPAIR, TCP_REPAIR_QUEUE, TCP_QUEUE_SEQ, TCP_REPAIR_OPTIONS,
 		 * TCP_REPAIR_WINDOW are not supported, better avoid this mess
 		 */
-		/* TCP_FASTOPEN_KEY is not supported because
-		 * fastopen for the listener side is currently unsupported
-		 */
 	}
 	return false;
 }
@@ -804,6 +802,7 @@ static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 		return 0;
 	case TCP_FASTOPEN:
 	case TCP_FASTOPEN_CONNECT:
+	case TCP_FASTOPEN_KEY:
 	case TCP_FASTOPEN_NO_COOKIE:
 		return mptcp_setsockopt_first_sf_only(msk, SOL_TCP, optname,
 						      optval, optlen);
@@ -1170,6 +1169,7 @@ static int mptcp_getsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 	case TCP_DEFER_ACCEPT:
 	case TCP_FASTOPEN:
 	case TCP_FASTOPEN_CONNECT:
+	case TCP_FASTOPEN_KEY:
 	case TCP_FASTOPEN_NO_COOKIE:
 		return mptcp_getsockopt_first_sf_only(msk, SOL_TCP, optname,
 						      optval, optlen);

base-commit: bc1626baad5a7db698ca1ea9212fe3f6e45181f0
-- 
2.37.2
Re: mptcp: add support for TCP_FASTOPEN_KEY sockopt: Tests Results
Posted by MPTCP CI 1 year, 5 months ago
Hi Matthieu,

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_mptcp_join 🔴:
  - Task: https://cirrus-ci.com/task/4970530218967040
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/4970530218967040/summary/summary.txt

- KVM Validation: debug:
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/6096430125809664
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6096430125809664/summary/summary.txt

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


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)
Re: [PATCH mptcp-next] mptcp: add support for TCP_FASTOPEN_KEY sockopt
Posted by Paolo Abeni 1 year, 5 months ago
On Fri, 2022-11-25 at 15:52 +0100, Matthieu Baerts wrote:
> The goal of this socket option is to set different keys per listener,
> see commit 1fba70e5b6be ("tcp: socket option to set TCP fast open key")
> for more details about this socket option.
> 
> The only thing to do here with MPTCP is to relay the request to the
> first subflow like it is already done for the other TCP_FASTOPEN* socket
> options.
> 
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>

Acked-by: Paolo Abeni <pabeni@redhat.com>
Re: [PATCH mptcp-next] mptcp: add support for TCP_FASTOPEN_KEY sockopt
Posted by Matthieu Baerts 1 year, 5 months ago
Hi Paolo,

On 25/11/2022 16:16, Paolo Abeni wrote:
> On Fri, 2022-11-25 at 15:52 +0100, Matthieu Baerts wrote:
>> The goal of this socket option is to set different keys per listener,
>> see commit 1fba70e5b6be ("tcp: socket option to set TCP fast open key")
>> for more details about this socket option.
>>
>> The only thing to do here with MPTCP is to relay the request to the
>> first subflow like it is already done for the other TCP_FASTOPEN* socket
>> options.
>>
>> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
> 
> Acked-by: Paolo Abeni <pabeni@redhat.com>

Thank you for the review!

Now in our tree, between "mptcp: add TCP_FASTOPEN sock option" and
"selftests: mptcp: mptfo Initiator/Listener":

New patches for t/upstream:
- 0525a935c675: mptcp: add support for TCP_FASTOPEN_KEY sockopt
- Results: bc1626baad5a..2deca8211919 (export)

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20221125T194530

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