[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200410031043.lza5p6rzi6vajy7h@ast-mbp.dhcp.thefacebook.com>
Date: Thu, 9 Apr 2020 20:10:43 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Yonghong Song <yhs@...com>
Cc: Andrii Nakryiko <andriin@...com>, bpf@...r.kernel.org,
Martin KaFai Lau <kafai@...com>, netdev@...r.kernel.org,
Alexei Starovoitov <ast@...com>,
Daniel Borkmann <daniel@...earbox.net>, kernel-team@...com
Subject: Re: [RFC PATCH bpf-next 11/16] bpf: implement query for target_proto
and file dumper prog_id
On Wed, Apr 08, 2020 at 04:25:33PM -0700, Yonghong Song wrote:
> diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
> index a245f0df53c4..fc2157e319f1 100644
> --- a/tools/include/uapi/linux/bpf.h
> +++ b/tools/include/uapi/linux/bpf.h
> @@ -113,6 +113,7 @@ enum bpf_cmd {
> BPF_MAP_DELETE_BATCH,
> BPF_LINK_CREATE,
> BPF_LINK_UPDATE,
> + BPF_DUMP_QUERY,
> };
>
> enum bpf_map_type {
> @@ -594,6 +595,18 @@ union bpf_attr {
> __u32 old_prog_fd;
> } link_update;
>
> + struct {
> + __u32 query_fd;
> + __u32 flags;
> + union {
> + struct {
> + __aligned_u64 target_proto;
> + __u32 proto_buf_len;
> + };
> + __u32 prog_id;
> + };
> + } dump_query;
I think it would be cleaner to use BPF_OBJ_GET_INFO_BY_FD instead of
introducing new command.
Powered by blists - more mailing lists