Skip to contentSkip to conversation

libbpf: Clean up legacy bpf maps declaration in bpf_helpers

PATCH Superseded Liuxin(EulerOS) 2 participants 2 messages Sep 5, 2022 – Sep 6, 2022

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libbpf: Clean up legacy bpf maps declaration in bpf_helpers

Legacy bpf maps declaration were no longer supported in Libbpf 1.0, so it was time to remove the definition of bpf_map_def in bpf_helpers.h.

---
tools/lib/bpf/bpf_helpers.h | 12 ------------

1 file changed, 12 deletions(-)
tools/lib/bpf/bpf_helpers.h +0 -0
index 867b73483..9cad13e7f 100644
@@ -167,18 +167,6 @@ bpf_tail_call_static(void *ctx, const void *map, const __u32 slot)

}
#endif

-/*
- * Helper structure used by eBPF C program
- * to describe BPF map attributes to libbpf loader
- */
-struct bpf_map_def {

-       unsigned int type;
-       unsigned int key_size;
-       unsigned int value_size;
-       unsigned int max_entries;
-       unsigned int map_flags;
-} __attribute__((deprecated("use BTF-defined maps in .maps section")));
-
enum libbpf_pin_type {
        LIBBPF_PIN_NONE,
        /* PIN_BY_NAME: pin maps by name (in /sys/fs/bpf by default) */

--
2.33.0

reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Liuxin(EulerOS)

Legacy bpf maps declaration were no longer supported in Libbpf 1.0, so it was time to remove the definition of bpf_map_def in bpf_helpers.h.

This looks a little weird.

From: "Liuxin(EulerOS)" <[email protected]>

Please fix your name in git config:

Otherwise,

Quoted 29 lines

---
tools/lib/bpf/bpf_helpers.h | 12 ------------

1 file changed, 12 deletions(-)
tools/lib/bpf/bpf_helpers.h +0 -13
index 867b73483..9cad13e7f 100644
@@ -167,18 +167,6 @@ bpf_tail_call_static(void *ctx, const void *map, const __u32 slot)
 }
 #endif
 
-/*
- * Helper structure used by eBPF C program
- * to describe BPF map attributes to libbpf loader
- */
-struct bpf_map_def {
-       unsigned int type;
-       unsigned int key_size;
-       unsigned int value_size;
-       unsigned int max_entries;
-       unsigned int map_flags;
-} __attribute__((deprecated("use BTF-defined maps in .maps section")));
-
 enum libbpf_pin_type {
        LIBBPF_PIN_NONE,
        /* PIN_BY_NAME: pin maps by name (in /sys/fs/bpf by default) */
--

2.33.0