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 | 896 | #define BPF_TAG_SIZE 8 |
| 897 | 897 | |
| 898 | +enum bpf_prog_status { | |
| 899 | + BPF_PROG_STATUS_DEV_BOUND = (1 << 0), | |
| 900 | +}; | |
| 901 | + | |
| 898 | 902 | struct bpf_prog_info { |
| 899 | 903 | __u32 type; |
| 900 | 904 | __u32 id; |
| @@ -908,6 +912,8 @@ struct bpf_prog_info { · 7 unmodified lines | ||
| 908 | 912 | __u32 nr_map_ids; |
| 909 | 913 | __aligned_u64 map_ids; |
| 910 | 914 | char name[BPF_OBJ_NAME_LEN]; |
| 915 | + __u32 ifindex; | |
| 916 | + __u32 status; | |
| 911 | 917 | } __attribute__((aligned(8))); |
| 912 | 918 | |
| 913 | 919 | struct bpf_map_info { |