* [PATCH bpf-next 0/3] Start libbpf 1.0 dev cycle
@ 2022-05-18 18:59 Andrii Nakryiko
2022-05-18 18:59 ` [PATCH bpf-next 1/3] libbpf: fix up global symbol counting logic Andrii Nakryiko
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Andrii Nakryiko @ 2022-05-18 18:59 UTC (permalink / raw)
To: bpf, ast, daniel; +Cc: andrii, kernel-team
Start preparations for libbpf 1.0 release and as a first test remove
bpf_create_map*() APIs.
Andrii Nakryiko (3):
libbpf: fix up global symbol counting logic
libbpf: start 1.0 development cycle
libbpf: remove bpf_create_map*() APIs
tools/lib/bpf/Makefile | 2 +-
tools/lib/bpf/bpf.c | 80 ----------------------------------
tools/lib/bpf/bpf.h | 42 ------------------
tools/lib/bpf/libbpf.map | 4 ++
tools/lib/bpf/libbpf_version.h | 4 +-
5 files changed, 7 insertions(+), 125 deletions(-)
--
2.30.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH bpf-next 1/3] libbpf: fix up global symbol counting logic
2022-05-18 18:59 [PATCH bpf-next 0/3] Start libbpf 1.0 dev cycle Andrii Nakryiko
@ 2022-05-18 18:59 ` Andrii Nakryiko
2022-05-18 18:59 ` [PATCH bpf-next 2/3] libbpf: start 1.0 development cycle Andrii Nakryiko
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Andrii Nakryiko @ 2022-05-18 18:59 UTC (permalink / raw)
To: bpf, ast, daniel; +Cc: andrii, kernel-team
Add the same negative ABS filter that we use in VERSIONED_SYM_COUNT to
filter out ABS symbols like LIBBPF_0.8.0.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
tools/lib/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 64741c55b8e3..a1265b152027 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -127,7 +127,7 @@ TAGS_PROG := $(if $(shell which etags 2>/dev/null),etags,ctags)
GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \
cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \
sed 's/\[.*\]//' | \
- awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \
+ awk '/GLOBAL/ && /DEFAULT/ && !/UND|ABS/ {print $$NF}' | \
sort -u | wc -l)
VERSIONED_SYM_COUNT = $(shell readelf --dyn-syms --wide $(OUTPUT)libbpf.so | \
sed 's/\[.*\]//' | \
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH bpf-next 2/3] libbpf: start 1.0 development cycle
2022-05-18 18:59 [PATCH bpf-next 0/3] Start libbpf 1.0 dev cycle Andrii Nakryiko
2022-05-18 18:59 ` [PATCH bpf-next 1/3] libbpf: fix up global symbol counting logic Andrii Nakryiko
@ 2022-05-18 18:59 ` Andrii Nakryiko
2022-05-18 18:59 ` [PATCH bpf-next 3/3] libbpf: remove bpf_create_map*() APIs Andrii Nakryiko
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Andrii Nakryiko @ 2022-05-18 18:59 UTC (permalink / raw)
To: bpf, ast, daniel; +Cc: andrii, kernel-team
Start libbpf 1.0 development cycle by adding LIBBPF_1.0.0 section to
libbpf.map file and marking all current symbols as local. As we remove
all the deprecated APIs we'll populate global list before the final 1.0
release.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
tools/lib/bpf/libbpf.map | 4 ++++
tools/lib/bpf/libbpf_version.h | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map
index 6b36f46ab5d8..52973cffc20c 100644
--- a/tools/lib/bpf/libbpf.map
+++ b/tools/lib/bpf/libbpf.map
@@ -459,3 +459,7 @@ LIBBPF_0.8.0 {
libbpf_register_prog_handler;
libbpf_unregister_prog_handler;
} LIBBPF_0.7.0;
+
+LIBBPF_1.0.0 {
+ local: *;
+};
diff --git a/tools/lib/bpf/libbpf_version.h b/tools/lib/bpf/libbpf_version.h
index 61f2039404b6..2fb2f4290080 100644
--- a/tools/lib/bpf/libbpf_version.h
+++ b/tools/lib/bpf/libbpf_version.h
@@ -3,7 +3,7 @@
#ifndef __LIBBPF_VERSION_H
#define __LIBBPF_VERSION_H
-#define LIBBPF_MAJOR_VERSION 0
-#define LIBBPF_MINOR_VERSION 8
+#define LIBBPF_MAJOR_VERSION 1
+#define LIBBPF_MINOR_VERSION 0
#endif /* __LIBBPF_VERSION_H */
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH bpf-next 3/3] libbpf: remove bpf_create_map*() APIs
2022-05-18 18:59 [PATCH bpf-next 0/3] Start libbpf 1.0 dev cycle Andrii Nakryiko
2022-05-18 18:59 ` [PATCH bpf-next 1/3] libbpf: fix up global symbol counting logic Andrii Nakryiko
2022-05-18 18:59 ` [PATCH bpf-next 2/3] libbpf: start 1.0 development cycle Andrii Nakryiko
@ 2022-05-18 18:59 ` Andrii Nakryiko
2022-05-19 3:11 ` [PATCH bpf-next 0/3] Start libbpf 1.0 dev cycle Yonghong Song
2022-05-19 16:10 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: Andrii Nakryiko @ 2022-05-18 18:59 UTC (permalink / raw)
To: bpf, ast, daniel; +Cc: andrii, kernel-team, Jiri Olsa, Arnaldo Carvalho de Melo
To test API removal, get rid of bpf_create_map*() APIs. Perf defines
__weak implementation of bpf_map_create() that redirects to old
bpf_create_map() and that seems to compile and run fine.
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
tools/lib/bpf/bpf.c | 80 ---------------------------------------------
tools/lib/bpf/bpf.h | 42 ------------------------
2 files changed, 122 deletions(-)
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
index 4677644d80f4..240186aac8e6 100644
--- a/tools/lib/bpf/bpf.c
+++ b/tools/lib/bpf/bpf.c
@@ -208,86 +208,6 @@ int bpf_map_create(enum bpf_map_type map_type,
return libbpf_err_errno(fd);
}
-int bpf_create_map_xattr(const struct bpf_create_map_attr *create_attr)
-{
- LIBBPF_OPTS(bpf_map_create_opts, p);
-
- p.map_flags = create_attr->map_flags;
- p.numa_node = create_attr->numa_node;
- p.btf_fd = create_attr->btf_fd;
- p.btf_key_type_id = create_attr->btf_key_type_id;
- p.btf_value_type_id = create_attr->btf_value_type_id;
- p.map_ifindex = create_attr->map_ifindex;
- if (create_attr->map_type == BPF_MAP_TYPE_STRUCT_OPS)
- p.btf_vmlinux_value_type_id = create_attr->btf_vmlinux_value_type_id;
- else
- p.inner_map_fd = create_attr->inner_map_fd;
-
- return bpf_map_create(create_attr->map_type, create_attr->name,
- create_attr->key_size, create_attr->value_size,
- create_attr->max_entries, &p);
-}
-
-int bpf_create_map_node(enum bpf_map_type map_type, const char *name,
- int key_size, int value_size, int max_entries,
- __u32 map_flags, int node)
-{
- LIBBPF_OPTS(bpf_map_create_opts, opts);
-
- opts.map_flags = map_flags;
- if (node >= 0) {
- opts.numa_node = node;
- opts.map_flags |= BPF_F_NUMA_NODE;
- }
-
- return bpf_map_create(map_type, name, key_size, value_size, max_entries, &opts);
-}
-
-int bpf_create_map(enum bpf_map_type map_type, int key_size,
- int value_size, int max_entries, __u32 map_flags)
-{
- LIBBPF_OPTS(bpf_map_create_opts, opts, .map_flags = map_flags);
-
- return bpf_map_create(map_type, NULL, key_size, value_size, max_entries, &opts);
-}
-
-int bpf_create_map_name(enum bpf_map_type map_type, const char *name,
- int key_size, int value_size, int max_entries,
- __u32 map_flags)
-{
- LIBBPF_OPTS(bpf_map_create_opts, opts, .map_flags = map_flags);
-
- return bpf_map_create(map_type, name, key_size, value_size, max_entries, &opts);
-}
-
-int bpf_create_map_in_map_node(enum bpf_map_type map_type, const char *name,
- int key_size, int inner_map_fd, int max_entries,
- __u32 map_flags, int node)
-{
- LIBBPF_OPTS(bpf_map_create_opts, opts);
-
- opts.inner_map_fd = inner_map_fd;
- opts.map_flags = map_flags;
- if (node >= 0) {
- opts.map_flags |= BPF_F_NUMA_NODE;
- opts.numa_node = node;
- }
-
- return bpf_map_create(map_type, name, key_size, 4, max_entries, &opts);
-}
-
-int bpf_create_map_in_map(enum bpf_map_type map_type, const char *name,
- int key_size, int inner_map_fd, int max_entries,
- __u32 map_flags)
-{
- LIBBPF_OPTS(bpf_map_create_opts, opts,
- .inner_map_fd = inner_map_fd,
- .map_flags = map_flags,
- );
-
- return bpf_map_create(map_type, name, key_size, 4, max_entries, &opts);
-}
-
static void *
alloc_zero_tailing_info(const void *orecord, __u32 cnt,
__u32 actual_rec_size, __u32 expected_rec_size)
diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
index 2e0d3731e4c0..cabc03703e29 100644
--- a/tools/lib/bpf/bpf.h
+++ b/tools/lib/bpf/bpf.h
@@ -61,48 +61,6 @@ LIBBPF_API int bpf_map_create(enum bpf_map_type map_type,
__u32 max_entries,
const struct bpf_map_create_opts *opts);
-struct bpf_create_map_attr {
- const char *name;
- enum bpf_map_type map_type;
- __u32 map_flags;
- __u32 key_size;
- __u32 value_size;
- __u32 max_entries;
- __u32 numa_node;
- __u32 btf_fd;
- __u32 btf_key_type_id;
- __u32 btf_value_type_id;
- __u32 map_ifindex;
- union {
- __u32 inner_map_fd;
- __u32 btf_vmlinux_value_type_id;
- };
-};
-
-LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_map_create() instead")
-LIBBPF_API int bpf_create_map_xattr(const struct bpf_create_map_attr *create_attr);
-LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_map_create() instead")
-LIBBPF_API int bpf_create_map_node(enum bpf_map_type map_type, const char *name,
- int key_size, int value_size,
- int max_entries, __u32 map_flags, int node);
-LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_map_create() instead")
-LIBBPF_API int bpf_create_map_name(enum bpf_map_type map_type, const char *name,
- int key_size, int value_size,
- int max_entries, __u32 map_flags);
-LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_map_create() instead")
-LIBBPF_API int bpf_create_map(enum bpf_map_type map_type, int key_size,
- int value_size, int max_entries, __u32 map_flags);
-LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_map_create() instead")
-LIBBPF_API int bpf_create_map_in_map_node(enum bpf_map_type map_type,
- const char *name, int key_size,
- int inner_map_fd, int max_entries,
- __u32 map_flags, int node);
-LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_map_create() instead")
-LIBBPF_API int bpf_create_map_in_map(enum bpf_map_type map_type,
- const char *name, int key_size,
- int inner_map_fd, int max_entries,
- __u32 map_flags);
-
struct bpf_prog_load_opts {
size_t sz; /* size of this struct for forward/backward compatibility */
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH bpf-next 0/3] Start libbpf 1.0 dev cycle
2022-05-18 18:59 [PATCH bpf-next 0/3] Start libbpf 1.0 dev cycle Andrii Nakryiko
` (2 preceding siblings ...)
2022-05-18 18:59 ` [PATCH bpf-next 3/3] libbpf: remove bpf_create_map*() APIs Andrii Nakryiko
@ 2022-05-19 3:11 ` Yonghong Song
2022-05-19 16:10 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: Yonghong Song @ 2022-05-19 3:11 UTC (permalink / raw)
To: Andrii Nakryiko, bpf, ast, daniel; +Cc: kernel-team
On 5/18/22 11:59 AM, Andrii Nakryiko wrote:
> Start preparations for libbpf 1.0 release and as a first test remove
> bpf_create_map*() APIs.
>
> Andrii Nakryiko (3):
> libbpf: fix up global symbol counting logic
> libbpf: start 1.0 development cycle
> libbpf: remove bpf_create_map*() APIs
>
> tools/lib/bpf/Makefile | 2 +-
> tools/lib/bpf/bpf.c | 80 ----------------------------------
> tools/lib/bpf/bpf.h | 42 ------------------
> tools/lib/bpf/libbpf.map | 4 ++
> tools/lib/bpf/libbpf_version.h | 4 +-
> 5 files changed, 7 insertions(+), 125 deletions(-)
>
Ack for the whole series.
Acked-by: Yonghong Song <yhs@fb.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH bpf-next 0/3] Start libbpf 1.0 dev cycle
2022-05-18 18:59 [PATCH bpf-next 0/3] Start libbpf 1.0 dev cycle Andrii Nakryiko
` (3 preceding siblings ...)
2022-05-19 3:11 ` [PATCH bpf-next 0/3] Start libbpf 1.0 dev cycle Yonghong Song
@ 2022-05-19 16:10 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-19 16:10 UTC (permalink / raw)
To: Andrii Nakryiko; +Cc: bpf, ast, daniel, kernel-team
Hello:
This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:
On Wed, 18 May 2022 11:59:12 -0700 you wrote:
> Start preparations for libbpf 1.0 release and as a first test remove
> bpf_create_map*() APIs.
>
> Andrii Nakryiko (3):
> libbpf: fix up global symbol counting logic
> libbpf: start 1.0 development cycle
> libbpf: remove bpf_create_map*() APIs
>
> [...]
Here is the summary with links:
- [bpf-next,1/3] libbpf: fix up global symbol counting logic
https://git.kernel.org/bpf/bpf-next/c/056431ae4d79
- [bpf-next,2/3] libbpf: start 1.0 development cycle
https://git.kernel.org/bpf/bpf-next/c/e2371b1632b1
- [bpf-next,3/3] libbpf: remove bpf_create_map*() APIs
https://git.kernel.org/bpf/bpf-next/c/d16495a98232
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] 6+ messages in thread
end of thread, other threads:[~2022-05-19 16:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18 18:59 [PATCH bpf-next 0/3] Start libbpf 1.0 dev cycle Andrii Nakryiko
2022-05-18 18:59 ` [PATCH bpf-next 1/3] libbpf: fix up global symbol counting logic Andrii Nakryiko
2022-05-18 18:59 ` [PATCH bpf-next 2/3] libbpf: start 1.0 development cycle Andrii Nakryiko
2022-05-18 18:59 ` [PATCH bpf-next 3/3] libbpf: remove bpf_create_map*() APIs Andrii Nakryiko
2022-05-19 3:11 ` [PATCH bpf-next 0/3] Start libbpf 1.0 dev cycle Yonghong Song
2022-05-19 16:10 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.