]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix xdpxceiver failures for no hugepages
authorTirthendu Sarkar <tirthendu.sarkar@intel.com>
Wed, 17 Nov 2021 12:36:13 +0000 (18:06 +0530)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 17 Nov 2021 22:49:10 +0000 (23:49 +0100)
commit9762321f0bfc91b45c1c4127383c4488d4251bb6
tree12af1a40f22771114622ca036f1c4ff059625f60
parent485d2ec4aefc081a7455684e7f3a062a8cb12ec6
selftests/bpf: Fix xdpxceiver failures for no hugepages

xsk_configure_umem() needs hugepages to work in unaligned mode. So when
hugepages are not configured, 'unaligned' tests should be skipped which
is determined by the helper function hugepages_present(). This function
erroneously returns true with MAP_NORESERVE flag even when no hugepages
are configured. The removal of this flag fixes the issue.

The test TEST_TYPE_UNALIGNED_INV_DESC also needs to be skipped when
there are no hugepages. However, this was not skipped as there was no
check for presence of hugepages and hence was failing. The check to skip
the test has now been added.

Fixes: 7efaa0d33c13 (selftests: xsk: Add test for unaligned mode)
Signed-off-by: Tirthendu Sarkar <tirthendu.sarkar@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211117123613.22288-1-tirthendu.sarkar@intel.com
tools/testing/selftests/bpf/xdpxceiver.c