Subject: Re: [PATCH bpf-next] bpf: Add BPF-helper for accessing CLOCK_TAI

From: Kurt Kanzenbach <[email-masked]>
Date: Tue, 02 Aug 2022 09:06:44 +0200

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?

Thanks,
Kurt

[1] - https://github.com/shifty91/xdp-timestamping/tree/master/src