@@ -1294,6 +1294,12 @@ bool __bpf_dynptr_is_rdonly(const struct bpf_dynptr_kern *ptr);
1294
1294
#ifdef CONFIG_BPF_JIT
1295
1295
int bpf_trampoline_link_prog (struct bpf_tramp_link * link , struct bpf_trampoline * tr );
1296
1296
int bpf_trampoline_unlink_prog (struct bpf_tramp_link * link , struct bpf_trampoline * tr );
1297
+ int bpf_extension_link_prog (struct bpf_tramp_link * link ,
1298
+ struct bpf_trampoline * tr ,
1299
+ struct bpf_prog * tgt_prog );
1300
+ int bpf_extension_unlink_prog (struct bpf_tramp_link * link ,
1301
+ struct bpf_trampoline * tr ,
1302
+ struct bpf_prog * tgt_prog );
1297
1303
struct bpf_trampoline * bpf_trampoline_get (u64 key ,
1298
1304
struct bpf_attach_target_info * tgt_info );
1299
1305
void bpf_trampoline_put (struct bpf_trampoline * tr );
@@ -1383,6 +1389,18 @@ static inline int bpf_trampoline_unlink_prog(struct bpf_tramp_link *link,
1383
1389
{
1384
1390
return - ENOTSUPP ;
1385
1391
}
1392
+ static inline int bpf_extension_link_prog (struct bpf_tramp_link * link ,
1393
+ struct bpf_trampoline * tr ,
1394
+ struct bpf_prog * tgt_prog )
1395
+ {
1396
+ return - ENOTSUPP ;
1397
+ }
1398
+ static inline int bpf_extension_unlink_prog (struct bpf_tramp_link * link ,
1399
+ struct bpf_trampoline * tr ,
1400
+ struct bpf_prog * tgt_prog )
1401
+ {
1402
+ return - ENOTSUPP ;
1403
+ }
1386
1404
static inline struct bpf_trampoline * bpf_trampoline_get (u64 key ,
1387
1405
struct bpf_attach_target_info * tgt_info )
1388
1406
{
@@ -1483,6 +1501,9 @@ struct bpf_prog_aux {
1483
1501
bool xdp_has_frags ;
1484
1502
bool exception_cb ;
1485
1503
bool exception_boundary ;
1504
+ bool is_extended ; /* true if extended by freplace program */
1505
+ u64 prog_array_member_cnt ; /* counts how many times as member of prog_array */
1506
+ struct mutex ext_mutex ; /* mutex for is_extended and prog_array_member_cnt */
1486
1507
struct bpf_arena * arena ;
1487
1508
/* BTF_KIND_FUNC_PROTO for valid attach_btf_id */
1488
1509
const struct btf_type * attach_func_proto ;
0 commit comments