diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt index 87fb4e480f7f2..83dd825584cd0 100644 --- a/libc-test/semver/linux-gnu.txt +++ b/libc-test/semver/linux-gnu.txt @@ -489,17 +489,12 @@ XDP_RING_NEED_WAKEUP XDP_RX_RING XDP_SHARED_UMEM XDP_STATISTICS -XDP_TXMD_FLAGS_CHECKSUM -XDP_TXMD_FLAGS_TIMESTAMP -XDP_TX_METADATA XDP_TX_RING XDP_UMEM_COMPLETION_RING XDP_UMEM_FILL_RING XDP_UMEM_PGOFF_COMPLETION_RING XDP_UMEM_PGOFF_FILL_RING XDP_UMEM_REG -XDP_UMEM_TX_METADATA_LEN -XDP_UMEM_TX_SW_CSUM XDP_UMEM_UNALIGNED_CHUNK_FLAG XDP_USE_NEED_WAKEUP XDP_USE_SG diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt index 802e1477ca470..62b188dac8288 100644 --- a/libc-test/semver/linux-musl.txt +++ b/libc-test/semver/linux-musl.txt @@ -48,17 +48,12 @@ XDP_RING_NEED_WAKEUP XDP_RX_RING XDP_SHARED_UMEM XDP_STATISTICS -XDP_TXMD_FLAGS_CHECKSUM -XDP_TXMD_FLAGS_TIMESTAMP -XDP_TX_METADATA XDP_TX_RING XDP_UMEM_COMPLETION_RING XDP_UMEM_FILL_RING XDP_UMEM_PGOFF_COMPLETION_RING XDP_UMEM_PGOFF_FILL_RING XDP_UMEM_REG -XDP_UMEM_TX_METADATA_LEN -XDP_UMEM_TX_SW_CSUM XDP_UMEM_UNALIGNED_CHUNK_FLAG XDP_USE_NEED_WAKEUP XDP_USE_SG diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index 655bfce4e1fa8..a983d62341dcf 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -3387,6 +3387,11 @@ W_EXITCODE W_STOPCODE XATTR_CREATE XATTR_REPLACE +XDP_TXMD_FLAGS_CHECKSUM +XDP_TXMD_FLAGS_TIMESTAMP +XDP_TX_METADATA +XDP_UMEM_TX_METADATA_LEN +XDP_UMEM_TX_SW_CSUM XTABS YESEXPR YESSTR diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs index f67b291bf2e2b..2f1bef1ddb4af 100644 --- a/src/unix/linux_like/linux/gnu/mod.rs +++ b/src/unix/linux_like/linux/gnu/mod.rs @@ -436,15 +436,6 @@ s! { pub options: ::__u32, } - pub struct xsk_tx_metadata_completion { - pub tx_timestamp: ::__u64, - } - - pub struct xsk_tx_metadata_request { - pub csum_start: ::__u16, - pub csum_offset: ::__u16, - } - pub struct iocb { pub aio_data: ::__u64, #[cfg(target_endian = "little")] @@ -666,18 +657,6 @@ s_no_extra_traits! { pub ut_addr_v6: [i32; 4], __glibc_reserved: [::c_char; 20], } - - #[allow(missing_debug_implementations)] - pub struct xsk_tx_metadata { - pub flags: ::__u64, - pub xsk_tx_metadata_union: __c_anonymous_xsk_tx_metadata_union, - } - - #[allow(missing_debug_implementations)] - pub union __c_anonymous_xsk_tx_metadata_union { - pub request: xsk_tx_metadata_request, - pub completion: xsk_tx_metadata_completion, - } } cfg_if! { @@ -1109,8 +1088,6 @@ pub const XDP_USE_NEED_WAKEUP: ::__u16 = 1 << 3; pub const XDP_USE_SG: ::__u16 = 1 << 4; pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: ::__u32 = 1 << 0; -pub const XDP_UMEM_TX_SW_CSUM: ::__u32 = 1 << 1; -pub const XDP_UMEM_TX_METADATA_LEN: ::__u32 = 1 << 2; pub const XDP_RING_NEED_WAKEUP: ::__u32 = 1 << 0; @@ -1133,11 +1110,7 @@ pub const XDP_UMEM_PGOFF_COMPLETION_RING: ::c_ulonglong = 0x180000000; pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: ::c_int = 48; pub const XSK_UNALIGNED_BUF_ADDR_MASK: ::c_ulonglong = (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1; -pub const XDP_TXMD_FLAGS_TIMESTAMP: ::__u32 = 1 << 0; -pub const XDP_TXMD_FLAGS_CHECKSUM: ::__u32 = 1 << 1; - pub const XDP_PKT_CONTD: ::__u32 = 1 << 0; -pub const XDP_TX_METADATA: ::__u32 = 1 << 1; pub const ELFOSABI_ARM_AEABI: u8 = 64; diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 9ce4e50c019fb..2bfd2fc145a97 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1194,6 +1194,16 @@ s! { pub chan: ::c_uint, pub rsv: [::c_uint; 5], } + + // linux/if_xdp.h + pub struct xsk_tx_metadata_completion { + pub tx_timestamp: ::__u64, + } + + pub struct xsk_tx_metadata_request { + pub csum_start: ::__u16, + pub csum_offset: ::__u16, + } } cfg_if! { @@ -1648,6 +1658,19 @@ s_no_extra_traits! { pub flags: ::c_uint, pub anonymous_2: __c_anonymous_ptp_perout_request_2, } + + // linux/if_xdp.h + #[allow(missing_debug_implementations)] + pub struct xsk_tx_metadata { + pub flags: ::__u64, + pub xsk_tx_metadata_union: __c_anonymous_xsk_tx_metadata_union, + } + + #[allow(missing_debug_implementations)] + pub union __c_anonymous_xsk_tx_metadata_union { + pub request: xsk_tx_metadata_request, + pub completion: xsk_tx_metadata_completion, + } } cfg_if! { @@ -5592,6 +5615,15 @@ pub const SCHED_FLAG_KEEP_PARAMS: ::c_int = 0x10; pub const SCHED_FLAG_UTIL_CLAMP_MIN: ::c_int = 0x20; pub const SCHED_FLAG_UTIL_CLAMP_MAX: ::c_int = 0x40; +// linux/if_xdp.h +pub const XDP_UMEM_TX_SW_CSUM: ::__u32 = 1 << 1; +pub const XDP_UMEM_TX_METADATA_LEN: ::__u32 = 1 << 2; + +pub const XDP_TXMD_FLAGS_TIMESTAMP: ::__u32 = 1 << 0; +pub const XDP_TXMD_FLAGS_CHECKSUM: ::__u32 = 1 << 1; + +pub const XDP_TX_METADATA: ::__u32 = 1 << 1; + // elf.h pub const NT_PRSTATUS: ::c_int = 1; pub const NT_PRFPREG: ::c_int = 2; diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index 82d319ff08649..ec295aa57deb3 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -346,15 +346,6 @@ s! { pub options: ::__u32, } - pub struct xsk_tx_metadata_completion { - pub tx_timestamp: ::__u64, - } - - pub struct xsk_tx_metadata_request { - pub csum_start: ::__u16, - pub csum_offset: ::__u16, - } - // netinet/tcp.h pub struct tcp_info { @@ -492,18 +483,6 @@ s_no_extra_traits! { pub ut_addr_v6: [::c_uint; 4], __unused: [::c_char; 20], } - - #[allow(missing_debug_implementations)] - pub struct xsk_tx_metadata { - pub flags: ::__u64, - pub xsk_tx_metadata_union: __c_anonymous_xsk_tx_metadata_union, - } - - #[allow(missing_debug_implementations)] - pub union __c_anonymous_xsk_tx_metadata_union { - pub request: xsk_tx_metadata_request, - pub completion: xsk_tx_metadata_completion, - } } cfg_if! { @@ -909,8 +888,6 @@ pub const XDP_USE_NEED_WAKEUP: ::__u16 = 1 << 3; pub const XDP_USE_SG: ::__u16 = 1 << 4; pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: ::__u32 = 1 << 0; -pub const XDP_UMEM_TX_SW_CSUM: ::__u32 = 1 << 1; -pub const XDP_UMEM_TX_METADATA_LEN: ::__u32 = 1 << 2; pub const XDP_RING_NEED_WAKEUP: ::__u32 = 1 << 0; @@ -933,11 +910,7 @@ pub const XDP_UMEM_PGOFF_COMPLETION_RING: ::c_ulonglong = 0x180000000; pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: ::c_int = 48; pub const XSK_UNALIGNED_BUF_ADDR_MASK: ::c_ulonglong = (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1; -pub const XDP_TXMD_FLAGS_TIMESTAMP: ::__u32 = 1 << 0; -pub const XDP_TXMD_FLAGS_CHECKSUM: ::__u32 = 1 << 1; - pub const XDP_PKT_CONTD: ::__u32 = 1 << 0; -pub const XDP_TX_METADATA: ::__u32 = 1 << 1; pub const _CS_V6_ENV: ::c_int = 1148; pub const _CS_V7_ENV: ::c_int = 1149;