[PATCH] libbpf: Remove the duplicate checking of function storage

Subsystems: bpf [general] (safe dynamic programs and tools), bpf [library] (libbpf), the rest

STALE2938d

4 messages, 3 authors, 2018-08-22 · open the first message on its own page

[PATCH] libbpf: Remove the duplicate checking of function storage

From: Taeung Song <hidden>
Date: 2018-08-21 16:13:13

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 <redacted>
Signed-off-by: Taeung Song <redacted>
---
 tools/lib/bpf/libbpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 2abd0f112627..8476da7f2720 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -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

Re: [PATCH] libbpf: Remove the duplicate checking of function storage

From: Jakub Kicinski <hidden>
Date: 2018-08-21 16:46:59

On Tue, Aug 21, 2018 at 6:12 PM, Taeung Song [off-list ref] wrote:
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 <redacted>
Signed-off-by: Taeung Song <redacted>
Looks reasonable, but you may need to repost once bpf-next is open:

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

Acked-by: Jakub Kicinski <redacted>
quoted hunk
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 2abd0f112627..8476da7f2720 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -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

Re: [PATCH] libbpf: Remove the duplicate checking of function storage

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2018-08-21 20:11:21

On 08/21/2018 06:46 PM, Jakub Kicinski wrote:
On Tue, Aug 21, 2018 at 6:12 PM, Taeung Song [off-list ref] wrote:
quoted
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 <redacted>
Signed-off-by: Taeung Song <redacted>
Looks reasonable, but you may need to repost once bpf-next is open:

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

Acked-by: Jakub Kicinski <redacted>
Agree, please resubmit once bpf-next opens up again. Thanks!

Re: [PATCH] libbpf: Remove the duplicate checking of function storage

From: Taeung Song <hidden>
Date: 2018-08-22 02:54:39


On 08/22/2018 05:11 AM, Daniel Borkmann wrote:
On 08/21/2018 06:46 PM, Jakub Kicinski wrote:
quoted
On Tue, Aug 21, 2018 at 6:12 PM, Taeung Song [off-list ref] wrote:
quoted
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 <redacted>
Signed-off-by: Taeung Song <redacted>
Looks reasonable, but you may need to repost once bpf-next is open:

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

Acked-by: Jakub Kicinski <redacted>
Agree, please resubmit once bpf-next opens up again. Thanks!
OK ! I will.

Thanks,
Taeung
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help