Documentation
¶
Overview ¶
Package memzone wraps RTE memzone library.
The goal of the memzone allocator is to reserve contiguous portions of physical memory. These zones are identified by a name.
The memzone descriptors are shared by all partitions and are located in a known place of physical memory. This zone is accessed using rte_eal_get_configuration(). The lookup (by name) of a memory zone can be done in any partition and returns the same physical address.
Please refer to DPDK Programmer's Guide for reference and caveats.
Index ¶
Constants ¶
const ( // Allow alternative page size to be used if the requested page // size is unavailable. If this flag is not set, the function will // return error on an unavailable size request. PageSizeHintOnly = C.RTE_MEMZONE_SIZE_HINT_ONLY )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Memzone ¶
type Memzone C.struct_rte_memzone
Memzone is a contiguous portion of physical memory. These zones are identified by a name.
func Reserve ¶
Reserve a portion of physical memory.
This function reserves some memory and returns a pointer to a correctly filled memzone descriptor. If the allocation cannot be done, return NULL.
Note: Reserving memzones with size set to 0 will only attempt to allocate memzones from memory that is already available. It will not trigger any new allocations. : When reserving memzones with size set to 0, it is preferable to also set a valid socket_id. Setting socket_id to SOCKET_ID_ANY is supported, but will likely not yield expected results. Specifically, the resulting memzone may not necessarily be the biggest memzone available, but rather biggest memzone available on socket id corresponding to an lcore from which reservation was called.
func (*Memzone) HugePageSz ¶
HugePageSz returns the page size of underlying memory.
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option may be specified during Reserve for a new memzone.
func OptAligned ¶
OptAligned requests alignment for resulting memzone. Must be a power of 2.
func OptBounded ¶
OptBounded requests boundary for resulting memzone. Must be a power of 2 or zero. Zero value implies no boundary condition.