aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf.h
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2018-06-28 17:41:37 -0400
committerDaniel Borkmann <daniel@iogearbox.net>2018-06-30 19:01:50 -0400
commit9aba36139a5f9ee1d11a60d0a3a90944b8d56385 (patch)
tree5af0a8406c86a3b9c2e494ab1db58bb4456892ed /tools/lib/bpf/libbpf.h
parentd9b683d7464ec9e8298d82c00b9033c96e27a187 (diff)
tools: libbpf: allow setting ifindex for programs and maps
Users of bpf_object__open()/bpf_object__load() APIs may want to load the programs and maps onto a device for offload. Allow setting ifindex on those sub-objects. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r--tools/lib/bpf/libbpf.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 09976531aa74..564f4be9bae0 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -109,6 +109,7 @@ int bpf_program__set_priv(struct bpf_program *prog, void *priv,
109 bpf_program_clear_priv_t clear_priv); 109 bpf_program_clear_priv_t clear_priv);
110 110
111void *bpf_program__priv(struct bpf_program *prog); 111void *bpf_program__priv(struct bpf_program *prog);
112void bpf_program__set_ifindex(struct bpf_program *prog, __u32 ifindex);
112 113
113const char *bpf_program__title(struct bpf_program *prog, bool needs_copy); 114const char *bpf_program__title(struct bpf_program *prog, bool needs_copy);
114 115
@@ -251,6 +252,7 @@ typedef void (*bpf_map_clear_priv_t)(struct bpf_map *, void *);
251int bpf_map__set_priv(struct bpf_map *map, void *priv, 252int bpf_map__set_priv(struct bpf_map *map, void *priv,
252 bpf_map_clear_priv_t clear_priv); 253 bpf_map_clear_priv_t clear_priv);
253void *bpf_map__priv(struct bpf_map *map); 254void *bpf_map__priv(struct bpf_map *map);
255void bpf_map__set_ifindex(struct bpf_map *map, __u32 ifindex);
254int bpf_map__pin(struct bpf_map *map, const char *path); 256int bpf_map__pin(struct bpf_map *map, const char *path);
255 257
256long libbpf_get_error(const void *ptr); 258long libbpf_get_error(const void *ptr);