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

tcp_bpf: improve ingress redirection performance with message corking #8541

Open
wants to merge 4 commits into
base: bpf-next_base
Choose a base branch
from

Conversation

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

Pull request for series with
subject: tcp_bpf: improve ingress redirection performance with message corking
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 63817c7
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 201b62c
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 2398608
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 11ba7ce
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 236d391
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 1ffe30e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4e4136c
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 9138048
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: b123480
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4580f4e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 0ba0ef0
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: fc3ab17
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 43d9d43
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 42c5e6d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e4d68c0
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

Cong Wang and others added 4 commits February 27, 2025 10:39
The name sk_msg_alloc is misleading, that function does not allocate
sk_msg at all, it simply refills sock page frags. Rename it to
sk_msg_expand() to better reflect what it actually does.

Signed-off-by: Cong Wang <[email protected]>
Optimizing redirect ingress performance requires frequent allocation and
deallocation of sk_msg structures. Introduce a dedicated kmem_cache for
sk_msg to reduce memory allocation overhead and improve performance.

Reviewed-by: Cong Wang <[email protected]>
Signed-off-by: Zijian Zhang <[email protected]>
psock->eval can only have 4 possible values, make it 8-bit is
sufficient.

psock->redir_ingress is just a boolean, using 1 bit is enough.

Signed-off-by: Cong Wang <[email protected]>
The TCP_BPF ingress redirection path currently lacks the message corking
mechanism found in standard TCP. This causes the sender to wake up the
receiver for every message, even when messages are small, resulting in
reduced throughput compared to regular TCP in certain scenarios.

This change introduces a kernel worker-based intermediate layer to provide
automatic message corking for TCP_BPF. While this adds a slight latency
overhead, it significantly improves overall throughput by reducing
unnecessary wake-ups and reducing the sock lock contention.

Reviewed-by: Amery Hung <[email protected]>
Co-developed-by: Cong Wang <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: Zijian Zhang <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 0b93631
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=936737
version: 1

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.

0 participants