]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: xsk: Simplify packet validation in xsk tests
authorMagnus Karlsson <magnus.karlsson@intel.com>
Wed, 25 Aug 2021 09:37:15 +0000 (11:37 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 25 Aug 2021 19:22:00 +0000 (12:22 -0700)
commitb3dbbeccf434c60115d8dcff8253f568d72aa7fb
treee13085de372a506e6a1ccd32924aa2eb4c3616c8
parent2b75d0527c2d8b28e2c814eaae7d33c1bf91af4a
selftests: xsk: Simplify packet validation in xsk tests

Simplify packet validation in the xsk selftests by performing it at
once for every packet. The current code performed this per batch and
did this on copied packet data. Make it simpler and faster by
validating it at once and on the umem packet data thus skipping the
copy and the memory allocation for the temprary buffer.

The optional packet dump feature is also simplified in the same
manner. Memory allocation and copying is removed and the dump is
performed directly on the umem data.

Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210825093722.10219-10-magnus.karlsson@gmail.com
tools/testing/selftests/bpf/xdpxceiver.c
tools/testing/selftests/bpf/xdpxceiver.h