selftests/bpf: Check bpf_sk_storage has uncharged sk_omem_alloc
authorMartin KaFai Lau <martin.lau@kernel.org>
Fri, 1 Sep 2023 23:11:29 +0000 (16:11 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 6 Sep 2023 09:08:47 +0000 (11:08 +0200)
commita96d1cfb2da040bdf692d22022371b249742abb2
treea310d28eccbff265cff894c14d51756474e04d25
parent55d49f750b1cb1f177fb1b00ae02cba4613bcfb7
selftests/bpf: Check bpf_sk_storage has uncharged sk_omem_alloc

This patch checks the sk_omem_alloc has been uncharged by bpf_sk_storage
during the __sk_destruct.

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230901231129.578493-4-martin.lau@linux.dev
tools/testing/selftests/bpf/prog_tests/sk_storage_omem_uncharge.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/bpf_tracing_net.h
tools/testing/selftests/bpf/progs/sk_storage_omem_uncharge.c [new file with mode: 0644]