Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1577964
| From | Daniel Borkmann <daniel@iogearbox.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH net-next v4 04/11] bpf: Use bpf_load_program() from the library |
| Date | 2017-02-09 22:30 +0100 |
| Message-ID | <t94rT-2U0-7@gated-at.bofh.it> (permalink) |
| References | <t8Hvk-56F-21@gated-at.bofh.it> <t8Hvl-56F-51@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 02/08/2017 09:49 PM, Mickaël Salaün wrote:
> Replace bpf_prog_load() with bpf_load_program() calls.
>
> Signed-off-by: Mickaël Salaün <mic@digikod.net>
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: Shuah Khan <shuah@kernel.org>
[...]
> diff --git a/tools/testing/selftests/bpf/test_tag.c b/tools/testing/selftests/bpf/test_tag.c
> index 5f7c602f47d1..b77dc4b03e77 100644
> --- a/tools/testing/selftests/bpf/test_tag.c
> +++ b/tools/testing/selftests/bpf/test_tag.c
> @@ -16,6 +16,8 @@
> #include <linux/bpf.h>
> #include <linux/if_alg.h>
>
> +#include <bpf/bpf.h>
> +
> #include "../../../include/linux/filter.h"
>
> #include "bpf_sys.h"
> @@ -55,8 +57,8 @@ static int bpf_try_load_prog(int insns, int fd_map,
> int fd_prog;
>
> bpf_filler(insns, fd_map);
> - fd_prog = bpf_prog_load(BPF_PROG_TYPE_SCHED_CLS, prog, insns *
> - sizeof(struct bpf_insn), "", NULL, 0);
> + fd_prog = bpf_load_program(BPF_PROG_TYPE_SCHED_CLS, prog, insns, "", 0,
> + NULL, 0);
Went over the set and generally looks good. Please make sure though,
like in above case that you properly fix aligning next line to the
opening '('. I've noticed this multiple times in this and in the next
patch at least. Please double check the rest of your series as well.
Thanks,
Daniel
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH net-next v4 00/11] Improve BPF selftests and use the library (net-next tree) Mickaël Salaün <mic@digikod.net> - 2017-02-08 22:00 +0100
[PATCH net-next v4 09/11] bpf: Use bpf_create_map() from the library Mickaël Salaün <mic@digikod.net> - 2017-02-08 22:00 +0100
[PATCH net-next v4 11/11] bpf: Add test_tag to .gitignore Mickaël Salaün <mic@digikod.net> - 2017-02-08 22:00 +0100
[PATCH net-next v4 10/11] bpf: Remove bpf_sys.h from selftests Mickaël Salaün <mic@digikod.net> - 2017-02-08 22:00 +0100
[PATCH net-next v4 08/11] bpf: Use bpf_map_get_next_key() from the library Mickaël Salaün <mic@digikod.net> - 2017-02-08 22:00 +0100
[PATCH net-next v4 04/11] bpf: Use bpf_load_program() from the library Mickaël Salaün <mic@digikod.net> - 2017-02-08 22:00 +0100
Re: [PATCH net-next v4 04/11] bpf: Use bpf_load_program() from the library Daniel Borkmann <daniel@iogearbox.net> - 2017-02-09 22:30 +0100
csiph-web