diff options
author | David S. Miller <davem@davemloft.net> | 2019-02-02 05:12:18 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-02 05:12:18 +0100 |
commit | beb73559bf57b0151dba0c27c4f866599f57bb0b (patch) | |
tree | f6d2fd8d8409add55ee3ae57d39e793f971b1b88 /tools/lib/bpf/bpf.c | |
parent | Merge branch 'devlink-add-device-driver-information-API' (diff) | |
parent | Merge branch 'shifts-cleanup' (diff) | |
download | linux-beb73559bf57b0151dba0c27c4f866599f57bb0b.tar.xz linux-beb73559bf57b0151dba0c27c4f866599f57bb0b.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
Alexei Starovoitov says:
====================
pull-request: bpf-next 2019-02-01
The following pull-request contains BPF updates for your *net-next* tree.
The main changes are:
1) introduce bpf_spin_lock, from Alexei.
2) convert xdp samples to libbpf, from Maciej.
3) skip verifier tests for unsupported program/map types, from Stanislav.
4) powerpc64 JIT support for BTF line info, from Sandipan.
5) assorted fixed, from Valdis, Jesper, Jiong.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/lib/bpf/bpf.c')
-rw-r--r-- | tools/lib/bpf/bpf.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index 88cbd110ae58..3defad77dc7a 100644 --- a/tools/lib/bpf/bpf.c +++ b/tools/lib/bpf/bpf.c @@ -368,6 +368,19 @@ int bpf_map_lookup_elem(int fd, const void *key, void *value) return sys_bpf(BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr)); } +int bpf_map_lookup_elem_flags(int fd, const void *key, void *value, __u64 flags) +{ + union bpf_attr attr; + + bzero(&attr, sizeof(attr)); + attr.map_fd = fd; + attr.key = ptr_to_u64(key); + attr.value = ptr_to_u64(value); + attr.flags = flags; + + return sys_bpf(BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr)); +} + int bpf_map_lookup_and_delete_elem(int fd, const void *key, void *value) { union bpf_attr attr; |