From: Song Yoong Siang Date: Sun, 3 Mar 2024 08:32:24 +0000 (+0800) Subject: selftests/bpf: xdp_hw_metadata reduce sleep interval X-Git-Tag: v6.9-rc1~159^2~2^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01031fd473059bf69bb6edc6d51d4bd58ad92e50;p=thirdparty%2Fkernel%2Flinux.git selftests/bpf: xdp_hw_metadata reduce sleep interval In current ping-pong design, xdp_hw_metadata will wait until the packet transmission completely done, then only start to receive the next packet. The current sleep interval is 10ms, which is unnecessary large. Typically, a NIC does not need such a long time to transmit a packet. Furthermore, during this 10ms sleep time, the app is unable to receive incoming packets. Therefore, this commit reduce sleep interval to 10us, so that xdp_hw_metadata is able to support periodic packets with shorter interval. 10us * 500 = 5ms should be enough for packet transmission and status retrieval. Signed-off-by: Song Yoong Siang Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20240303083225.1184165-2-yoong.siang.song@intel.com --- diff --git a/tools/testing/selftests/bpf/xdp_hw_metadata.c b/tools/testing/selftests/bpf/xdp_hw_metadata.c index 878d68db03256..bdf5d8180067f 100644 --- a/tools/testing/selftests/bpf/xdp_hw_metadata.c +++ b/tools/testing/selftests/bpf/xdp_hw_metadata.c @@ -480,7 +480,7 @@ peek: for (int j = 0; j < 500; j++) { if (complete_tx(xsk, clock_id)) break; - usleep(10*1000); + usleep(10); } } }