On Tue, Aug 2, 2022 at 12:06 AM Kurt Kanzenbach <kurt@xxxxxxxxxxxxx> wrote: > > Hi Alexei, > > On Tue Jun 07 2022, Alexei Starovoitov wrote: > > Anyway I guess new helper bpf_ktime_get_tai_ns() is ok, since > > it's so trivial, but selftest is necessary. > > So, I did write a selftest [1] for testing bpf_ktime_get_tai_ns() and > verifying that the access to the clock works. It uses AF_XDP sockets and > timestamps the incoming packets. The timestamps are then validated in > user space. > > Since AF_XDP related code is migrating from libbpf to libxdp, I'm > wondering if that sample fits into the kernel's selftests or not. What > kind of selftest are you looking for? Please use selftests/bpf framework. There are plenty of networking tests in there. bpf_ktime_get_tai_ns() doesn't have to rely on af_xdp. It can be skb based.