diff --git a/bindgen-tests/Cargo.toml b/bindgen-tests/Cargo.toml
index 2f3ec700c9..8598e9de1c 100644
--- a/bindgen-tests/Cargo.toml
+++ b/bindgen-tests/Cargo.toml
@@ -26,3 +26,4 @@ runtime = ["bindgen/runtime"]
__testing_only_extra_assertions = ["bindgen/__testing_only_extra_assertions"]
__testing_only_libclang_16 = ["bindgen/__testing_only_libclang_16"]
__testing_only_libclang_20 = ["bindgen/__testing_only_libclang_20"]
+__testing_only_libclang_22 = ["bindgen/__testing_only_libclang_22"]
diff --git a/bindgen-tests/tests/expectations/tests/libclang-22/constified-enum-module-overflow.rs b/bindgen-tests/tests/expectations/tests/libclang-22/constified-enum-module-overflow.rs
new file mode 100644
index 0000000000..4f8296c65c
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-22/constified-enum-module-overflow.rs
@@ -0,0 +1,32 @@
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct B {
+ pub _address: u8,
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct C {
+ pub _address: u8,
+}
+pub type C_U = B;
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct A {
+ pub u: u8,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of A"][::std::mem::size_of::() - 1usize];
+ ["Alignment of A"][::std::mem::align_of::() - 1usize];
+ ["Offset of field: A::u"][::std::mem::offset_of!(A, u) - 0usize];
+};
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of template specialization: C_open0_A_close0",
+ ][::std::mem::size_of::() - 1usize];
+ [
+ "Align of template specialization: C_open0_A_close0",
+ ][::std::mem::align_of::() - 1usize];
+};
diff --git a/bindgen-tests/tests/expectations/tests/libclang-22/issue-2566-cstr.rs b/bindgen-tests/tests/expectations/tests/libclang-22/issue-2566-cstr.rs
new file mode 100644
index 0000000000..72f7f710ab
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-22/issue-2566-cstr.rs
@@ -0,0 +1,3 @@
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+/// We should _not_ generate a cstr for this because cstr shouldn't have interior nulls.
+pub const FOO: &[u8; 4] = b"a\0b\0";
diff --git a/bindgen-tests/tests/expectations/tests/libclang-22/issue-544-stylo-creduce-2.rs b/bindgen-tests/tests/expectations/tests/libclang-22/issue-544-stylo-creduce-2.rs
new file mode 100644
index 0000000000..39139632ee
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-22/issue-544-stylo-creduce-2.rs
@@ -0,0 +1,17 @@
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct Foo {
+ pub member: *mut Foo_SecondAlias,
+}
+pub type Foo_FirstAlias = T;
+pub type Foo_SecondAlias = Foo;
+impl Default for Foo {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-22/layout_arp.rs b/bindgen-tests/tests/expectations/tests/libclang-22/layout_arp.rs
new file mode 100644
index 0000000000..081b9b3bcd
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-22/layout_arp.rs
@@ -0,0 +1,97 @@
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+///< Length of Ethernet address.
+pub const ETHER_ADDR_LEN: u32 = 6;
+pub const ARP_HRD_ETHER: u32 = 1;
+pub const ARP_OP_REQUEST: u32 = 1;
+pub const ARP_OP_REPLY: u32 = 2;
+pub const ARP_OP_REVREQUEST: u32 = 3;
+pub const ARP_OP_REVREPLY: u32 = 4;
+pub const ARP_OP_INVREQUEST: u32 = 8;
+pub const ARP_OP_INVREPLY: u32 = 9;
+/** Ethernet address:
+ A universally administered address is uniquely assigned to a device by its
+ manufacturer. The first three octets (in transmission order) contain the
+ Organizationally Unique Identifier (OUI). The following three (MAC-48 and
+ EUI-48) octets are assigned by that organization with the only constraint
+ of uniqueness.
+ A locally administered address is assigned to a device by a network
+ administrator and does not contain OUIs.
+ See http://standards.ieee.org/regauth/groupmac/tutorial.html*/
+#[repr(C, packed)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct ether_addr {
+ ///< Addr bytes in tx order
+ pub addr_bytes: [u8; 6usize],
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of ether_addr"][::std::mem::size_of::() - 6usize];
+ ["Alignment of ether_addr"][::std::mem::align_of::() - 1usize];
+ [
+ "Offset of field: ether_addr::addr_bytes",
+ ][::std::mem::offset_of!(ether_addr, addr_bytes) - 0usize];
+};
+/// ARP header IPv4 payload.
+#[repr(C, packed)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct arp_ipv4 {
+ ///< sender hardware address
+ pub arp_sha: ether_addr,
+ ///< sender IP address
+ pub arp_sip: u32,
+ ///< target hardware address
+ pub arp_tha: ether_addr,
+ ///< target IP address
+ pub arp_tip: u32,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of arp_ipv4"][::std::mem::size_of::() - 20usize];
+ ["Alignment of arp_ipv4"][::std::mem::align_of::() - 1usize];
+ [
+ "Offset of field: arp_ipv4::arp_sha",
+ ][::std::mem::offset_of!(arp_ipv4, arp_sha) - 0usize];
+ [
+ "Offset of field: arp_ipv4::arp_sip",
+ ][::std::mem::offset_of!(arp_ipv4, arp_sip) - 6usize];
+ [
+ "Offset of field: arp_ipv4::arp_tha",
+ ][::std::mem::offset_of!(arp_ipv4, arp_tha) - 10usize];
+ [
+ "Offset of field: arp_ipv4::arp_tip",
+ ][::std::mem::offset_of!(arp_ipv4, arp_tip) - 16usize];
+};
+/// ARP header.
+#[repr(C, packed)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct arp_hdr {
+ pub arp_hrd: u16,
+ pub arp_pro: u16,
+ pub arp_hln: u8,
+ pub arp_pln: u8,
+ pub arp_op: u16,
+ pub arp_data: arp_ipv4,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of arp_hdr"][::std::mem::size_of::() - 28usize];
+ ["Alignment of arp_hdr"][::std::mem::align_of::() - 1usize];
+ [
+ "Offset of field: arp_hdr::arp_hrd",
+ ][::std::mem::offset_of!(arp_hdr, arp_hrd) - 0usize];
+ [
+ "Offset of field: arp_hdr::arp_pro",
+ ][::std::mem::offset_of!(arp_hdr, arp_pro) - 2usize];
+ [
+ "Offset of field: arp_hdr::arp_hln",
+ ][::std::mem::offset_of!(arp_hdr, arp_hln) - 4usize];
+ [
+ "Offset of field: arp_hdr::arp_pln",
+ ][::std::mem::offset_of!(arp_hdr, arp_pln) - 5usize];
+ [
+ "Offset of field: arp_hdr::arp_op",
+ ][::std::mem::offset_of!(arp_hdr, arp_op) - 6usize];
+ [
+ "Offset of field: arp_hdr::arp_data",
+ ][::std::mem::offset_of!(arp_hdr, arp_data) - 8usize];
+};
diff --git a/bindgen-tests/tests/expectations/tests/libclang-22/layout_array.rs b/bindgen-tests/tests/expectations/tests/libclang-22/layout_array.rs
new file mode 100644
index 0000000000..8bd96e7240
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-22/layout_array.rs
@@ -0,0 +1,235 @@
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+#[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)]
+#[repr(C, align(8))]
+pub struct __BindgenOpaqueArray8(pub T);
+impl Default for __BindgenOpaqueArray8<[T; N]> {
+ fn default() -> Self {
+ Self([::default(); N])
+ }
+}
+pub const RTE_CACHE_LINE_SIZE: u32 = 64;
+///< Max length of ops struct name.
+pub const RTE_MEMPOOL_OPS_NAMESIZE: u32 = 32;
+///< Max registered ops structs
+pub const RTE_MEMPOOL_MAX_OPS_IDX: u32 = 16;
+pub const RTE_HEAP_NUM_FREELISTS: u32 = 13;
+#[repr(C)]
+#[derive(Debug)]
+pub struct rte_mempool {
+ _unused: [u8; 0],
+}
+/** Prototype for implementation specific data provisioning function.
+
+ The function should provide the implementation specific memory for
+ for use by the other mempool ops functions in a given mempool ops struct.
+ E.g. the default ops provides an instance of the rte_ring for this purpose.
+ it will most likely point to a different type of data structure, and
+ will be transparent to the application programmer.
+ This function should set mp->pool_data.*/
+pub type rte_mempool_alloc_t = ::std::option::Option<
+ unsafe extern "C" fn(mp: *mut rte_mempool) -> ::std::os::raw::c_int,
+>;
+/// Free the opaque private data pointed to by mp->pool_data pointer.
+pub type rte_mempool_free_t = ::std::option::Option<
+ unsafe extern "C" fn(mp: *mut rte_mempool),
+>;
+/// Enqueue an object into the external pool.
+pub type rte_mempool_enqueue_t = ::std::option::Option<
+ unsafe extern "C" fn(
+ mp: *mut rte_mempool,
+ obj_table: *const *mut ::std::os::raw::c_void,
+ n: ::std::os::raw::c_uint,
+ ) -> ::std::os::raw::c_int,
+>;
+/// Dequeue an object from the external pool.
+pub type rte_mempool_dequeue_t = ::std::option::Option<
+ unsafe extern "C" fn(
+ mp: *mut rte_mempool,
+ obj_table: *mut *mut ::std::os::raw::c_void,
+ n: ::std::os::raw::c_uint,
+ ) -> ::std::os::raw::c_int,
+>;
+/// Return the number of available objects in the external pool.
+pub type rte_mempool_get_count = ::std::option::Option<
+ unsafe extern "C" fn(mp: *const rte_mempool) -> ::std::os::raw::c_uint,
+>;
+/// Structure defining mempool operations structure
+#[repr(C)]
+#[repr(align(64))]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_mempool_ops {
+ ///< Name of mempool ops struct.
+ pub name: [::std::os::raw::c_char; 32usize],
+ ///< Allocate private data.
+ pub alloc: rte_mempool_alloc_t,
+ ///< Free the external pool.
+ pub free: rte_mempool_free_t,
+ ///< Enqueue an object.
+ pub enqueue: rte_mempool_enqueue_t,
+ ///< Dequeue an object.
+ pub dequeue: rte_mempool_dequeue_t,
+ ///< Get qty of available objs.
+ pub get_count: rte_mempool_get_count,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_mempool_ops"][::std::mem::size_of::() - 128usize];
+ [
+ "Alignment of rte_mempool_ops",
+ ][::std::mem::align_of::() - 64usize];
+ [
+ "Offset of field: rte_mempool_ops::name",
+ ][::std::mem::offset_of!(rte_mempool_ops, name) - 0usize];
+ [
+ "Offset of field: rte_mempool_ops::alloc",
+ ][::std::mem::offset_of!(rte_mempool_ops, alloc) - 32usize];
+ [
+ "Offset of field: rte_mempool_ops::free",
+ ][::std::mem::offset_of!(rte_mempool_ops, free) - 40usize];
+ [
+ "Offset of field: rte_mempool_ops::enqueue",
+ ][::std::mem::offset_of!(rte_mempool_ops, enqueue) - 48usize];
+ [
+ "Offset of field: rte_mempool_ops::dequeue",
+ ][::std::mem::offset_of!(rte_mempool_ops, dequeue) - 56usize];
+ [
+ "Offset of field: rte_mempool_ops::get_count",
+ ][::std::mem::offset_of!(rte_mempool_ops, get_count) - 64usize];
+};
+impl Default for rte_mempool_ops {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+/// The rte_spinlock_t type.
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_spinlock_t {
+ ///< lock status 0 = unlocked, 1 = locked
+ pub locked: ::std::os::raw::c_int,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_spinlock_t"][::std::mem::size_of::() - 4usize];
+ ["Alignment of rte_spinlock_t"][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_spinlock_t::locked",
+ ][::std::mem::offset_of!(rte_spinlock_t, locked) - 0usize];
+};
+/** Structure storing the table of registered ops structs, each of which contain
+ the function pointers for the mempool ops functions.
+ Each process has its own storage for this ops struct array so that
+ the mempools can be shared across primary and secondary processes.
+ The indices used to access the array are valid across processes, whereas
+ any function pointers stored directly in the mempool struct would not be.
+ This results in us simply having "ops_index" in the mempool struct.*/
+#[repr(C)]
+#[repr(align(64))]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_mempool_ops_table {
+ ///< Spinlock for add/delete.
+ pub sl: rte_spinlock_t,
+ ///< Number of used ops structs in the table.
+ pub num_ops: u32,
+ pub __bindgen_padding_0: __BindgenOpaqueArray8<[u8; 56usize]>,
+ /// Storage for all possible ops structs.
+ pub ops: [rte_mempool_ops; 16usize],
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_mempool_ops_table",
+ ][::std::mem::size_of::() - 2112usize];
+ [
+ "Alignment of rte_mempool_ops_table",
+ ][::std::mem::align_of::() - 64usize];
+ [
+ "Offset of field: rte_mempool_ops_table::sl",
+ ][::std::mem::offset_of!(rte_mempool_ops_table, sl) - 0usize];
+ [
+ "Offset of field: rte_mempool_ops_table::num_ops",
+ ][::std::mem::offset_of!(rte_mempool_ops_table, num_ops) - 4usize];
+ [
+ "Offset of field: rte_mempool_ops_table::ops",
+ ][::std::mem::offset_of!(rte_mempool_ops_table, ops) - 64usize];
+};
+impl Default for rte_mempool_ops_table {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+/// Structure to hold malloc heap
+#[repr(C)]
+#[repr(align(64))]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct malloc_heap {
+ pub lock: rte_spinlock_t,
+ pub free_head: [malloc_heap__bindgen_ty_1; 13usize],
+ pub alloc_count: ::std::os::raw::c_uint,
+ pub total_size: usize,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct malloc_heap__bindgen_ty_1 {
+ pub lh_first: *mut malloc_elem,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of malloc_heap__bindgen_ty_1",
+ ][::std::mem::size_of::() - 8usize];
+ [
+ "Alignment of malloc_heap__bindgen_ty_1",
+ ][::std::mem::align_of::() - 8usize];
+ [
+ "Offset of field: malloc_heap__bindgen_ty_1::lh_first",
+ ][::std::mem::offset_of!(malloc_heap__bindgen_ty_1, lh_first) - 0usize];
+};
+impl Default for malloc_heap__bindgen_ty_1 {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of malloc_heap"][::std::mem::size_of::() - 128usize];
+ ["Alignment of malloc_heap"][::std::mem::align_of::() - 64usize];
+ [
+ "Offset of field: malloc_heap::lock",
+ ][::std::mem::offset_of!(malloc_heap, lock) - 0usize];
+ [
+ "Offset of field: malloc_heap::free_head",
+ ][::std::mem::offset_of!(malloc_heap, free_head) - 8usize];
+ [
+ "Offset of field: malloc_heap::alloc_count",
+ ][::std::mem::offset_of!(malloc_heap, alloc_count) - 112usize];
+ [
+ "Offset of field: malloc_heap::total_size",
+ ][::std::mem::offset_of!(malloc_heap, total_size) - 120usize];
+};
+impl Default for malloc_heap {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct malloc_elem {
+ pub _address: u8,
+}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-22/layout_eth_conf.rs b/bindgen-tests/tests/expectations/tests/libclang-22/layout_eth_conf.rs
new file mode 100644
index 0000000000..d78a885c77
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-22/layout_eth_conf.rs
@@ -0,0 +1,1993 @@
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+#[repr(C)]
+#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub struct __BindgenBitfieldUnit {
+ storage: Storage,
+}
+impl __BindgenBitfieldUnit {
+ #[inline]
+ pub const fn new(storage: Storage) -> Self {
+ Self { storage }
+ }
+}
+impl __BindgenBitfieldUnit
+where
+ Storage: AsRef<[u8]> + AsMut<[u8]>,
+{
+ #[inline]
+ fn extract_bit(byte: u8, index: usize) -> bool {
+ let bit_index = if cfg!(target_endian = "big") {
+ 7 - (index % 8)
+ } else {
+ index % 8
+ };
+ let mask = 1 << bit_index;
+ byte & mask == mask
+ }
+ #[inline]
+ pub fn get_bit(&self, index: usize) -> bool {
+ debug_assert!(index / 8 < self.storage.as_ref().len());
+ let byte_index = index / 8;
+ let byte = self.storage.as_ref()[byte_index];
+ Self::extract_bit(byte, index)
+ }
+ #[inline]
+ pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
+ debug_assert!(index / 8 < core::mem::size_of::());
+ let byte_index = index / 8;
+ let byte = unsafe {
+ *(core::ptr::addr_of!((*this).storage) as *const u8)
+ .offset(byte_index as isize)
+ };
+ Self::extract_bit(byte, index)
+ }
+ #[inline]
+ fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
+ let bit_index = if cfg!(target_endian = "big") {
+ 7 - (index % 8)
+ } else {
+ index % 8
+ };
+ let mask = 1 << bit_index;
+ if val { byte | mask } else { byte & !mask }
+ }
+ #[inline]
+ pub fn set_bit(&mut self, index: usize, val: bool) {
+ debug_assert!(index / 8 < self.storage.as_ref().len());
+ let byte_index = index / 8;
+ let byte = &mut self.storage.as_mut()[byte_index];
+ *byte = Self::change_bit(*byte, index, val);
+ }
+ #[inline]
+ pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
+ debug_assert!(index / 8 < core::mem::size_of::());
+ let byte_index = index / 8;
+ let byte = unsafe {
+ (core::ptr::addr_of_mut!((*this).storage) as *mut u8)
+ .offset(byte_index as isize)
+ };
+ unsafe { *byte = Self::change_bit(*byte, index, val) };
+ }
+ #[inline]
+ pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
+ debug_assert!(bit_width <= 64);
+ debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
+ debug_assert!(
+ (bit_offset + (bit_width as usize) + 7) / 8 <= self.storage.as_ref().len(),
+ );
+ if bit_width == 0 {
+ return 0;
+ }
+ let mut val = 0u64;
+ let storage = self.storage.as_ref();
+ let start_byte = bit_offset / 8;
+ let bit_shift = bit_offset % 8;
+ let bytes_needed = (bit_width as usize + bit_shift + 7) / 8;
+ if cfg!(target_endian = "big") {
+ for i in 0..bytes_needed {
+ val |= (storage[start_byte + i].reverse_bits() as u64) << (i * 8);
+ }
+ } else {
+ for i in 0..bytes_needed {
+ val |= (storage[start_byte + i] as u64) << (i * 8);
+ }
+ }
+ val >>= bit_shift;
+ if bit_width < 64 {
+ val &= (1u64 << bit_width) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - bit_width as usize);
+ }
+ val
+ }
+ #[inline]
+ pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
+ debug_assert!(bit_width <= 64);
+ debug_assert!(bit_offset / 8 < core::mem::size_of::());
+ debug_assert!(
+ (bit_offset + (bit_width as usize) + 7) / 8
+ <= core::mem::size_of::(),
+ );
+ if bit_width == 0 {
+ return 0;
+ }
+ let mut val = 0u64;
+ let start_byte = bit_offset / 8;
+ let bit_shift = bit_offset % 8;
+ let bytes_needed = (bit_width as usize + bit_shift + 7) / 8;
+ let storage_ptr = unsafe { core::ptr::addr_of!((*this).storage) as *const u8 };
+ if cfg!(target_endian = "big") {
+ for i in 0..bytes_needed {
+ let byte = unsafe { *storage_ptr.add(start_byte + i) };
+ val |= (byte.reverse_bits() as u64) << (i * 8);
+ }
+ } else {
+ for i in 0..bytes_needed {
+ let byte = unsafe { *storage_ptr.add(start_byte + i) };
+ val |= (byte as u64) << (i * 8);
+ }
+ }
+ val >>= bit_shift;
+ if bit_width < 64 {
+ val &= (1u64 << bit_width) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - bit_width as usize);
+ }
+ val
+ }
+ #[inline]
+ pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
+ debug_assert!(bit_width <= 64);
+ debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
+ debug_assert!(
+ (bit_offset + (bit_width as usize) + 7) / 8 <= self.storage.as_ref().len(),
+ );
+ if bit_width == 0 {
+ return;
+ }
+ let mut val = val;
+ if bit_width < 64 {
+ val &= (1u64 << bit_width) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - bit_width as usize);
+ }
+ let storage = self.storage.as_mut();
+ let start_byte = bit_offset / 8;
+ let bit_shift = bit_offset % 8;
+ let bytes_needed = (bit_width as usize + bit_shift + 7) / 8;
+ val <<= bit_shift;
+ let field_mask = if bit_width as usize + bit_shift >= 64 {
+ !0u64 << bit_shift
+ } else {
+ ((1u64 << bit_width) - 1) << bit_shift
+ };
+ for i in 0..bytes_needed {
+ let byte_val = (val >> (i * 8)) as u8;
+ let byte_mask = (field_mask >> (i * 8)) as u8;
+ if cfg!(target_endian = "big") {
+ let byte = storage[start_byte + i].reverse_bits();
+ let new_byte = (byte & !byte_mask) | (byte_val & byte_mask);
+ storage[start_byte + i] = new_byte.reverse_bits();
+ } else {
+ storage[start_byte + i] = (storage[start_byte + i] & !byte_mask)
+ | (byte_val & byte_mask);
+ }
+ }
+ }
+ #[inline]
+ pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
+ debug_assert!(bit_width <= 64);
+ debug_assert!(bit_offset / 8 < core::mem::size_of::());
+ debug_assert!(
+ (bit_offset + (bit_width as usize) + 7) / 8
+ <= core::mem::size_of::(),
+ );
+ if bit_width == 0 {
+ return;
+ }
+ let mut val = val;
+ if bit_width < 64 {
+ val &= (1u64 << bit_width) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - bit_width as usize);
+ }
+ let start_byte = bit_offset / 8;
+ let bit_shift = bit_offset % 8;
+ let bytes_needed = (bit_width as usize + bit_shift + 7) / 8;
+ val <<= bit_shift;
+ let field_mask = if bit_width as usize + bit_shift >= 64 {
+ !0u64 << bit_shift
+ } else {
+ ((1u64 << bit_width) - 1) << bit_shift
+ };
+ let storage_ptr = unsafe { core::ptr::addr_of_mut!((*this).storage) as *mut u8 };
+ for i in 0..bytes_needed {
+ let byte_val = (val >> (i * 8)) as u8;
+ let byte_mask = (field_mask >> (i * 8)) as u8;
+ let byte_ptr = unsafe { storage_ptr.add(start_byte + i) };
+ if cfg!(target_endian = "big") {
+ let byte = unsafe { (*byte_ptr).reverse_bits() };
+ let new_byte = (byte & !byte_mask) | (byte_val & byte_mask);
+ unsafe { *byte_ptr = new_byte.reverse_bits() };
+ } else {
+ unsafe { *byte_ptr = (*byte_ptr & !byte_mask) | (byte_val & byte_mask) };
+ }
+ }
+ }
+}
+/// Const-generic methods for efficient bitfield access when offset and width
+/// are known at compile time.
+impl __BindgenBitfieldUnit<[u8; N]> {
+ /// Get a field using const generics for compile-time optimization.
+ /// Uses native word size operations when the field fits in usize.
+ #[inline]
+ pub const fn get_const(&self) -> u64 {
+ debug_assert!(BIT_WIDTH <= 64);
+ debug_assert!(BIT_OFFSET / 8 < N);
+ debug_assert!((BIT_OFFSET + (BIT_WIDTH as usize) + 7) / 8 <= N);
+ if BIT_WIDTH == 0 {
+ return 0;
+ }
+ let start_byte = BIT_OFFSET / 8;
+ let bit_shift = BIT_OFFSET % 8;
+ let bytes_needed = (BIT_WIDTH as usize + bit_shift + 7) / 8;
+ if BIT_WIDTH as usize + bit_shift <= usize::BITS as usize {
+ let mut val = 0usize;
+ if cfg!(target_endian = "big") {
+ let mut i = 0;
+ while i < bytes_needed {
+ val
+ |= (self.storage[start_byte + i].reverse_bits() as usize)
+ << (i * 8);
+ i += 1;
+ }
+ } else {
+ let mut i = 0;
+ while i < bytes_needed {
+ val |= (self.storage[start_byte + i] as usize) << (i * 8);
+ i += 1;
+ }
+ }
+ val >>= bit_shift;
+ if (BIT_WIDTH as u32) < usize::BITS {
+ val &= (1usize << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (usize::BITS as usize - BIT_WIDTH as usize);
+ }
+ val as u64
+ } else {
+ let mut val = 0u64;
+ if cfg!(target_endian = "big") {
+ let mut i = 0;
+ while i < bytes_needed {
+ val
+ |= (self.storage[start_byte + i].reverse_bits() as u64)
+ << (i * 8);
+ i += 1;
+ }
+ } else {
+ let mut i = 0;
+ while i < bytes_needed {
+ val |= (self.storage[start_byte + i] as u64) << (i * 8);
+ i += 1;
+ }
+ }
+ val >>= bit_shift;
+ if BIT_WIDTH < 64 {
+ val &= (1u64 << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - BIT_WIDTH as usize);
+ }
+ val
+ }
+ }
+ /// Set a field using const generics for compile-time optimization.
+ /// Uses native word size operations when the field fits in usize.
+ #[inline]
+ pub fn set_const(&mut self, val: u64) {
+ debug_assert!(BIT_WIDTH <= 64);
+ debug_assert!(BIT_OFFSET / 8 < N);
+ debug_assert!((BIT_OFFSET + (BIT_WIDTH as usize) + 7) / 8 <= N);
+ if BIT_WIDTH == 0 {
+ return;
+ }
+ let start_byte = BIT_OFFSET / 8;
+ let bit_shift = BIT_OFFSET % 8;
+ let bytes_needed = (BIT_WIDTH as usize + bit_shift + 7) / 8;
+ if BIT_WIDTH as usize + bit_shift <= usize::BITS as usize {
+ let mut val = val as usize;
+ if (BIT_WIDTH as u32) < usize::BITS {
+ val &= (1usize << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (usize::BITS as usize - BIT_WIDTH as usize);
+ }
+ val <<= bit_shift;
+ let field_mask = if BIT_WIDTH as usize + bit_shift >= usize::BITS as usize {
+ !0usize << bit_shift
+ } else {
+ ((1usize << BIT_WIDTH) - 1) << bit_shift
+ };
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte_val = (val >> (i * 8)) as u8;
+ let byte_mask = (field_mask >> (i * 8)) as u8;
+ if cfg!(target_endian = "big") {
+ let byte = self.storage[start_byte + i].reverse_bits();
+ let new_byte = (byte & !byte_mask) | (byte_val & byte_mask);
+ self.storage[start_byte + i] = new_byte.reverse_bits();
+ } else {
+ self.storage[start_byte + i] = (self.storage[start_byte + i]
+ & !byte_mask) | (byte_val & byte_mask);
+ }
+ i += 1;
+ }
+ } else {
+ let mut val = val;
+ if BIT_WIDTH < 64 {
+ val &= (1u64 << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - BIT_WIDTH as usize);
+ }
+ val <<= bit_shift;
+ let field_mask = if BIT_WIDTH as usize + bit_shift >= 64 {
+ !0u64 << bit_shift
+ } else {
+ ((1u64 << BIT_WIDTH) - 1) << bit_shift
+ };
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte_val = (val >> (i * 8)) as u8;
+ let byte_mask = (field_mask >> (i * 8)) as u8;
+ if cfg!(target_endian = "big") {
+ let byte = self.storage[start_byte + i].reverse_bits();
+ let new_byte = (byte & !byte_mask) | (byte_val & byte_mask);
+ self.storage[start_byte + i] = new_byte.reverse_bits();
+ } else {
+ self.storage[start_byte + i] = (self.storage[start_byte + i]
+ & !byte_mask) | (byte_val & byte_mask);
+ }
+ i += 1;
+ }
+ }
+ }
+ /// Raw pointer get using const generics for compile-time optimization.
+ /// Uses native word size operations when the field fits in usize.
+ #[inline]
+ pub const unsafe fn raw_get_const(
+ this: *const Self,
+ ) -> u64 {
+ debug_assert!(BIT_WIDTH <= 64);
+ debug_assert!(BIT_OFFSET / 8 < N);
+ debug_assert!((BIT_OFFSET + (BIT_WIDTH as usize) + 7) / 8 <= N);
+ if BIT_WIDTH == 0 {
+ return 0;
+ }
+ let start_byte = BIT_OFFSET / 8;
+ let bit_shift = BIT_OFFSET % 8;
+ let bytes_needed = (BIT_WIDTH as usize + bit_shift + 7) / 8;
+ let storage_ptr = unsafe { core::ptr::addr_of!((*this).storage) as *const u8 };
+ if BIT_WIDTH as usize + bit_shift <= usize::BITS as usize {
+ let mut val = 0usize;
+ if cfg!(target_endian = "big") {
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte = unsafe { *storage_ptr.add(start_byte + i) };
+ val |= (byte.reverse_bits() as usize) << (i * 8);
+ i += 1;
+ }
+ } else {
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte = unsafe { *storage_ptr.add(start_byte + i) };
+ val |= (byte as usize) << (i * 8);
+ i += 1;
+ }
+ }
+ val >>= bit_shift;
+ if (BIT_WIDTH as u32) < usize::BITS {
+ val &= (1usize << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (usize::BITS as usize - BIT_WIDTH as usize);
+ }
+ val as u64
+ } else {
+ let mut val = 0u64;
+ if cfg!(target_endian = "big") {
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte = unsafe { *storage_ptr.add(start_byte + i) };
+ val |= (byte.reverse_bits() as u64) << (i * 8);
+ i += 1;
+ }
+ } else {
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte = unsafe { *storage_ptr.add(start_byte + i) };
+ val |= (byte as u64) << (i * 8);
+ i += 1;
+ }
+ }
+ val >>= bit_shift;
+ if BIT_WIDTH < 64 {
+ val &= (1u64 << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - BIT_WIDTH as usize);
+ }
+ val
+ }
+ }
+ /// Raw pointer set using const generics for compile-time optimization.
+ /// Uses native word size operations when the field fits in usize.
+ #[inline]
+ pub unsafe fn raw_set_const(
+ this: *mut Self,
+ val: u64,
+ ) {
+ debug_assert!(BIT_WIDTH <= 64);
+ debug_assert!(BIT_OFFSET / 8 < N);
+ debug_assert!((BIT_OFFSET + (BIT_WIDTH as usize) + 7) / 8 <= N);
+ if BIT_WIDTH == 0 {
+ return;
+ }
+ let start_byte = BIT_OFFSET / 8;
+ let bit_shift = BIT_OFFSET % 8;
+ let bytes_needed = (BIT_WIDTH as usize + bit_shift + 7) / 8;
+ let storage_ptr = this.cast::<[u8; N]>().cast::();
+ if BIT_WIDTH as usize + bit_shift <= usize::BITS as usize {
+ let mut val = val as usize;
+ if (BIT_WIDTH as u32) < usize::BITS {
+ val &= (1usize << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (usize::BITS as usize - BIT_WIDTH as usize);
+ }
+ val <<= bit_shift;
+ let field_mask = if BIT_WIDTH as usize + bit_shift >= usize::BITS as usize {
+ !0usize << bit_shift
+ } else {
+ ((1usize << BIT_WIDTH) - 1) << bit_shift
+ };
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte_val = (val >> (i * 8)) as u8;
+ let byte_mask = (field_mask >> (i * 8)) as u8;
+ let byte_ptr = unsafe { storage_ptr.add(start_byte + i) };
+ if cfg!(target_endian = "big") {
+ let byte = unsafe { (*byte_ptr).reverse_bits() };
+ let new_byte = (byte & !byte_mask) | (byte_val & byte_mask);
+ unsafe { *byte_ptr = new_byte.reverse_bits() };
+ } else {
+ unsafe {
+ *byte_ptr = (*byte_ptr & !byte_mask) | (byte_val & byte_mask)
+ };
+ }
+ i += 1;
+ }
+ } else {
+ let mut val = val;
+ if BIT_WIDTH < 64 {
+ val &= (1u64 << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - BIT_WIDTH as usize);
+ }
+ val <<= bit_shift;
+ let field_mask = if BIT_WIDTH as usize + bit_shift >= 64 {
+ !0u64 << bit_shift
+ } else {
+ ((1u64 << BIT_WIDTH) - 1) << bit_shift
+ };
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte_val = (val >> (i * 8)) as u8;
+ let byte_mask = (field_mask >> (i * 8)) as u8;
+ let byte_ptr = unsafe { storage_ptr.add(start_byte + i) };
+ if cfg!(target_endian = "big") {
+ let byte = unsafe { (*byte_ptr).reverse_bits() };
+ let new_byte = (byte & !byte_mask) | (byte_val & byte_mask);
+ unsafe { *byte_ptr = new_byte.reverse_bits() };
+ } else {
+ unsafe {
+ *byte_ptr = (*byte_ptr & !byte_mask) | (byte_val & byte_mask)
+ };
+ }
+ i += 1;
+ }
+ }
+ }
+}
+/// Simple flags are used for rte_eth_conf.rxmode.mq_mode.
+pub const ETH_MQ_RX_RSS_FLAG: u32 = 1;
+pub const ETH_MQ_RX_DCB_FLAG: u32 = 2;
+pub const ETH_MQ_RX_VMDQ_FLAG: u32 = 4;
+///< Maximum nb. of VMDQ vlan filters.
+pub const ETH_VMDQ_MAX_VLAN_FILTERS: u32 = 64;
+///< Maximum nb. of DCB priorities.
+pub const ETH_DCB_NUM_USER_PRIORITIES: u32 = 8;
+///< Maximum nb. of VMDQ DCB queues.
+pub const ETH_VMDQ_DCB_NUM_QUEUES: u32 = 128;
+///< Maximum nb. of DCB queues.
+pub const ETH_DCB_NUM_QUEUES: u32 = 128;
+///< Max length of flexbytes.
+pub const RTE_ETH_FDIR_MAX_FLEXLEN: u32 = 16;
+///< Max length of input set.
+pub const RTE_ETH_INSET_SIZE_MAX: u32 = 128;
+pub const RTE_ETH_FLOW_UNKNOWN: u32 = 0;
+pub const RTE_ETH_FLOW_RAW: u32 = 1;
+pub const RTE_ETH_FLOW_IPV4: u32 = 2;
+pub const RTE_ETH_FLOW_FRAG_IPV4: u32 = 3;
+pub const RTE_ETH_FLOW_NONFRAG_IPV4_TCP: u32 = 4;
+pub const RTE_ETH_FLOW_NONFRAG_IPV4_UDP: u32 = 5;
+pub const RTE_ETH_FLOW_NONFRAG_IPV4_SCTP: u32 = 6;
+pub const RTE_ETH_FLOW_NONFRAG_IPV4_OTHER: u32 = 7;
+pub const RTE_ETH_FLOW_IPV6: u32 = 8;
+pub const RTE_ETH_FLOW_FRAG_IPV6: u32 = 9;
+pub const RTE_ETH_FLOW_NONFRAG_IPV6_TCP: u32 = 10;
+pub const RTE_ETH_FLOW_NONFRAG_IPV6_UDP: u32 = 11;
+pub const RTE_ETH_FLOW_NONFRAG_IPV6_SCTP: u32 = 12;
+pub const RTE_ETH_FLOW_NONFRAG_IPV6_OTHER: u32 = 13;
+pub const RTE_ETH_FLOW_L2_PAYLOAD: u32 = 14;
+pub const RTE_ETH_FLOW_IPV6_EX: u32 = 15;
+pub const RTE_ETH_FLOW_IPV6_TCP_EX: u32 = 16;
+pub const RTE_ETH_FLOW_IPV6_UDP_EX: u32 = 17;
+pub const RTE_ETH_FLOW_PORT: u32 = 18;
+///< VXLAN protocol based flow
+pub const RTE_ETH_FLOW_VXLAN: u32 = 19;
+///< GENEVE protocol based flow
+pub const RTE_ETH_FLOW_GENEVE: u32 = 20;
+///< NVGRE protocol based flow
+pub const RTE_ETH_FLOW_NVGRE: u32 = 21;
+pub const RTE_ETH_FLOW_MAX: u32 = 22;
+#[repr(u32)]
+/** A set of values to identify what method is to be used to route
+ packets to multiple queues.*/
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum rte_eth_rx_mq_mode {
+ /// None of DCB,RSS or VMDQ mode
+ ETH_MQ_RX_NONE = 0,
+ /// For RX side, only RSS is on
+ ETH_MQ_RX_RSS = 1,
+ /// For RX side,only DCB is on.
+ ETH_MQ_RX_DCB = 2,
+ /// Both DCB and RSS enable
+ ETH_MQ_RX_DCB_RSS = 3,
+ /// Only VMDQ, no RSS nor DCB
+ ETH_MQ_RX_VMDQ_ONLY = 4,
+ /// RSS mode with VMDQ
+ ETH_MQ_RX_VMDQ_RSS = 5,
+ /// Use VMDQ+DCB to route traffic to queues
+ ETH_MQ_RX_VMDQ_DCB = 6,
+ /// Enable both VMDQ and DCB in VMDq
+ ETH_MQ_RX_VMDQ_DCB_RSS = 7,
+}
+/// A structure used to configure the RX features of an Ethernet port.
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_rxmode {
+ /// The multi-queue packet distribution mode to be used, e.g. RSS.
+ pub mq_mode: rte_eth_rx_mq_mode,
+ ///< Only used if jumbo_frame enabled.
+ pub max_rx_pkt_len: u32,
+ ///< hdr buf size (header_split enabled).
+ pub split_hdr_size: u16,
+ pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_eth_rxmode"][::std::mem::size_of::() - 12usize];
+ ["Alignment of rte_eth_rxmode"][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_eth_rxmode::mq_mode",
+ ][::std::mem::offset_of!(rte_eth_rxmode, mq_mode) - 0usize];
+ [
+ "Offset of field: rte_eth_rxmode::max_rx_pkt_len",
+ ][::std::mem::offset_of!(rte_eth_rxmode, max_rx_pkt_len) - 4usize];
+ [
+ "Offset of field: rte_eth_rxmode::split_hdr_size",
+ ][::std::mem::offset_of!(rte_eth_rxmode, split_hdr_size) - 8usize];
+};
+impl Default for rte_eth_rxmode {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+impl rte_eth_rxmode {
+ #[inline]
+ pub fn header_split(&self) -> u16 {
+ self._bitfield_1.get_const::<0usize, 1u8>() as u16 as _
+ }
+ #[inline]
+ pub fn set_header_split(&mut self, val: u16) {
+ let val: u16 = val as _;
+ self._bitfield_1.set_const::<0usize, 1u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn header_split_raw(this: *const Self) -> u16 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_get_const::<0usize, 1u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u16 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_header_split_raw(this: *mut Self, val: u16) {
+ unsafe {
+ let val: u16 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_set_const::<
+ 0usize,
+ 1u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn hw_ip_checksum(&self) -> u16 {
+ self._bitfield_1.get_const::<1usize, 1u8>() as u16 as _
+ }
+ #[inline]
+ pub fn set_hw_ip_checksum(&mut self, val: u16) {
+ let val: u16 = val as _;
+ self._bitfield_1.set_const::<1usize, 1u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn hw_ip_checksum_raw(this: *const Self) -> u16 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_get_const::<1usize, 1u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u16 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_hw_ip_checksum_raw(this: *mut Self, val: u16) {
+ unsafe {
+ let val: u16 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_set_const::<
+ 1usize,
+ 1u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn hw_vlan_filter(&self) -> u16 {
+ self._bitfield_1.get_const::<2usize, 1u8>() as u16 as _
+ }
+ #[inline]
+ pub fn set_hw_vlan_filter(&mut self, val: u16) {
+ let val: u16 = val as _;
+ self._bitfield_1.set_const::<2usize, 1u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn hw_vlan_filter_raw(this: *const Self) -> u16 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_get_const::<2usize, 1u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u16 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_hw_vlan_filter_raw(this: *mut Self, val: u16) {
+ unsafe {
+ let val: u16 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_set_const::<
+ 2usize,
+ 1u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn hw_vlan_strip(&self) -> u16 {
+ self._bitfield_1.get_const::<3usize, 1u8>() as u16 as _
+ }
+ #[inline]
+ pub fn set_hw_vlan_strip(&mut self, val: u16) {
+ let val: u16 = val as _;
+ self._bitfield_1.set_const::<3usize, 1u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn hw_vlan_strip_raw(this: *const Self) -> u16 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_get_const::<3usize, 1u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u16 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_hw_vlan_strip_raw(this: *mut Self, val: u16) {
+ unsafe {
+ let val: u16 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_set_const::<
+ 3usize,
+ 1u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn hw_vlan_extend(&self) -> u16 {
+ self._bitfield_1.get_const::<4usize, 1u8>() as u16 as _
+ }
+ #[inline]
+ pub fn set_hw_vlan_extend(&mut self, val: u16) {
+ let val: u16 = val as _;
+ self._bitfield_1.set_const::<4usize, 1u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn hw_vlan_extend_raw(this: *const Self) -> u16 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_get_const::<4usize, 1u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u16 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_hw_vlan_extend_raw(this: *mut Self, val: u16) {
+ unsafe {
+ let val: u16 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_set_const::<
+ 4usize,
+ 1u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn jumbo_frame(&self) -> u16 {
+ self._bitfield_1.get_const::<5usize, 1u8>() as u16 as _
+ }
+ #[inline]
+ pub fn set_jumbo_frame(&mut self, val: u16) {
+ let val: u16 = val as _;
+ self._bitfield_1.set_const::<5usize, 1u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn jumbo_frame_raw(this: *const Self) -> u16 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_get_const::<5usize, 1u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u16 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_jumbo_frame_raw(this: *mut Self, val: u16) {
+ unsafe {
+ let val: u16 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_set_const::<
+ 5usize,
+ 1u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn hw_strip_crc(&self) -> u16 {
+ self._bitfield_1.get_const::<6usize, 1u8>() as u16 as _
+ }
+ #[inline]
+ pub fn set_hw_strip_crc(&mut self, val: u16) {
+ let val: u16 = val as _;
+ self._bitfield_1.set_const::<6usize, 1u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn hw_strip_crc_raw(this: *const Self) -> u16 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_get_const::<6usize, 1u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u16 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_hw_strip_crc_raw(this: *mut Self, val: u16) {
+ unsafe {
+ let val: u16 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_set_const::<
+ 6usize,
+ 1u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn enable_scatter(&self) -> u16 {
+ self._bitfield_1.get_const::<7usize, 1u8>() as u16 as _
+ }
+ #[inline]
+ pub fn set_enable_scatter(&mut self, val: u16) {
+ let val: u16 = val as _;
+ self._bitfield_1.set_const::<7usize, 1u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn enable_scatter_raw(this: *const Self) -> u16 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_get_const::<7usize, 1u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u16 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_enable_scatter_raw(this: *mut Self, val: u16) {
+ unsafe {
+ let val: u16 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_set_const::<
+ 7usize,
+ 1u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn enable_lro(&self) -> u16 {
+ self._bitfield_1.get_const::<8usize, 1u8>() as u16 as _
+ }
+ #[inline]
+ pub fn set_enable_lro(&mut self, val: u16) {
+ let val: u16 = val as _;
+ self._bitfield_1.set_const::<8usize, 1u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn enable_lro_raw(this: *const Self) -> u16 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_get_const::<8usize, 1u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u16 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_enable_lro_raw(this: *mut Self, val: u16) {
+ unsafe {
+ let val: u16 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 2usize],
+ >>::raw_set_const::<
+ 8usize,
+ 1u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn new_bitfield_1(
+ header_split: u16,
+ hw_ip_checksum: u16,
+ hw_vlan_filter: u16,
+ hw_vlan_strip: u16,
+ hw_vlan_extend: u16,
+ jumbo_frame: u16,
+ hw_strip_crc: u16,
+ enable_scatter: u16,
+ enable_lro: u16,
+ ) -> __BindgenBitfieldUnit<[u8; 2usize]> {
+ let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
+ __bindgen_bitfield_unit
+ .set_const::<
+ 0usize,
+ 1u8,
+ >({
+ let header_split: u16 = header_split as _;
+ header_split as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 1usize,
+ 1u8,
+ >({
+ let hw_ip_checksum: u16 = hw_ip_checksum as _;
+ hw_ip_checksum as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 2usize,
+ 1u8,
+ >({
+ let hw_vlan_filter: u16 = hw_vlan_filter as _;
+ hw_vlan_filter as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 3usize,
+ 1u8,
+ >({
+ let hw_vlan_strip: u16 = hw_vlan_strip as _;
+ hw_vlan_strip as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 4usize,
+ 1u8,
+ >({
+ let hw_vlan_extend: u16 = hw_vlan_extend as _;
+ hw_vlan_extend as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 5usize,
+ 1u8,
+ >({
+ let jumbo_frame: u16 = jumbo_frame as _;
+ jumbo_frame as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 6usize,
+ 1u8,
+ >({
+ let hw_strip_crc: u16 = hw_strip_crc as _;
+ hw_strip_crc as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 7usize,
+ 1u8,
+ >({
+ let enable_scatter: u16 = enable_scatter as _;
+ enable_scatter as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 8usize,
+ 1u8,
+ >({
+ let enable_lro: u16 = enable_lro as _;
+ enable_lro as u64
+ });
+ __bindgen_bitfield_unit
+ }
+}
+#[repr(u32)]
+/** A set of values to identify what method is to be used to transmit
+ packets using multi-TCs.*/
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum rte_eth_tx_mq_mode {
+ ///< It is in neither DCB nor VT mode.
+ ETH_MQ_TX_NONE = 0,
+ ///< For TX side,only DCB is on.
+ ETH_MQ_TX_DCB = 1,
+ ///< For TX side,both DCB and VT is on.
+ ETH_MQ_TX_VMDQ_DCB = 2,
+ ///< Only VT on, no DCB
+ ETH_MQ_TX_VMDQ_ONLY = 3,
+}
+/// A structure used to configure the TX features of an Ethernet port.
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_txmode {
+ ///< TX multi-queues mode.
+ pub mq_mode: rte_eth_tx_mq_mode,
+ pub pvid: u16,
+ pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
+ pub __bindgen_padding_0: u8,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_eth_txmode"][::std::mem::size_of::() - 8usize];
+ ["Alignment of rte_eth_txmode"][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_eth_txmode::mq_mode",
+ ][::std::mem::offset_of!(rte_eth_txmode, mq_mode) - 0usize];
+ [
+ "Offset of field: rte_eth_txmode::pvid",
+ ][::std::mem::offset_of!(rte_eth_txmode, pvid) - 4usize];
+};
+impl Default for rte_eth_txmode {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+impl rte_eth_txmode {
+ #[inline]
+ pub fn hw_vlan_reject_tagged(&self) -> u8 {
+ self._bitfield_1.get_const::<0usize, 1u8>() as u8 as _
+ }
+ #[inline]
+ pub fn set_hw_vlan_reject_tagged(&mut self, val: u8) {
+ let val: u8 = val as _;
+ self._bitfield_1.set_const::<0usize, 1u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn hw_vlan_reject_tagged_raw(this: *const Self) -> u8 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 1usize],
+ >>::raw_get_const::<0usize, 1u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u8 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_hw_vlan_reject_tagged_raw(this: *mut Self, val: u8) {
+ unsafe {
+ let val: u8 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 1usize],
+ >>::raw_set_const::<
+ 0usize,
+ 1u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn hw_vlan_reject_untagged(&self) -> u8 {
+ self._bitfield_1.get_const::<1usize, 1u8>() as u8 as _
+ }
+ #[inline]
+ pub fn set_hw_vlan_reject_untagged(&mut self, val: u8) {
+ let val: u8 = val as _;
+ self._bitfield_1.set_const::<1usize, 1u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn hw_vlan_reject_untagged_raw(this: *const Self) -> u8 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 1usize],
+ >>::raw_get_const::<1usize, 1u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u8 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_hw_vlan_reject_untagged_raw(this: *mut Self, val: u8) {
+ unsafe {
+ let val: u8 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 1usize],
+ >>::raw_set_const::<
+ 1usize,
+ 1u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn hw_vlan_insert_pvid(&self) -> u8 {
+ self._bitfield_1.get_const::<2usize, 1u8>() as u8 as _
+ }
+ #[inline]
+ pub fn set_hw_vlan_insert_pvid(&mut self, val: u8) {
+ let val: u8 = val as _;
+ self._bitfield_1.set_const::<2usize, 1u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn hw_vlan_insert_pvid_raw(this: *const Self) -> u8 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 1usize],
+ >>::raw_get_const::<2usize, 1u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u8 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_hw_vlan_insert_pvid_raw(this: *mut Self, val: u8) {
+ unsafe {
+ let val: u8 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 1usize],
+ >>::raw_set_const::<
+ 2usize,
+ 1u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn new_bitfield_1(
+ hw_vlan_reject_tagged: u8,
+ hw_vlan_reject_untagged: u8,
+ hw_vlan_insert_pvid: u8,
+ ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
+ let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
+ __bindgen_bitfield_unit
+ .set_const::<
+ 0usize,
+ 1u8,
+ >({
+ let hw_vlan_reject_tagged: u8 = hw_vlan_reject_tagged as _;
+ hw_vlan_reject_tagged as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 1usize,
+ 1u8,
+ >({
+ let hw_vlan_reject_untagged: u8 = hw_vlan_reject_untagged as _;
+ hw_vlan_reject_untagged as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 2usize,
+ 1u8,
+ >({
+ let hw_vlan_insert_pvid: u8 = hw_vlan_insert_pvid as _;
+ hw_vlan_insert_pvid as u64
+ });
+ __bindgen_bitfield_unit
+ }
+}
+/** A structure used to configure the Receive Side Scaling (RSS) feature
+ of an Ethernet port.
+ If not NULL, the *rss_key* pointer of the *rss_conf* structure points
+ to an array holding the RSS key to use for hashing specific header
+ fields of received packets. The length of this array should be indicated
+ by *rss_key_len* below. Otherwise, a default random hash key is used by
+ the device driver.
+
+ The *rss_key_len* field of the *rss_conf* structure indicates the length
+ in bytes of the array pointed by *rss_key*. To be compatible, this length
+ will be checked in i40e only. Others assume 40 bytes to be used as before.
+
+ The *rss_hf* field of the *rss_conf* structure indicates the different
+ types of IPv4/IPv6 packets to which the RSS hashing must be applied.
+ Supplying an *rss_hf* equal to zero disables the RSS feature.*/
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_rss_conf {
+ ///< If not NULL, 40-byte hash key.
+ pub rss_key: *mut u8,
+ ///< hash key length in bytes.
+ pub rss_key_len: u8,
+ ///< Hash functions to apply - see below.
+ pub rss_hf: u64,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_eth_rss_conf"][::std::mem::size_of::() - 24usize];
+ [
+ "Alignment of rte_eth_rss_conf",
+ ][::std::mem::align_of::() - 8usize];
+ [
+ "Offset of field: rte_eth_rss_conf::rss_key",
+ ][::std::mem::offset_of!(rte_eth_rss_conf, rss_key) - 0usize];
+ [
+ "Offset of field: rte_eth_rss_conf::rss_key_len",
+ ][::std::mem::offset_of!(rte_eth_rss_conf, rss_key_len) - 8usize];
+ [
+ "Offset of field: rte_eth_rss_conf::rss_hf",
+ ][::std::mem::offset_of!(rte_eth_rss_conf, rss_hf) - 16usize];
+};
+impl Default for rte_eth_rss_conf {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(u32)]
+/** This enum indicates the possible number of traffic classes
+ in DCB configratioins*/
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum rte_eth_nb_tcs {
+ ///< 4 TCs with DCB.
+ ETH_4_TCS = 4,
+ ///< 8 TCs with DCB.
+ ETH_8_TCS = 8,
+}
+#[repr(u32)]
+/** This enum indicates the possible number of queue pools
+ in VMDQ configurations.*/
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum rte_eth_nb_pools {
+ ///< 8 VMDq pools.
+ ETH_8_POOLS = 8,
+ ///< 16 VMDq pools.
+ ETH_16_POOLS = 16,
+ ///< 32 VMDq pools.
+ ETH_32_POOLS = 32,
+ ///< 64 VMDq pools.
+ ETH_64_POOLS = 64,
+}
+/** A structure used to configure the VMDQ+DCB feature
+ of an Ethernet port.
+
+ Using this feature, packets are routed to a pool of queues, based
+ on the vlan ID in the vlan tag, and then to a specific queue within
+ that pool, using the user priority vlan tag field.
+
+ A default pool may be used, if desired, to route all traffic which
+ does not match the vlan filter rules.*/
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_vmdq_dcb_conf {
+ ///< With DCB, 16 or 32 pools
+ pub nb_queue_pools: rte_eth_nb_pools,
+ ///< If non-zero, use a default pool
+ pub enable_default_pool: u8,
+ ///< The default pool, if applicable
+ pub default_pool: u8,
+ ///< We can have up to 64 filters/mappings
+ pub nb_pool_maps: u8,
+ ///< VMDq vlan pool maps.
+ pub pool_map: [rte_eth_vmdq_dcb_conf__bindgen_ty_1; 64usize],
+ pub dcb_tc: [u8; 8usize],
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_vmdq_dcb_conf__bindgen_ty_1 {
+ ///< The vlan ID of the received frame
+ pub vlan_id: u16,
+ ///< Bitmask of pools for packet rx
+ pub pools: u64,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_vmdq_dcb_conf__bindgen_ty_1",
+ ][::std::mem::size_of::() - 16usize];
+ [
+ "Alignment of rte_eth_vmdq_dcb_conf__bindgen_ty_1",
+ ][::std::mem::align_of::() - 8usize];
+ [
+ "Offset of field: rte_eth_vmdq_dcb_conf__bindgen_ty_1::vlan_id",
+ ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf__bindgen_ty_1, vlan_id) - 0usize];
+ [
+ "Offset of field: rte_eth_vmdq_dcb_conf__bindgen_ty_1::pools",
+ ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf__bindgen_ty_1, pools) - 8usize];
+};
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_vmdq_dcb_conf",
+ ][::std::mem::size_of::() - 1040usize];
+ [
+ "Alignment of rte_eth_vmdq_dcb_conf",
+ ][::std::mem::align_of::() - 8usize];
+ [
+ "Offset of field: rte_eth_vmdq_dcb_conf::nb_queue_pools",
+ ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf, nb_queue_pools) - 0usize];
+ [
+ "Offset of field: rte_eth_vmdq_dcb_conf::enable_default_pool",
+ ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf, enable_default_pool) - 4usize];
+ [
+ "Offset of field: rte_eth_vmdq_dcb_conf::default_pool",
+ ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf, default_pool) - 5usize];
+ [
+ "Offset of field: rte_eth_vmdq_dcb_conf::nb_pool_maps",
+ ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf, nb_pool_maps) - 6usize];
+ [
+ "Offset of field: rte_eth_vmdq_dcb_conf::pool_map",
+ ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf, pool_map) - 8usize];
+ [
+ "Offset of field: rte_eth_vmdq_dcb_conf::dcb_tc",
+ ][::std::mem::offset_of!(rte_eth_vmdq_dcb_conf, dcb_tc) - 1032usize];
+};
+impl Default for rte_eth_vmdq_dcb_conf {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_dcb_rx_conf {
+ ///< Possible DCB TCs, 4 or 8 TCs
+ pub nb_tcs: rte_eth_nb_tcs,
+ /// Traffic class each UP mapped to.
+ pub dcb_tc: [u8; 8usize],
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_dcb_rx_conf",
+ ][::std::mem::size_of::() - 12usize];
+ [
+ "Alignment of rte_eth_dcb_rx_conf",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_eth_dcb_rx_conf::nb_tcs",
+ ][::std::mem::offset_of!(rte_eth_dcb_rx_conf, nb_tcs) - 0usize];
+ [
+ "Offset of field: rte_eth_dcb_rx_conf::dcb_tc",
+ ][::std::mem::offset_of!(rte_eth_dcb_rx_conf, dcb_tc) - 4usize];
+};
+impl Default for rte_eth_dcb_rx_conf {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_vmdq_dcb_tx_conf {
+ ///< With DCB, 16 or 32 pools.
+ pub nb_queue_pools: rte_eth_nb_pools,
+ /// Traffic class each UP mapped to.
+ pub dcb_tc: [u8; 8usize],
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_vmdq_dcb_tx_conf",
+ ][::std::mem::size_of::() - 12usize];
+ [
+ "Alignment of rte_eth_vmdq_dcb_tx_conf",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_eth_vmdq_dcb_tx_conf::nb_queue_pools",
+ ][::std::mem::offset_of!(rte_eth_vmdq_dcb_tx_conf, nb_queue_pools) - 0usize];
+ [
+ "Offset of field: rte_eth_vmdq_dcb_tx_conf::dcb_tc",
+ ][::std::mem::offset_of!(rte_eth_vmdq_dcb_tx_conf, dcb_tc) - 4usize];
+};
+impl Default for rte_eth_vmdq_dcb_tx_conf {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_dcb_tx_conf {
+ ///< Possible DCB TCs, 4 or 8 TCs.
+ pub nb_tcs: rte_eth_nb_tcs,
+ /// Traffic class each UP mapped to.
+ pub dcb_tc: [u8; 8usize],
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_dcb_tx_conf",
+ ][::std::mem::size_of::() - 12usize];
+ [
+ "Alignment of rte_eth_dcb_tx_conf",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_eth_dcb_tx_conf::nb_tcs",
+ ][::std::mem::offset_of!(rte_eth_dcb_tx_conf, nb_tcs) - 0usize];
+ [
+ "Offset of field: rte_eth_dcb_tx_conf::dcb_tc",
+ ][::std::mem::offset_of!(rte_eth_dcb_tx_conf, dcb_tc) - 4usize];
+};
+impl Default for rte_eth_dcb_tx_conf {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_vmdq_tx_conf {
+ ///< VMDq mode, 64 pools.
+ pub nb_queue_pools: rte_eth_nb_pools,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_vmdq_tx_conf",
+ ][::std::mem::size_of::() - 4usize];
+ [
+ "Alignment of rte_eth_vmdq_tx_conf",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_eth_vmdq_tx_conf::nb_queue_pools",
+ ][::std::mem::offset_of!(rte_eth_vmdq_tx_conf, nb_queue_pools) - 0usize];
+};
+impl Default for rte_eth_vmdq_tx_conf {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_vmdq_rx_conf {
+ ///< VMDq only mode, 8 or 64 pools
+ pub nb_queue_pools: rte_eth_nb_pools,
+ ///< If non-zero, use a default pool
+ pub enable_default_pool: u8,
+ ///< The default pool, if applicable
+ pub default_pool: u8,
+ ///< Enable VT loop back
+ pub enable_loop_back: u8,
+ ///< We can have up to 64 filters/mappings
+ pub nb_pool_maps: u8,
+ ///< Flags from ETH_VMDQ_ACCEPT_*
+ pub rx_mode: u32,
+ ///< VMDq vlan pool maps.
+ pub pool_map: [rte_eth_vmdq_rx_conf__bindgen_ty_1; 64usize],
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_vmdq_rx_conf__bindgen_ty_1 {
+ ///< The vlan ID of the received frame
+ pub vlan_id: u16,
+ ///< Bitmask of pools for packet rx
+ pub pools: u64,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_vmdq_rx_conf__bindgen_ty_1",
+ ][::std::mem::size_of::() - 16usize];
+ [
+ "Alignment of rte_eth_vmdq_rx_conf__bindgen_ty_1",
+ ][::std::mem::align_of::() - 8usize];
+ [
+ "Offset of field: rte_eth_vmdq_rx_conf__bindgen_ty_1::vlan_id",
+ ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf__bindgen_ty_1, vlan_id) - 0usize];
+ [
+ "Offset of field: rte_eth_vmdq_rx_conf__bindgen_ty_1::pools",
+ ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf__bindgen_ty_1, pools) - 8usize];
+};
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_vmdq_rx_conf",
+ ][::std::mem::size_of::() - 1040usize];
+ [
+ "Alignment of rte_eth_vmdq_rx_conf",
+ ][::std::mem::align_of::() - 8usize];
+ [
+ "Offset of field: rte_eth_vmdq_rx_conf::nb_queue_pools",
+ ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, nb_queue_pools) - 0usize];
+ [
+ "Offset of field: rte_eth_vmdq_rx_conf::enable_default_pool",
+ ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, enable_default_pool) - 4usize];
+ [
+ "Offset of field: rte_eth_vmdq_rx_conf::default_pool",
+ ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, default_pool) - 5usize];
+ [
+ "Offset of field: rte_eth_vmdq_rx_conf::enable_loop_back",
+ ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, enable_loop_back) - 6usize];
+ [
+ "Offset of field: rte_eth_vmdq_rx_conf::nb_pool_maps",
+ ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, nb_pool_maps) - 7usize];
+ [
+ "Offset of field: rte_eth_vmdq_rx_conf::rx_mode",
+ ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, rx_mode) - 8usize];
+ [
+ "Offset of field: rte_eth_vmdq_rx_conf::pool_map",
+ ][::std::mem::offset_of!(rte_eth_vmdq_rx_conf, pool_map) - 16usize];
+};
+impl Default for rte_eth_vmdq_rx_conf {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(u32)]
+/// Flow Director setting modes: none, signature or perfect.
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum rte_fdir_mode {
+ ///< Disable FDIR support.
+ RTE_FDIR_MODE_NONE = 0,
+ ///< Enable FDIR signature filter mode.
+ RTE_FDIR_MODE_SIGNATURE = 1,
+ ///< Enable FDIR perfect filter mode.
+ RTE_FDIR_MODE_PERFECT = 2,
+ ///< Enable FDIR filter mode - MAC VLAN.
+ RTE_FDIR_MODE_PERFECT_MAC_VLAN = 3,
+ ///< Enable FDIR filter mode - tunnel.
+ RTE_FDIR_MODE_PERFECT_TUNNEL = 4,
+}
+#[repr(u32)]
+/** Memory space that can be configured to store Flow Director filters
+ in the board memory.*/
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum rte_fdir_pballoc_type {
+ ///< 64k.
+ RTE_FDIR_PBALLOC_64K = 0,
+ ///< 128k.
+ RTE_FDIR_PBALLOC_128K = 1,
+ ///< 256k.
+ RTE_FDIR_PBALLOC_256K = 2,
+}
+#[repr(u32)]
+/// Select report mode of FDIR hash information in RX descriptors.
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum rte_fdir_status_mode {
+ ///< Never report FDIR hash.
+ RTE_FDIR_NO_REPORT_STATUS = 0,
+ ///< Only report FDIR hash for matching pkts.
+ RTE_FDIR_REPORT_STATUS = 1,
+ ///< Always report FDIR hash.
+ RTE_FDIR_REPORT_STATUS_ALWAYS = 2,
+}
+/// A structure used to define the input for IPV4 flow
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_ipv4_flow {
+ ///< IPv4 source address in big endian.
+ pub src_ip: u32,
+ ///< IPv4 destination address in big endian.
+ pub dst_ip: u32,
+ ///< Type of service to match.
+ pub tos: u8,
+ ///< Time to live to match.
+ pub ttl: u8,
+ ///< Protocol, next header in big endian.
+ pub proto: u8,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_eth_ipv4_flow"][::std::mem::size_of::() - 12usize];
+ [
+ "Alignment of rte_eth_ipv4_flow",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_eth_ipv4_flow::src_ip",
+ ][::std::mem::offset_of!(rte_eth_ipv4_flow, src_ip) - 0usize];
+ [
+ "Offset of field: rte_eth_ipv4_flow::dst_ip",
+ ][::std::mem::offset_of!(rte_eth_ipv4_flow, dst_ip) - 4usize];
+ [
+ "Offset of field: rte_eth_ipv4_flow::tos",
+ ][::std::mem::offset_of!(rte_eth_ipv4_flow, tos) - 8usize];
+ [
+ "Offset of field: rte_eth_ipv4_flow::ttl",
+ ][::std::mem::offset_of!(rte_eth_ipv4_flow, ttl) - 9usize];
+ [
+ "Offset of field: rte_eth_ipv4_flow::proto",
+ ][::std::mem::offset_of!(rte_eth_ipv4_flow, proto) - 10usize];
+};
+/// A structure used to define the input for IPV6 flow
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_ipv6_flow {
+ ///< IPv6 source address in big endian.
+ pub src_ip: [u32; 4usize],
+ ///< IPv6 destination address in big endian.
+ pub dst_ip: [u32; 4usize],
+ ///< Traffic class to match.
+ pub tc: u8,
+ ///< Protocol, next header to match.
+ pub proto: u8,
+ ///< Hop limits to match.
+ pub hop_limits: u8,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_eth_ipv6_flow"][::std::mem::size_of::() - 36usize];
+ [
+ "Alignment of rte_eth_ipv6_flow",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_eth_ipv6_flow::src_ip",
+ ][::std::mem::offset_of!(rte_eth_ipv6_flow, src_ip) - 0usize];
+ [
+ "Offset of field: rte_eth_ipv6_flow::dst_ip",
+ ][::std::mem::offset_of!(rte_eth_ipv6_flow, dst_ip) - 16usize];
+ [
+ "Offset of field: rte_eth_ipv6_flow::tc",
+ ][::std::mem::offset_of!(rte_eth_ipv6_flow, tc) - 32usize];
+ [
+ "Offset of field: rte_eth_ipv6_flow::proto",
+ ][::std::mem::offset_of!(rte_eth_ipv6_flow, proto) - 33usize];
+ [
+ "Offset of field: rte_eth_ipv6_flow::hop_limits",
+ ][::std::mem::offset_of!(rte_eth_ipv6_flow, hop_limits) - 34usize];
+};
+/** A structure used to configure FDIR masks that are used by the device
+ to match the various fields of RX packet headers.*/
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_fdir_masks {
+ ///< Bit mask for vlan_tci in big endian
+ pub vlan_tci_mask: u16,
+ /// Bit mask for ipv4 flow in big endian.
+ pub ipv4_mask: rte_eth_ipv4_flow,
+ /// Bit maks for ipv6 flow in big endian.
+ pub ipv6_mask: rte_eth_ipv6_flow,
+ /// Bit mask for L4 source port in big endian.
+ pub src_port_mask: u16,
+ /// Bit mask for L4 destination port in big endian.
+ pub dst_port_mask: u16,
+ /** 6 bit mask for proper 6 bytes of Mac address, bit 0 matches the
+first byte on the wire*/
+ pub mac_addr_byte_mask: u8,
+ /// Bit mask for tunnel ID in big endian.
+ pub tunnel_id_mask: u32,
+ /**< 1 - Match tunnel type,
+0 - Ignore tunnel type.*/
+ pub tunnel_type_mask: u8,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_fdir_masks",
+ ][::std::mem::size_of::() - 68usize];
+ [
+ "Alignment of rte_eth_fdir_masks",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_eth_fdir_masks::vlan_tci_mask",
+ ][::std::mem::offset_of!(rte_eth_fdir_masks, vlan_tci_mask) - 0usize];
+ [
+ "Offset of field: rte_eth_fdir_masks::ipv4_mask",
+ ][::std::mem::offset_of!(rte_eth_fdir_masks, ipv4_mask) - 4usize];
+ [
+ "Offset of field: rte_eth_fdir_masks::ipv6_mask",
+ ][::std::mem::offset_of!(rte_eth_fdir_masks, ipv6_mask) - 16usize];
+ [
+ "Offset of field: rte_eth_fdir_masks::src_port_mask",
+ ][::std::mem::offset_of!(rte_eth_fdir_masks, src_port_mask) - 52usize];
+ [
+ "Offset of field: rte_eth_fdir_masks::dst_port_mask",
+ ][::std::mem::offset_of!(rte_eth_fdir_masks, dst_port_mask) - 54usize];
+ [
+ "Offset of field: rte_eth_fdir_masks::mac_addr_byte_mask",
+ ][::std::mem::offset_of!(rte_eth_fdir_masks, mac_addr_byte_mask) - 56usize];
+ [
+ "Offset of field: rte_eth_fdir_masks::tunnel_id_mask",
+ ][::std::mem::offset_of!(rte_eth_fdir_masks, tunnel_id_mask) - 60usize];
+ [
+ "Offset of field: rte_eth_fdir_masks::tunnel_type_mask",
+ ][::std::mem::offset_of!(rte_eth_fdir_masks, tunnel_type_mask) - 64usize];
+};
+#[repr(u32)]
+/// Payload type
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum rte_eth_payload_type {
+ RTE_ETH_PAYLOAD_UNKNOWN = 0,
+ RTE_ETH_RAW_PAYLOAD = 1,
+ RTE_ETH_L2_PAYLOAD = 2,
+ RTE_ETH_L3_PAYLOAD = 3,
+ RTE_ETH_L4_PAYLOAD = 4,
+ RTE_ETH_PAYLOAD_MAX = 8,
+}
+/** A structure used to select bytes extracted from the protocol layers to
+ flexible payload for filter*/
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_flex_payload_cfg {
+ ///< Payload type
+ pub type_: rte_eth_payload_type,
+ pub src_offset: [u16; 16usize],
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_flex_payload_cfg",
+ ][::std::mem::size_of::() - 36usize];
+ [
+ "Alignment of rte_eth_flex_payload_cfg",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_eth_flex_payload_cfg::type_",
+ ][::std::mem::offset_of!(rte_eth_flex_payload_cfg, type_) - 0usize];
+ [
+ "Offset of field: rte_eth_flex_payload_cfg::src_offset",
+ ][::std::mem::offset_of!(rte_eth_flex_payload_cfg, src_offset) - 4usize];
+};
+impl Default for rte_eth_flex_payload_cfg {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+/** A structure used to define FDIR masks for flexible payload
+ for each flow type*/
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_fdir_flex_mask {
+ pub flow_type: u16,
+ pub mask: [u8; 16usize],
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_fdir_flex_mask",
+ ][::std::mem::size_of::() - 18usize];
+ [
+ "Alignment of rte_eth_fdir_flex_mask",
+ ][::std::mem::align_of::() - 2usize];
+ [
+ "Offset of field: rte_eth_fdir_flex_mask::flow_type",
+ ][::std::mem::offset_of!(rte_eth_fdir_flex_mask, flow_type) - 0usize];
+ [
+ "Offset of field: rte_eth_fdir_flex_mask::mask",
+ ][::std::mem::offset_of!(rte_eth_fdir_flex_mask, mask) - 2usize];
+};
+/** A structure used to define all flexible payload related setting
+ include flex payload and flex mask*/
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_fdir_flex_conf {
+ ///< The number of following payload cfg
+ pub nb_payloads: u16,
+ ///< The number of following mask
+ pub nb_flexmasks: u16,
+ pub flex_set: [rte_eth_flex_payload_cfg; 8usize],
+ pub flex_mask: [rte_eth_fdir_flex_mask; 22usize],
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_fdir_flex_conf",
+ ][::std::mem::size_of::() - 688usize];
+ [
+ "Alignment of rte_eth_fdir_flex_conf",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_eth_fdir_flex_conf::nb_payloads",
+ ][::std::mem::offset_of!(rte_eth_fdir_flex_conf, nb_payloads) - 0usize];
+ [
+ "Offset of field: rte_eth_fdir_flex_conf::nb_flexmasks",
+ ][::std::mem::offset_of!(rte_eth_fdir_flex_conf, nb_flexmasks) - 2usize];
+ [
+ "Offset of field: rte_eth_fdir_flex_conf::flex_set",
+ ][::std::mem::offset_of!(rte_eth_fdir_flex_conf, flex_set) - 4usize];
+ [
+ "Offset of field: rte_eth_fdir_flex_conf::flex_mask",
+ ][::std::mem::offset_of!(rte_eth_fdir_flex_conf, flex_mask) - 292usize];
+};
+impl Default for rte_eth_fdir_flex_conf {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+/** A structure used to configure the Flow Director (FDIR) feature
+ of an Ethernet port.
+
+ If mode is RTE_FDIR_DISABLE, the pballoc value is ignored.*/
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_fdir_conf {
+ ///< Flow Director mode.
+ pub mode: rte_fdir_mode,
+ ///< Space for FDIR filters.
+ pub pballoc: rte_fdir_pballoc_type,
+ ///< How to report FDIR hash.
+ pub status: rte_fdir_status_mode,
+ /// RX queue of packets matching a "drop" filter in perfect mode.
+ pub drop_queue: u8,
+ pub mask: rte_eth_fdir_masks,
+ pub flex_conf: rte_eth_fdir_flex_conf,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_fdir_conf"][::std::mem::size_of::() - 772usize];
+ ["Alignment of rte_fdir_conf"][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_fdir_conf::mode",
+ ][::std::mem::offset_of!(rte_fdir_conf, mode) - 0usize];
+ [
+ "Offset of field: rte_fdir_conf::pballoc",
+ ][::std::mem::offset_of!(rte_fdir_conf, pballoc) - 4usize];
+ [
+ "Offset of field: rte_fdir_conf::status",
+ ][::std::mem::offset_of!(rte_fdir_conf, status) - 8usize];
+ [
+ "Offset of field: rte_fdir_conf::drop_queue",
+ ][::std::mem::offset_of!(rte_fdir_conf, drop_queue) - 12usize];
+ [
+ "Offset of field: rte_fdir_conf::mask",
+ ][::std::mem::offset_of!(rte_fdir_conf, mask) - 16usize];
+ [
+ "Offset of field: rte_fdir_conf::flex_conf",
+ ][::std::mem::offset_of!(rte_fdir_conf, flex_conf) - 84usize];
+};
+impl Default for rte_fdir_conf {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+/// A structure used to enable/disable specific device interrupts.
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_intr_conf {
+ /// enable/disable lsc interrupt. 0 (default) - disable, 1 enable
+ pub lsc: u16,
+ /// enable/disable rxq interrupt. 0 (default) - disable, 1 enable
+ pub rxq: u16,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_intr_conf"][::std::mem::size_of::() - 4usize];
+ ["Alignment of rte_intr_conf"][::std::mem::align_of::() - 2usize];
+ [
+ "Offset of field: rte_intr_conf::lsc",
+ ][::std::mem::offset_of!(rte_intr_conf, lsc) - 0usize];
+ [
+ "Offset of field: rte_intr_conf::rxq",
+ ][::std::mem::offset_of!(rte_intr_conf, rxq) - 2usize];
+};
+/** A structure used to configure an Ethernet port.
+ Depending upon the RX multi-queue mode, extra advanced
+ configuration settings may be needed.*/
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct rte_eth_conf {
+ /**< bitmap of ETH_LINK_SPEED_XXX of speeds to be
+used. ETH_LINK_SPEED_FIXED disables link
+autonegotiation, and a unique speed shall be
+set. Otherwise, the bitmap defines the set of
+speeds to be advertised. If the special value
+ETH_LINK_SPEED_AUTONEG (0) is used, all speeds
+supported are advertised.*/
+ pub link_speeds: u32,
+ ///< Port RX configuration.
+ pub rxmode: rte_eth_rxmode,
+ ///< Port TX configuration.
+ pub txmode: rte_eth_txmode,
+ /**< Loopback operation mode. By default the value
+is 0, meaning the loopback mode is disabled.
+Read the datasheet of given ethernet controller
+for details. The possible values of this field
+are defined in implementation of each driver.*/
+ pub lpbk_mode: u32,
+ ///< Port RX filtering configuration (union).
+ pub rx_adv_conf: rte_eth_conf__bindgen_ty_1,
+ ///< Port TX DCB configuration (union).
+ pub tx_adv_conf: rte_eth_conf__bindgen_ty_2,
+ /** Currently,Priority Flow Control(PFC) are supported,if DCB with PFC
+is needed,and the variable must be set ETH_DCB_PFC_SUPPORT.*/
+ pub dcb_capability_en: u32,
+ ///< FDIR configuration.
+ pub fdir_conf: rte_fdir_conf,
+ ///< Interrupt mode configuration.
+ pub intr_conf: rte_intr_conf,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_eth_conf__bindgen_ty_1 {
+ ///< Port RSS configuration
+ pub rss_conf: rte_eth_rss_conf,
+ pub vmdq_dcb_conf: rte_eth_vmdq_dcb_conf,
+ pub dcb_rx_conf: rte_eth_dcb_rx_conf,
+ pub vmdq_rx_conf: rte_eth_vmdq_rx_conf,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_conf__bindgen_ty_1",
+ ][::std::mem::size_of::() - 2120usize];
+ [
+ "Alignment of rte_eth_conf__bindgen_ty_1",
+ ][::std::mem::align_of::() - 8usize];
+ [
+ "Offset of field: rte_eth_conf__bindgen_ty_1::rss_conf",
+ ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_1, rss_conf) - 0usize];
+ [
+ "Offset of field: rte_eth_conf__bindgen_ty_1::vmdq_dcb_conf",
+ ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_1, vmdq_dcb_conf) - 24usize];
+ [
+ "Offset of field: rte_eth_conf__bindgen_ty_1::dcb_rx_conf",
+ ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_1, dcb_rx_conf) - 1064usize];
+ [
+ "Offset of field: rte_eth_conf__bindgen_ty_1::vmdq_rx_conf",
+ ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_1, vmdq_rx_conf) - 1080usize];
+};
+impl Default for rte_eth_conf__bindgen_ty_1 {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union rte_eth_conf__bindgen_ty_2 {
+ pub vmdq_dcb_tx_conf: rte_eth_vmdq_dcb_tx_conf,
+ pub dcb_tx_conf: rte_eth_dcb_tx_conf,
+ pub vmdq_tx_conf: rte_eth_vmdq_tx_conf,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_eth_conf__bindgen_ty_2",
+ ][::std::mem::size_of::() - 12usize];
+ [
+ "Alignment of rte_eth_conf__bindgen_ty_2",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_eth_conf__bindgen_ty_2::vmdq_dcb_tx_conf",
+ ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_2, vmdq_dcb_tx_conf) - 0usize];
+ [
+ "Offset of field: rte_eth_conf__bindgen_ty_2::dcb_tx_conf",
+ ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_2, dcb_tx_conf) - 0usize];
+ [
+ "Offset of field: rte_eth_conf__bindgen_ty_2::vmdq_tx_conf",
+ ][::std::mem::offset_of!(rte_eth_conf__bindgen_ty_2, vmdq_tx_conf) - 0usize];
+};
+impl Default for rte_eth_conf__bindgen_ty_2 {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_eth_conf"][::std::mem::size_of::() - 2944usize];
+ ["Alignment of rte_eth_conf"][::std::mem::align_of::() - 8usize];
+ [
+ "Offset of field: rte_eth_conf::link_speeds",
+ ][::std::mem::offset_of!(rte_eth_conf, link_speeds) - 0usize];
+ [
+ "Offset of field: rte_eth_conf::rxmode",
+ ][::std::mem::offset_of!(rte_eth_conf, rxmode) - 4usize];
+ [
+ "Offset of field: rte_eth_conf::txmode",
+ ][::std::mem::offset_of!(rte_eth_conf, txmode) - 16usize];
+ [
+ "Offset of field: rte_eth_conf::lpbk_mode",
+ ][::std::mem::offset_of!(rte_eth_conf, lpbk_mode) - 24usize];
+ [
+ "Offset of field: rte_eth_conf::rx_adv_conf",
+ ][::std::mem::offset_of!(rte_eth_conf, rx_adv_conf) - 32usize];
+ [
+ "Offset of field: rte_eth_conf::tx_adv_conf",
+ ][::std::mem::offset_of!(rte_eth_conf, tx_adv_conf) - 2152usize];
+ [
+ "Offset of field: rte_eth_conf::dcb_capability_en",
+ ][::std::mem::offset_of!(rte_eth_conf, dcb_capability_en) - 2164usize];
+ [
+ "Offset of field: rte_eth_conf::fdir_conf",
+ ][::std::mem::offset_of!(rte_eth_conf, fdir_conf) - 2168usize];
+ [
+ "Offset of field: rte_eth_conf::intr_conf",
+ ][::std::mem::offset_of!(rte_eth_conf, intr_conf) - 2940usize];
+};
+impl Default for rte_eth_conf {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-22/layout_kni_mbuf.rs b/bindgen-tests/tests/expectations/tests/libclang-22/layout_kni_mbuf.rs
new file mode 100644
index 0000000000..27b4123a55
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-22/layout_kni_mbuf.rs
@@ -0,0 +1,85 @@
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+///< Minimum Cache line size.
+pub const RTE_CACHE_LINE_MIN_SIZE: u32 = 64;
+pub const RTE_CACHE_LINE_SIZE: u32 = 64;
+#[repr(C)]
+#[repr(align(64))]
+#[derive(Debug, Copy, Clone)]
+pub struct rte_kni_mbuf {
+ pub buf_addr: *mut ::std::os::raw::c_void,
+ pub buf_physaddr: u64,
+ pub pad0: [::std::os::raw::c_char; 2usize],
+ ///< Start address of data in segment buffer.
+ pub data_off: u16,
+ pub pad1: [::std::os::raw::c_char; 2usize],
+ ///< Number of segments.
+ pub nb_segs: u8,
+ pub pad4: [::std::os::raw::c_char; 1usize],
+ ///< Offload features.
+ pub ol_flags: u64,
+ pub pad2: [::std::os::raw::c_char; 4usize],
+ ///< Total pkt len: sum of all segment data_len.
+ pub pkt_len: u32,
+ ///< Amount of data in segment buffer.
+ pub data_len: u16,
+ pub __bindgen_padding_0: [u8; 22usize],
+ pub pad3: [::std::os::raw::c_char; 8usize],
+ pub pool: *mut ::std::os::raw::c_void,
+ pub next: *mut ::std::os::raw::c_void,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_kni_mbuf"][::std::mem::size_of::() - 128usize];
+ ["Alignment of rte_kni_mbuf"][::std::mem::align_of::() - 64usize];
+ [
+ "Offset of field: rte_kni_mbuf::buf_addr",
+ ][::std::mem::offset_of!(rte_kni_mbuf, buf_addr) - 0usize];
+ [
+ "Offset of field: rte_kni_mbuf::buf_physaddr",
+ ][::std::mem::offset_of!(rte_kni_mbuf, buf_physaddr) - 8usize];
+ [
+ "Offset of field: rte_kni_mbuf::pad0",
+ ][::std::mem::offset_of!(rte_kni_mbuf, pad0) - 16usize];
+ [
+ "Offset of field: rte_kni_mbuf::data_off",
+ ][::std::mem::offset_of!(rte_kni_mbuf, data_off) - 18usize];
+ [
+ "Offset of field: rte_kni_mbuf::pad1",
+ ][::std::mem::offset_of!(rte_kni_mbuf, pad1) - 20usize];
+ [
+ "Offset of field: rte_kni_mbuf::nb_segs",
+ ][::std::mem::offset_of!(rte_kni_mbuf, nb_segs) - 22usize];
+ [
+ "Offset of field: rte_kni_mbuf::pad4",
+ ][::std::mem::offset_of!(rte_kni_mbuf, pad4) - 23usize];
+ [
+ "Offset of field: rte_kni_mbuf::ol_flags",
+ ][::std::mem::offset_of!(rte_kni_mbuf, ol_flags) - 24usize];
+ [
+ "Offset of field: rte_kni_mbuf::pad2",
+ ][::std::mem::offset_of!(rte_kni_mbuf, pad2) - 32usize];
+ [
+ "Offset of field: rte_kni_mbuf::pkt_len",
+ ][::std::mem::offset_of!(rte_kni_mbuf, pkt_len) - 36usize];
+ [
+ "Offset of field: rte_kni_mbuf::data_len",
+ ][::std::mem::offset_of!(rte_kni_mbuf, data_len) - 40usize];
+ [
+ "Offset of field: rte_kni_mbuf::pad3",
+ ][::std::mem::offset_of!(rte_kni_mbuf, pad3) - 64usize];
+ [
+ "Offset of field: rte_kni_mbuf::pool",
+ ][::std::mem::offset_of!(rte_kni_mbuf, pool) - 72usize];
+ [
+ "Offset of field: rte_kni_mbuf::next",
+ ][::std::mem::offset_of!(rte_kni_mbuf, next) - 80usize];
+};
+impl Default for rte_kni_mbuf {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-22/layout_mbuf.rs b/bindgen-tests/tests/expectations/tests/libclang-22/layout_mbuf.rs
new file mode 100644
index 0000000000..6651f0ed75
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-22/layout_mbuf.rs
@@ -0,0 +1,1489 @@
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+#[repr(C)]
+#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub struct __BindgenBitfieldUnit {
+ storage: Storage,
+}
+impl __BindgenBitfieldUnit {
+ #[inline]
+ pub const fn new(storage: Storage) -> Self {
+ Self { storage }
+ }
+}
+impl __BindgenBitfieldUnit
+where
+ Storage: AsRef<[u8]> + AsMut<[u8]>,
+{
+ #[inline]
+ fn extract_bit(byte: u8, index: usize) -> bool {
+ let bit_index = if cfg!(target_endian = "big") {
+ 7 - (index % 8)
+ } else {
+ index % 8
+ };
+ let mask = 1 << bit_index;
+ byte & mask == mask
+ }
+ #[inline]
+ pub fn get_bit(&self, index: usize) -> bool {
+ debug_assert!(index / 8 < self.storage.as_ref().len());
+ let byte_index = index / 8;
+ let byte = self.storage.as_ref()[byte_index];
+ Self::extract_bit(byte, index)
+ }
+ #[inline]
+ pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
+ debug_assert!(index / 8 < core::mem::size_of::());
+ let byte_index = index / 8;
+ let byte = unsafe {
+ *(core::ptr::addr_of!((*this).storage) as *const u8)
+ .offset(byte_index as isize)
+ };
+ Self::extract_bit(byte, index)
+ }
+ #[inline]
+ fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
+ let bit_index = if cfg!(target_endian = "big") {
+ 7 - (index % 8)
+ } else {
+ index % 8
+ };
+ let mask = 1 << bit_index;
+ if val { byte | mask } else { byte & !mask }
+ }
+ #[inline]
+ pub fn set_bit(&mut self, index: usize, val: bool) {
+ debug_assert!(index / 8 < self.storage.as_ref().len());
+ let byte_index = index / 8;
+ let byte = &mut self.storage.as_mut()[byte_index];
+ *byte = Self::change_bit(*byte, index, val);
+ }
+ #[inline]
+ pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
+ debug_assert!(index / 8 < core::mem::size_of::());
+ let byte_index = index / 8;
+ let byte = unsafe {
+ (core::ptr::addr_of_mut!((*this).storage) as *mut u8)
+ .offset(byte_index as isize)
+ };
+ unsafe { *byte = Self::change_bit(*byte, index, val) };
+ }
+ #[inline]
+ pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
+ debug_assert!(bit_width <= 64);
+ debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
+ debug_assert!(
+ (bit_offset + (bit_width as usize) + 7) / 8 <= self.storage.as_ref().len(),
+ );
+ if bit_width == 0 {
+ return 0;
+ }
+ let mut val = 0u64;
+ let storage = self.storage.as_ref();
+ let start_byte = bit_offset / 8;
+ let bit_shift = bit_offset % 8;
+ let bytes_needed = (bit_width as usize + bit_shift + 7) / 8;
+ if cfg!(target_endian = "big") {
+ for i in 0..bytes_needed {
+ val |= (storage[start_byte + i].reverse_bits() as u64) << (i * 8);
+ }
+ } else {
+ for i in 0..bytes_needed {
+ val |= (storage[start_byte + i] as u64) << (i * 8);
+ }
+ }
+ val >>= bit_shift;
+ if bit_width < 64 {
+ val &= (1u64 << bit_width) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - bit_width as usize);
+ }
+ val
+ }
+ #[inline]
+ pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
+ debug_assert!(bit_width <= 64);
+ debug_assert!(bit_offset / 8 < core::mem::size_of::());
+ debug_assert!(
+ (bit_offset + (bit_width as usize) + 7) / 8
+ <= core::mem::size_of::(),
+ );
+ if bit_width == 0 {
+ return 0;
+ }
+ let mut val = 0u64;
+ let start_byte = bit_offset / 8;
+ let bit_shift = bit_offset % 8;
+ let bytes_needed = (bit_width as usize + bit_shift + 7) / 8;
+ let storage_ptr = unsafe { core::ptr::addr_of!((*this).storage) as *const u8 };
+ if cfg!(target_endian = "big") {
+ for i in 0..bytes_needed {
+ let byte = unsafe { *storage_ptr.add(start_byte + i) };
+ val |= (byte.reverse_bits() as u64) << (i * 8);
+ }
+ } else {
+ for i in 0..bytes_needed {
+ let byte = unsafe { *storage_ptr.add(start_byte + i) };
+ val |= (byte as u64) << (i * 8);
+ }
+ }
+ val >>= bit_shift;
+ if bit_width < 64 {
+ val &= (1u64 << bit_width) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - bit_width as usize);
+ }
+ val
+ }
+ #[inline]
+ pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
+ debug_assert!(bit_width <= 64);
+ debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
+ debug_assert!(
+ (bit_offset + (bit_width as usize) + 7) / 8 <= self.storage.as_ref().len(),
+ );
+ if bit_width == 0 {
+ return;
+ }
+ let mut val = val;
+ if bit_width < 64 {
+ val &= (1u64 << bit_width) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - bit_width as usize);
+ }
+ let storage = self.storage.as_mut();
+ let start_byte = bit_offset / 8;
+ let bit_shift = bit_offset % 8;
+ let bytes_needed = (bit_width as usize + bit_shift + 7) / 8;
+ val <<= bit_shift;
+ let field_mask = if bit_width as usize + bit_shift >= 64 {
+ !0u64 << bit_shift
+ } else {
+ ((1u64 << bit_width) - 1) << bit_shift
+ };
+ for i in 0..bytes_needed {
+ let byte_val = (val >> (i * 8)) as u8;
+ let byte_mask = (field_mask >> (i * 8)) as u8;
+ if cfg!(target_endian = "big") {
+ let byte = storage[start_byte + i].reverse_bits();
+ let new_byte = (byte & !byte_mask) | (byte_val & byte_mask);
+ storage[start_byte + i] = new_byte.reverse_bits();
+ } else {
+ storage[start_byte + i] = (storage[start_byte + i] & !byte_mask)
+ | (byte_val & byte_mask);
+ }
+ }
+ }
+ #[inline]
+ pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
+ debug_assert!(bit_width <= 64);
+ debug_assert!(bit_offset / 8 < core::mem::size_of::());
+ debug_assert!(
+ (bit_offset + (bit_width as usize) + 7) / 8
+ <= core::mem::size_of::(),
+ );
+ if bit_width == 0 {
+ return;
+ }
+ let mut val = val;
+ if bit_width < 64 {
+ val &= (1u64 << bit_width) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - bit_width as usize);
+ }
+ let start_byte = bit_offset / 8;
+ let bit_shift = bit_offset % 8;
+ let bytes_needed = (bit_width as usize + bit_shift + 7) / 8;
+ val <<= bit_shift;
+ let field_mask = if bit_width as usize + bit_shift >= 64 {
+ !0u64 << bit_shift
+ } else {
+ ((1u64 << bit_width) - 1) << bit_shift
+ };
+ let storage_ptr = unsafe { core::ptr::addr_of_mut!((*this).storage) as *mut u8 };
+ for i in 0..bytes_needed {
+ let byte_val = (val >> (i * 8)) as u8;
+ let byte_mask = (field_mask >> (i * 8)) as u8;
+ let byte_ptr = unsafe { storage_ptr.add(start_byte + i) };
+ if cfg!(target_endian = "big") {
+ let byte = unsafe { (*byte_ptr).reverse_bits() };
+ let new_byte = (byte & !byte_mask) | (byte_val & byte_mask);
+ unsafe { *byte_ptr = new_byte.reverse_bits() };
+ } else {
+ unsafe { *byte_ptr = (*byte_ptr & !byte_mask) | (byte_val & byte_mask) };
+ }
+ }
+ }
+}
+/// Const-generic methods for efficient bitfield access when offset and width
+/// are known at compile time.
+impl __BindgenBitfieldUnit<[u8; N]> {
+ /// Get a field using const generics for compile-time optimization.
+ /// Uses native word size operations when the field fits in usize.
+ #[inline]
+ pub const fn get_const(&self) -> u64 {
+ debug_assert!(BIT_WIDTH <= 64);
+ debug_assert!(BIT_OFFSET / 8 < N);
+ debug_assert!((BIT_OFFSET + (BIT_WIDTH as usize) + 7) / 8 <= N);
+ if BIT_WIDTH == 0 {
+ return 0;
+ }
+ let start_byte = BIT_OFFSET / 8;
+ let bit_shift = BIT_OFFSET % 8;
+ let bytes_needed = (BIT_WIDTH as usize + bit_shift + 7) / 8;
+ if BIT_WIDTH as usize + bit_shift <= usize::BITS as usize {
+ let mut val = 0usize;
+ if cfg!(target_endian = "big") {
+ let mut i = 0;
+ while i < bytes_needed {
+ val
+ |= (self.storage[start_byte + i].reverse_bits() as usize)
+ << (i * 8);
+ i += 1;
+ }
+ } else {
+ let mut i = 0;
+ while i < bytes_needed {
+ val |= (self.storage[start_byte + i] as usize) << (i * 8);
+ i += 1;
+ }
+ }
+ val >>= bit_shift;
+ if (BIT_WIDTH as u32) < usize::BITS {
+ val &= (1usize << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (usize::BITS as usize - BIT_WIDTH as usize);
+ }
+ val as u64
+ } else {
+ let mut val = 0u64;
+ if cfg!(target_endian = "big") {
+ let mut i = 0;
+ while i < bytes_needed {
+ val
+ |= (self.storage[start_byte + i].reverse_bits() as u64)
+ << (i * 8);
+ i += 1;
+ }
+ } else {
+ let mut i = 0;
+ while i < bytes_needed {
+ val |= (self.storage[start_byte + i] as u64) << (i * 8);
+ i += 1;
+ }
+ }
+ val >>= bit_shift;
+ if BIT_WIDTH < 64 {
+ val &= (1u64 << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - BIT_WIDTH as usize);
+ }
+ val
+ }
+ }
+ /// Set a field using const generics for compile-time optimization.
+ /// Uses native word size operations when the field fits in usize.
+ #[inline]
+ pub fn set_const(&mut self, val: u64) {
+ debug_assert!(BIT_WIDTH <= 64);
+ debug_assert!(BIT_OFFSET / 8 < N);
+ debug_assert!((BIT_OFFSET + (BIT_WIDTH as usize) + 7) / 8 <= N);
+ if BIT_WIDTH == 0 {
+ return;
+ }
+ let start_byte = BIT_OFFSET / 8;
+ let bit_shift = BIT_OFFSET % 8;
+ let bytes_needed = (BIT_WIDTH as usize + bit_shift + 7) / 8;
+ if BIT_WIDTH as usize + bit_shift <= usize::BITS as usize {
+ let mut val = val as usize;
+ if (BIT_WIDTH as u32) < usize::BITS {
+ val &= (1usize << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (usize::BITS as usize - BIT_WIDTH as usize);
+ }
+ val <<= bit_shift;
+ let field_mask = if BIT_WIDTH as usize + bit_shift >= usize::BITS as usize {
+ !0usize << bit_shift
+ } else {
+ ((1usize << BIT_WIDTH) - 1) << bit_shift
+ };
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte_val = (val >> (i * 8)) as u8;
+ let byte_mask = (field_mask >> (i * 8)) as u8;
+ if cfg!(target_endian = "big") {
+ let byte = self.storage[start_byte + i].reverse_bits();
+ let new_byte = (byte & !byte_mask) | (byte_val & byte_mask);
+ self.storage[start_byte + i] = new_byte.reverse_bits();
+ } else {
+ self.storage[start_byte + i] = (self.storage[start_byte + i]
+ & !byte_mask) | (byte_val & byte_mask);
+ }
+ i += 1;
+ }
+ } else {
+ let mut val = val;
+ if BIT_WIDTH < 64 {
+ val &= (1u64 << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - BIT_WIDTH as usize);
+ }
+ val <<= bit_shift;
+ let field_mask = if BIT_WIDTH as usize + bit_shift >= 64 {
+ !0u64 << bit_shift
+ } else {
+ ((1u64 << BIT_WIDTH) - 1) << bit_shift
+ };
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte_val = (val >> (i * 8)) as u8;
+ let byte_mask = (field_mask >> (i * 8)) as u8;
+ if cfg!(target_endian = "big") {
+ let byte = self.storage[start_byte + i].reverse_bits();
+ let new_byte = (byte & !byte_mask) | (byte_val & byte_mask);
+ self.storage[start_byte + i] = new_byte.reverse_bits();
+ } else {
+ self.storage[start_byte + i] = (self.storage[start_byte + i]
+ & !byte_mask) | (byte_val & byte_mask);
+ }
+ i += 1;
+ }
+ }
+ }
+ /// Raw pointer get using const generics for compile-time optimization.
+ /// Uses native word size operations when the field fits in usize.
+ #[inline]
+ pub const unsafe fn raw_get_const(
+ this: *const Self,
+ ) -> u64 {
+ debug_assert!(BIT_WIDTH <= 64);
+ debug_assert!(BIT_OFFSET / 8 < N);
+ debug_assert!((BIT_OFFSET + (BIT_WIDTH as usize) + 7) / 8 <= N);
+ if BIT_WIDTH == 0 {
+ return 0;
+ }
+ let start_byte = BIT_OFFSET / 8;
+ let bit_shift = BIT_OFFSET % 8;
+ let bytes_needed = (BIT_WIDTH as usize + bit_shift + 7) / 8;
+ let storage_ptr = unsafe { core::ptr::addr_of!((*this).storage) as *const u8 };
+ if BIT_WIDTH as usize + bit_shift <= usize::BITS as usize {
+ let mut val = 0usize;
+ if cfg!(target_endian = "big") {
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte = unsafe { *storage_ptr.add(start_byte + i) };
+ val |= (byte.reverse_bits() as usize) << (i * 8);
+ i += 1;
+ }
+ } else {
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte = unsafe { *storage_ptr.add(start_byte + i) };
+ val |= (byte as usize) << (i * 8);
+ i += 1;
+ }
+ }
+ val >>= bit_shift;
+ if (BIT_WIDTH as u32) < usize::BITS {
+ val &= (1usize << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (usize::BITS as usize - BIT_WIDTH as usize);
+ }
+ val as u64
+ } else {
+ let mut val = 0u64;
+ if cfg!(target_endian = "big") {
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte = unsafe { *storage_ptr.add(start_byte + i) };
+ val |= (byte.reverse_bits() as u64) << (i * 8);
+ i += 1;
+ }
+ } else {
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte = unsafe { *storage_ptr.add(start_byte + i) };
+ val |= (byte as u64) << (i * 8);
+ i += 1;
+ }
+ }
+ val >>= bit_shift;
+ if BIT_WIDTH < 64 {
+ val &= (1u64 << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - BIT_WIDTH as usize);
+ }
+ val
+ }
+ }
+ /// Raw pointer set using const generics for compile-time optimization.
+ /// Uses native word size operations when the field fits in usize.
+ #[inline]
+ pub unsafe fn raw_set_const(
+ this: *mut Self,
+ val: u64,
+ ) {
+ debug_assert!(BIT_WIDTH <= 64);
+ debug_assert!(BIT_OFFSET / 8 < N);
+ debug_assert!((BIT_OFFSET + (BIT_WIDTH as usize) + 7) / 8 <= N);
+ if BIT_WIDTH == 0 {
+ return;
+ }
+ let start_byte = BIT_OFFSET / 8;
+ let bit_shift = BIT_OFFSET % 8;
+ let bytes_needed = (BIT_WIDTH as usize + bit_shift + 7) / 8;
+ let storage_ptr = this.cast::<[u8; N]>().cast::();
+ if BIT_WIDTH as usize + bit_shift <= usize::BITS as usize {
+ let mut val = val as usize;
+ if (BIT_WIDTH as u32) < usize::BITS {
+ val &= (1usize << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (usize::BITS as usize - BIT_WIDTH as usize);
+ }
+ val <<= bit_shift;
+ let field_mask = if BIT_WIDTH as usize + bit_shift >= usize::BITS as usize {
+ !0usize << bit_shift
+ } else {
+ ((1usize << BIT_WIDTH) - 1) << bit_shift
+ };
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte_val = (val >> (i * 8)) as u8;
+ let byte_mask = (field_mask >> (i * 8)) as u8;
+ let byte_ptr = unsafe { storage_ptr.add(start_byte + i) };
+ if cfg!(target_endian = "big") {
+ let byte = unsafe { (*byte_ptr).reverse_bits() };
+ let new_byte = (byte & !byte_mask) | (byte_val & byte_mask);
+ unsafe { *byte_ptr = new_byte.reverse_bits() };
+ } else {
+ unsafe {
+ *byte_ptr = (*byte_ptr & !byte_mask) | (byte_val & byte_mask)
+ };
+ }
+ i += 1;
+ }
+ } else {
+ let mut val = val;
+ if BIT_WIDTH < 64 {
+ val &= (1u64 << BIT_WIDTH) - 1;
+ }
+ if cfg!(target_endian = "big") {
+ val = val.reverse_bits() >> (64 - BIT_WIDTH as usize);
+ }
+ val <<= bit_shift;
+ let field_mask = if BIT_WIDTH as usize + bit_shift >= 64 {
+ !0u64 << bit_shift
+ } else {
+ ((1u64 << BIT_WIDTH) - 1) << bit_shift
+ };
+ let mut i = 0;
+ while i < bytes_needed {
+ let byte_val = (val >> (i * 8)) as u8;
+ let byte_mask = (field_mask >> (i * 8)) as u8;
+ let byte_ptr = unsafe { storage_ptr.add(start_byte + i) };
+ if cfg!(target_endian = "big") {
+ let byte = unsafe { (*byte_ptr).reverse_bits() };
+ let new_byte = (byte & !byte_mask) | (byte_val & byte_mask);
+ unsafe { *byte_ptr = new_byte.reverse_bits() };
+ } else {
+ unsafe {
+ *byte_ptr = (*byte_ptr & !byte_mask) | (byte_val & byte_mask)
+ };
+ }
+ i += 1;
+ }
+ }
+ }
+}
+///< Minimum Cache line size.
+pub const RTE_CACHE_LINE_MIN_SIZE: u32 = 64;
+pub const RTE_CACHE_LINE_SIZE: u32 = 64;
+pub type phys_addr_t = u64;
+pub type MARKER = [*mut ::std::os::raw::c_void; 0usize];
+pub type MARKER8 = [u8; 0usize];
+pub type MARKER64 = [u64; 0usize];
+/// The atomic counter structure.
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_atomic16_t {
+ ///< An internal counter value.
+ pub cnt: i16,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_atomic16_t"][::std::mem::size_of::() - 2usize];
+ ["Alignment of rte_atomic16_t"][::std::mem::align_of::() - 2usize];
+ [
+ "Offset of field: rte_atomic16_t::cnt",
+ ][::std::mem::offset_of!(rte_atomic16_t, cnt) - 0usize];
+};
+/// The generic rte_mbuf, containing a packet mbuf.
+#[repr(C)]
+#[repr(align(64))]
+pub struct rte_mbuf {
+ pub cacheline0: MARKER,
+ ///< Virtual address of segment buffer.
+ pub buf_addr: *mut ::std::os::raw::c_void,
+ ///< Physical address of segment buffer.
+ pub buf_physaddr: phys_addr_t,
+ ///< Length of segment buffer.
+ pub buf_len: u16,
+ pub rearm_data: MARKER8,
+ pub data_off: u16,
+ pub __bindgen_anon_1: rte_mbuf__bindgen_ty_1,
+ ///< Number of segments.
+ pub nb_segs: u8,
+ ///< Input port.
+ pub port: u8,
+ ///< Offload features.
+ pub ol_flags: u64,
+ pub rx_descriptor_fields1: MARKER,
+ pub __bindgen_anon_2: rte_mbuf__bindgen_ty_2,
+ ///< Total pkt len: sum of all segments.
+ pub pkt_len: u32,
+ ///< Amount of data in segment buffer.
+ pub data_len: u16,
+ /// VLAN TCI (CPU order), valid if PKT_RX_VLAN_STRIPPED is set.
+ pub vlan_tci: u16,
+ ///< hash information
+ pub hash: rte_mbuf__bindgen_ty_3,
+ ///< Sequence number. See also rte_reorder_insert()
+ pub seqn: u32,
+ /// Outer VLAN TCI (CPU order), valid if PKT_RX_QINQ_STRIPPED is set.
+ pub vlan_tci_outer: u16,
+ pub cacheline1: MARKER,
+ pub __bindgen_anon_3: rte_mbuf__bindgen_ty_4,
+ ///< Pool from which mbuf was allocated.
+ pub pool: *mut rte_mempool,
+ ///< Next segment of scattered packet.
+ pub next: *mut rte_mbuf,
+ pub __bindgen_anon_4: rte_mbuf__bindgen_ty_5,
+ /** Size of the application private data. In case of an indirect
+ mbuf, it stores the direct mbuf private data size.*/
+ pub priv_size: u16,
+ /// Timesync flags for use with IEEE1588.
+ pub timesync: u16,
+}
+/** 16-bit Reference counter.
+ It should only be accessed using the following functions:
+ rte_mbuf_refcnt_update(), rte_mbuf_refcnt_read(), and
+ rte_mbuf_refcnt_set(). The functionality of these functions (atomic,
+ or non-atomic) is controlled by the CONFIG_RTE_MBUF_REFCNT_ATOMIC
+ config option.*/
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union rte_mbuf__bindgen_ty_1 {
+ ///< Atomically accessed refcnt
+ pub refcnt_atomic: rte_atomic16_t,
+ ///< Non-atomically accessed refcnt
+ pub refcnt: u16,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_mbuf__bindgen_ty_1",
+ ][::std::mem::size_of::() - 2usize];
+ [
+ "Alignment of rte_mbuf__bindgen_ty_1",
+ ][::std::mem::align_of::() - 2usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_1::refcnt_atomic",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_1, refcnt_atomic) - 0usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_1::refcnt",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_1, refcnt) - 0usize];
+};
+impl Default for rte_mbuf__bindgen_ty_1 {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union rte_mbuf__bindgen_ty_2 {
+ ///< L2/L3/L4 and tunnel information.
+ pub packet_type: u32,
+ pub __bindgen_anon_1: rte_mbuf__bindgen_ty_2__bindgen_ty_1,
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
+ pub _bindgen_align: [u32; 0],
+ pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_mbuf__bindgen_ty_2__bindgen_ty_1",
+ ][::std::mem::size_of::() - 4usize];
+ [
+ "Alignment of rte_mbuf__bindgen_ty_2__bindgen_ty_1",
+ ][::std::mem::align_of::() - 4usize];
+};
+impl rte_mbuf__bindgen_ty_2__bindgen_ty_1 {
+ #[inline]
+ pub fn l2_type(&self) -> u32 {
+ self._bitfield_1.get_const::<0usize, 4u8>() as u32 as _
+ }
+ #[inline]
+ pub fn set_l2_type(&mut self, val: u32) {
+ let val: u32 = val as _;
+ self._bitfield_1.set_const::<0usize, 4u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn l2_type_raw(this: *const Self) -> u32 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_get_const::<0usize, 4u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u32 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_l2_type_raw(this: *mut Self, val: u32) {
+ unsafe {
+ let val: u32 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_set_const::<
+ 0usize,
+ 4u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn l3_type(&self) -> u32 {
+ self._bitfield_1.get_const::<4usize, 4u8>() as u32 as _
+ }
+ #[inline]
+ pub fn set_l3_type(&mut self, val: u32) {
+ let val: u32 = val as _;
+ self._bitfield_1.set_const::<4usize, 4u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn l3_type_raw(this: *const Self) -> u32 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_get_const::<4usize, 4u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u32 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_l3_type_raw(this: *mut Self, val: u32) {
+ unsafe {
+ let val: u32 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_set_const::<
+ 4usize,
+ 4u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn l4_type(&self) -> u32 {
+ self._bitfield_1.get_const::<8usize, 4u8>() as u32 as _
+ }
+ #[inline]
+ pub fn set_l4_type(&mut self, val: u32) {
+ let val: u32 = val as _;
+ self._bitfield_1.set_const::<8usize, 4u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn l4_type_raw(this: *const Self) -> u32 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_get_const::<8usize, 4u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u32 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_l4_type_raw(this: *mut Self, val: u32) {
+ unsafe {
+ let val: u32 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_set_const::<
+ 8usize,
+ 4u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn tun_type(&self) -> u32 {
+ self._bitfield_1.get_const::<12usize, 4u8>() as u32 as _
+ }
+ #[inline]
+ pub fn set_tun_type(&mut self, val: u32) {
+ let val: u32 = val as _;
+ self._bitfield_1.set_const::<12usize, 4u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn tun_type_raw(this: *const Self) -> u32 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_get_const::<12usize, 4u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u32 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_tun_type_raw(this: *mut Self, val: u32) {
+ unsafe {
+ let val: u32 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_set_const::<
+ 12usize,
+ 4u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn inner_l2_type(&self) -> u32 {
+ self._bitfield_1.get_const::<16usize, 4u8>() as u32 as _
+ }
+ #[inline]
+ pub fn set_inner_l2_type(&mut self, val: u32) {
+ let val: u32 = val as _;
+ self._bitfield_1.set_const::<16usize, 4u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn inner_l2_type_raw(this: *const Self) -> u32 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_get_const::<16usize, 4u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u32 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_inner_l2_type_raw(this: *mut Self, val: u32) {
+ unsafe {
+ let val: u32 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_set_const::<
+ 16usize,
+ 4u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn inner_l3_type(&self) -> u32 {
+ self._bitfield_1.get_const::<20usize, 4u8>() as u32 as _
+ }
+ #[inline]
+ pub fn set_inner_l3_type(&mut self, val: u32) {
+ let val: u32 = val as _;
+ self._bitfield_1.set_const::<20usize, 4u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn inner_l3_type_raw(this: *const Self) -> u32 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_get_const::<20usize, 4u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u32 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_inner_l3_type_raw(this: *mut Self, val: u32) {
+ unsafe {
+ let val: u32 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_set_const::<
+ 20usize,
+ 4u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn inner_l4_type(&self) -> u32 {
+ self._bitfield_1.get_const::<24usize, 4u8>() as u32 as _
+ }
+ #[inline]
+ pub fn set_inner_l4_type(&mut self, val: u32) {
+ let val: u32 = val as _;
+ self._bitfield_1.set_const::<24usize, 4u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn inner_l4_type_raw(this: *const Self) -> u32 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_get_const::<24usize, 4u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u32 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_inner_l4_type_raw(this: *mut Self, val: u32) {
+ unsafe {
+ let val: u32 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 4usize],
+ >>::raw_set_const::<
+ 24usize,
+ 4u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn new_bitfield_1(
+ l2_type: u32,
+ l3_type: u32,
+ l4_type: u32,
+ tun_type: u32,
+ inner_l2_type: u32,
+ inner_l3_type: u32,
+ inner_l4_type: u32,
+ ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
+ let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
+ __bindgen_bitfield_unit
+ .set_const::<
+ 0usize,
+ 4u8,
+ >({
+ let l2_type: u32 = l2_type as _;
+ l2_type as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 4usize,
+ 4u8,
+ >({
+ let l3_type: u32 = l3_type as _;
+ l3_type as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 8usize,
+ 4u8,
+ >({
+ let l4_type: u32 = l4_type as _;
+ l4_type as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 12usize,
+ 4u8,
+ >({
+ let tun_type: u32 = tun_type as _;
+ tun_type as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 16usize,
+ 4u8,
+ >({
+ let inner_l2_type: u32 = inner_l2_type as _;
+ inner_l2_type as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 20usize,
+ 4u8,
+ >({
+ let inner_l3_type: u32 = inner_l3_type as _;
+ inner_l3_type as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 24usize,
+ 4u8,
+ >({
+ let inner_l4_type: u32 = inner_l4_type as _;
+ inner_l4_type as u64
+ });
+ __bindgen_bitfield_unit
+ }
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_mbuf__bindgen_ty_2",
+ ][::std::mem::size_of::() - 4usize];
+ [
+ "Alignment of rte_mbuf__bindgen_ty_2",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_2::packet_type",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_2, packet_type) - 0usize];
+};
+impl Default for rte_mbuf__bindgen_ty_2 {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union rte_mbuf__bindgen_ty_3 {
+ ///< RSS hash result if RSS enabled
+ pub rss: u32,
+ ///< Filter identifier if FDIR enabled
+ pub fdir: rte_mbuf__bindgen_ty_3__bindgen_ty_1,
+ ///< Hierarchical scheduler
+ pub sched: rte_mbuf__bindgen_ty_3__bindgen_ty_2,
+ ///< User defined tags. See rte_distributor_process()
+ pub usr: u32,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1 {
+ pub __bindgen_anon_1: rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1,
+ pub hi: u32,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 {
+ pub __bindgen_anon_1: rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1,
+ pub lo: u32,
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
+ pub hash: u16,
+ pub id: u16,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1",
+ ][::std::mem::size_of::<
+ rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1,
+ >() - 4usize];
+ [
+ "Alignment of rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1",
+ ][::std::mem::align_of::<
+ rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1,
+ >() - 2usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1::hash",
+ ][::std::mem::offset_of!(
+ rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, hash
+ ) - 0usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1::id",
+ ][::std::mem::offset_of!(
+ rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, id
+ ) - 2usize];
+};
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1",
+ ][::std::mem::size_of::()
+ - 4usize];
+ [
+ "Alignment of rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1",
+ ][::std::mem::align_of::()
+ - 4usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1::lo",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1, lo)
+ - 0usize];
+};
+impl Default for rte_mbuf__bindgen_ty_3__bindgen_ty_1__bindgen_ty_1 {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_mbuf__bindgen_ty_3__bindgen_ty_1",
+ ][::std::mem::size_of::() - 8usize];
+ [
+ "Alignment of rte_mbuf__bindgen_ty_3__bindgen_ty_1",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_3__bindgen_ty_1::hi",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_3__bindgen_ty_1, hi) - 4usize];
+};
+impl Default for rte_mbuf__bindgen_ty_3__bindgen_ty_1 {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_mbuf__bindgen_ty_3__bindgen_ty_2 {
+ pub lo: u32,
+ pub hi: u32,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_mbuf__bindgen_ty_3__bindgen_ty_2",
+ ][::std::mem::size_of::() - 8usize];
+ [
+ "Alignment of rte_mbuf__bindgen_ty_3__bindgen_ty_2",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_3__bindgen_ty_2::lo",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_3__bindgen_ty_2, lo) - 0usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_3__bindgen_ty_2::hi",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_3__bindgen_ty_2, hi) - 4usize];
+};
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_mbuf__bindgen_ty_3",
+ ][::std::mem::size_of::() - 8usize];
+ [
+ "Alignment of rte_mbuf__bindgen_ty_3",
+ ][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_3::rss",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_3, rss) - 0usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_3::fdir",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_3, fdir) - 0usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_3::sched",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_3, sched) - 0usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_3::usr",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_3, usr) - 0usize];
+};
+impl Default for rte_mbuf__bindgen_ty_3 {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union rte_mbuf__bindgen_ty_4 {
+ ///< Can be used for external metadata
+ pub userdata: *mut ::std::os::raw::c_void,
+ ///< Allow 8-byte userdata on 32-bit
+ pub udata64: u64,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_mbuf__bindgen_ty_4",
+ ][::std::mem::size_of::() - 8usize];
+ [
+ "Alignment of rte_mbuf__bindgen_ty_4",
+ ][::std::mem::align_of::() - 8usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_4::userdata",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_4, userdata) - 0usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_4::udata64",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_4, udata64) - 0usize];
+};
+impl Default for rte_mbuf__bindgen_ty_4 {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union rte_mbuf__bindgen_ty_5 {
+ ///< combined for easy fetch
+ pub tx_offload: u64,
+ pub __bindgen_anon_1: rte_mbuf__bindgen_ty_5__bindgen_ty_1,
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
+ pub _bindgen_align: [u64; 0],
+ pub _bitfield_1: __BindgenBitfieldUnit<[u8; 7usize]>,
+ pub __bindgen_padding_0: u8,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_mbuf__bindgen_ty_5__bindgen_ty_1",
+ ][::std::mem::size_of::() - 8usize];
+ [
+ "Alignment of rte_mbuf__bindgen_ty_5__bindgen_ty_1",
+ ][::std::mem::align_of::() - 8usize];
+};
+impl rte_mbuf__bindgen_ty_5__bindgen_ty_1 {
+ #[inline]
+ pub fn l2_len(&self) -> u64 {
+ self._bitfield_1.get_const::<0usize, 7u8>() as u64 as _
+ }
+ #[inline]
+ pub fn set_l2_len(&mut self, val: u64) {
+ let val: u64 = val as _;
+ self._bitfield_1.set_const::<0usize, 7u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn l2_len_raw(this: *const Self) -> u64 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 7usize],
+ >>::raw_get_const::<0usize, 7u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u64 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_l2_len_raw(this: *mut Self, val: u64) {
+ unsafe {
+ let val: u64 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 7usize],
+ >>::raw_set_const::<
+ 0usize,
+ 7u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn l3_len(&self) -> u64 {
+ self._bitfield_1.get_const::<7usize, 9u8>() as u64 as _
+ }
+ #[inline]
+ pub fn set_l3_len(&mut self, val: u64) {
+ let val: u64 = val as _;
+ self._bitfield_1.set_const::<7usize, 9u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn l3_len_raw(this: *const Self) -> u64 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 7usize],
+ >>::raw_get_const::<7usize, 9u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u64 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_l3_len_raw(this: *mut Self, val: u64) {
+ unsafe {
+ let val: u64 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 7usize],
+ >>::raw_set_const::<
+ 7usize,
+ 9u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn l4_len(&self) -> u64 {
+ self._bitfield_1.get_const::<16usize, 8u8>() as u64 as _
+ }
+ #[inline]
+ pub fn set_l4_len(&mut self, val: u64) {
+ let val: u64 = val as _;
+ self._bitfield_1.set_const::<16usize, 8u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn l4_len_raw(this: *const Self) -> u64 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 7usize],
+ >>::raw_get_const::<16usize, 8u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u64 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_l4_len_raw(this: *mut Self, val: u64) {
+ unsafe {
+ let val: u64 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 7usize],
+ >>::raw_set_const::<
+ 16usize,
+ 8u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn tso_segsz(&self) -> u64 {
+ self._bitfield_1.get_const::<24usize, 16u8>() as u64 as _
+ }
+ #[inline]
+ pub fn set_tso_segsz(&mut self, val: u64) {
+ let val: u64 = val as _;
+ self._bitfield_1.set_const::<24usize, 16u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn tso_segsz_raw(this: *const Self) -> u64 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 7usize],
+ >>::raw_get_const::<24usize, 16u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u64 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_tso_segsz_raw(this: *mut Self, val: u64) {
+ unsafe {
+ let val: u64 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 7usize],
+ >>::raw_set_const::<
+ 24usize,
+ 16u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn outer_l3_len(&self) -> u64 {
+ self._bitfield_1.get_const::<40usize, 9u8>() as u64 as _
+ }
+ #[inline]
+ pub fn set_outer_l3_len(&mut self, val: u64) {
+ let val: u64 = val as _;
+ self._bitfield_1.set_const::<40usize, 9u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn outer_l3_len_raw(this: *const Self) -> u64 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 7usize],
+ >>::raw_get_const::<40usize, 9u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u64 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_outer_l3_len_raw(this: *mut Self, val: u64) {
+ unsafe {
+ let val: u64 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 7usize],
+ >>::raw_set_const::<
+ 40usize,
+ 9u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn outer_l2_len(&self) -> u64 {
+ self._bitfield_1.get_const::<49usize, 7u8>() as u64 as _
+ }
+ #[inline]
+ pub fn set_outer_l2_len(&mut self, val: u64) {
+ let val: u64 = val as _;
+ self._bitfield_1.set_const::<49usize, 7u8>(val as u64)
+ }
+ #[inline]
+ pub unsafe fn outer_l2_len_raw(this: *const Self) -> u64 {
+ unsafe {
+ <__BindgenBitfieldUnit<
+ [u8; 7usize],
+ >>::raw_get_const::<49usize, 7u8>(::std::ptr::addr_of!((*this)._bitfield_1))
+ as u64 as _
+ }
+ }
+ #[inline]
+ pub unsafe fn set_outer_l2_len_raw(this: *mut Self, val: u64) {
+ unsafe {
+ let val: u64 = val as _;
+ <__BindgenBitfieldUnit<
+ [u8; 7usize],
+ >>::raw_set_const::<
+ 49usize,
+ 7u8,
+ >(::std::ptr::addr_of_mut!((*this)._bitfield_1), val as u64)
+ }
+ }
+ #[inline]
+ pub fn new_bitfield_1(
+ l2_len: u64,
+ l3_len: u64,
+ l4_len: u64,
+ tso_segsz: u64,
+ outer_l3_len: u64,
+ outer_l2_len: u64,
+ ) -> __BindgenBitfieldUnit<[u8; 7usize]> {
+ let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 7usize]> = Default::default();
+ __bindgen_bitfield_unit
+ .set_const::<
+ 0usize,
+ 7u8,
+ >({
+ let l2_len: u64 = l2_len as _;
+ l2_len as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 7usize,
+ 9u8,
+ >({
+ let l3_len: u64 = l3_len as _;
+ l3_len as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 16usize,
+ 8u8,
+ >({
+ let l4_len: u64 = l4_len as _;
+ l4_len as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 24usize,
+ 16u8,
+ >({
+ let tso_segsz: u64 = tso_segsz as _;
+ tso_segsz as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 40usize,
+ 9u8,
+ >({
+ let outer_l3_len: u64 = outer_l3_len as _;
+ outer_l3_len as u64
+ });
+ __bindgen_bitfield_unit
+ .set_const::<
+ 49usize,
+ 7u8,
+ >({
+ let outer_l2_len: u64 = outer_l2_len as _;
+ outer_l2_len as u64
+ });
+ __bindgen_bitfield_unit
+ }
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ [
+ "Size of rte_mbuf__bindgen_ty_5",
+ ][::std::mem::size_of::() - 8usize];
+ [
+ "Alignment of rte_mbuf__bindgen_ty_5",
+ ][::std::mem::align_of::() - 8usize];
+ [
+ "Offset of field: rte_mbuf__bindgen_ty_5::tx_offload",
+ ][::std::mem::offset_of!(rte_mbuf__bindgen_ty_5, tx_offload) - 0usize];
+};
+impl Default for rte_mbuf__bindgen_ty_5 {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of rte_mbuf"][::std::mem::size_of::() - 128usize];
+ ["Alignment of rte_mbuf"][::std::mem::align_of::() - 64usize];
+ [
+ "Offset of field: rte_mbuf::cacheline0",
+ ][::std::mem::offset_of!(rte_mbuf, cacheline0) - 0usize];
+ [
+ "Offset of field: rte_mbuf::buf_addr",
+ ][::std::mem::offset_of!(rte_mbuf, buf_addr) - 0usize];
+ [
+ "Offset of field: rte_mbuf::buf_physaddr",
+ ][::std::mem::offset_of!(rte_mbuf, buf_physaddr) - 8usize];
+ [
+ "Offset of field: rte_mbuf::buf_len",
+ ][::std::mem::offset_of!(rte_mbuf, buf_len) - 16usize];
+ [
+ "Offset of field: rte_mbuf::rearm_data",
+ ][::std::mem::offset_of!(rte_mbuf, rearm_data) - 18usize];
+ [
+ "Offset of field: rte_mbuf::data_off",
+ ][::std::mem::offset_of!(rte_mbuf, data_off) - 18usize];
+ [
+ "Offset of field: rte_mbuf::nb_segs",
+ ][::std::mem::offset_of!(rte_mbuf, nb_segs) - 22usize];
+ [
+ "Offset of field: rte_mbuf::port",
+ ][::std::mem::offset_of!(rte_mbuf, port) - 23usize];
+ [
+ "Offset of field: rte_mbuf::ol_flags",
+ ][::std::mem::offset_of!(rte_mbuf, ol_flags) - 24usize];
+ [
+ "Offset of field: rte_mbuf::rx_descriptor_fields1",
+ ][::std::mem::offset_of!(rte_mbuf, rx_descriptor_fields1) - 32usize];
+ [
+ "Offset of field: rte_mbuf::pkt_len",
+ ][::std::mem::offset_of!(rte_mbuf, pkt_len) - 36usize];
+ [
+ "Offset of field: rte_mbuf::data_len",
+ ][::std::mem::offset_of!(rte_mbuf, data_len) - 40usize];
+ [
+ "Offset of field: rte_mbuf::vlan_tci",
+ ][::std::mem::offset_of!(rte_mbuf, vlan_tci) - 42usize];
+ [
+ "Offset of field: rte_mbuf::hash",
+ ][::std::mem::offset_of!(rte_mbuf, hash) - 44usize];
+ [
+ "Offset of field: rte_mbuf::seqn",
+ ][::std::mem::offset_of!(rte_mbuf, seqn) - 52usize];
+ [
+ "Offset of field: rte_mbuf::vlan_tci_outer",
+ ][::std::mem::offset_of!(rte_mbuf, vlan_tci_outer) - 56usize];
+ [
+ "Offset of field: rte_mbuf::cacheline1",
+ ][::std::mem::offset_of!(rte_mbuf, cacheline1) - 64usize];
+ [
+ "Offset of field: rte_mbuf::pool",
+ ][::std::mem::offset_of!(rte_mbuf, pool) - 72usize];
+ [
+ "Offset of field: rte_mbuf::next",
+ ][::std::mem::offset_of!(rte_mbuf, next) - 80usize];
+ [
+ "Offset of field: rte_mbuf::priv_size",
+ ][::std::mem::offset_of!(rte_mbuf, priv_size) - 96usize];
+ [
+ "Offset of field: rte_mbuf::timesync",
+ ][::std::mem::offset_of!(rte_mbuf, timesync) - 98usize];
+};
+impl Default for rte_mbuf {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+///< Pool from which mbuf was allocated.
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct rte_mempool {
+ pub _address: u8,
+}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-22/nsBaseHashtable.rs b/bindgen-tests/tests/expectations/tests/libclang-22/nsBaseHashtable.rs
new file mode 100644
index 0000000000..e8c90f2e06
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-22/nsBaseHashtable.rs
@@ -0,0 +1,57 @@
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct nsBaseHashtableET {
+ pub _address: u8,
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct nsTHashtable {
+ pub _address: u8,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct nsBaseHashtable {
+ pub _address: u8,
+}
+pub type nsBaseHashtable_KeyType = KeyClass;
+pub type nsBaseHashtable_EntryType = nsBaseHashtableET;
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct nsBaseHashtable_LookupResult {
+ pub mEntry: *mut nsBaseHashtable_EntryType,
+ pub mTable: *mut nsBaseHashtable,
+}
+impl Default for nsBaseHashtable_LookupResult {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+#[repr(C)]
+#[derive(Debug)]
+pub struct nsBaseHashtable_EntryPtr {
+ pub mEntry: *mut nsBaseHashtable_EntryType,
+ pub mExistingEntry: bool,
+}
+impl Default for nsBaseHashtable_EntryPtr {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+impl Default for nsBaseHashtable {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
diff --git a/bindgen-tests/tests/expectations/tests/libclang-22/typedef-pointer-overlap.rs b/bindgen-tests/tests/expectations/tests/libclang-22/typedef-pointer-overlap.rs
new file mode 100644
index 0000000000..a4700c3c6c
--- /dev/null
+++ b/bindgen-tests/tests/expectations/tests/libclang-22/typedef-pointer-overlap.rs
@@ -0,0 +1,87 @@
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct foo {
+ pub inner: ::std::os::raw::c_char,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of foo"][::std::mem::size_of::() - 1usize];
+ ["Alignment of foo"][::std::mem::align_of::() - 1usize];
+ ["Offset of field: foo::inner"][::std::mem::offset_of!(foo, inner) - 0usize];
+};
+pub type foo = *const foo;
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct bar {
+ pub inner: ::std::os::raw::c_char,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of bar"][::std::mem::size_of::() - 1usize];
+ ["Alignment of bar"][::std::mem::align_of::() - 1usize];
+ ["Offset of field: bar::inner"][::std::mem::offset_of!(bar, inner) - 0usize];
+};
+pub type bar = *mut bar;
+#[repr(C)]
+#[derive(Debug)]
+pub struct baz {
+ _unused: [u8; 0],
+}
+pub type baz = *mut baz;
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union cat {
+ pub standard_issue: ::std::os::raw::c_int,
+}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of cat"][::std::mem::size_of::() - 4usize];
+ ["Alignment of cat"][::std::mem::align_of::() - 4usize];
+ [
+ "Offset of field: cat::standard_issue",
+ ][::std::mem::offset_of!(cat, standard_issue) - 0usize];
+};
+impl Default for cat {
+ fn default() -> Self {
+ let mut s = ::std::mem::MaybeUninit::::uninit();
+ unsafe {
+ ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
+ s.assume_init()
+ }
+ }
+}
+pub type cat = *mut cat;
+pub const mad_scientist: mad = 0;
+pub type mad = ::std::os::raw::c_uint;
+pub type mad = *mut mad;
+unsafe extern "C" {
+ pub fn takes_foo_ptr(arg1: foo);
+}
+unsafe extern "C" {
+ pub fn takes_foo_struct(arg1: foo);
+}
+unsafe extern "C" {
+ pub fn takes_bar_ptr(arg1: bar);
+}
+unsafe extern "C" {
+ pub fn takes_bar_struct(arg1: bar);
+}
+unsafe extern "C" {
+ pub fn takes_baz_ptr(arg1: baz);
+}
+unsafe extern "C" {
+ pub fn takes_baz_struct(arg1: baz);
+}
+unsafe extern "C" {
+ pub fn takes_cat_ptr(arg1: cat);
+}
+unsafe extern "C" {
+ pub fn takes_cat_union(arg1: cat);
+}
+unsafe extern "C" {
+ pub fn takes_mad_ptr(arg1: mad);
+}
+unsafe extern "C" {
+ pub fn takes_mad_enum(arg1: mad);
+}
diff --git a/bindgen-tests/tests/tests.rs b/bindgen-tests/tests/tests.rs
index ad103eb592..77d86bd45a 100644
--- a/bindgen-tests/tests/tests.rs
+++ b/bindgen-tests/tests/tests.rs
@@ -141,16 +141,20 @@ fn compare_generated_header(
{
let mut expectation = expectation.clone();
- if cfg!(feature = "__testing_only_libclang_20") {
+ if cfg!(feature = "__testing_only_libclang_22") {
+ expectation.push("libclang-22");
+ } else if cfg!(feature = "__testing_only_libclang_20") {
expectation.push("libclang-20");
} else if cfg!(feature = "__testing_only_libclang_16") {
expectation.push("libclang-16");
} else {
match clang_version().parsed {
- None => expectation.push("libclang-20"),
+ None => expectation.push("libclang-22"),
Some(version) => {
let (maj, min) = version;
- let version_str = if maj >= 20 {
+ let version_str = if maj >= 22 {
+ "22".to_owned()
+ } else if maj >= 20 {
"20".to_owned()
} else if maj >= 16 {
"16".to_owned()
diff --git a/bindgen/Cargo.toml b/bindgen/Cargo.toml
index 786d147765..db57e96fd2 100644
--- a/bindgen/Cargo.toml
+++ b/bindgen/Cargo.toml
@@ -57,6 +57,7 @@ __cli = ["dep:clap", "dep:clap_complete"]
__testing_only_extra_assertions = []
__testing_only_libclang_16 = []
__testing_only_libclang_20 = []
+__testing_only_libclang_22 = []
[package.metadata.docs.rs]
features = ["experimental"]