Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf: Force to MPTCP #5467

Closed

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: bpf: Force to MPTCP
version: 8
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=772472

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 87dc2bb
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=772472
version: 8

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 87dc2bb
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=772639
version: 9

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 87dc2bb
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=772639
version: 9

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 648880e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=772639
version: 9

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6f9bad6
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=772639
version: 9

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 5964d1e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=772639
version: 9

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 5964d1e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=772850
version: 10

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 5964d1e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=772896
version: 11

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 21ce6ab
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=772896
version: 11

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: a5c0a42
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=773504
version: 12

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: eb62e6a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=773504
version: 12

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e546a11
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=773504
version: 12

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 96ead1e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=773504
version: 12

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 898f55f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=773504
version: 12

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 526bc5b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=773504
version: 12

Add a hook named update_socket_protocol in __sys_socket(), for bpf
progs to attach to and update socket protocol. One user case is to
force legacy TCP apps to create and use MPTCP sockets instead of
TCP ones.

Define a mod_ret set named bpf_mptcp_fmodret_ids, add the hook
update_socket_protocol into this set, and register it in
bpf_mptcp_kfunc_init().

Closes: multipath-tcp/mptcp_net-next#79
Acked-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
When running mptcp tests simultaneously, it fails sometimes with
"Cannot create namespace file "/var/run/netns/mptcp_ns": File exists"
errors. So this patch uses rand() to generate a random netns name
instead of using the fixed name "mptcp_ns" for every test.

Add "ip netns show" after "ip netns del" to check if there is a test
did not clean up its netns

By doing that, we can re-launch the test even if there was an issue
removing the previous netns or if by accident, a netns with this
generic name already existed on the system.

Note that using a different name each will also help adding more
subtests in future commits.

Acked-by: Yonghong Song <yonghong.song@linux.dev>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Add two netns helpers for mptcp tests: create_netns() and
cleanup_netns(). Use them in test_base().

These new helpers will be re-used in the following commits introducing
new tests.

Acked-by: Yonghong Song <yonghong.song@linux.dev>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 2adbb76
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=773504
version: 12

Return libbpf_get_error(), instead of -EIO, for the error from
mptcp_sock__open_and_load().

Load success means prog_fd and map_fd are always valid. So drop these
unneeded ASSERT_GE checks for them in mptcp run_test().

Acked-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Implement a new test program mptcpify: if the family is AF_INET or
AF_INET6, the type is SOCK_STREAM, and the protocol ID is 0 or
IPPROTO_TCP, set it to IPPROTO_MPTCP. It will be hooked in
update_socket_protocol().

Extend the MPTCP test base, add a selftest test_mptcpify() for the
mptcpify case. Open and load the mptcpify test prog to mptcpify the
TCP sockets dynamically, then use start_server() and connect_to_fd()
to create a TCP socket, but actually what's created is an MPTCP
socket, which can be verified through 'getsockopt(SOL_PROTOCOL)'
and 'nstat' commands.

Acked-by: Yonghong Song <yonghong.song@linux.dev>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=773504 expired. Closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant