Skip to content

Commit

Permalink
move changes to src/unix/linux_like/linux/mod.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
arctic-alpaca committed Nov 20, 2024
1 parent 6bc41c9 commit 88aa42a
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 64 deletions.
5 changes: 0 additions & 5 deletions libc-test/semver/linux-gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions libc-test/semver/linux-musl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 0 additions & 27 deletions src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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! {
Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand Down
32 changes: 32 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down Expand Up @@ -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! {
Expand Down Expand Up @@ -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;
Expand Down
27 changes: 0 additions & 27 deletions src/unix/linux_like/linux/musl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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! {
Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit 88aa42a

Please sign in to comment.