bpf: Force to MPTCP
Status from this message: This series was applied to bpf/bpf-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v14 Latest4 patches 3 repliesApplied 4/4
- v134 patches 3 repliesSuperseded
- v125 patches 0 repliesSuperseded
Earlier versions · 11
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v11 | 5 patches | 11 replies | Superseded | |
| v10 | 5 patches | 3 replies | Superseded | |
| v9 | 4 patches | 7 replies | Superseded | |
| v8 | 4 patches | 5 replies | Superseded | |
| v7 RFC | 6 patches | 5 replies | Superseded | |
| v6 RFC | 1 patch | 1 reply | Superseded | |
| v5 RFC | 1 patch | 6 replies | Superseded | |
| v4 | 7 patches | 3 replies | Superseded | |
| v3 | 5 patches | 1 reply | Superseded | |
| v2 | 4 patches | 1 reply | Superseded | |
| v1 | 4 patches | 10 replies | Superseded |
Changes in v14 from the cover letter
- Use getsockopt(MPTCP_INFO) to verify mptcp protocol intead of using
nstat command.
Patches in v14 All 4 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | bpf: Add update_socket_protocol hooknet/ net/ | +40 | 2 replies | Applied |
| 2/4 | selftests/bpf: Add two mptcp netns helperstools/ | +21 | 0 replies | Applied |
| 3/4 | selftests/bpf: Fix error checks of mptcp open_and_loadtools/ | +1 | 0 replies | Applied |
| 4/4 | selftests/bpf: Add mptcpify testtools/ tools/ | +136 | 1 reply | Applied |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Matthieu Baerts | Yonghong Song |
|---|---|---|
| 1/4 | A-b | A-b |
| 2/4 | R-b | A-b |
| 3/4 | A-b | |
| 4/4 | R-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf-next v14 0/4] bpf: Force to MPTCP
As is described in the "How to use MPTCP?" section in MPTCP wiki [1]:
"Your app should create sockets with IPPROTO_MPTCP as the proto:
( socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP); ). Legacy apps can be forced to create and use MPTCP sockets instead of TCP ones via the mptcpize command bundled with the mptcpd daemon."
But the mptcpize (LD_PRELOAD technique) command has some limitations [2]:
- it doesn't work if the application is not using libc (e.g. GoLang
apps)
- in some envs, it might not be easy to set env vars / change the way
apps are launched, e.g. on Android
- mptcpize needs to be launched with all apps that want MPTCP: we could
have more control from BPF to enable MPTCP only for some apps or all the ones of a netns or a cgroup, etc.
- it is not in BPF, we cannot talk about it at netdev conf.
So this patchset attempts to use BPF to implement functions similer to mptcpize.
The main idea is to add a hook in sys_socket() to change the protocol id from IPPROTO_TCP (or 0) to IPPROTO_MPTCP.
[1]
https://github.com/multipath-tcp/mptcp_net-next/wiki
[2]
https://github.com/multipath-tcp/mptcp_net-next/issues/79
v14:
- Use getsockopt(MPTCP_INFO) to verify mptcp protocol intead of using
nstat command.
v13:
- drop "Use random netns name for mptcp" patch.
v12:
- update diag_* log of update_socket_protocol.
- add 'ip netns show' after 'ip netns del' to check if there is
a test did not clean up its netns.
- return libbpf_get_error() instead of -EIO for the error fromopen_and_load().
- Use getsockopt(SOL_PROTOCOL) to verify mptcp protocol intead of
using 'ss -tOni'.
v11:
- add comments about outputs of 'ss' and 'nstat'.
- use "err = verify_mptcpify()" instead of using =+.
v10:
- drop "#ifdef CONFIG_BPF_JIT".
- include vmlinux.h and bpf_tracing_net.h to avoid defining some
macros.
- drop unneeded checks for mptcp.
v9:
- update comment for 'update_socket_protocol'.
v8:
- drop the additional checks on the 'protocol' value after the
'update_socket_protocol()' call.
v7:
- add __weak and __diag_* for update_socket_protocol.
v6:
- add update_socket_protocol.
v5:
- add bpf_mptcpify helper.
v4:
- use lsm_cgroup/socket_create
v3:
- patch 8: char cmd[128]; -> char cmd[256];
v2:
- Fix build selftests errors reported by CI
Geliang Tang (4):
bpf: Add update_socket_protocol hook selftests/bpf: Add two mptcp netns helpers selftests/bpf: Fix error checks of mptcp open_and_load selftests/bpf: Add mptcpify test
net/mptcp/bpf.c | 15 ++ net/socket.c | 26 ++- .../testing/selftests/bpf/prog_tests/mptcp.c | 155 +++++++++++++++--- tools/testing/selftests/bpf/progs/mptcpify.c | 20 +++ 4 files changed, 196 insertions(+), 20 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/mptcpify.c
Signature · 1 line
2.35.3