Extend struct bpf_prog_info to contain information about program being bound to a device. Since the netdev may get destroyed while program still exists we need a flag to indicate the program is loaded for a device, even if the device is gone.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -895,6 +895,10 @@ enum sk_action { · 894 unmodified lines | |||
| 895 | 895 | ||
| 896 | #define BPF_TAG_SIZE 8 | 896 | #define BPF_TAG_SIZE 8 |
| 897 | 897 | ||
| 898 | enum bpf_prog_status { | ||
| 899 | BPF_PROG_STATUS_DEV_BOUND = (1 << 0), | ||
| 900 | }; | ||
| 901 | |||
| 898 | struct bpf_prog_info { | 902 | struct bpf_prog_info { |
| 899 | __u32 type; | 903 | __u32 type; |
| 900 | __u32 id; | 904 | __u32 id; |
| @@ -908,6 +912,8 @@ struct bpf_prog_info { · 7 unmodified lines | |||
| 908 | __u32 nr_map_ids; | 912 | __u32 nr_map_ids; |
| 909 | __aligned_u64 map_ids; | 913 | __aligned_u64 map_ids; |
| 910 | char name[BPF_OBJ_NAME_LEN]; | 914 | char name[BPF_OBJ_NAME_LEN]; |
| 915 | __u32 ifindex; | ||
| 916 | __u32 status; | ||
| 911 | } __attribute__((aligned(8))); | 917 | } __attribute__((aligned(8))); |
| 912 | 918 | ||
| 913 | struct bpf_map_info { | 919 | struct bpf_map_info { |