Skip to contentSkip to conversation

libbpf: Clean up legacy bpf maps declaration in bpf_helpers

PATCH Superseded Liuxin(EulerOS) 2 participants 3 messages Sep 7, 2022 – Sep 13, 2022

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 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.

---
Changes in v2:
- Fix strange signatures

V1: https://lore.kernel.org/bpf/CAPhsuW7Em6q5hqiKWEZpJOaU5DTrZE+BPPHq+Chyz0-+-yQ_ZA@mail.gmail.com/T/#t

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

1 file changed, 12 deletions(-)
tools/lib/bpf/bpf_helpers.h +0 -12
@@ -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

#1 lore raw
Quoted 2 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.

please make sure that commit log lines are wrapped at <80 characters

Quoted 2 lines

don't add "LINK", just two spaces and then [0] and then refer to it from the above as "supported in Libbpf 1.0 ([0])"

Quoted 3 lines

space after name and before opening < is missing

Quoted 4 lines

---
Changes in v2:
- Fix strange signatures

It looks good overall, but your patch doesn't apply. Please make sure you base it on top of bpf-next's master and you use git send-email which won't clobber the patch. Thanks.

Quoted 27 lines

V1: https://lore.kernel.org/bpf/CAPhsuW7Em6q5hqiKWEZpJOaU5DTrZE+BPPHq+Chyz0-+-yQ_ZA@mail.gmail.com/T/#t

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

1 file changed, 12 deletions(-)
tools/lib/bpf/bpf_helpers.h +0 -13
@@ -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

#2 lore raw

Thanks to Song and Andrii for their advice, I will fix it in V3.

-----邮件原件-----
发件人: Andrii Nakryiko [mailto:[email protected]]
发送时间: 2022年9月10日 8:44
收件人: Liuxin(EulerOS) <[email protected]>
抄送: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Yanan (Euler) <[email protected]>; Wuchangye (EulerOS) <[email protected]>; Xiesongyang <[email protected]>; zhudi (E) <[email protected]>; kongweibin (A) <[email protected]> 主题: Re: [PATCH v2] libbpf: Clean up legacy bpf maps declaration in bpf_helpers

Quoted 2 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.

please make sure that commit log lines are wrapped at <80 characters

Quoted 3 lines

LINK:[1]
https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0

don't add "LINK", just two spaces and then [0] and then refer to it from the above as "supported in Libbpf 1.0 ([0])"

Quoted 3 lines

space after name and before opening < is missing

Quoted 4 lines

---
Changes in v2:
- Fix strange signatures

It looks good overall, but your patch doesn't apply. Please make sure you base it on top of bpf-next's master and you use git send-email which won't clobber the patch. Thanks.

Quoted 33 lines

V1:
https://lore.kernel.org/bpf/CAPhsuW7Em6q5hqiKWEZpJOaU5DTrZE+BPPHq+Chyz
[email protected]/T/#t

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

tools/lib/bpf/bpf_helpers.h +0 -11
-/*
- * 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