[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250708082228.824766-7-chen.dylane@linux.dev>
Date: Tue, 8 Jul 2025 16:22:27 +0800
From: Tao Chen <chen.dylane@...ux.dev>
To: daniel@...earbox.net,
razor@...ckwall.org,
andrew+netdev@...n.ch,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
ast@...nel.org,
andrii@...nel.org,
martin.lau@...ux.dev,
eddyz87@...il.com,
song@...nel.org,
yonghong.song@...ux.dev,
john.fastabend@...il.com,
kpsingh@...nel.org,
sdf@...ichev.me,
haoluo@...gle.com,
jolsa@...nel.org,
mattbobrowski@...gle.com,
rostedt@...dmis.org,
mhiramat@...nel.org,
mathieu.desnoyers@...icios.com,
horms@...nel.org,
willemb@...gle.com,
jakub@...udflare.com,
pablo@...filter.org,
kadlec@...filter.org,
hawk@...nel.org
Cc: bpf@...r.kernel.org,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org,
netfilter-devel@...r.kernel.org,
coreteam@...filter.org,
Tao Chen <chen.dylane@...ux.dev>
Subject: [PATCH bpf-next v2 6/7] bpf: Remove attach_type in bpf_tracing_link
Use attach_type in bpf_link, and remove it in bpf_tracing_link.
Signed-off-by: Tao Chen <chen.dylane@...ux.dev>
---
include/linux/bpf.h | 1 -
kernel/bpf/syscall.c | 5 ++---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 12a965362de..9c4ed6b372b 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1783,7 +1783,6 @@ struct bpf_shim_tramp_link {
struct bpf_tracing_link {
struct bpf_tramp_link link;
- enum bpf_attach_type attach_type;
struct bpf_trampoline *trampoline;
struct bpf_prog *tgt_prog;
};
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 14883b3040a..bed523bf92c 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -3414,7 +3414,7 @@ static void bpf_tracing_link_show_fdinfo(const struct bpf_link *link,
"target_obj_id:\t%u\n"
"target_btf_id:\t%u\n"
"cookie:\t%llu\n",
- tr_link->attach_type,
+ link->attach_type,
target_obj_id,
target_btf_id,
tr_link->link.cookie);
@@ -3426,7 +3426,7 @@ static int bpf_tracing_link_fill_link_info(const struct bpf_link *link,
struct bpf_tracing_link *tr_link =
container_of(link, struct bpf_tracing_link, link.link);
- info->tracing.attach_type = tr_link->attach_type;
+ info->tracing.attach_type = link->attach_type;
info->tracing.cookie = tr_link->link.cookie;
bpf_trampoline_unpack_key(tr_link->trampoline->key,
&info->tracing.target_obj_id,
@@ -3516,7 +3516,6 @@ static int bpf_tracing_prog_attach(struct bpf_prog *prog,
bpf_link_init(&link->link.link, BPF_LINK_TYPE_TRACING,
&bpf_tracing_link_lops, prog, attach_type);
- link->attach_type = prog->expected_attach_type;
link->link.cookie = bpf_cookie;
mutex_lock(&prog->aux->dst_mutex);
--
2.48.1
Powered by blists - more mailing lists