Commit 9992d63e authored by Hengqi Chen's avatar Hengqi Chen Committed by Liu Jian
Browse files

libbpf: Support uniform BTF-defined key/value specification across all BPF maps

mainline inclusion
from mainline-v5.16-rc1
commit f7310523
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7DNAP
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f731052325efc3726577feb743c7495f880ae07d

--------------------------------

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: default avatarHengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210930161456.3444544-2-hengqi.chen@gmail.com


(cherry picked from commit f7310523)
Signed-off-by: default avatarLiu Jian <liujian56@huawei.com>

Conflicts:
	tools/lib/bpf/libbpf.c
parent 276d5fca
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment