New flag BPF_F_XDP_DEV_BOUND_ONLY plus all the infra to have a way to associate a netdev with a BPF program at load time. netdevsim checks are dropped in favor of generic check in dev_xdp_attach.
Showing the changes to include/uapi (1 of 8 files). Show all
Unified · Split
| @@ -1156,6 +1156,11 @@ enum bpf_link_type { · 1155 unmodified lines | |||
| 1156 | */ | 1156 | */ |
| 1157 | #define BPF_F_XDP_HAS_FRAGS (1U << 5) | 1157 | #define BPF_F_XDP_HAS_FRAGS (1U << 5) |
| 1158 | 1158 | ||
| 1159 | /* If BPF_F_XDP_DEV_BOUND_ONLY is used in BPF_PROG_LOAD command, the loaded | ||
| 1160 | * program becomes device-bound but can access XDP metadata. | ||
| 1161 | */ | ||
| 1162 | #define BPF_F_XDP_DEV_BOUND_ONLY (1U << 6) | ||
| 1163 | |||
| 1159 | /* link_create.kprobe_multi.flags used in LINK_CREATE command for | 1164 | /* link_create.kprobe_multi.flags used in LINK_CREATE command for |
| 1160 | * BPF_TRACE_KPROBE_MULTI attach type to create return probe. | 1165 | * BPF_TRACE_KPROBE_MULTI attach type to create return probe. |
| 1161 | */ | 1166 | */ |