linux/tools/testing
Kumar Kartikeya Dwivedi ac9f06050a bpf: Introduce bpf_obj_drop
Introduce bpf_obj_drop, which is the kfunc used to free allocated
objects (allocated using bpf_obj_new). Pairing with bpf_obj_new, it
implicitly destructs the fields part of object automatically without
user intervention.

Just like the previous patch, btf_struct_meta that is needed to free up
the special fields is passed as a hidden argument to the kfunc.

For the user, a convenience macro hides over the kernel side kfunc which
is named bpf_obj_drop_impl.

Continuing the previous example:

void prog(void) {
	struct foo *f;

	f = bpf_obj_new(typeof(*f));
	if (!f)
		return;
	bpf_obj_drop(f);
}

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20221118015614.2013203-15-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2022-11-17 19:22:14 -08:00
..
crypto/chacha20-s390 tools/testing/crypto: Use vzalloc instead of vmalloc+memset 2022-07-05 14:46:36 +02:00
cxl tools/testing/cxl: Add a single-port host-bridge regression config 2022-11-04 16:01:24 -07:00
fault-injection
ktest
kunit kunit: tool: Don't download risc-v opensbi firmware with wget 2022-10-07 10:16:28 -06:00
memblock memblock: test suite improvements 2022-10-11 20:48:55 -07:00
nvdimm ndtest: Cleanup all of blk namespace specific code 2022-07-12 17:57:55 -07:00
radix-tree lib/test_maple_tree: add testing for maple tree 2022-09-26 19:46:14 -07:00
scatterlist
selftests bpf: Introduce bpf_obj_drop 2022-11-17 19:22:14 -08:00
vsock vsock_test: POLLIN + SO_RCVLOWAT test 2022-08-23 10:43:12 +02:00