bpf: Clarify batch lookup/lookup_and_delete semantics
authorMartin Kelly <martin.kelly@crowdstrike.com>
Wed, 21 Feb 2024 21:18:38 +0000 (13:18 -0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 22 Feb 2024 18:24:38 +0000 (10:24 -0800)
commit58fd62e0aa50fdd20bc41a01e787001f3af8a925
tree1fb68a2bc562186287c461a7c1382697e8e19b69
parent89ee838130f470afcd02b30ca868f236a3f3b1d2
bpf: Clarify batch lookup/lookup_and_delete semantics

The batch lookup and lookup_and_delete APIs have two parameters,
in_batch and out_batch, to facilitate iterative
lookup/lookup_and_deletion operations for supported maps. Except NULL
for in_batch at the start of these two batch operations, both parameters
need to point to memory equal or larger than the respective map key
size, except for various hashmaps (hash, percpu_hash, lru_hash,
lru_percpu_hash) where the in_batch/out_batch memory size should be
at least 4 bytes.

Document these semantics to clarify the API.

Signed-off-by: Martin Kelly <martin.kelly@crowdstrike.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20240221211838.1241578-1-martin.kelly@crowdstrike.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
include/uapi/linux/bpf.h
tools/include/uapi/linux/bpf.h
tools/lib/bpf/bpf.h