Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf: add support for BTF_KIND_DECL_TAG typedef #1974

Closed
wants to merge 6 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: bpf: add support for BTF_KIND_DECL_TAG typedef
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=568137

@kernel-patches-bot
Copy link
Author

Master branch: db5b6a4
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=568137
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 44ce0ac
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=568137
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 549beec
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=568137
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: b0c7663
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=568137
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 29da17c
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=568137
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 57385ae
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=568137
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 1000298
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=568137
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 59f2a29
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=568137
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: e89ef63
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=568137
version: 1

Nobody and others added 6 commits October 22, 2021 17:05
The llvm patches ([1], [2]) added support to attach btf_decl_tag
attributes to typedef declarations. This patch added
support in kernel.

  [1] https://reviews.llvm.org/D110127
  [2] https://reviews.llvm.org/D112259

Signed-off-by: Yonghong Song <yhs@fb.com>
Test good and bad variants of typedef BTF_KIND_DECL_TAG encoding.

Signed-off-by: Yonghong Song <yhs@fb.com>
Add unit tests for deduplication of BTF_KIND_DECL_TAG to typedef types.
Also changed a few comments from "tag" to "decl_tag" to match
BTF_KIND_DECL_TAG enum value name.

Signed-off-by: Yonghong Song <yhs@fb.com>
Change value type in progs/tag.c to a typedef with a btf_decl_tag.
With `bpftool btf dump file tag.o`, we have
  ...
  [14] TYPEDEF 'value_t' type_id=17
  [15] DECL_TAG 'tag1' type_id=14 component_idx=-1
  [16] DECL_TAG 'tag2' type_id=14 component_idx=-1
  [17] STRUCT '(anon)' size=8 vlen=2
        'a' type_id=2 bits_offset=0
        'b' type_id=2 bits_offset=32
  ...

The btf_tag selftest also succeeded:
  $ ./test_progs -t tag
    #21 btf_tag:OK
    Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Yonghong Song <yhs@fb.com>
Add BTF_KIND_DECL_TAG typedef support in btf.rst.

Signed-off-by: Yonghong Song <yhs@fb.com>
@kernel-patches-bot
Copy link
Author

Master branch: a33f607
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=568137
version: 1

@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=568137 irrelevant now. Closing PR.

@kernel-patches-bot kernel-patches-bot deleted the series/568137=>bpf-next branch October 23, 2021 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants