Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1575127 > unrolled thread

[PATCH v2 1/5] bpf: Add missing header to the library

Started byMickaël Salaün <mic@digikod.net>
First post2017-02-06 21:50 +0100
Last post2017-02-08 21:30 +0100
Articles 7 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 1/5] bpf: Add missing header to the library Mickaël Salaün <mic@digikod.net> - 2017-02-06 21:50 +0100
    [PATCH v2 3/5] samples/bpf: Ignore already processed ELF sections Mickaël Salaün <mic@digikod.net> - 2017-02-06 21:50 +0100
    [PATCH v2 4/5] samples/bpf: Reset global variables Mickaël Salaün <mic@digikod.net> - 2017-02-06 21:50 +0100
    [PATCH v2 5/5] samples/bpf: Add missing header Mickaël Salaün <mic@digikod.net> - 2017-02-06 21:50 +0100
    Re: [PATCH v2 1/5] bpf: Add missing header to the library David Miller <davem@davemloft.net> - 2017-02-07 19:10 +0100
    Re: [PATCH v2 1/5] bpf: Add missing header to the library "Wangnan (F)" <wangnan0@huawei.com> - 2017-02-08 04:00 +0100
      Re: [PATCH v2 1/5] bpf: Add missing header to the library Mickaël Salaün <mic@digikod.net> - 2017-02-08 21:30 +0100

#1575127 — [PATCH v2 1/5] bpf: Add missing header to the library

FromMickaël Salaün <mic@digikod.net>
Date2017-02-06 21:50 +0100
Subject[PATCH v2 1/5] bpf: Add missing header to the library
Message-ID<t7Yoy-1to-9@gated-at.bofh.it>
Include stddef.h to define size_t.

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Wang Nan <wangnan0@huawei.com>
---
 tools/lib/bpf/bpf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
index a2f9853dd882..df6e186da788 100644
--- a/tools/lib/bpf/bpf.h
+++ b/tools/lib/bpf/bpf.h
@@ -22,6 +22,7 @@
 #define __BPF_BPF_H
 
 #include <linux/bpf.h>
+#include <stddef.h>
 
 int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size,
 		   int max_entries, __u32 map_flags);
-- 
2.11.0

[toc] | [next] | [standalone]


#1575128 — [PATCH v2 3/5] samples/bpf: Ignore already processed ELF sections

FromMickaël Salaün <mic@digikod.net>
Date2017-02-06 21:50 +0100
Subject[PATCH v2 3/5] samples/bpf: Ignore already processed ELF sections
Message-ID<t7Yoy-1to-23@gated-at.bofh.it>
In reply to#1575127
Add a missing check for the map fixup loop.

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
---
 samples/bpf/bpf_load.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c
index 396e204888b3..e04fe09d7c2e 100644
--- a/samples/bpf/bpf_load.c
+++ b/samples/bpf/bpf_load.c
@@ -328,6 +328,8 @@ int load_bpf_file(char *path)
 
 	/* load programs that need map fixup (relocations) */
 	for (i = 1; i < ehdr.e_shnum; i++) {
+		if (processed_sec[i])
+			continue;
 
 		if (get_sec(elf, i, &ehdr, &shname, &shdr, &data))
 			continue;
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1575129 — [PATCH v2 4/5] samples/bpf: Reset global variables

FromMickaël Salaün <mic@digikod.net>
Date2017-02-06 21:50 +0100
Subject[PATCH v2 4/5] samples/bpf: Reset global variables
Message-ID<t7Yoy-1to-17@gated-at.bofh.it>
In reply to#1575127
Before loading a new ELF, clean previous kernel version, license and
processed sections.

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David S. Miller <davem@davemloft.net>
---
 samples/bpf/bpf_load.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c
index e04fe09d7c2e..b86ee54da2d1 100644
--- a/samples/bpf/bpf_load.c
+++ b/samples/bpf/bpf_load.c
@@ -277,6 +277,11 @@ int load_bpf_file(char *path)
 	Elf_Data *data, *data_prog, *symbols = NULL;
 	char *shname, *shname_prog;
 
+	/* reset global variables */
+	kern_version = 0;
+	memset(license, 0, sizeof(license));
+	memset(processed_sec, 0, sizeof(processed_sec));
+
 	if (elf_version(EV_CURRENT) == EV_NONE)
 		return 1;
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1575130 — [PATCH v2 5/5] samples/bpf: Add missing header

FromMickaël Salaün <mic@digikod.net>
Date2017-02-06 21:50 +0100
Subject[PATCH v2 5/5] samples/bpf: Add missing header
Message-ID<t7Yoy-1to-19@gated-at.bofh.it>
In reply to#1575127
Include unistd.h to define __NR_getuid and __NR_getsid.

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David S. Miller <davem@davemloft.net>
---
 samples/bpf/tracex5_kern.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/samples/bpf/tracex5_kern.c b/samples/bpf/tracex5_kern.c
index fd12d7154d42..7e4cf74553ff 100644
--- a/samples/bpf/tracex5_kern.c
+++ b/samples/bpf/tracex5_kern.c
@@ -8,6 +8,7 @@
 #include <linux/version.h>
 #include <uapi/linux/bpf.h>
 #include <uapi/linux/seccomp.h>
+#include <uapi/linux/unistd.h>
 #include "bpf_helpers.h"
 
 #define PROG(F) SEC("kprobe/"__stringify(F)) int bpf_func_##F
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1575934

FromDavid Miller <davem@davemloft.net>
Date2017-02-07 19:10 +0100
Message-ID<t8ing-6go-7@gated-at.bofh.it>
In reply to#1575127
I don't see a proper "[PATCH v2 0/5] ..." posting, and I can't tell what
tree you are targetting this series at.

[toc] | [prev] | [next] | [standalone]


#1576245

From"Wangnan (F)" <wangnan0@huawei.com>
Date2017-02-08 04:00 +0100
Message-ID<t8qE9-2Lp-5@gated-at.bofh.it>
In reply to#1575127
Please add me into the cc list of all of the 5 patches.

Thank you.

On 2017/2/7 4:40, Mickaël Salaün wrote:
> Include stddef.h to define size_t.
>
> Signed-off-by: Mickaël Salaün <mic@digikod.net>
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: Wang Nan <wangnan0@huawei.com>
> ---
>   tools/lib/bpf/bpf.h | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
> index a2f9853dd882..df6e186da788 100644
> --- a/tools/lib/bpf/bpf.h
> +++ b/tools/lib/bpf/bpf.h
> @@ -22,6 +22,7 @@
>   #define __BPF_BPF_H
>   
>   #include <linux/bpf.h>
> +#include <stddef.h>
>   
>   int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size,
>   		   int max_entries, __u32 map_flags);

[toc] | [prev] | [next] | [standalone]


#1577022

FromMickaël Salaün <mic@digikod.net>
Date2017-02-08 21:30 +0100
Message-ID<t8H2h-4VH-13@gated-at.bofh.it>
In reply to#1576245

[Multipart message — attachments visible in raw view] — view raw

On 08/02/2017 03:52, Wangnan (F) wrote:
> Please add me into the cc list of all of the 5 patches.

Sorry, get_maintainer.pl didn't get your name for all patches but I'll
CC you for the next series.

> 
> Thank you.
> 
> On 2017/2/7 4:40, Mickaël Salaün wrote:
>> Include stddef.h to define size_t.
>>
>> Signed-off-by: Mickaël Salaün <mic@digikod.net>
>> Cc: Alexei Starovoitov <ast@fb.com>
>> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
>> Cc: Daniel Borkmann <daniel@iogearbox.net>
>> Cc: Wang Nan <wangnan0@huawei.com>
>> ---
>>   tools/lib/bpf/bpf.h | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
>> index a2f9853dd882..df6e186da788 100644
>> --- a/tools/lib/bpf/bpf.h
>> +++ b/tools/lib/bpf/bpf.h
>> @@ -22,6 +22,7 @@
>>   #define __BPF_BPF_H
>>     #include <linux/bpf.h>
>> +#include <stddef.h>
>>     int bpf_create_map(enum bpf_map_type map_type, int key_size, int
>> value_size,
>>              int max_entries, __u32 map_flags);
> 
> 
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web