* [PATCH net-next] bpf: bpf_stackmap_copy depends on CONFIG_PERF_EVENTS
@ 2016-03-10 2:56 Alexei Starovoitov
2016-03-10 4:28 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Alexei Starovoitov @ 2016-03-10 2:56 UTC (permalink / raw)
To: David S . Miller; +Cc: Daniel Borkmann, Fengguang Wu, netdev
0-day bot reported build error:
kernel/built-in.o: In function `map_lookup_elem':
>> kernel/bpf/.tmp_syscall.o:(.text+0x329b3c): undefined reference to `bpf_stackmap_copy'
when CONFIG_BPF_SYSCALL is set and CONFIG_PERF_EVENTS is not.
Add weak definition to resolve it.
This code path in map_lookup_elem() is never taken
when CONFIG_PERF_EVENTS is not set.
Fixes: 557c0c6e7df8 ("bpf: convert stackmap to pre-allocation")
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
---
kernel/bpf/syscall.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 2978d0d08869..2a2efe1bc76c 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -244,6 +244,11 @@ static void __user *u64_to_ptr(__u64 val)
return (void __user *) (unsigned long) val;
}
+int __weak bpf_stackmap_copy(struct bpf_map *map, void *key, void *value)
+{
+ return -ENOTSUPP;
+}
+
/* last field in 'union bpf_attr' used by this command */
#define BPF_MAP_LOOKUP_ELEM_LAST_FIELD value
--
2.8.0.rc1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] bpf: bpf_stackmap_copy depends on CONFIG_PERF_EVENTS
2016-03-10 2:56 [PATCH net-next] bpf: bpf_stackmap_copy depends on CONFIG_PERF_EVENTS Alexei Starovoitov
@ 2016-03-10 4:28 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-03-10 4:28 UTC (permalink / raw)
To: ast; +Cc: daniel, fengguang.wu, netdev
From: Alexei Starovoitov <ast@fb.com>
Date: Wed, 9 Mar 2016 18:56:49 -0800
> 0-day bot reported build error:
> kernel/built-in.o: In function `map_lookup_elem':
>>> kernel/bpf/.tmp_syscall.o:(.text+0x329b3c): undefined reference to `bpf_stackmap_copy'
> when CONFIG_BPF_SYSCALL is set and CONFIG_PERF_EVENTS is not.
> Add weak definition to resolve it.
> This code path in map_lookup_elem() is never taken
> when CONFIG_PERF_EVENTS is not set.
>
> Fixes: 557c0c6e7df8 ("bpf: convert stackmap to pre-allocation")
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-10 4:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 2:56 [PATCH net-next] bpf: bpf_stackmap_copy depends on CONFIG_PERF_EVENTS Alexei Starovoitov
2016-03-10 4:28 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).