aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
AgeCommit message (Collapse)AuthorFilesLines
2024-05-14vppinfra: Add platform cpu and domain get for FreeBSDTom Jones1-1/+71
Type: improvement Change-Id: I5253f2b1b51493f2d4d0f451ad4c2208fd8f6bf2 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-05-14vppinfra: fix mhash oob after unset and add testsVladislav Grishenko5-7/+455
Fix out of buffer access after mhash_unset Add format mhash pair functions Add related mhash tests, similar to hash ones Type: fix Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Change-Id: Idbefd7d32c4cd16b55d84ad4006c38251b4e2c33
2024-05-07api: upgrade cjson and fix reallocOle Troan2-88/+120
Upgrade cJSON library to patchlevel 17. Replace internal realloc added earlier 36217e3ca. Type: fix Fixes: 36217e3ca Change-Id: I7d8a80dc4241e9f952895d24adca8fa2d873e746 Signed-off-by: Ole Troan <otroan@employees.org>
2024-05-06vlib: revert automatic core pinning changesHadi Rayan Al-Sandid2-34/+0
This reverts commit 71c32a898941e32b5d4f865b50fbe775560c582d. Type: fix Reason for revert: vnet pinning is not considered in this patch. This causes keywords 'workers' and 'skip-cores' to be broken, as well as keyword 'main-core auto' introduced in this patch. If this patch is ever reconsidered, it must account for vnet pinning fix in commit https://gerrit.fd.io/r/c/vpp/+/40711. Change-Id: I1f3154a6c7e830b100f824375aa00e95b192f7f3 Signed-off-by: hsandid <halsandi@cisco.com>
2024-05-06vppinfra: Include param.h on FreeBSDTom Jones1-1/+2
Type: improvement Change-Id: I5fa90dd26d6cac2cefee009c97dd5ff8dac3ee1e Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24vppinfra: Link against lib execinfo on FreeBSDTom Jones1-1/+6
Type: improvement Change-Id: Ie3d6cba886e0779949e8d574f82cff62abc7ebed Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24vppinfra: 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-04-24vppinfra: Add method for getting current executable nameTom Jones2-0/+28
Add a unix method for getting the current executable name. This is implemented to match the readlink api for existing calls. Type: improvement Change-Id: Id06a55892d09d0b305a56b55a424f53ffb685a72 Signed-off-by: Tom Jones <thj@freebsd.org> Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-09vppinfra: add support for precomputed SHA2 HMAC key and chained buffersDamjan Marion1-209/+285
Change-Id: Ic1fa3bd164e80c2ca1146be001870da0238a5f2e Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-08vppinfra: fix mask compare and compress OOB readsDmitry Valter3-33/+297
Use mask_load_zero to avoid out-of-buffer reads in vectorized function versions. Type: fix Signed-off-by: Dmitry Valter <d-valter@yandex-team.com> Change-Id: I12bcb817ccf2db210c1c99fdfa444dc3f540035b
2024-04-05api: fix [un]formatting in vpp/api/types.cKlement Sekera2-0/+31
vl_api_prefix_t.len is 1 byte only, but unformat %d writes 4 bytes add helper functions unformat_u(8|16) which don't write more than appropriate amount of bytes fix other similar errors in vpp/api/types.c Type: fix Change-Id: I74a61a377147c373f8c25ed083052b2287763c39 Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2024-04-02vppinfra: fix array_mask_u32 underrunDmitry Valter1-0/+1
Properly handle small buffers in the AVX256 version of array_mask_u32. Type: fix Signed-off-by: Dmitry Valter <d-valter@yandex-team.com> Fixes: f62ed3f9c1ec3e8db36f63d6a54f46b7bea43723 Change-Id: Idf1cb43ccf37bd7c439d11e4f68fe30064c6d09a
2024-03-29vlib: improve automatic core pinninghsandid2-0/+34
Type: feature Auto core pinning now fetches vpp cpu affinity list using pthread api. This enables us to do core-pinning in environments where the host cpu list does not necessarily align with cpus available to vpp Change-Id: Ife8c2a2351c08c5c6c4fdf7c729eeff2697bc39a Signed-off-by: hsandid <halsandi@cisco.com>
2024-03-20vppinfra: Define EBADFD on FreeBSDTom Jones1-0/+4
Type: improvement Change-Id: I303a8a7333d44f6eab902d4d61023cfa96760dd2 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-18vppinfra: os agnostic api for getting CPU informationDamjan Marion6-7/+69
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 Marion20-110/+0
Type: refactor Change-Id: I5235bf3e9aff58af6ba2c14e8c6529c4fc9ec86c Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-04vppinfra: SHA2-256 ARM ISA supportDamjan Marion1-55/+104
Change-Id: I0fcda3e7afaab037bd12d0079d6639c6cbe8647e Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-04vppinfra: add os_get_online_cpu_core() and os_get_online_cpu_node()Damjan Marion2-0/+30
Type: improvement Change-Id: I6f99f09c7724ce656a4f41a1d5f9c88d74c00faf Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-02-19vppinfra: Stub out get_current_cpu and get_current_numa on FreeBSDTom Jones1-0/+8
FreeBSD has its own set of syscalls for getting current CPU and NUMA domain information. Stub out these calls and return CPU 0 and NUMA domain 0 as placeholders until we bring in FreeBSD specific calls. Type: improvement Change-Id: Id61df0273b0bcc6acf4844ee626e4f246f9f217b Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18vppinfra: Place hugepage MMAP call behind linux specific ifdefTom Jones1-0/+6
Type: improvement Change-Id: I3a48ec4fd4a4063b6e3792b87def7bb796fc947c Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18vppinfra: Provide FreeBSD implementation of clib_mem functionsTom Jones2-0/+476
Working from the implementation in linux/mem.c add FreeBSD specific functionality. This duplicates parts of the Linux implementation and a depuplication job could be run in the future. Stub out some parts of the API for now, they are either use unavailable features on FreeBSD or require further implementation than this initial implementation. Type: improvement Change-Id: I1e443e32304d19776a9a4d5e34adfa16ec919427 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13vppinfra: Put clib_perf* behind Linux checks and provide stubs for FreeBSDTom Jones2-0/+38
As a placeholder stub out clib_perf functions on FreeBSD, the interface for performance counters on FreeBSD is different and will require its own implementation. Type: improvement Change-Id: I61511ebe5ee1fd6fe93d3179c7843c811f47a846 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13vppinfra: Add netlink header on FreeBSDTom Jones1-1/+3
FreeBSD has support netlink since 13.2, but keeps its header in a slightly different place. Correctly include netlink/netlink.h for FreeBSD. Type: improvement Change-Id: Iec78ca72db74ea7f9c874e7039c7d17b6321f9dc Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13vppinfra: Protect Linux specific features behind CLIB_LINUXTom Jones1-2/+4
Place Linux specific features behind CLIB_LINUX. The previous #ifdef calls would still pass even if CLIB_LINUX is set to 0 in clib.h, instead use #if. Type: improvement Change-Id: Ibe4424eee4bc0065f54764b017b9a56a3e854380 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13vppinfra: Make program counter printing more portableTom Jones1-0/+8
Finding the program counter in the ucontext struct is platform and architecture specific, place the Linux checks inside an #ifdef and add a look up for the FreeBSD amd64 specific naming. Type: improvement Change-Id: I42fcef5f20227c23d84acee336e37c4870146bb4 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13vppinfra: Add a stubbed out test_perf function for FreeBSDTom Jones1-0/+6
Type: improvement Change-Id: If136e0854dbaecfa62fc009ca2b0b94e8d9a56f2 Signed-off-by: Tom Jones <thj@freebsd.org>
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>
2024-02-13vppinfra: Don't build perfmon on FreeBSDTom Jones1-3/+4
FreeBSD has platform specific APIs for interfacing with performance counters. Until we bring in FreeBSD support, don't build perfmon on platforms which aren't linux. Type: improvement Change-Id: Iabc418922c0d2e851c6098508761135f53433ae8 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13vppinfra: Place SIGPWR behind a linux defineTom Jones1-0/+2
The SIGPWR signal is specific to Linux, place it behind a Linux flag to help the build on FreeBSD. Type: improvement Change-Id: Ie36c2ceb201afff98e92bbe64595c3953b11c457 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-01-23vppinfra: fix clib_array_mask_u32 OOB readsDmitry Valter2-7/+28
Handle non-even n_elts for the larger array instead of reading past the source buffer. Type: fix Fixes: f62ed3f9c1ec3e8db36f63d6a54f46b7bea43723 Signed-off-by: Dmitry Valter <d-valter@yandex-team.com> Change-Id: Ic1708a3f33fe71ca752345b5c77b6ae7a2d42bcd
2024-01-19vppinfra: fix test_bihashDmitry Valter1-2/+2
Correctly wrap data indices in test_bihash. Type: fix Signed-off-by: Dmitry Valter <d-valter@yandex-team.com> Change-Id: I740fa1cf9f8c382c12f01f607095c5995be6845f
2024-01-19vppinfra: fix bracket balanceGeorgy Borodin1-1/+2
fix bracket balance in pool_put_will_expand Type: fix Fixes: 66d4cb5a217d556aa7bd2471f02a39badb6d5cd2 Change-Id: I921366c0898cca39cc728b7c7ef4c4c725c6b87d Signed-off-by: Georgy Borodin <bor1-go@yandex-team.ru>
2024-01-19vppinfra: fix vec_prepend use-after-freeDmitry Valter1-7/+9
Don't access free'd memory in vec_prepend. Don't allow prepend when v1 == v2 as it also causes a use-after-free. Found via ASAN. Type: fix Signed-off-by: Dmitry Valter <d-valter@yandex-team.com> Change-Id: I21f8422c007d07d40d237e873b84c042be1fe8e8
2024-01-17vppinfra: change fchmod to umask for unix socketGeorgy Borodin1-14/+17
Setting g+w permission for unix sockets didn't work. There were two problems: 1. new flag local_only wasn't set for all AF_UNIX sockets; 2. fchmod is not a good choice for sockets. fchmod was replaced with couple of umasks, and local_only with socket type check. Type: fix Fixes: 085757bb4930511928daa97f972cdca021e7a813 Change-Id: I8dc0fceb110a36bfa234f552bbdf182e09e55e27 Signed-off-by: Georgy Borodin <bor1-go@yandex-team.ru>
2024-01-16vppinfra: fix memcpy test buffer sizeDmitry Valter1-1/+1
Fix dst buffer size in memcpy_x86_64 test. Type: fix Signed-off-by: Dmitry Valter <d-valter@yandex-team.com> Change-Id: I2b4502a62d9346d729b83522f4ea01c98a5b961c
2024-01-16vppinfra: enable AES tests on ARMDamjan Marion4-10/+3
Type: improvement Change-Id: I30f3b2924ab219a8bace87f358b1b823e8bc83bb Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-01-12vppinfra: native AES-CTR implementationDamjan Marion6-193/+868
Type: feature Change-Id: I7ef3277edaeb266fbd3c8c9355d4443002ed2311 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-12-11vppinfra : fix alignment issuehsandid1-1/+1
Type: fix Modified alignment cast causing crash issues Change-Id: Iae3bb767ef2ba81466bf1567264a4c76ae45bb92 Signed-off-by: hsandid <halsandi@cisco.com>
2023-11-14vppinfra: respect indent in format_tableDamjan Marion1-2/+3
Change-Id: Ib7e5cb5adfe81e5cc6243125d91f5179608a7733 Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-14vppinfra: add unformat_{single,double}_quoted_string functionDamjan Marion2-0/+44
Change-Id: I8ee90be1b772074c1130b98c71b3be48c973b2e2 Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-13ena: Amazon Elastic Network Adapter (ENA) native driverDamjan Marion1-1/+1
Type: feature Change-Id: Icd9de05f2cbac0e5a6dfb1f1414f21dc4b893104 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-09iavf: interrupt mode supportDamjan Marion1-0/+30
Type: improvement Change-Id: Ie5fcaa706ab0995e0021cf1ee74b95c5a3b30283 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-06vppinfra: fix ASAN issue in vec_foreach_pointer and pool_foreach_pointerDamjan Marion2-5/+6
Change-Id: If9381ae7283488b352a3c22f85732cd56ac6bfd9 Type: fix Fixes: 9937359, 91ff0e9 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-03vppinfra: refactor interrupt codeDamjan Marion4-138/+112
Type: improvement Change-Id: Ie6987736faf7d8a641762e276775da8ee0c03ea4 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-03dev: strip debig log function name prefix during compilationDamjan Marion1-0/+7
Type: improvement Change-Id: I9b9bb37a0895366b412f042b0e2da5bbdd477325 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-02iavf: new driver using new dev infraDamjan Marion1-4/+9
Type: feature Change-Id: I9ae0dbf28b4571a37c568b587b771f90c06f200d Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-02dev: new device driver infraDamjan Marion2-4/+14
Type: feature Change-Id: I20c56e0d3103624407f18365c2bc1273dea5c199 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-30ipsec: huge anti-replay window supportMaxime Peim1-1/+1
Type: improvement Since RFC4303 does not specify the anti-replay window size, VPP should support multiple window size. It is done through a clib_bitmap. Signed-off-by: Maxime Peim <mpeim@cisco.com> Change-Id: I3dfe30efd20018e345418bef298ec7cec19b1cfc
2023-10-09vppinfra: fix coverity issue CID 323952Dave Wallace1-1/+1
Type: fix Fixes: 08600ccfa Change-Id: I53ba0d96507b55ab7cd735073d6c4cf20a3cc948 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>