Skip to content

bpf, sockmap: Introduce tracing capability for sockmap #8763

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

Closed

Conversation

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

Pull request for series with
subject: bpf, sockmap: Introduce tracing capability for sockmap
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=951492

@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 527b33d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=951492
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 967e8de
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=951492
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 690d43d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=951492
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: a27a97f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=952401
version: 2

@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6aca583
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=953164
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: b9c09fb
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=953164
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 60400cd
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=953164
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4cc2048
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=953164
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 46eb012
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=953164
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 91dbac4
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=953164
version: 3

mrpre added 2 commits April 28, 2025 08:58
Sockmap has the same high-performance forwarding capability as XDP, but
operates at Layer 7.

Introduce tracing capability for sockmap, to trace the execution results
of BPF programs without modifying the programs themselves, similar to
the existing trace_xdp_redirect{_map}.

It is crucial for debugging sockmap programs, especially in production
environments.

Additionally, the new header file has to be added to bpf_trace.h to
automatically generate tracepoints.

Test results:
$ echo "1" > /sys/kernel/tracing/events/sockmap/enable

msg/skb:
'''
sockmap_redirect: sk=000000000ec02a93, netns=4026531840, inode=318, \
family=2, protocol=6, prog_id=59, len=8192, type=msg, action=REDIRECT, \
redirect_type=ingress

sockmap_redirect: sk=00000000d5d9c931, netns=4026531840, inode=64731, \
family=2, protocol=6, prog_id=91, len=8221, type=skb, action=REDIRECT, \
redirect_type=egress

sockmap_redirect: sk=00000000106fc281, netns=4026531840, inode=64729, \
family=2, protocol=6, prog_id=94, len=8192, type=msg, action=PASS, \
redirect_type=none
'''

strparser:
'''
sockmap_strparser: sk=00000000f15fc1c8, netns=4026531840, inode=52396, \
family=2, protocol=6, prog_id=143, in_len=1000, full_len=10
'''

Suggested-by: Jakub Sitnicki <[email protected]>
Suggested-by: Cong Wang <[email protected]>
Suggested-by: Steven Rostedt <[email protected]>
Signed-off-by: Jiayuan Chen <[email protected]>
Reviewed-by: Cong Wang <[email protected]>
This commit relocates the BPF tracepoint definitions for XDP and sockmap
from the kernel directory to net/bpf.

This ensures that these tracepoints are controlled by the CONFIG_NET,
avoiding unnecessary function definitions when the CONFIG_NET is disabled.
Additionally, it prevents build failures caused by the use of net module
functions when CONFIG_NET is not enabled.

Signed-off-by: Jiayuan Chen <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 224ee86
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=953164
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=952401 irrelevant now. 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