diff options
author | Jiong Wang <jiong.wang@netronome.com> | 2019-05-24 23:25:19 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-05-24 18:58:37 -0700 |
commit | 046561981b948e07df096a8402f9efc80bc784d9 (patch) | |
tree | f98a6321e327d3bb2649b2f8854d7106778b9f03 /tools/lib/bpf/bpf.c | |
parent | d6c2308c742a655f4598364ab331959639aae166 (diff) | |
download | linux-046561981b948e07df096a8402f9efc80bc784d9.tar.bz2 |
libbpf: add "prog_flags" to bpf_program/bpf_prog_load_attr/bpf_load_program_attr
libbpf doesn't allow passing "prog_flags" during bpf program load in a
couple of load related APIs, "bpf_load_program_xattr", "load_program" and
"bpf_prog_load_xattr".
It makes sense to allow passing "prog_flags" which is useful for
customizing program loading.
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/bpf.c')
-rw-r--r-- | tools/lib/bpf/bpf.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index c4a48086dc9a..0d4b4fe10a84 100644 --- a/tools/lib/bpf/bpf.c +++ b/tools/lib/bpf/bpf.c @@ -256,6 +256,7 @@ int bpf_load_program_xattr(const struct bpf_load_program_attr *load_attr, if (load_attr->name) memcpy(attr.prog_name, load_attr->name, min(strlen(load_attr->name), BPF_OBJ_NAME_LEN - 1)); + attr.prog_flags = load_attr->prog_flags; fd = sys_bpf_prog_load(&attr, sizeof(attr)); if (fd >= 0) |