OSDN Git Service

bpf/tests: Add more BPF_END byte order conversion tests
authorJohan Almbladh <johan.almbladh@anyfinetworks.com>
Tue, 14 Sep 2021 09:18:40 +0000 (11:18 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 28 Sep 2021 07:26:29 +0000 (09:26 +0200)
commitf536a7c80675e4875e50df9182881d7678e27651
tree514fbff805632ee326ad383ad0202a07b0aa2b90
parentf1517eb790f97c1326016eb164a33a64d4d4fb7a
bpf/tests: Add more BPF_END byte order conversion tests

This patch adds tests of the high 32 bits of 64-bit BPF_END conversions.

It also adds a mirrored set of tests where the source bytes are reversed.
The MSB of each byte is now set on the high word instead, possibly
affecting sign-extension during conversion in a different way. Mainly
for JIT testing.

Signed-off-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210914091842.4186267-13-johan.almbladh@anyfinetworks.com
lib/test_bpf.c