File tree Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -933,6 +933,7 @@ struct bpf_prog_aux {
933
933
bool func_proto_unreliable ;
934
934
bool sleepable ;
935
935
bool tail_call_reachable ;
936
+ bool xdp_has_frags ;
936
937
struct hlist_node tramp_hlist ;
937
938
/* BTF_KIND_FUNC_PROTO for valid attach_btf_id */
938
939
const struct btf_type * attach_func_proto ;
Original file line number Diff line number Diff line change @@ -1113,6 +1113,11 @@ enum bpf_link_type {
1113
1113
*/
1114
1114
#define BPF_F_SLEEPABLE (1U << 4)
1115
1115
1116
+ /* If BPF_F_XDP_HAS_FRAGS is used in BPF_PROG_LOAD command, the loaded program
1117
+ * fully support xdp frags.
1118
+ */
1119
+ #define BPF_F_XDP_HAS_FRAGS (1U << 5)
1120
+
1116
1121
/* When BPF ldimm64's insn[0].src_reg != 0 then this can have
1117
1122
* the following extensions:
1118
1123
*
Original file line number Diff line number Diff line change @@ -2217,7 +2217,8 @@ static int bpf_prog_load(union bpf_attr *attr, bpfptr_t uattr)
2217
2217
BPF_F_ANY_ALIGNMENT |
2218
2218
BPF_F_TEST_STATE_FREQ |
2219
2219
BPF_F_SLEEPABLE |
2220
- BPF_F_TEST_RND_HI32 ))
2220
+ BPF_F_TEST_RND_HI32 |
2221
+ BPF_F_XDP_HAS_FRAGS ))
2221
2222
return - EINVAL ;
2222
2223
2223
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)
2303
2304
prog -> aux -> dst_prog = dst_prog ;
2304
2305
prog -> aux -> offload_requested = !!attr -> prog_ifindex ;
2305
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
2309
err = security_bpf_prog_alloc (prog -> aux );
2308
2310
if (err )
Original file line number Diff line number Diff line change @@ -1113,6 +1113,11 @@ enum bpf_link_type {
1113
1113
*/
1114
1114
#define BPF_F_SLEEPABLE (1U << 4)
1115
1115
1116
+ /* If BPF_F_XDP_HAS_FRAGS is used in BPF_PROG_LOAD command, the loaded program
1117
+ * fully support xdp frags.
1118
+ */
1119
+ #define BPF_F_XDP_HAS_FRAGS (1U << 5)
1120
+
1116
1121
/* When BPF ldimm64's insn[0].src_reg != 0 then this can have
1117
1122
* the following extensions:
1118
1123
*
You can’t perform that action at this time.
0 commit comments