X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tools%2Flib%2Fbpf%2Fbpf.c;h=575867d694965cc65ad52910a1850442d52a5f34;hb=1f235777c3a4ab115162fe7d45b82be534b9ae2e;hp=6a96e665dc5dbdc16d0c6b6959e59ef5cbd590e6;hpb=8308bf207ce6963adb42791cfb260dc6552b6665;p=platform%2Fkernel%2Flinux-rpi.git diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index 6a96e66..575867d 100644 --- a/tools/lib/bpf/bpf.c +++ b/tools/lib/bpf/bpf.c @@ -84,9 +84,7 @@ static inline int sys_bpf_fd(enum bpf_cmd cmd, union bpf_attr *attr, return ensure_good_fd(fd); } -#define PROG_LOAD_ATTEMPTS 5 - -static inline int sys_bpf_prog_load(union bpf_attr *attr, unsigned int size, int attempts) +int sys_bpf_prog_load(union bpf_attr *attr, unsigned int size, int attempts) { int fd; @@ -263,7 +261,7 @@ int bpf_prog_load(enum bpf_prog_type prog_type, attr.prog_ifindex = OPTS_GET(opts, prog_ifindex, 0); attr.kern_version = OPTS_GET(opts, kern_version, 0); - if (prog_name) + if (prog_name && kernel_supports(NULL, FEAT_PROG_NAME)) libbpf_strlcpy(attr.prog_name, prog_name, sizeof(attr.prog_name)); attr.license = ptr_to_u64(license);