lkml.org 
[lkml]   [2019]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH v2 bpf-next 7/9] libbpf: add libbpf support to batch ops
Date


On 11/19/19 11:30 AM, Brian Vazquez wrote:
> From: Yonghong Song <yhs@fb.com>
>
> Added four libbpf API functions to support map batch operations:
> . int bpf_map_delete_batch( ... )
> . int bpf_map_lookup_batch( ... )
> . int bpf_map_lookup_and_delete_batch( ... )
> . int bpf_map_update_batch( ... )
>
> Signed-off-by: Yonghong Song <yhs@fb.com>
> ---
> tools/lib/bpf/bpf.c | 61 ++++++++++++++++++++++++++++++++++++++++
> tools/lib/bpf/bpf.h | 14 +++++++++
> tools/lib/bpf/libbpf.map | 4 +++
> 3 files changed, 79 insertions(+)
>
> diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
> index 98596e15390fb..9acd9309b47b3 100644
> --- a/tools/lib/bpf/bpf.c
> +++ b/tools/lib/bpf/bpf.c
> @@ -443,6 +443,67 @@ int bpf_map_freeze(int fd)
> return sys_bpf(BPF_MAP_FREEZE, &attr, sizeof(attr));
> }
>
[...]> LIBBPF_API int bpf_obj_pin(int fd, const char *pathname);
> LIBBPF_API int bpf_obj_get(const char *pathname);
> LIBBPF_API int bpf_prog_attach(int prog_fd, int attachable_fd,
> diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map
> index 8ddc2c40e482d..56462fea66f74 100644
> --- a/tools/lib/bpf/libbpf.map
> +++ b/tools/lib/bpf/libbpf.map
> @@ -207,4 +207,8 @@ LIBBPF_0.0.6 {
> bpf_program__size;
> btf__find_by_name_kind;
> libbpf_find_vmlinux_btf_id;
> + bpf_map_delete_batch;
> + bpf_map_lookup_and_delete_batch;
> + bpf_map_lookup_batch;
> + bpf_map_update_batch;

Please insert new API functions following alphabet ordering.

> } LIBBPF_0.0.5;
>
\
 
 \ /
  Last update: 2019-11-21 19:30    [W:0.163 / U:2.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site