|
DPDK
17.11.10
|
#include <stdint.h>#include <stddef.h>#include <stdio.h>#include <rte_common.h>#include <rte_config.h>Go to the source code of this file.
Data Structures | |
| struct | rte_memseg |
Macros | |
| #define | SOCKET_ID_ANY -1 |
| #define | RTE_CACHE_LINE_MASK (RTE_CACHE_LINE_SIZE-1) |
| #define | RTE_CACHE_LINE_ROUNDUP(size) (RTE_CACHE_LINE_SIZE * ((size + RTE_CACHE_LINE_SIZE - 1) / RTE_CACHE_LINE_SIZE)) |
| #define | RTE_CACHE_LINE_MIN_SIZE 64 |
| #define | __rte_cache_aligned __rte_aligned(RTE_CACHE_LINE_SIZE) |
| #define | __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE) |
Typedefs | |
| typedef uint64_t | phys_addr_t |
| typedef uint64_t | rte_iova_t |
Functions | |
| int | rte_mem_lock_page (const void *virt) |
| phys_addr_t | rte_mem_virt2phy (const void *virt) |
| rte_iova_t | rte_mem_virt2iova (const void *virt) |
| const struct rte_memseg * | rte_eal_get_physmem_layout (void) |
| void | rte_dump_physmem_layout (FILE *f) |
| uint64_t | rte_eal_get_physmem_size (void) |
| unsigned | rte_memory_get_nchannel (void) |
| unsigned | rte_memory_get_nrank (void) |
| int | rte_eal_using_phys_addrs (void) |
Memory-related RTE API.
Definition in file rte_memory.h.
| #define SOCKET_ID_ANY -1 |
Any NUMA socket.
Definition at line 68 of file rte_memory.h.
| #define RTE_CACHE_LINE_MASK (RTE_CACHE_LINE_SIZE-1) |
Cache line mask.
Definition at line 69 of file rte_memory.h.
| #define RTE_CACHE_LINE_ROUNDUP | ( | size | ) | (RTE_CACHE_LINE_SIZE * ((size + RTE_CACHE_LINE_SIZE - 1) / RTE_CACHE_LINE_SIZE)) |
Return the first cache-aligned value greater or equal to size. Cache line size in terms of log2
Definition at line 71 of file rte_memory.h.
| #define RTE_CACHE_LINE_MIN_SIZE 64 |
Minimum Cache line size.
Definition at line 86 of file rte_memory.h.
| struct rte_mempool_ops_table __rte_cache_aligned __rte_aligned(RTE_CACHE_LINE_SIZE) |
Force alignment to cache line.
Definition at line 91 of file rte_memory.h.
| struct rte_eth_txq_info __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE) |
Force minimum cache line alignment.
Definition at line 96 of file rte_memory.h.
| typedef uint64_t phys_addr_t |
Physical address.
Definition at line 98 of file rte_memory.h.
| typedef uint64_t rte_iova_t |
IO virtual address type. When the physical addressing mode (IOVA as PA) is in use, the translation from an IO virtual address (IOVA) to a physical address is a direct mapping, i.e. the same value. Otherwise, in virtual mode (IOVA as VA), an IOMMU may do the translation.
Definition at line 107 of file rte_memory.h.
| int rte_mem_lock_page | ( | const void * | virt | ) |
Lock page in physical memory and prevent from swapping.
| virt | The virtual address. |
| phys_addr_t rte_mem_virt2phy | ( | const void * | virt | ) |
Get physical address of any mapped virtual address in the current process. It is found by browsing the /proc/self/pagemap special file. The page must be locked.
| virt | The virtual address. |
| rte_iova_t rte_mem_virt2iova | ( | const void * | virt | ) |
Get IO virtual address of any mapped virtual address in the current process.
| virt | The virtual address. |
| const struct rte_memseg* rte_eal_get_physmem_layout | ( | void | ) |
Get the layout of the available physical memory.
It can be useful for an application to have the full physical memory layout to decide the size of a memory zone to reserve. This table is stored in rte_config (see rte_eal_get_configuration()).
| void rte_dump_physmem_layout | ( | FILE * | f | ) |
Dump the physical memory layout to a file.
| f | A pointer to a file for output |
| uint64_t rte_eal_get_physmem_size | ( | void | ) |
Get the total amount of available physical memory.
| unsigned rte_memory_get_nchannel | ( | void | ) |
Get the number of memory channels.
| unsigned rte_memory_get_nrank | ( | void | ) |
Get the number of memory ranks.
| int rte_eal_using_phys_addrs | ( | void | ) |
Drivers based on uio will not load unless physical addresses are obtainable. It is only possible to get physical addresses when running as a privileged user.
1.8.9.1