netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/6] Move attach_type into bpf_link
@ 2025-07-07 15:39 Tao Chen
  2025-07-07 15:39 ` [PATCH bpf-next 1/6] bpf: Add attach_type in bpf_link Tao Chen
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Tao Chen @ 2025-07-07 15:39 UTC (permalink / raw)
  To: ast, daniel, john.fastabend, andrii, martin.lau, eddyz87, song,
	yonghong.song, kpsingh, sdf, haoluo, jolsa, mattbobrowski,
	rostedt, mhiramat, mathieu.desnoyers, davem, edumazet, kuba,
	pabeni, horms, kuniyu, willemb, jakub, pablo, kadlec, hawk
  Cc: bpf, linux-kernel, netdev, linux-trace-kernel, netfilter-devel,
	coreteam, Tao Chen

Andrii suggested moving the attach_type into bpf_link, the previous discussion
is as follows:
https://lore.kernel.org/bpf/CAEf4BzY7TZRjxpCJM-+LYgEqe23YFj5Uv3isb7gat2-HU4OSng@mail.gmail.com

patch1 add attach_type in bpf_link, and pass it to bpf_link_init, which
will init the attach_type field.

patch2-6 remove the attach_type in struct bpf_xx_link, update the info
with bpf_link attach_type.

There are some functions finally call bpf_link_init but do not have bpf_attr
from user or do not need to init attach_type from user like bpf_raw_tracepoint_open,
now use prog->expected_attach_type to init attach_type.

bpf_struct_ops_map_update_elem
bpf_raw_tracepoint_open
bpf_struct_ops_test_run

Feedback of any kind is welcome, thanks.

Tao Chen (6):
  bpf: Add attach_type in bpf_link
  bpf: Remove attach_type in bpf_cgroup_link
  bpf: Remove attach_type in bpf_sockmap_link
  bpf: Remove location field in tcx_link
  bpf: Remove attach_type in bpf_netns_link
  bpf: Remove attach_type in bpf_tracing_link

 include/linux/bpf-cgroup.h     |  1 -
 include/linux/bpf.h            | 18 +++++++++------
 include/net/tcx.h              |  1 -
 kernel/bpf/bpf_iter.c          |  3 ++-
 kernel/bpf/bpf_struct_ops.c    |  5 +++--
 kernel/bpf/cgroup.c            | 17 +++++++--------
 kernel/bpf/net_namespace.c     |  8 +++----
 kernel/bpf/syscall.c           | 40 ++++++++++++++++++++--------------
 kernel/bpf/tcx.c               | 16 +++++++-------
 kernel/bpf/trampoline.c        | 10 +++++----
 kernel/trace/bpf_trace.c       |  4 ++--
 net/bpf/bpf_dummy_struct_ops.c |  3 ++-
 net/core/dev.c                 |  3 ++-
 net/core/sock_map.c            | 13 +++++------
 net/netfilter/nf_bpf_link.c    |  3 ++-
 15 files changed, 79 insertions(+), 66 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-07-08  4:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07 15:39 [PATCH bpf-next 0/6] Move attach_type into bpf_link Tao Chen
2025-07-07 15:39 ` [PATCH bpf-next 1/6] bpf: Add attach_type in bpf_link Tao Chen
2025-07-07 21:13   ` Jiri Olsa
2025-07-08  2:26     ` Tao Chen
2025-07-08  4:10   ` kernel test robot
2025-07-07 15:39 ` [PATCH bpf-next 2/6] bpf: Remove attach_type in bpf_cgroup_link Tao Chen
2025-07-07 15:39 ` [PATCH bpf-next 3/6] bpf: Remove attach_type in bpf_sockmap_link Tao Chen
2025-07-07 15:39 ` [PATCH bpf-next 4/6] bpf: Remove location field in tcx_link Tao Chen
2025-07-07 15:39 ` [PATCH bpf-next 5/6] bpf: Remove attach_type in bpf_netns_link Tao Chen
2025-07-07 15:39 ` [PATCH bpf-next 6/6] bpf: Remove attach_type in bpf_tracing_link Tao Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).