]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: Fix expired UDP LRU entries in XDP LB benchmark
authorPuranjay Mohan <puranjay@kernel.org>
Wed, 20 May 2026 13:33:31 +0000 (06:33 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 20 May 2026 16:25:46 +0000 (09:25 -0700)
commit12e896b9794bbd88f56aeac2a5807ae8d4bb5ad8
tree30660e2a9ab18c9c945fd6e8c598a558df924907
parentfa747e9f843ba3a0fa4d3fabaf50c9e11aaf963f
selftests/bpf: Fix expired UDP LRU entries in XDP LB benchmark

populate_lru() zero-initializes atime:

    struct real_pos_lru lru = { .pos = real_idx };

connection_table_lookup() treats UDP entries with
cur_time - atime > 30s as expired, so every pre-populated entry
expires immediately.  Calibration masks this on the CPU it runs on,
but if validation migrates to another CPU:

    [udp-v4-lru-hit] COUNTER FAIL: LRU misses=1, expected 0

Initialize atime from CLOCK_MONOTONIC for UDP flows.

Fixes: a4b5ba8187cb ("selftests/bpf: Add XDP load-balancer benchmark driver")
Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Link: https://lore.kernel.org/r/20260520133338.3392667-3-puranjay@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/benchs/bench_xdp_lb.c