tests/net/bpf: skip the bpf:inject test when RSS is presentWith RSS the epair(4) may reorder packets making the test flaky. Seenet/if_epair.c:epair_select_queue().
tests/net/bpf: hexdump(3) the packets if compare fails
bpf/tests: Run tests in an execenv jailOtherwise the tests cannot be run in parallel since they createidentically named jails.Fixes: dd49816b0d66 ("bpf: avoid panic on multiple readers")
tests/net: add some bpf(4) testsA test helper program pcap-test allows to capture, inject and compare.Build a simple test case on top of it. More test cases can be easilyconstructed.
bpf: avoid panic on multiple readersIf we have multiple simultaneous readers on a single /dev/bpf fd it's possiblefor the assertion after the bpf_uiomove() in bpfread() to fail.Note that the bpf
bpf: avoid panic on multiple readersIf we have multiple simultaneous readers on a single /dev/bpf fd it's possiblefor the assertion after the bpf_uiomove() in bpfread() to fail.Note that the bpf_uiomove() is done outside of the BPFD_LOCK, because uiomovemay sleep. As a result it's possible for another thread to have alreadyreclaimed toe bd_hbuf, thus causing us to fail the assertion.Even without INVARIANTS this may provoke panics.That results (with INVARIANTS) in a panic such as: login: panic: bpfread: lost bd_hbuf cpuid = 13 time = 1740567635 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe003972db10 vpanic() at vpanic+0x136/frame 0xfffffe003972dc40 panic() at panic+0x43/frame 0xfffffe003972dca0 bpfread() at bpfread+0x2e8/frame 0xfffffe003972dce0 devfs_read_f() at devfs_read_f+0xe4/frame 0xfffffe003972dd40 dofileread() at dofileread+0x80/frame 0xfffffe003972dd90 sys_read() at sys_read+0xb7/frame 0xfffffe003972de00 amd64_syscall() at amd64_syscall+0x15a/frame 0xfffffe003972df30 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe003972df30 --- syscall (3, FreeBSD ELF64, read), rip = 0x302787166afa, rsp = 0x302782638a78, rbp = 0x302782638aa0 ---Also add a test case replicating the known trigger for this panic.Sponsored by: Rubicon Communications, LLC ("Netgate")Differential Revision: https://reviews.freebsd.org/D49135
show more ...