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

chore(codegen): Fix duplicate BPF_F_LINK #1154

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

dave-tucker
Copy link
Member

@dave-tucker dave-tucker commented Jan 31, 2025

Per the comment added in the code, there are 2 definitions of BPF_F_LINK in the kernel headers. Once is in an anonymous enum which bindgen will constify, and once is via a #define macro. The values are identical. The fix is to exclude BPF_F_LINK from the list of variables in bindgen removing one of the duplicate definitions.


This change is Reviewable

Per the comment added in the code, there are 2 definitions of
BPF_F_LINK in the kernel headers. Once is in an anonymous enum which
bindgen will constify, and once is via a #define macro. The values are
identical. The fix is to exclude BPF_F_LINK from the list of variables
in bindgen removing one of the duplicate definitions.

Signed-off-by: Dave Tucker <[email protected]>
Copy link

netlify bot commented Jan 31, 2025

Deploy Preview for aya-rs-docs ready!

Name Link
🔨 Latest commit d92284e
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/679cff77b441db00085c88e1
😎 Deploy Preview https://deploy-preview-1154--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mergify mergify bot added the test A PR that improves test cases or CI label Jan 31, 2025
Copy link
Member

@tamird tamird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @dave-tucker and @vadorovsky)


xtask/src/codegen/aya.rs line 219 at r1 (raw file):

            bindgen = bindgen
                .allowlist_var(x)
                // BPF_F_LINK is defined twice. Once in an anonymous enum

Curious, where is the enum? I only find https://github.com/torvalds/linux/blob/69e858e0b8b2ea07759e995aa383e8780d9d140c/include/uapi/linux/bpf.h#L1210 which is the define.

Copy link
Member

@tamird tamird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @vadorovsky)


xtask/src/codegen/aya.rs line 219 at r1 (raw file):

Previously, tamird (Tamir Duberstein) wrote…

Curious, where is the enum? I only find https://github.com/torvalds/linux/blob/69e858e0b8b2ea07759e995aa383e8780d9d140c/include/uapi/linux/bpf.h#L1210 which is the define.

Ah, it's here: https://github.com/libbpf/libbpf/blob/324f3c3846d99c8a1e1384a55591f893f0ae5de4/include/uapi/linux/bpf.h#L1400

@dave-tucker
Copy link
Member Author

Thanks for the fast review @tamird 🫡

@dave-tucker dave-tucker merged commit fdd25cd into aya-rs:main Jan 31, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test A PR that improves test cases or CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants