Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'Start libbpf 1.0 dev cycle'

Andrii Nakryiko says:

====================

Start preparations for libbpf 1.0 release and as a first test remove
bpf_create_map*() APIs.
====================

Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

+7 -125
+1 -1
tools/lib/bpf/Makefile
··· 127 127 GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \ 128 128 cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \ 129 129 sed 's/\[.*\]//' | \ 130 - awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \ 130 + awk '/GLOBAL/ && /DEFAULT/ && !/UND|ABS/ {print $$NF}' | \ 131 131 sort -u | wc -l) 132 132 VERSIONED_SYM_COUNT = $(shell readelf --dyn-syms --wide $(OUTPUT)libbpf.so | \ 133 133 sed 's/\[.*\]//' | \
-80
tools/lib/bpf/bpf.c
··· 208 208 return libbpf_err_errno(fd); 209 209 } 210 210 211 - int bpf_create_map_xattr(const struct bpf_create_map_attr *create_attr) 212 - { 213 - LIBBPF_OPTS(bpf_map_create_opts, p); 214 - 215 - p.map_flags = create_attr->map_flags; 216 - p.numa_node = create_attr->numa_node; 217 - p.btf_fd = create_attr->btf_fd; 218 - p.btf_key_type_id = create_attr->btf_key_type_id; 219 - p.btf_value_type_id = create_attr->btf_value_type_id; 220 - p.map_ifindex = create_attr->map_ifindex; 221 - if (create_attr->map_type == BPF_MAP_TYPE_STRUCT_OPS) 222 - p.btf_vmlinux_value_type_id = create_attr->btf_vmlinux_value_type_id; 223 - else 224 - p.inner_map_fd = create_attr->inner_map_fd; 225 - 226 - return bpf_map_create(create_attr->map_type, create_attr->name, 227 - create_attr->key_size, create_attr->value_size, 228 - create_attr->max_entries, &p); 229 - } 230 - 231 - int bpf_create_map_node(enum bpf_map_type map_type, const char *name, 232 - int key_size, int value_size, int max_entries, 233 - __u32 map_flags, int node) 234 - { 235 - LIBBPF_OPTS(bpf_map_create_opts, opts); 236 - 237 - opts.map_flags = map_flags; 238 - if (node >= 0) { 239 - opts.numa_node = node; 240 - opts.map_flags |= BPF_F_NUMA_NODE; 241 - } 242 - 243 - return bpf_map_create(map_type, name, key_size, value_size, max_entries, &opts); 244 - } 245 - 246 - int bpf_create_map(enum bpf_map_type map_type, int key_size, 247 - int value_size, int max_entries, __u32 map_flags) 248 - { 249 - LIBBPF_OPTS(bpf_map_create_opts, opts, .map_flags = map_flags); 250 - 251 - return bpf_map_create(map_type, NULL, key_size, value_size, max_entries, &opts); 252 - } 253 - 254 - int bpf_create_map_name(enum bpf_map_type map_type, const char *name, 255 - int key_size, int value_size, int max_entries, 256 - __u32 map_flags) 257 - { 258 - LIBBPF_OPTS(bpf_map_create_opts, opts, .map_flags = map_flags); 259 - 260 - return bpf_map_create(map_type, name, key_size, value_size, max_entries, &opts); 261 - } 262 - 263 - int bpf_create_map_in_map_node(enum bpf_map_type map_type, const char *name, 264 - int key_size, int inner_map_fd, int max_entries, 265 - __u32 map_flags, int node) 266 - { 267 - LIBBPF_OPTS(bpf_map_create_opts, opts); 268 - 269 - opts.inner_map_fd = inner_map_fd; 270 - opts.map_flags = map_flags; 271 - if (node >= 0) { 272 - opts.map_flags |= BPF_F_NUMA_NODE; 273 - opts.numa_node = node; 274 - } 275 - 276 - return bpf_map_create(map_type, name, key_size, 4, max_entries, &opts); 277 - } 278 - 279 - int bpf_create_map_in_map(enum bpf_map_type map_type, const char *name, 280 - int key_size, int inner_map_fd, int max_entries, 281 - __u32 map_flags) 282 - { 283 - LIBBPF_OPTS(bpf_map_create_opts, opts, 284 - .inner_map_fd = inner_map_fd, 285 - .map_flags = map_flags, 286 - ); 287 - 288 - return bpf_map_create(map_type, name, key_size, 4, max_entries, &opts); 289 - } 290 - 291 211 static void * 292 212 alloc_zero_tailing_info(const void *orecord, __u32 cnt, 293 213 __u32 actual_rec_size, __u32 expected_rec_size)
-42
tools/lib/bpf/bpf.h
··· 61 61 __u32 max_entries, 62 62 const struct bpf_map_create_opts *opts); 63 63 64 - struct bpf_create_map_attr { 65 - const char *name; 66 - enum bpf_map_type map_type; 67 - __u32 map_flags; 68 - __u32 key_size; 69 - __u32 value_size; 70 - __u32 max_entries; 71 - __u32 numa_node; 72 - __u32 btf_fd; 73 - __u32 btf_key_type_id; 74 - __u32 btf_value_type_id; 75 - __u32 map_ifindex; 76 - union { 77 - __u32 inner_map_fd; 78 - __u32 btf_vmlinux_value_type_id; 79 - }; 80 - }; 81 - 82 - LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_map_create() instead") 83 - LIBBPF_API int bpf_create_map_xattr(const struct bpf_create_map_attr *create_attr); 84 - LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_map_create() instead") 85 - LIBBPF_API int bpf_create_map_node(enum bpf_map_type map_type, const char *name, 86 - int key_size, int value_size, 87 - int max_entries, __u32 map_flags, int node); 88 - LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_map_create() instead") 89 - LIBBPF_API int bpf_create_map_name(enum bpf_map_type map_type, const char *name, 90 - int key_size, int value_size, 91 - int max_entries, __u32 map_flags); 92 - LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_map_create() instead") 93 - LIBBPF_API int bpf_create_map(enum bpf_map_type map_type, int key_size, 94 - int value_size, int max_entries, __u32 map_flags); 95 - LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_map_create() instead") 96 - LIBBPF_API int bpf_create_map_in_map_node(enum bpf_map_type map_type, 97 - const char *name, int key_size, 98 - int inner_map_fd, int max_entries, 99 - __u32 map_flags, int node); 100 - LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_map_create() instead") 101 - LIBBPF_API int bpf_create_map_in_map(enum bpf_map_type map_type, 102 - const char *name, int key_size, 103 - int inner_map_fd, int max_entries, 104 - __u32 map_flags); 105 - 106 64 struct bpf_prog_load_opts { 107 65 size_t sz; /* size of this struct for forward/backward compatibility */ 108 66
+4
tools/lib/bpf/libbpf.map
··· 459 459 libbpf_register_prog_handler; 460 460 libbpf_unregister_prog_handler; 461 461 } LIBBPF_0.7.0; 462 + 463 + LIBBPF_1.0.0 { 464 + local: *; 465 + };
+2 -2
tools/lib/bpf/libbpf_version.h
··· 3 3 #ifndef __LIBBPF_VERSION_H 4 4 #define __LIBBPF_VERSION_H 5 5 6 - #define LIBBPF_MAJOR_VERSION 0 7 - #define LIBBPF_MINOR_VERSION 8 6 + #define LIBBPF_MAJOR_VERSION 1 7 + #define LIBBPF_MINOR_VERSION 0 8 8 9 9 #endif /* __LIBBPF_VERSION_H */