-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
move AF_XDP structs and constants to linux/mod.rs
#4163
Conversation
r? @JohnTitor rustbot has assigned @JohnTitor. Use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
If the _v1
structs aren't intended to be used anymore, could you mark them as deprecated here? Then this can go to 0.2, and they can be removed in a separate PR that only goes to main
.
501b2fc
to
2a21a93
Compare
If the CI failure is related to the changes, I cannot tell what caused it. |
src/unix/linux_like/linux/mod.rs
Outdated
|
||
#[deprecated( | ||
since = "0.2.167", | ||
note = "We consider removing this as the newer version of this struct will work with older kernel versions. If you're using it, please comment on https://github.com/rust-lang/libc/issues/4168" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight rewording to suggest an alternative, and to rewrap to 100 characters. Could you update the others as well?
note = "We consider removing this as the newer version of this struct will work with older kernel versions. If you're using it, please comment on https://github.com/rust-lang/libc/issues/4168" | |
note = "Use `xdp_ring_offset` instead, which will still work with old kernel versions. If \ | |
you still need this version, please comment at \ | |
https://github.com/rust-lang/libc/issues/4168" |
After this please squash and we should be able to merge.
Nah CI is just Android getting stuck, that happens for some reason |
I just realized that I made a mistake with the deprecation. The older versions might be used to check sizes for when another version gets added. Basically checking the length the kernel returns against I'm not sure whether you would prefer to keep them in, or to only support the latest version of the Linux Kernel. Sorry for getting this wrong. If it's fine for you, I'd remove the deprecation info and close the issue so that this PR only contains the move to the |
I think I need to double check what the kernel headers/docs say to get a better understanding. Feel free to drop deprecation from this PR, we can revisit later. |
2a21a93
to
9e358a7
Compare
Thanks, sorry again for the trouble. |
9e358a7
to
7eaea55
Compare
No trouble at all :) |
Description
As discussed in #3956, the
AF_XDP
structs and constants are all uapi and as such should go intosrc/unix/linux_like/linux/mod.rs
. This PR moves allAF_XDP
structs and constants there.The
_v1
versions are for backwards compatibility with older kernel versions. With v1.0, they could probably be removed, since the newer versions will work (with new fields not being taken into account by the kernel). If that is desirable, I can crate a follow-up PR to remove them or remove them here.Sources
if_xdp.h
.xdp_ring_offset_v1
&xdp_mmap_offsets_v1
inxsk.h
.xdp_umem_reg_v1
&xdp_statistics_v1
inxsk.c
.Checklist
libc-test/semver
have been updated*LAST
or*MAX
areincluded (see #3131)
cd libc-test && cargo test --target mytarget
);especially relevant for platforms that may not be checked in CI
I could not test the the changes locally due to the error described in #3865 (comment)