diff options
author | Tao Chen <chen.dylane@linux.dev> | 2025-07-10 11:20:32 +0800 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2025-07-11 10:51:55 -0700 |
commit | b725441f02c2b31c04a95d0e9ca5420fa029a767 (patch) | |
tree | 2f2dc3a2f6835dbcc09fad06ab975f60304a0607 /drivers/net/netkit.c | |
parent | d81526a6ebff4ac2358b71d40271c8f95212fac1 (diff) |
bpf: Add attach_type field to bpf_link
Attach_type will be set when a link is created by user. It is better to
record attach_type in bpf_link generically and have it available
universally for all link types. So add the attach_type field in bpf_link
and move the sleepable field to avoid unnecessary gap padding.
Signed-off-by: Tao Chen <chen.dylane@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20250710032038.888700-2-chen.dylane@linux.dev
Diffstat (limited to 'drivers/net/netkit.c')
-rw-r--r-- | drivers/net/netkit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/netkit.c b/drivers/net/netkit.c index d072a7968f56..5928c99eac73 100644 --- a/drivers/net/netkit.c +++ b/drivers/net/netkit.c @@ -775,7 +775,7 @@ static int netkit_link_init(struct netkit_link *nkl, struct bpf_prog *prog) { bpf_link_init(&nkl->link, BPF_LINK_TYPE_NETKIT, - &netkit_link_lops, prog); + &netkit_link_lops, prog, attr->link_create.attach_type); nkl->location = attr->link_create.attach_type; nkl->dev = dev; return bpf_link_prime(&nkl->link, link_primer); |