pub struct Umem { /* private fields */ }
Expand description

A region of virtual contiguous memory divided into equal-sized frames. It provides the underlying working memory for an AF_XDP Socket.

Implementations

Create a new Umem instance backed by an anonymous memory mapped region.

Setting use_huge_pages to true will instructed mmap() to allocate the underlying memory using huge pages. If you are getting errors as a result of this, check that the HugePages_Total setting is non-zero when you run cat /proc/meminfo.

The headroom and packet data segments of the Umem frame pointed at by desc. Contents are read-only.

Safety

desc must correspond to a frame belonging to this Umem. Passing the descriptor of another Umem is very likely to result in incorrect memory access, by either straddling frames or accessing memory outside the underlying Umem area.

Furthermore, the memory region accessed must not be mutably accessed anywhere else at the same time, either in userspace or by the kernel. To ensure this, care should be taken not to use the frame after submission to either the TxQueue or FillQueue until received over the CompQueue or RxQueue respectively.

The headroom segment of the Umem frame pointed at by desc. Contents are read-only.

Safety

See frame.

The data segment of the Umem frame pointed at by desc. Contents are read-only.

Safety

See frame.

The headroom and packet data segments of the Umem frame pointed at by desc. Contents are writeable.

Safety

desc must correspond to a frame belonging to this Umem. Passing the descriptor of another Umem is very likely to result in incorrect memory access, by either straddling frames or accessing memory outside the underlying Umem area.

Furthermore, the memory region accessed must not be mutably or immutably accessed anywhere else at the same time, either in userspace or by the kernel. To ensure this, care should be taken not to use the frame after submission to either the TxQueue or FillQueue until received over the CompQueue or RxQueue respectively.

The headroom segment of the Umem frame pointed at by desc. Contents are writeable.

Safety

See frame_mut.

The data segment of the Umem frame pointed at by desc. Contents are writeable.

Safety

See frame_mut.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.