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. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
ab3f0063c4
commit
bd601b6ada
@@ -895,6 +895,10 @@ enum sk_action {
|
||||
|
||||
#define BPF_TAG_SIZE 8
|
||||
|
||||
enum bpf_prog_status {
|
||||
BPF_PROG_STATUS_DEV_BOUND = (1 << 0),
|
||||
};
|
||||
|
||||
struct bpf_prog_info {
|
||||
__u32 type;
|
||||
__u32 id;
|
||||
@@ -908,6 +912,8 @@ struct bpf_prog_info {
|
||||
__u32 nr_map_ids;
|
||||
__aligned_u64 map_ids;
|
||||
char name[BPF_OBJ_NAME_LEN];
|
||||
__u32 ifindex;
|
||||
__u32 status;
|
||||
} __attribute__((aligned(8)));
|
||||
|
||||
struct bpf_map_info {
|
||||
|
Reference in New Issue
Block a user