netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ebpf: include perf_event only where really needed
@ 2015-10-02 16:42 Daniel Borkmann
  2015-10-02 16:44 ` Alexei Starovoitov
  2015-10-05 14:05 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Borkmann @ 2015-10-02 16:42 UTC (permalink / raw)
  To: davem; +Cc: ast, netdev, Daniel Borkmann, Kaixu Xia

Commit ea317b267e9d ("bpf: Add new bpf map type to store the pointer
to struct perf_event") added perf_event.h to the main eBPF header, so
it gets included for all users. perf_event.h is actually only needed
from array map side, so lets sanitize this a bit.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Kaixu Xia <xiakaixu@huawei.com>
---
 [ Did couple of tests, but lets see if Fengguang's build bot agrees
   with me eventually. ;) P.s., the feature of pulling patches from
   patchwork is awesome! ]

 include/linux/bpf.h   | 1 -
 kernel/bpf/arraymap.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index f57d7fe..c915a6b 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -10,7 +10,6 @@
 #include <uapi/linux/bpf.h>
 #include <linux/workqueue.h>
 #include <linux/file.h>
-#include <linux/perf_event.h>
 
 struct bpf_map;
 
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index 29ace10..2fecc4a 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -15,6 +15,7 @@
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/filter.h>
+#include <linux/perf_event.h>
 
 /* Called from syscall */
 static struct bpf_map *array_map_alloc(union bpf_attr *attr)
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] ebpf: include perf_event only where really needed
  2015-10-02 16:42 [PATCH net-next] ebpf: include perf_event only where really needed Daniel Borkmann
@ 2015-10-02 16:44 ` Alexei Starovoitov
  2015-10-05 14:05 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2015-10-02 16:44 UTC (permalink / raw)
  To: Daniel Borkmann, davem; +Cc: netdev, Kaixu Xia

On 10/2/15 9:42 AM, Daniel Borkmann wrote:
> Commit ea317b267e9d ("bpf: Add new bpf map type to store the pointer
> to struct perf_event") added perf_event.h to the main eBPF header, so
> it gets included for all users. perf_event.h is actually only needed
> from array map side, so lets sanitize this a bit.
>
> Signed-off-by: Daniel Borkmann<daniel@iogearbox.net>
> Cc: Kaixu Xia<xiakaixu@huawei.com>

Acked-by: Alexei Starovoitov <ast@plumgrid.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] ebpf: include perf_event only where really needed
  2015-10-02 16:42 [PATCH net-next] ebpf: include perf_event only where really needed Daniel Borkmann
  2015-10-02 16:44 ` Alexei Starovoitov
@ 2015-10-05 14:05 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-10-05 14:05 UTC (permalink / raw)
  To: daniel; +Cc: ast, netdev, xiakaixu

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Fri,  2 Oct 2015 18:42:00 +0200

> Commit ea317b267e9d ("bpf: Add new bpf map type to store the pointer
> to struct perf_event") added perf_event.h to the main eBPF header, so
> it gets included for all users. perf_event.h is actually only needed
> from array map side, so lets sanitize this a bit.
> 
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Applied, thanks.

>  [ Did couple of tests, but lets see if Fengguang's build bot agrees
>    with me eventually. ;) P.s., the feature of pulling patches from
>    patchwork is awesome! ]

Agreed.  :-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-05 13:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-02 16:42 [PATCH net-next] ebpf: include perf_event only where really needed Daniel Borkmann
2015-10-02 16:44 ` Alexei Starovoitov
2015-10-05 14:05 ` 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).