Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1578146
| From | "Wangnan (F)" <wangnan0@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH net-next v5 04/11] bpf: Use bpf_load_program() from the library |
| Date | 2017-02-10 04:00 +0100 |
| Message-ID | <t99Bf-5Yu-7@gated-at.bofh.it> (permalink) |
| References | <t96k1-465-3@gated-at.bofh.it> <t96k1-465-7@gated-at.bofh.it> <t998d-5Oi-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 2017/2/10 10:25, Wangnan (F) wrote:
>
>
> On 2017/2/10 7:21, 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>
>> ---
>> tools/lib/bpf/bpf.c | 6 +++---
>> tools/lib/bpf/bpf.h | 4 ++--
>> tools/testing/selftests/bpf/Makefile | 4 +++-
>> tools/testing/selftests/bpf/bpf_sys.h | 21 ---------------------
>> tools/testing/selftests/bpf/test_tag.c | 6 ++++--
>> tools/testing/selftests/bpf/test_verifier.c | 8 +++++---
>> 6 files changed, 17 insertions(+), 32 deletions(-)
>>
>> diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
>> index 3ddb58a36d3c..58ce252073fa 100644
>> --- a/tools/lib/bpf/bpf.c
>> +++ b/tools/lib/bpf/bpf.c
>> @@ -42,7 +42,7 @@
>> # endif
>> #endif
>> -static __u64 ptr_to_u64(void *ptr)
>> +static __u64 ptr_to_u64(const void *ptr)
>> {
>> return (__u64) (unsigned long) ptr;
>> }
>> @@ -69,8 +69,8 @@ int bpf_create_map(enum bpf_map_type map_type, int
>> key_size,
>> return sys_bpf(BPF_MAP_CREATE, &attr, sizeof(attr));
>> }
>> -int bpf_load_program(enum bpf_prog_type type, struct bpf_insn *insns,
>> - size_t insns_cnt, char *license,
>> +int bpf_load_program(enum bpf_prog_type type, const struct bpf_insn
>> *insns,
>> + size_t insns_cnt, const char *license,
>> __u32 kern_version, char *log_buf, size_t log_buf_sz)
>> {
>> int fd;
>> diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
>> index a2f9853dd882..bc959a2de023 100644
>> --- a/tools/lib/bpf/bpf.h
>> +++ b/tools/lib/bpf/bpf.h
>> @@ -28,8 +28,8 @@ int bpf_create_map(enum bpf_map_type map_type, int
>> key_size, int value_size,
>> /* Recommend log buffer size */
>> #define BPF_LOG_BUF_SIZE 65536
>> -int bpf_load_program(enum bpf_prog_type type, struct bpf_insn *insns,
>> - size_t insns_cnt, char *license,
>> +int bpf_load_program(enum bpf_prog_type type, const struct bpf_insn
>> *insns,
>> + size_t insns_cnt, const char *license,
>> __u32 kern_version, char *log_buf,
>> size_t log_buf_sz);
>
> For libbpf changes:
And for similar code in patch 5-8:
Acked-by Wang Nan <wangnan0@huawei.com>
Thank you.
>
> Acked-by Wang Nan <wangnan0@huawei.com>
>
> Thank you.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH net-next v5 04/11] bpf: Use bpf_load_program() from the library Mickaël Salaün <mic@digikod.net> - 2017-02-10 00:30 +0100
Re: [PATCH net-next v5 04/11] bpf: Use bpf_load_program() from the library "Wangnan (F)" <wangnan0@huawei.com> - 2017-02-10 03:30 +0100
Re: [PATCH net-next v5 04/11] bpf: Use bpf_load_program() from the library "Wangnan (F)" <wangnan0@huawei.com> - 2017-02-10 04:00 +0100
csiph-web