Since commit
6d61a2b55799 ("lib: add libbpf support"), passing the
verbose flag to tc filter doesn't dump the verifier logs anymore in case
of successful loading.
This commit fixes it by setting the log_level attribute before loading.
To that end, we need to call bpf_object__load_xattr directly instead of
relying on bpf_object__load.
Fixes: 6d61a2b55799 ("lib: add libbpf support")
Signed-off-by: Paul Chaignon <paul@isovalent.com>
Acked-by: Hangbin Liu <haliu@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
static int load_bpf_object(struct bpf_cfg_in *cfg)
{
+ struct bpf_object_load_attr attr = {};
struct bpf_program *p, *prog = NULL;
struct bpf_object *obj;
char root_path[PATH_MAX];
if (ret)
goto unload_obj;
- ret = bpf_object__load(obj);
+ attr.obj = obj;
+ if (cfg->verbose)
+ attr.log_level = 2;
+
+ ret = bpf_object__load_xattr(&attr);
if (ret)
goto unload_obj;