libbpf: Support uniform BTF-defined key/value specification across all BPF maps
authorHengqi Chen <hengqi.chen@gmail.com>
Thu, 30 Sep 2021 16:14:55 +0000 (00:14 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 1 Oct 2021 22:31:50 +0000 (15:31 -0700)
commitf731052325efc3726577feb743c7495f880ae07d
tree07095a22878b49ae0d27e990a0276c06a5717369
parent7bceeb95726b105bd4241c9635acc0836df675d4
libbpf: Support uniform BTF-defined key/value specification across all BPF maps

A bunch of BPF maps do not support specifying BTF types for key and value.
This is non-uniform and inconvenient[0]. Currently, libbpf uses a retry
logic which removes BTF type IDs when BPF map creation failed. Instead
of retrying, this commit recognizes those specialized maps and removes
BTF type IDs when creating BPF map.

  [0] Closes: https://github.com/libbpf/libbpf/issues/355

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210930161456.3444544-2-hengqi.chen@gmail.com
tools/lib/bpf/libbpf.c