OSDN Git Service

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)
commit0d41f59f458a4f08353f7aba64bbc6388a858265
treee13085de372a506e6a1ccd32924aa2eb4c3616c8
parent9da2ea4fe8d10060a417a71f808df7e825660867
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