Skip to content

Commit 048d19d

Browse files
Florian Westphaldavem330
authored andcommitted
mptcp: add basic kselftest for mptcp
Add mptcp_connect tool: xmit two files back and forth between two processes, several net namespaces including some adding delays, losses and reordering. Wrapper script tests that data was transmitted without corruption. The "-c" command line option for mptcp_connect.sh is there for debugging: The script will use tcpdump to create one .pcap file per test case, named according to the namespaces, protocols, and connect address in use. For example, the first test case writes the capture to ns1-ns1-MPTCP-MPTCP-10.0.1.1.pcap. The stderr output from tcpdump is printed after the test completes to show tcpdump's "packets dropped by kernel" information. Also check that userspace can't create MPTCP sockets when mptcp.enabled sysctl is off. The "-b" option allows to tune/lower send buffer size. "-m mmap" can be used to test blocking io. Default is non-blocking io using read/write/poll. Will run automatically on "make kselftest". Note that the default timeout of 45 seconds is used even if there is a "settings" changing it to 450. 45 seconds should be enough in most cases but this depends on the machine running the tests. A fix to correctly read the "settings" file has been proposed upstream but not applied yet. It is not blocking the execution of these new tests but it would be nice to have it: https://patchwork.kernel.org/patch/11204935/ Co-developed-by: Paolo Abeni <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> Co-developed-by: Mat Martineau <[email protected]> Signed-off-by: Mat Martineau <[email protected]> Co-developed-by: Matthieu Baerts <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> Co-developed-by: Davide Caratti <[email protected]> Signed-off-by: Davide Caratti <[email protected]> Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Christoph Paasch <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 784325e commit 048d19d

File tree

8 files changed

+1449
-0
lines changed

8 files changed

+1449
-0
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11584,6 +11584,7 @@ B: https://github.com/multipath-tcp/mptcp_net-next/issues
1158411584
S: Maintained
1158511585
F: include/net/mptcp.h
1158611586
F: net/mptcp/
11587+
F: tools/testing/selftests/net/mptcp/
1158711588

1158811589
NETWORKING [TCP]
1158911590
M: Eric Dumazet <[email protected]>

tools/testing/selftests/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ TARGETS += memory-hotplug
3232
TARGETS += mount
3333
TARGETS += mqueue
3434
TARGETS += net
35+
TARGETS += net/mptcp
3536
TARGETS += netfilter
3637
TARGETS += networking/timestamping
3738
TARGETS += nsfs
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mptcp_connect
2+
*.pcap
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
top_srcdir = ../../../../..
4+
5+
CFLAGS = -Wall -Wl,--no-as-needed -O2 -g
6+
7+
TEST_PROGS := mptcp_connect.sh
8+
9+
TEST_GEN_FILES = mptcp_connect
10+
11+
EXTRA_CLEAN := *.pcap
12+
13+
include ../../lib.mk
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CONFIG_MPTCP=y
2+
CONFIG_MPTCP_IPV6=y
3+
CONFIG_VETH=y
4+
CONFIG_NET_SCH_NETEM=m

0 commit comments

Comments
 (0)