History

bpf: report offload info to user space

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.

Jakub Kicinski committed 9 years ago

Commit bd601b61 parent ab3f0064 files · +24 −0Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/bpf.h+6−0
@@ -895,6 +895,10 @@ enum sk_action { · 894 unmodified lines
895895
896896 #define BPF_TAG_SIZE 8
897897
898+enum bpf_prog_status {
899+ BPF_PROG_STATUS_DEV_BOUND = (1 << 0),
900+};
901+
898902 struct bpf_prog_info {
899903 __u32 type;
900904 __u32 id;
@@ -908,6 +912,8 @@ struct bpf_prog_info { · 7 unmodified lines
908912 __u32 nr_map_ids;
909913 __aligned_u64 map_ids;
910914 char name[BPF_OBJ_NAME_LEN];
915+ __u32 ifindex;
916+ __u32 status;
911917 } __attribute__((aligned(8)));
912918
913919 struct bpf_map_info {