diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-06-28 17:41:37 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-06-30 19:01:50 -0400 |
commit | 9aba36139a5f9ee1d11a60d0a3a90944b8d56385 (patch) | |
tree | 5af0a8406c86a3b9c2e494ab1db58bb4456892ed /tools/lib/bpf/libbpf.h | |
parent | d9b683d7464ec9e8298d82c00b9033c96e27a187 (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.h | 2 |
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 | ||
111 | void *bpf_program__priv(struct bpf_program *prog); | 111 | void *bpf_program__priv(struct bpf_program *prog); |
112 | void bpf_program__set_ifindex(struct bpf_program *prog, __u32 ifindex); | ||
112 | 113 | ||
113 | const char *bpf_program__title(struct bpf_program *prog, bool needs_copy); | 114 | const 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 *); | |||
251 | int bpf_map__set_priv(struct bpf_map *map, void *priv, | 252 | int 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); |
253 | void *bpf_map__priv(struct bpf_map *map); | 254 | void *bpf_map__priv(struct bpf_map *map); |
255 | void bpf_map__set_ifindex(struct bpf_map *map, __u32 ifindex); | ||
254 | int bpf_map__pin(struct bpf_map *map, const char *path); | 256 | int bpf_map__pin(struct bpf_map *map, const char *path); |
255 | 257 | ||
256 | long libbpf_get_error(const void *ptr); | 258 | long libbpf_get_error(const void *ptr); |