diff options
| author | Philo Lu <[email protected]> | 2024-04-25 16:17:24 +0000 |
|---|---|---|
| committer | Martin KaFai Lau <[email protected]> | 2024-04-25 21:09:05 +0000 |
| commit | 7eb4f66b38069eec9c86c9d115f0bba1cf73ef2c (patch) | |
| tree | 90f30033f73d8801ca45d1ac453134c80b65b4db /tools/testing/selftests/bpf/progs/tcp_rtt.c | |
| parent | bpf: add mrtt and srtt as BPF_SOCK_OPS_RTT_CB args (diff) | |
| download | kernel-7eb4f66b38069eec9c86c9d115f0bba1cf73ef2c.tar.gz kernel-7eb4f66b38069eec9c86c9d115f0bba1cf73ef2c.zip | |
selftests/bpf: extend BPF_SOCK_OPS_RTT_CB test for srtt and mrtt_us
Because srtt and mrtt_us are added as args in bpf_sock_ops at
BPF_SOCK_OPS_RTT_CB, a simple check is added to make sure they are both
non-zero.
$ ./test_progs -t tcp_rtt
#373 tcp_rtt:OK
Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED
Suggested-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Philo Lu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin KaFai Lau <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/tcp_rtt.c')
| -rw-r--r-- | tools/testing/selftests/bpf/progs/tcp_rtt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/tcp_rtt.c b/tools/testing/selftests/bpf/progs/tcp_rtt.c index 0988d79f1587..42c729f85524 100644 --- a/tools/testing/selftests/bpf/progs/tcp_rtt.c +++ b/tools/testing/selftests/bpf/progs/tcp_rtt.c @@ -10,6 +10,9 @@ struct tcp_rtt_storage { __u32 delivered; __u32 delivered_ce; __u32 icsk_retransmits; + + __u32 mrtt_us; /* args[0] */ + __u32 srtt; /* args[1] */ }; struct { @@ -55,5 +58,8 @@ int _sockops(struct bpf_sock_ops *ctx) storage->delivered_ce = tcp_sk->delivered_ce; storage->icsk_retransmits = tcp_sk->icsk_retransmits; + storage->mrtt_us = ctx->args[0]; + storage->srtt = ctx->args[1]; + return 1; } |
