Skip to contentSkip to conversation

libbpf: Remove the duplicate checking of function storage

PATCH Superseded Taeung Song 3 participants 4 messages Aug 21, 2018 – Aug 22, 2018

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libbpf: Remove the duplicate checking of function storage

After the commit eac7d84519a3 ("tools: libbpf: don't return '.text' as a program for multi-function programs"), bpf_program__next() in bpf_object__for_each_program skips the function storage such as .text, so eliminate the duplicate checking.

Cc Jakub Kicinski <[email protected]>
---
 tools/lib/bpf/libbpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/libbpf.c +1 -1
index 2abd0f112627..8476da7f2720 100644
@@ -2336,7 +2336,7 @@ int bpf_prog_load_xattr(const struct bpf_prog_load_attr *attr,
 		bpf_program__set_expected_attach_type(prog,
 						      expected_attach_type);
 
-		if (!bpf_program__is_function_storage(prog, obj) && !first_prog)
+		if (!first_prog)
 			first_prog = prog;
 	}
 
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Taeung Song

After the commit eac7d84519a3 ("tools: libbpf: don't return '.text' as a program for multi-function programs"), bpf_program__next() in bpf_object__for_each_program skips the function storage such as .text, so eliminate the duplicate checking.

Cc Jakub Kicinski <[email protected]>

Looks reasonable, but you may need to repost once bpf-next is open:

https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt

Quoted 16 lines
tools/lib/bpf/libbpf.c +1 -2
index 2abd0f112627..8476da7f2720 100644
@@ -2336,7 +2336,7 @@ int bpf_prog_load_xattr(const struct bpf_prog_load_attr *attr,
                bpf_program__set_expected_attach_type(prog,
                                                      expected_attach_type);
 
-               if (!bpf_program__is_function_storage(prog, obj) && !first_prog)
+               if (!first_prog)
                        first_prog = prog;
        }
 
--

2.17.1

maintainer
#2 lore raw
Quoted 6 lines · Jakub Kicinski
Quoted 5 lines · Taeung Song

After the commit eac7d84519a3 ("tools: libbpf: don't return '.text' as a program for multi-function programs"), bpf_program__next() in bpf_object__for_each_program skips the function storage such as .text, so eliminate the duplicate checking.

Quoted 8 lines
Quoted 2 lines
Cc Jakub Kicinski <[email protected]>

Looks reasonable, but you may need to repost once bpf-next is open:

https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt

Agree, please resubmit once bpf-next opens up again. Thanks!

#3 lore raw
Quoted 10 lines · Daniel Borkmann
Quoted 9 lines · Jakub Kicinski
Quoted 7 lines · Taeung Song

After the commit eac7d84519a3 ("tools: libbpf: don't return '.text' as a program for multi-function programs"), bpf_program__next() in bpf_object__for_each_program skips the function storage such as .text, so eliminate the duplicate checking.

Cc Jakub Kicinski <[email protected]>
Quoted 8 lines
Quoted 5 lines

Looks reasonable, but you may need to repost once bpf-next is open:

https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt

Agree, please resubmit once bpf-next opens up again. Thanks!

OK ! I will.

Thanks,
Taeung