BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next] libbpf: deprecate forgotten btf__get_map_kv_tids()
@ 2022-02-03 22:50 Andrii Nakryiko
  2022-02-03 23:23 ` Yonghong Song
  2022-02-04  0:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2022-02-03 22:50 UTC (permalink / raw)
  To: bpf, ast, daniel; +Cc: andrii, kernel-team, Dave Marchevsky, Yonghong Song

btf__get_map_kv_tids() is in the same group of APIs as
btf_ext__reloc_func_info()/btf_ext__reloc_line_info() which were only
used by BCC. It was missed to be marked as deprecated in [0]. Fixing
that to complete [1].

  [0] https://patchwork.kernel.org/project/netdevbpf/patch/20220201014610.3522985-1-davemarchevsky@fb.com/
  [1] Closes: https://github.com/libbpf/libbpf/issues/277

Cc: Dave Marchevsky <davemarchevsky@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
 tools/lib/bpf/btf.h    | 1 +
 tools/lib/bpf/libbpf.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/tools/lib/bpf/btf.h b/tools/lib/bpf/btf.h
index b10729fd830c..951ac7475794 100644
--- a/tools/lib/bpf/btf.h
+++ b/tools/lib/bpf/btf.h
@@ -150,6 +150,7 @@ LIBBPF_API void btf__set_fd(struct btf *btf, int fd);
 LIBBPF_API const void *btf__raw_data(const struct btf *btf, __u32 *size);
 LIBBPF_API const char *btf__name_by_offset(const struct btf *btf, __u32 offset);
 LIBBPF_API const char *btf__str_by_offset(const struct btf *btf, __u32 offset);
+LIBBPF_DEPRECATED_SINCE(0, 7, "this API is not necessary when BTF-defined maps are used")
 LIBBPF_API int btf__get_map_kv_tids(const struct btf *btf, const char *map_name,
 				    __u32 expected_key_size,
 				    __u32 expected_value_size,
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 81605de8654e..904cdf83002b 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -4202,9 +4202,12 @@ static int bpf_map_find_btf_info(struct bpf_object *obj, struct bpf_map *map)
 
 	if (!bpf_map__is_internal(map)) {
 		pr_warn("Use of BPF_ANNOTATE_KV_PAIR is deprecated, use BTF-defined maps in .maps section instead\n");
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 		ret = btf__get_map_kv_tids(obj->btf, map->name, def->key_size,
 					   def->value_size, &key_type_id,
 					   &value_type_id);
+#pragma GCC diagnostic pop
 	} else {
 		/*
 		 * LLVM annotates global data differently in BTF, that is,
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] libbpf: deprecate forgotten btf__get_map_kv_tids()
  2022-02-03 22:50 [PATCH bpf-next] libbpf: deprecate forgotten btf__get_map_kv_tids() Andrii Nakryiko
@ 2022-02-03 23:23 ` Yonghong Song
  2022-02-04  0:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2022-02-03 23:23 UTC (permalink / raw)
  To: Andrii Nakryiko, bpf, ast, daniel; +Cc: kernel-team, Dave Marchevsky



On 2/3/22 2:50 PM, Andrii Nakryiko wrote:
> btf__get_map_kv_tids() is in the same group of APIs as
> btf_ext__reloc_func_info()/btf_ext__reloc_line_info() which were only
> used by BCC. It was missed to be marked as deprecated in [0]. Fixing
> that to complete [1].
> 
>    [0] https://patchwork.kernel.org/project/netdevbpf/patch/20220201014610.3522985-1-davemarchevsky@fb.com/
>    [1] Closes: https://github.com/libbpf/libbpf/issues/277
> 
> Cc: Dave Marchevsky <davemarchevsky@fb.com>
> Cc: Yonghong Song <yhs@fb.com>
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>

Acked-by: Yonghong Song <yhs@fb.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] libbpf: deprecate forgotten btf__get_map_kv_tids()
  2022-02-03 22:50 [PATCH bpf-next] libbpf: deprecate forgotten btf__get_map_kv_tids() Andrii Nakryiko
  2022-02-03 23:23 ` Yonghong Song
@ 2022-02-04  0:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-02-04  0:10 UTC (permalink / raw)
  To: Andrii Nakryiko; +Cc: bpf, ast, daniel, kernel-team, davemarchevsky, yhs

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Thu, 3 Feb 2022 14:50:17 -0800 you wrote:
> btf__get_map_kv_tids() is in the same group of APIs as
> btf_ext__reloc_func_info()/btf_ext__reloc_line_info() which were only
> used by BCC. It was missed to be marked as deprecated in [0]. Fixing
> that to complete [1].
> 
>   [0] https://patchwork.kernel.org/project/netdevbpf/patch/20220201014610.3522985-1-davemarchevsky@fb.com/
>   [1] Closes: https://github.com/libbpf/libbpf/issues/277
> 
> [...]

Here is the summary with links:
  - [bpf-next] libbpf: deprecate forgotten btf__get_map_kv_tids()
    https://git.kernel.org/bpf/bpf-next/c/227a0713b319

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-04  0:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-03 22:50 [PATCH bpf-next] libbpf: deprecate forgotten btf__get_map_kv_tids() Andrii Nakryiko
2022-02-03 23:23 ` Yonghong Song
2022-02-04  0:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox