bpf: Add lookup_and_delete_elem support to hashtab
authorDenis Salopek <denis.salopek@sartura.hr>
Tue, 11 May 2021 21:00:04 +0000 (23:00 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 24 May 2021 20:30:26 +0000 (13:30 -0700)
commit3e87f192b405960c0fe83e0925bd0dadf4f8cf43
treeab5d250191d057ff1d0a166c400334df841505e3
parentf9bceaa59c5c47a8a08f48e19cbe887e500a1978
bpf: Add lookup_and_delete_elem support to hashtab

Extend the existing bpf_map_lookup_and_delete_elem() functionality to
hashtab map types, in addition to stacks and queues.
Create a new hashtab bpf_map_ops function that does lookup and deletion
of the element under the same bucket lock and add the created map_ops to
bpf.h.

Signed-off-by: Denis Salopek <denis.salopek@sartura.hr>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/4d18480a3e990ffbf14751ddef0325eed3be2966.1620763117.git.denis.salopek@sartura.hr
include/linux/bpf.h
include/uapi/linux/bpf.h
kernel/bpf/hashtab.c
kernel/bpf/syscall.c
tools/include/uapi/linux/bpf.h