From: "Wangnan (F)" <wangnan0@huawei.com>
To: "Mickaël Salaün" <mic@digikod.net>, linux-kernel@vger.kernel.org
Cc: Alexei Starovoitov <ast@fb.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Daniel Borkmann <daniel@iogearbox.net>,
"David S . Miller" <davem@davemloft.net>,
<netdev@vger.kernel.org>, Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH net-next v5 04/11] bpf: Use bpf_load_program() from the library
Date: Fri, 10 Feb 2017 10:25:58 +0800 [thread overview]
Message-ID: <2ffd3f6b-ee07-af83-ced3-bad5e4e35cc8@huawei.com> (raw)
In-Reply-To: <20170209232145.19085-5-mic@digikod.net>
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:
Acked-by Wang Nan <wangnan0@huawei.com>
Thank you.
next prev parent reply other threads:[~2017-02-10 2:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-09 23:21 [PATCH net-next v5 00/11] Improve BPF selftests and use the library (net-next tree) Mickaël Salaün
2017-02-09 23:21 ` [PATCH net-next v5 01/11] tools: Sync {,tools/}include/uapi/linux/bpf.h Mickaël Salaün
2017-02-09 23:21 ` [PATCH net-next v5 02/11] bpf: Change the include directory for selftest Mickaël Salaün
2017-02-09 23:21 ` [PATCH net-next v5 03/11] bpf: Always test unprivileged programs Mickaël Salaün
2017-02-09 23:21 ` [PATCH net-next v5 04/11] bpf: Use bpf_load_program() from the library Mickaël Salaün
2017-02-10 2:25 ` Wangnan (F) [this message]
2017-02-10 2:39 ` Wangnan (F)
2017-02-09 23:21 ` [PATCH net-next v5 05/11] bpf: Use bpf_map_update_elem() " Mickaël Salaün
2017-02-09 23:21 ` [PATCH net-next v5 06/11] bpf: Use bpf_map_lookup_elem() " Mickaël Salaün
2017-02-09 23:21 ` [PATCH net-next v5 07/11] bpf: Use bpf_map_delete_elem() " Mickaël Salaün
2017-02-09 23:21 ` [PATCH net-next v5 08/11] bpf: Use bpf_map_get_next_key() " Mickaël Salaün
2017-02-09 23:21 ` [PATCH net-next v5 09/11] bpf: Use bpf_create_map() " Mickaël Salaün
2017-02-09 23:21 ` [PATCH net-next v5 10/11] bpf: Remove bpf_sys.h from selftests Mickaël Salaün
2017-02-10 2:30 ` Wangnan (F)
2017-02-09 23:21 ` [PATCH net-next v5 11/11] bpf: Add test_tag to .gitignore Mickaël Salaün
2017-02-10 20:56 ` [PATCH net-next v5 00/11] Improve BPF selftests and use the library (net-next tree) David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2ffd3f6b-ee07-af83-ced3-bad5e4e35cc8@huawei.com \
--to=wangnan0@huawei.com \
--cc=acme@redhat.com \
--cc=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mic@digikod.net \
--cc=netdev@vger.kernel.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®