selftests: mptcp: mptfo Initiator/Listener
authorDmytro Shytyi <dmytro@shytyi.net>
Fri, 25 Nov 2022 22:29:54 +0000 (23:29 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 30 Nov 2022 04:24:26 +0000 (20:24 -0800)
commitca7ae89160434cd045a4795a235eb16587bd8f73
tree917eebb20ba632172411d69cd576d4d57efc5f89
parentcb99816cb59d4253758827186d5a5616f9825b6c
selftests: mptcp: mptfo Initiator/Listener

This patch first adds TFO support in mptcp_connect.c.

This can be enabled via a new option: -o MPTFO.

Once enabled, the TCP_FASTOPEN socket option is enabled for the server
side and a sendto() with MSG_FASTOPEN is used instead of a connect() for
the client side.

Note that the first SYN has a limit of bytes it can carry. In other
words, it is allowed to send less data than the provided one. We then
need to track more status info to properly allow the next sendmsg()
starting from the next part of the data to send the rest.

Also in TFO scenarios, we need to completely spool the partially xmitted
buffer -- and account for that -- before starting sendfile/mmap xmit,
otherwise the relevant tests will fail.

Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Dmytro Shytyi <dmytro@shytyi.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_connect.c
tools/testing/selftests/net/mptcp/mptcp_connect.sh