Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpf: Add accesses to bpf_skc_to_tcp_sock
Squash to "bpf: Add bpf_mptcp_sched_ops" II As is reported in torvalds#417 by sferlin, we can't access tcp_sock fields in BPF schedulers. I gave two suggestions in the comments of torvalds#417 to solve it: 1. Move the helpers which needs to access tcp_sock fields like tcp_packets_in_flight() into the kernel space, call the helpers in BPF context. 2. Add more helpers in the kernel space to access more tcp_sock fields, call the helpers in BPF context. Although these can solve this issue to some extent, but they aren't the best solutions. A better one is using bpf_skc_to_tcp_sock() to get the tcp_sock instead of using tcp_sk(): tp = bpf_skc_to_tcp_sock(sk); Then we can access every fields of tp and keep sferlin's patch as is. But this needs to add accesses to call bpf_skc_to_tcp_sock() in BPF schedulers. Closes: multipath-tcp/mptcp_net-next#417 Cc: [email protected] Signed-off-by: Geliang Tang <[email protected]>
- Loading branch information