v1->v2: add bugzilla tag.
Fix below warning messages: libbpf: Error in bpf_create_map_xattr(redissock_map):ERROR: strerror_r(-524)=22(-524). Retrying without BTF. rmmod: ERROR: Module localip is not currently loaded
Hengqi Chen (1): libbpf: Support uniform BTF-defined key/value specification across all BPF maps
Liu Jian (1): tools: ignore one warning message
tools/lib/bpf/libbpf.c | 24 ++++++++++++++++++++++++ tools/netacc/net-acc | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-)
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/1183 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/5...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/1183 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/5...
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7DNAP CVE: NA
--------------------------------
Ignore one warning messages: rmmod: ERROR: Module localip is not currently loaded
Signed-off-by: Liu Jian liujian56@huawei.com --- tools/netacc/net-acc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/netacc/net-acc b/tools/netacc/net-acc index f3db4803ced3..f9b6159e9854 100755 --- a/tools/netacc/net-acc +++ b/tools/netacc/net-acc @@ -27,7 +27,7 @@ if [[ "$CMD"X == "enableX" ]]; then /usr/sbin/tuned_acc/redis_acc enable elif [[ "$CMD"X == "disableX" ]]; then /usr/sbin/tuned_acc/redis_acc disable - rmmod localip + rmmod localip 2>/dev/null exit 0 else usage;
From: Hengqi Chen hengqi.chen@gmail.com
mainline inclusion from mainline-v5.16-rc1 commit f731052325efc3726577feb743c7495f880ae07d 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/?i...
--------------------------------
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 (cherry picked from commit f731052325efc3726577feb743c7495f880ae07d) Signed-off-by: Liu Jian liujian56@huawei.com
Conflicts: tools/lib/bpf/libbpf.c --- tools/lib/bpf/libbpf.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 9dd29b39010c..283881242222 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -4229,6 +4229,30 @@ static int bpf_object__create_map(struct bpf_object *obj, struct bpf_map *map) create_attr.inner_map_fd = map->inner_map_fd; }
+ switch (def->type) { + case BPF_MAP_TYPE_PERF_EVENT_ARRAY: + case BPF_MAP_TYPE_CGROUP_ARRAY: + case BPF_MAP_TYPE_STACK_TRACE: + case BPF_MAP_TYPE_ARRAY_OF_MAPS: + case BPF_MAP_TYPE_HASH_OF_MAPS: + case BPF_MAP_TYPE_DEVMAP: + case BPF_MAP_TYPE_DEVMAP_HASH: + case BPF_MAP_TYPE_CPUMAP: + case BPF_MAP_TYPE_XSKMAP: + case BPF_MAP_TYPE_SOCKMAP: + case BPF_MAP_TYPE_SOCKHASH: + case BPF_MAP_TYPE_QUEUE: + case BPF_MAP_TYPE_STACK: + case BPF_MAP_TYPE_RINGBUF: + create_attr.btf_fd = 0; + create_attr.btf_key_type_id = 0; + create_attr.btf_value_type_id = 0; + map->btf_key_type_id = 0; + map->btf_value_type_id = 0; + default: + break; + } + map->fd = bpf_create_map_xattr(&create_attr); if (map->fd < 0 && (create_attr.btf_key_type_id || create_attr.btf_value_type_id)) {