Re: [PATCH bpf-next v2] selftests/bpf: Time tc_edt from its first packet with data
From: Alexis Lothoré
Date: Tue Oct 20 2026 - 04:55:06 EST
Hi Qiliang,
On Mon Oct 19, 2026 at 8:35 AM CEST, Qiliang Yuan wrote:
> tc_edt sends 1MB over a TCP connection that a BPF program shapes with
> EDT, and checks that the rate it measures is within 2% of the target
> rate. The transfer takes about 200ms, so the margin is about 4ms.
>
> The measurement starts before send_recv_data(), which first creates the
> sender thread and accepts the connection. On a KASAN kernel, x86_64 VM
> with 32 vCPUs, that takes 0.7ms when idle and up to 4.7ms with all
> CPUs busy, while the BPF program spreads the data over 200.08ms in the
> median. The test also fails without test_progs -j where everything runs
> slower, e.g. on s390x and with ASAN in BPF CI.
>
> Have the BPF program note when the first packet with data goes out, and
> start the measurement there.
>
> tc_edt run 100 times on the same VM, idle and with 32 busy loops in the
> background, before and after this patch:
>
> before after
> idle 0 of 100 failed 0 of 100 failed
> busy loops 3 of 100 failed 0 of 100 failed
>
> Fixes: b0f82e7ab6fb ("selftests/bpf: integrate test_tc_edt into test_progs")
> Signed-off-by: Qiliang Yuan <odys.yuan@xxxxxxxxx>
I still suspect that it will not solve the flakyness for every setup and
that it probably deserves a margin increase anyway, but the updated
measurement looks like a reasonable improvement to me.
Reviewed-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@xxxxxxxxxxx>
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com