On 10/16/26 5:25 AM, Qiliang Yuan wrote:
tc_netkit_scrub attaches tc8 to the primary netkit device, sends an ICMP
echo with a mark and a priority through it, and checks the mark and the
priority that tc8 saw against what the scrub mode lets through.

tc8 records the mark and priority of every packet it sees, and the
device also carries what the system sends on its own once the device
is up, like IPv6 neighbor discovery or the mDNS of avahi-daemon. When
such a packet goes out after the echo, it overwrites what tc8 recorded,
and the test finds a mark and a priority of 0.

Record only IPv4 ICMP packets in tc8.

tc_netkit_scrub run 100 times on a bpf-next kernel with KASAN enabled,
x86_64 VM with 32 vCPUs and avahi-daemon running, before and after this
patch:

             before                                after
   outcome   2 of 100 failed (mark and priority 0)   0 of 100 failed

Fixes: 716fa7dadf11 ("selftests/bpf: Extend netkit tests to validate skb meta 
data")
Signed-off-by: Qiliang Yuan <[email protected]>
---
V1 -> V2:
- Check the packet in tc8 the way tc1 and tc7 do, with
   __bpf_constant_htons() and a goto out for each check (Daniel)
- Add before/after data
Looks good, took this into bpf-next, thanks!

Reply via email to