OSDN Git Service

selftests: xsk: Change interleaving of packets in unaligned mode
authorMagnus Karlsson <magnus.karlsson@intel.com>
Wed, 22 Sep 2021 07:56:12 +0000 (09:56 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 27 Sep 2021 22:18:35 +0000 (00:18 +0200)
commite4e9baf06a6ea6cfbf69db4c3766a0879329dda2
treee60f101507807392c651ebcf04db90a72254c018
parent96a40678ce5390cd8515ff32e55ad932fd1fa328
selftests: xsk: Change interleaving of packets in unaligned mode

Change the interleaving of packets in unaligned mode. With the current
buffer addresses in the packet stream, the last buffer in the umem
could not be used as a large packet could potentially write over the
end of the umem. The kernel correctly threw this buffer address away
and refused to use it. This is perfectly fine for all regular packet
streams, but the ones used for unaligned mode have every other packet
being at some different offset. As we will add checks for correct
offsets in the next patch, this needs to be fixed. Just start these
page-boundary straddling buffers one page earlier so that the last
one is not on the last page of the umem, making all buffers valid.

Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210922075613.12186-13-magnus.karlsson@gmail.com
tools/testing/selftests/bpf/xdpxceiver.c