Skip to content

Move attach_type into bpf_link

Tao Chen bpf linux-trace-kernel lkml netdev netfilter-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 3 repliesIn review 6 of 7 applied
  2. v37 patches 9 repliesSuperseded
  3. v27 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches2 repliesSuperseded

Changes in v4 from the cover letter

- move netns_type field to the end in bpf_netns_link to fill the byte hole.(Jakub)
- the series reviewed-by Jakub
- patch1,2,3,4,7 acked-by Daniel
- patch7 acked-by Nikolay
- change the patch0 name to be consistent with the v1 version, sorry for that the name is the same as patch1 in v2 and v3.
v3: https://lore.kernel.org/bpf/[email protected]

Patches in v4 6 of 7 applied

#Subject and filesSizeRepliesApplied
1/7bpf: Add attach_type in bpf_linkdrivers/net/netkit.c include/linux/bpf.h kernel/bpf/bpf_iter.c +11 more+66 -421 reply
2/7bpf: Remove attach_type in bpf_cgroup_linkinclude/linux/bpf-cgroup.h kernel/bpf/cgroup.c+6 -80 repliesApplied
3/7bpf: Remove attach_type in sockmap_linknet/core/sock_map.c+4 -61 replyApplied
4/7bpf: Remove location field in tcx_linkinclude/net/tcx.h kernel/bpf/tcx.c+6 -81 replyApplied
5/7bpf: Remove attach_type in bpf_netns_linkkernel/bpf/net_namespace.c+3 -50 repliesApplied
6/7bpf: Remove attach_type in bpf_tracing_linkinclude/linux/bpf.h kernel/bpf/syscall.c+2 -40 repliesApplied
7/7netkit: Remove location field in netkit_linkdrivers/net/netkit.c+3 -50 repliesApplied

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchDaniel BorkmannJiri OlsaJakub SitnickiNikolay AleksandrovJohn Fastabend
1/7A-b A-b
2/7A-b A-b
3/7A-b A-b A-b
4/7A-b A-b A-b
5/7A-b R-b
6/7A-b
7/7A-b A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v4 thread

Cover letter [PATCH bpf-next v4 0/7] Move attach_type into bpf_link

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-7 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 (7):
bpf: Add attach_type in bpf_link
bpf: Remove attach_type in bpf_cgroup_link
bpf: Remove attach_type in 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
netkit: Remove location field in netkit_link

 drivers/net/netkit.c           | 10 ++++-----
 include/linux/bpf-cgroup.h     |  1 -
 include/linux/bpf.h            | 29 ++++++++++++++----------
 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     | 10 ++++-----
 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 ++-
 16 files changed, 90 insertions(+), 78 deletions(-)

Change list:
v3 -> v4:
- move netns_type field to the end in bpf_netns_link to fill the byte hole.(Jakub)
- the series reviewed-by Jakub
- patch1,2,3,4,7 acked-by Daniel
- patch7 acked-by Nikolay
- change the patch0 name to be consistent with the v1 version, sorry for that the name is the same as patch1 in v2 and v3.
v3: https://lore.kernel.org/bpf/[email protected]

v2 -> v3:
- move sleepable field to the end in bpf_link to fill the byte hole.(Jiri)
- Acked from Jiri
v2: https://lore.kernel.org/bpf/[email protected]

v1 -> v2:
- fix build error.(Jiri)
v1: https://lore.kernel.org/bpf/[email protected]

Signature · 1 line
2.48.1