Skip to content

bpf: TCP RTT sock_ops bpf callback

Stanislav Fomichev bpf netdev 2 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 5 repliesApplied
  2. v18 patches 8 repliesSuperseded

Changes in v2 from the cover letter

* add a comment about second accept() in selftest (Yonghong Song)
* refer to tcp_bpf.readme in sample program (Yonghong Song)

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/8bpf: add BPF_CGROUP_SOCK_OPS callback that is executed on every RTTinclude/net/tcp.h include/uapi/linux/bpf.h net/ipv4/tcp_input.c+17 -10 replies
2/8bpf: split shared bpf_tcp_sock and bpf_sock_ops implementationnet/core/filter.c+126 -540 replies
3/8bpf: add dsack_dups/delivered{,_ce} to bpf_tcp_sockinclude/uapi/linux/bpf.h net/core/filter.c+15 -10 replies
4/8bpf: add icsk_retransmits to bpf_tcp_sockinclude/uapi/linux/bpf.h net/core/filter.c+20 -10 replies
5/8bpf/tools: sync bpf.htools/include/uapi/linux/bpf.h+11 -10 replies
6/8selftests/bpf: test BPF_SOCK_OPS_RTT_CBtools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/progs/tcp_rtt.c tools/testing/selftests/bpf/test_tcp_rtt.c+317 -12 replies
7/8samples/bpf: add sample program that periodically dumps TCP statssamples/bpf/Makefile samples/bpf/tcp_dumpstats_kern.c+69 -00 replies
8/8samples/bpf: fix tcp_bpf.readme detach commandsamples/bpf/tcp_bpf.readme+1 -10 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchSoheil Hassas YeganehYuchung ChengYonghong SongLawrence Brakmo
SeriesA-b A-b A-b A-b A-b
1/8A-b A-b
2/8A-b A-b
3/8A-b A-b
4/8A-b A-b
5/8A-b A-b
6/8A-b A-b
7/8A-b A-b
8/8A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/8] bpf: TCP RTT sock_ops bpf callback

Congestion control team would like to have a periodic callback to track some TCP statistics. Let's add a sock_ops callback that can be selectively enabled on a socket by socket basis and is executed for every RTT. BPF program frequency can be further controlled by calling bpf_ktime_get_ns and bailing out early.

I run neper tcp_stream and tcp_rr tests with the sample program from the last patch and didn't observe any noticeable performance difference.

v2:
* add a comment about second accept() in selftest (Yonghong Song)
* refer to tcp_bpf.readme in sample program (Yonghong Song)

Stanislav Fomichev (8):
bpf: add BPF_CGROUP_SOCK_OPS callback that is executed on every RTT
bpf: split shared bpf_tcp_sock and bpf_sock_ops implementation
bpf: add dsack_dups/delivered{,_ce} to bpf_tcp_sock
bpf: add icsk_retransmits to bpf_tcp_sock
bpf/tools: sync bpf.h
selftests/bpf: test BPF_SOCK_OPS_RTT_CB
samples/bpf: add sample program that periodically dumps TCP stats samples/bpf: fix tcp_bpf.readme detach command

 include/net/tcp.h                           |   8 +
 include/uapi/linux/bpf.h                    |  12 +-
 net/core/filter.c                           | 207 +++++++++++-----
 net/ipv4/tcp_input.c                        |   4 +
 samples/bpf/Makefile                        |   1 +
 samples/bpf/tcp_bpf.readme                  |   2 +-
 samples/bpf/tcp_dumpstats_kern.c            |  68 ++++++
 tools/include/uapi/linux/bpf.h              |  12 +-
 tools/testing/selftests/bpf/Makefile        |   3 +-
 tools/testing/selftests/bpf/progs/tcp_rtt.c |  61 +++++
 tools/testing/selftests/bpf/test_tcp_rtt.c  | 254 ++++++++++++++++++++
 11 files changed, 574 insertions(+), 58 deletions(-)
 create mode 100644 samples/bpf/tcp_dumpstats_kern.c
 create mode 100644 tools/testing/selftests/bpf/progs/tcp_rtt.c
 create mode 100644 tools/testing/selftests/bpf/test_tcp_rtt.c
Signature · 1 line
2.22.0.410.gd8fdbe21b5-goog