History

bpf: introduce BPF_F_XDP_HAS_FRAGS flag in prog_flags loading the ebpf program

Introduce BPF_F_XDP_HAS_FRAGS and the related field in bpf_prog_aux in order to notify the driver the loaded program support xdp frags.

Lorenzo Bianconi committed 4 years ago

Commit c2f2cdb1 parent c41ced04 files · +14 −1Browse files

Showing the changes to kernel (1 of 4 files). Show all

Unified · Split

kernel/bpf/syscall.c+3−1
@@ -2217,7 +2217,8 @@ static int bpf_prog_load(union bpf_attr *attr, bpfptr_t uattr) · 2216 unmodified lines
2217 BPF_F_ANY_ALIGNMENT |2217 BPF_F_ANY_ALIGNMENT |
2218 BPF_F_TEST_STATE_FREQ |2218 BPF_F_TEST_STATE_FREQ |
2219 BPF_F_SLEEPABLE |2219 BPF_F_SLEEPABLE |
2220 BPF_F_TEST_RND_HI32))2220 BPF_F_TEST_RND_HI32 |
2221 BPF_F_XDP_HAS_FRAGS))
2221 return -EINVAL;2222 return -EINVAL;
2222 2223
2223 if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) &&2224 if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) &&
@@ -2303,6 +2304,7 @@ static int bpf_prog_load(union bpf_attr *attr, bpfptr_t uattr) · 79 unmodified lines
2303 prog->aux->dst_prog = dst_prog;2304 prog->aux->dst_prog = dst_prog;
2304 prog->aux->offload_requested = !!attr->prog_ifindex;2305 prog->aux->offload_requested = !!attr->prog_ifindex;
2305 prog->aux->sleepable = attr->prog_flags & BPF_F_SLEEPABLE;2306 prog->aux->sleepable = attr->prog_flags & BPF_F_SLEEPABLE;
2307 prog->aux->xdp_has_frags = attr->prog_flags & BPF_F_XDP_HAS_FRAGS;
2306 2308
2307 err = security_bpf_prog_alloc(prog->aux);2309 err = security_bpf_prog_alloc(prog->aux);
2308 if (err)2310 if (err)