Skip to content

Commit 01031fd

Browse files
yoongsiang2borkmann
authored andcommitted
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 <yoong.siang.song@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Stanislav Fomichev <sdf@google.com> Link: https://lore.kernel.org/bpf/20240303083225.1184165-2-yoong.siang.song@intel.com
1 parent 8f79870 commit 01031fd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/testing/selftests/bpf/xdp_hw_metadata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ static int verify_metadata(struct xsk *rx_xsk, int rxq, int server_fd, clockid_t
480480
for (int j = 0; j < 500; j++) {
481481
if (complete_tx(xsk, clock_id))
482482
break;
483-
usleep(10*1000);
483+
usleep(10);
484484
}
485485
}
486486
}

0 commit comments

Comments
 (0)