aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/pmalloc.c
AgeCommit message (Collapse)AuthorFilesLines
10 daysvppinfra: Add FreeBSD method for updating pmalloc lookup tableTom Jones1-1/+44
FreeBSD has a different interface to request memory mapping information. Add a FreeBSD specific method for reading physical addresses and make it available at build time. Type: improvement Change-Id: I3588dde8e0a6f6d53333040245341ed09cebef9d Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-18vppinfra: os agnostic api for getting CPU informationDamjan Marion1-0/+2
Avoid direct sysfs reads when possible... Type: improvement Change-Id: I2b84cd18f3da47925d068951f24b79b5b6e20bb1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-12misc: remove GNU Indent directivesDamjan Marion1-2/+0
Type: refactor Change-Id: I5235bf3e9aff58af6ba2c14e8c6529c4fc9ec86c Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-02-13vppinfra: MAP_HUGETLB isn't available on FreeBSDTom Jones1-0/+2
Don't use the MAP_HUGETLB mmap flag on FreeBSD as it isn't available on the platform. Type: improvement Change-Id: Ie2046601c693f9ef12cf8113d6dbd87c322f1cf0 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13vppinfra: Only prealloc hugepages on LinuxTom Jones1-0/+2
FreeBSD doesn't support sysfs or preallocating hugepages directly. In lieu of refactoring clib_sysfs calls place this one behind an #ifdef linux. Type: improvement Change-Id: I4079ca70175e4cec44d913db2b0407a3ca6306c9 Signed-off-by: Tom Jones <thj@freebsd.org>
2022-06-09vppinfra: missing __clib_export for clib_pmalloc_alloc_alignedDamjan Marion1-2/+2
Type: improvement Change-Id: I7489327d8b9c5f69b4ceb2159456f00f8a3612df Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-05-06vppinfra: fix testsDamjan Marion1-2/+2
Type: fix Change-Id: If59a66aae658dd35dbcb4987ab00c306b3c6e2e2 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-20pmalloc: tolerate move_pages failure on numa node #0Klement Sekera1-1/+2
Type: fix Change-Id: I65dbc4f3db47c745a0187e015845e07b3b0568e5 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-04-18vppinfra: remove linux/syscall.hDamjan Marion1-43/+27
For portabiliy reasons it is better to have all wrapped in clib code. I.e. instead of using getcpu() we have clib_get_current_numa_node () and clib_get_current_cpu_id(). Type: refactor Change-Id: I29b52d7f29bc7f93873402c4070561f564b71c63 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-2/+2
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-17vppinfra: explicitly export symbolsDamjan Marion1-6/+6
Type: improvement Change-Id: I57a9f85f7df1fc48656b72592349f4c544302f77 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-17stats: configurable page sizeDamjan Marion1-4/+1
Type: improvement Change-Id: I9973bce20a0a2a8a7e227cf96518de5b79374425 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-17vppinfra: support main heap with different page sizesDamjan Marion1-9/+9
Type: improvement Change-Id: I381fc3dec8580208d0e24637d791af69011aa83b Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-14vppinfra: add clib_log2_page_sz and format/unformat functionsDamjan Marion1-18/+0
Type: improvement Change-Id: Ie44dbf9396cfed19dba153810b7bd76ce5377cd4 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-21vppinfra: bihash improvementsDave Barach1-23/+6
Template instances can allocate BIHASH_KVP_PER_PAGE data records tangent to the bucket, to remove a dependent read / prefetch. Template instances can ask for immediate memory allocation, to avoid several branches in the lookup path. Clean up l2 fib, gpb plugin codes: use clib_bihash_get_bucket(...) Use hugepages for bihash allocation arenas Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Damjan Marion <damarion@cisco.com> Change-Id: I92fc11bc58e48d84e2d61f44580916dd1c56361c
2019-11-22vppinfra: fix coverity issue 205691 in pmallocAndrew Yourtchenko1-0/+1
set the address to MMAP_FAILED if mmap has failed, so that we do not attempt to free it in the error handling path. Change-Id: I6e6b51a365fb68086dc20aa40a676a36af59a3ba Type: fix Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-11-07pmalloc: always lock pagesDamjan Marion1-25/+11
Type: feature Change-Id: I5bbf37969c9c51e40a013d1fc3ab966838eeb80d Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-03-18Fix build with newer linux headersDamjan Marion1-1/+2
Change-Id: Ibfdcec60567ec357205fa137257f2d8cba44b01c Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-27VPP-1576: fix Coverity issuesDave Barach1-1/+1
Change-Id: I8b59b2e1c0525abf4b0492e50a7af57df4cd3ce2 Signed-off-by: Dave Barach <dave@barachs.net>
2019-02-26Fix vpp crashing when attempting to run in kubernetes PodArtem Belov1-0/+21
mmap does not fail but writing to mapped memory is causing sigbus. Change-Id: I5135f32eede67fccb4aaa07a501cd262d254ed8d Signed-off-by: Artem Belov <artem.belov@xored.com>
2019-02-21physmem: keep physmem VA in 39-bit address space on x86_64Damjan Marion1-3/+9
Some x86 CPUs have IOMMU capable dealing only with 39-bit address space This patch also adds option to specify physmem base address from startup.conf Change-Id: I9e8abd26efb60e9c4ad54c035fb1751a4a61f4dc Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-23pmalloc: don't iterate if there is no enough free spaceDamjan Marion1-0/+3
Change-Id: I975d46a82e9f884a9cd0ac2bd5f57181695f4124 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-11-28cmake: display warning and continue if dpdk not presentDamjan Marion1-4/+4
Change-Id: I5cb2619444507a159c42ac8401800e90b6541a20 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-11-27pmalloc: correct format_pmalloc_map u32 index overrun bugKingwel Xie1-4/+3
Change-Id: I95ba4eab6e2154ef33a479450b997c8317db3a92 Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2018-11-15VPP-1474: fix 2x coverity warningsDave Barach1-1/+1
Change-Id: I441beaf3d7f57886580d7cce35ef592aa0fcca5f Signed-off-by: Dave Barach <dave@barachs.net>
2018-11-10pmalloc: u32 pp->index leads to va address overrunKingwel Xie1-1/+2
when pagesize is 1G, this pm->base + (pp->index << pm->def_log2_page_sz) would very soon overrun if creating multiple mempools add a (uword) to it Change-Id: If769b99d344cc3f547418a242a7497d044071615 Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2018-11-08physmem: Add physmem map supportMohsin Kazmi1-0/+21
This patch adds support for mapping the virtual address to physical address and size of memory allocated. Change-Id: I7659a1881308e89b215c486fecd7c973076d0773 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-11-07pmalloc: fix shared mappingsDamjan Marion1-2/+4
Change-Id: I6782544d5ee0a66b1a027874b23574416093ca92 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-28physmem: coverity issuesDamjan Marion1-3/+4
Change-Id: I34cc55d8292a69fb451ed0031484994f51d3537a Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-25pmalloc: don't lock 4K pages if we don't have access to pagemapDamjan Marion1-6/+26
Without pagemap access only way to do DMA to physmem is by using IOMMU. In such case VFIO will take care for preventing paging of such memory so we don't need to lock here. Change-Id: Ica9c20659fba3ea3c96202eb5f7d29c43b313fa9 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-25pmalloc: support for 4K pagesDamjan Marion1-56/+180
Change-Id: Iecceffe06a92660976ebb58cd3cbec4be8931db0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-24vppinfra: autodetect default hugepage sizeDamjan Marion1-16/+2
Change-Id: I5ff713ad0b254c74c5622e3b9425cca365b5ee97 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-23physmem coverity issuesDamjan Marion1-2/+3
Change-Id: Ie9ff9b751190632dfc4576e5cbb1987a4142af5e Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-23Numa-aware, growable physical memory allocator (pmalloc)Damjan Marion1-0/+562
Change-Id: Ic4c46bc733afae8bf0d8146623ed15633928de30 Signed-off-by: Damjan Marion <damarion@cisco.com>