]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
bpf: Allow __sk_buff tstamp in BPF_PROG_TEST_RUN
authorStanislav Fomichev <sdf@google.com>
Tue, 15 Oct 2019 18:31:24 +0000 (11:31 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 15 Oct 2019 23:24:26 +0000 (16:24 -0700)
commitba94094818a811758570990648160a6ba2ca05cb
tree3617cb0fba9170b15e8f3f2c0ad7bfae8c28f5ce
parentda927466a152a9497c05926a95c6aebba6d3ad5b
bpf: Allow __sk_buff tstamp in BPF_PROG_TEST_RUN

It's useful for implementing EDT related tests (set tstamp, run the
test, see how the tstamp is changed or observe some other parameter).

Note that bpf_ktime_get_ns() helper is using monotonic clock, so for
the BPF programs that compare tstamp against it, tstamp should be
derived from clock_gettime(CLOCK_MONOTONIC, ...).

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20191015183125.124413-1-sdf@google.com
net/bpf/test_run.c