bpf: Allow to specify kernel module BTFs when attaching BPF programs
[linux-2.6-microblaze.git] / include / uapi / linux / bpf.h
index c3458ec..1233f14 100644 (file)
@@ -557,7 +557,12 @@ union bpf_attr {
                __aligned_u64   line_info;      /* line info */
                __u32           line_info_cnt;  /* number of bpf_line_info records */
                __u32           attach_btf_id;  /* in-kernel BTF type id to attach to */
-               __u32           attach_prog_fd; /* 0 to attach to vmlinux */
+               union {
+                       /* valid prog_fd to attach to bpf prog */
+                       __u32           attach_prog_fd;
+                       /* or valid module BTF object fd or 0 to attach to vmlinux */
+                       __u32           attach_btf_obj_fd;
+               };
        };
 
        struct { /* anonymous struct used by BPF_OBJ_* commands */