aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
AgeCommit message (Collapse)AuthorFilesLines
2021-10-07vppinfra: asan: improve overflow semanticBenoît Ganne2-33/+43
Type: improvement Change-Id: Ia63899b82e34f179f9efa921e4630b598f2a86cb Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-06vlib: doc nitfixesNathan Skrzypczak1-1/+1
Type: improvement Change-Id: I9e761f908d9d2becbc61eb0515dc6b7c1e1e036f Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-10-05build: don't hardcode triplet, allow specifying custom lib dirDamjan Marion1-1/+1
Type: fix Change-Id: I33f364fda88914f88f9b976cb83e6d3ff466f0bb Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
2021-10-04vppinfra: fix potential memory access error in _pool_init_fixedJieqiang Wang1-1/+1
_pool_init_fixed uses mmap to initialize a fixed-size and preallocated pool, whose size is the sum of vector_size and free_index_size with alignment to the CLIB_CACHE_LINE_BYTES and page size. In this way vector_size equals to pool_header_t + vec_header_t + elt_size * max_elts so moving to the end of the pool space should be pool_header_t pointer + vector_size, instead of vec_header_t pointer + vector_size. Simple code to reproduce this error: u64 *pool; pool_init_fixed(pool, 2042); Improve unit test to cover this case Type: fix Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com> Reviewed-by: Lijian Zhang <lijian.zhang@arm.com> Reviewed-by: Tianyu Li <tianyu.li@arm.com> Change-Id: If088ef89b3dcb2d874ee837ae9da60983b14615c Signed-off-by: Dave Barach <dave@barachs.net>
2021-09-28api: API trace improvementsFilip Tehlar5-37/+694
Type: improvement * add support for JSON format in API trace * add ability to replay JSON API trace in both VPP and VAT2 * use CRC for backward compatibility check during JSON API replay * fix API trace CLI (and remove duplicits) * remove custom dump * remove vppapitrace.py * update docs accordingly Change-Id: I5294f68bebe6cbe738630f457f3a87720e06486b Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
2021-09-23classify: use AVX-512 to calculate hash on x86Damjan Marion2-0/+6
Type:improvement Change-Id: I9f9f16eabf64203db11cd4338948d76ca5e0ef12 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-09-22vppinfra: make default hugepage size configurableDamjan Marion2-37/+19
i.e. memory { default-hugepage-size 1G } Type: improvement Change-Id: I822afb51712ae92f4e4992b8ffa33dcb15ccaef1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-09-20vppinfra: format table improvementsNathan Skrzypczak2-10/+32
This adds a way to define default fg, bg colors and alignement for cell tables. It also allows removing the table title by not setting it. It also removes the trailing newline, for usage inside a format("%U", format_table, ...) Type: improvement Change-Id: I27d7a04c4a919b34d0170b04e24a56831f581ea1 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-17build: use GNUInstallDirs install destinationsNick Brown1-1/+1
So as to be compliant with distribution layouts, as recommend by: https://cmake.org/cmake/help/latest/command/install.html#installing-files Type: make Change-Id: Ic46ace4f26aab1aa4902cbd013c40a92c480680d Signed-off-by: Nick Brown <nickbroon@gmail.com>
2021-09-17vppinfra: move format_table from perfmonNathan Skrzypczak3-0/+374
This code seems really usefull for reuse in other plugins, for pretty table formatting Type: feature Change-Id: Ib5784a0dfc81b7d5a5d1f5ccdd02072e460a50fb Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-08-27vppinfra: add compress functions for u64, u16 and u8Mohsin Kazmi3-4/+352
Type: improvement Change-Id: I2640148b8959f9a8303520ba2815fe02f1e47928 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-08-20vppinfra: fix clib_random_buffer_get_data cachingBenoît Ganne1-2/+2
When using cached bytes: - do not overflow - do not return the same bytes twice Type: fix Change-Id: I2a87b47a79300e56a2201b8fc3cb6cb15b592e28 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-08-10vppinfra: Fix bihash del warningNathan Skrzypczak2-0/+7
Type: fix When freeing an uninstantiated bihash created with dont_add_to_all_bihash_list = 1 we get a warning. This removes the warning & the search for the bihash on cleanup. Change-Id: Iac50ce7e30b97925768f7ad3cb1d30af14686e21 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-08-04vppinfra: fix the array mask functionMohsin Kazmi2-2/+20
Type: fix Fixes: 0ec7dad7a00852663eb88554561347987f87bb53 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I7fab80b3c7e86ac712a34c24ea3e526b0b5bb7ad
2021-07-27vppinfra: introduce CLIB_CACHE_PREFETCH_BYTESDamjan Marion1-31/+29
Type: improvement Change-Id: Ic07010f11ef303f5213a33b0faf24aaedb62f110 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-07-27vppinfra: fix sock init netnsNathan Skrzypczak1-1/+5
Type: fix Change-Id: I0ce8183ded601bdab031c9689ca361414fed165f Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-07-22vppinfra: add abstract socket & netns fnsNathan Skrzypczak5-3/+140
* Add clib_socket_init support for abstract sockets if name starts with an '@' * Add clib_socket_init_netns to open socket in netns * Add clib_netns_open Type: feature Change-Id: I89637ad657c702ec38ddecb5c03a1673d0dfb104 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-07-16vppinfra: remove pool_foreach_old, pool_foreach_index_old, ↵Damjan Marion2-28/+0
clib_bitmap_foreach_old Type: refactor Change-Id: Ifacdd001bdeb5d609d495406f53546090b86476d Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-07-16vppinfra: add array mask funcMohsin Kazmi3-0/+185
Type: feature Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I6869221917f30f7e59709e20571b4615bc68dc8c
2021-07-15vppinfra: fix the vector funcs test for march variantsMohsin Kazmi1-1/+12
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I4208c2622817eb51a4b192cf420f9f1b5f193eef
2021-07-15misc: replace CLIB_PREFETCH with clib_prefetch_{load,store}Damjan Marion1-16/+19
Type: refactor Change-Id: Id10cbf52e8f2dd809080a228d8fa282308be84ac Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-07-14vppinfra: remove old and unused vector macros and inlinesDamjan Marion3-257/+0
Type: refactor Change-Id: Ic504bcfca6e7fbd85e858c3bc7a4f5e72d931789 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-07-13vppinfra: fix saturate add/sub NEON wrappersLijian.Zhang1-40/+60
Fix the saturate add/sub wrappers in vector_neon.h by using the correct intrinsics. Type: fix Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com> Reviewed-by: Tianyu Li <Tianyu.Li@arm.com> Change-Id: I38a85633948472d4bdb1c199a806633d3070013f
2021-07-13vppinfra: put each vector function into own fileDamjan Marion7-79/+90
Type: refactor Change-Id: I2dd9a18497992ac7e2686c14f5d17eccccda0cda Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-07-13vppinfra: fix SIGSEGV in clib_mem_vm_unmapchenqijun1-4/+6
while one mprotect PROT_NONE on hdr->next or hdr->prev, the other one with the PROT_NONE is unmap at the same time, cause SIGSEGV. Type: fix Signed-off-by: arikachen <eaglesora@gmail.com> Change-Id: I21c0497da140c9654b566e47f767a90346715ed8
2021-06-21vppinfra: asan: fix overflow supportBenoît Ganne3-14/+89
In some part of VPP we are accessing memory past what was allocated for efficiency when we know it is safe to do so. We need to tell ASan about it so it does not complain. The initial attempt was too simple and could not manage cases where the poisoned memory was scattered. This new attempt is more robust as we save and restore the full shadow state. Note it will still not work properly if we poison/unpoison memory while in an overflow context, but this should not be a big issue as overflow should only be temporary. Type: fix Change-Id: I636f44eb59aa8455a4d13929a3791b56619af7b4 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-06-08vppinfra: pool_free_elts() now supports fixed-size poolsDave Barach1-29/+36
Test added to the unittest plugin / test_vlib.py Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I73445e57918347c102ff6f5e8c9ddb9bd96f1407
2021-05-26vppinfra: explicit blocking mode for sock connectsFlorin Coras2-2/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3a33230de13fef613dc9523cf24a9968d200c2e5
2021-05-26api: socket client connect set to blockingFlorin Coras1-0/+8
Binary api client must otherwise check the returned error and if it was EAGAIN/EINPROGRESS poll for connect completion. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I89845b1a59b9fa2ab0968029435ceb203bfa8f6c
2021-05-19vppinfra: add more llist macrosFlorin Coras1-0/+38
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ife79871c6530d2cd485928fee465baf2c8957e11
2021-05-13tests: move test source to vpp/testDave Wallace2-114/+0
- Generate copyright year and version instead of using hard-coded data Type: refactor Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: I6058f5025323b3aa483f5df4a2c4371e27b5914e
2021-05-11vppinfra: Add missing %oNathan Skrzypczak1-0/+4
This is used in vppinfra/socket.c:495 Type: feature Change-Id: I89b409ae7abb01723108ae3e6c55bb1675db50ee Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-05-07vppinfra: add universal array mask_compare and compress funcsDamjan Marion8-17/+467
Type: improvement Change-Id: I6d812339f626ea630ad9354632d2f9506122d379 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-05-06vppinfra: fix testsDamjan Marion17-87/+78
Type: fix Change-Id: If59a66aae658dd35dbcb4987ab00c306b3c6e2e2 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-05-06stats: memory heap countersOle Troan1-7/+10
- Add counters for the main-heap - Add additional counters per heap: STAT_MEM_TOTAL STAT_MEM_USED, STAT_MEM_FREE, STAT_MEM_USED_MMAP, STAT_MEM_TOTAL_ALLOC, STAT_MEM_FREE_CHUNKS, STAT_MEM_RELEASABLE, The per-heap counters are organised as a two dimensional vector. total, used and free are directly available via symlinks. vpp_get_stats ls "^/mem/" /mem/stat segment /mem/stat segment/total /mem/stat segment/used /mem/stat segment/free /mem/main heap /mem/main heap/total /mem/main heap/used /mem/main heap/free vpp_get_stats dump "^/mem/main\ heap$" [0 @ 0]: 1073741776 packets /mem/main heap [1 @ 0]: 91586688 packets /mem/main heap [2 @ 0]: 982155088 packets /mem/main heap [3 @ 0]: 0 packets /mem/main heap [4 @ 0]: 1073741776 packets /mem/main heap [5 @ 0]: 433 packets /mem/main heap [6 @ 0]: 981708688 packets /mem/main heap Type: feature Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I36725dde3b4b3befd27a8b4d3ba931f2d3b627cc
2021-05-05vppinfra: enfoce function pointer cast in CLIB_MARCH_FN_POINTERDamjan Marion1-2/+2
Type: improvement Change-Id: I6ba9f9467a3990f1436a60b1dbc6cb795fd18ba9 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-05-05vppinfra: fix x86 packs / packus wrappersDamjan Marion4-94/+52
They both take signed value as input. Type: fix Change-Id: If3d8ec4e0b1c02d7d65262bdd9db49ff7fbfef39 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-30misc: experimental configure scriptDamjan Marion1-2/+2
Type: make Change-Id: Iaeb9d22eec9a7a763b63899814a44e78c8050f1f Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-30build: switch release build to -O3Damjan Marion1-18/+11
Type: make Change-Id: Ia39c2f847e7b4907fdd3fcac75897b8b4c545a65 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-28vppinfra: AArch64 NEON implementation of clib_compare_u16_x64()Damjan Marion1-1/+20
Type: improvement Change-Id: I1382813211ea20c6204d7a3b6e6d470aa51aed69 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-28vppinfra: don't fail if config.h is missing, fallback to defaults insteadDamjan Marion2-0/+7
Type: improvement Change-Id: Idc82d40a16cbc8a401a8fb359bc63083f47361b9 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-27misc: fix dead storesDamjan Marion1-4/+1
Type: fix Change-Id: I08969e1c4a78f8ac92ec066a3b67e64dc931bc16 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-27vlib: improve enqueue_to_next buffer indices extractionDamjan Marion6-330/+72
Type: improvement Change-Id: Ib7b2fa7d821f6d2708f6dc378a0f36f68c843f57 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-27vppinfra: silence coverity warnings related to clib_memcpy_u32()Damjan Marion1-0/+10
Type: fix Change-Id: I17e7b3fca390c0b0150c4606f7c93771ee9bdbdc Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-27vppinfra: Fix a bug related to path_searchRyo Nishikawa1-1/+1
Type: fix Signed-off-by: Ryo Nishikawa <nishikawa0320@gmail.com> Change-Id: Iabf7e088245395ea3fff62a22266a31de3fc305e
2021-04-27perfmon: top down level 1 supportmdr781-0/+1
Adding perfmon node TMAM support on ICX. Type: improvement Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I48a9a9ff6a72efc28eaf0cb11ef39fb62cebb126
2021-04-26vppinfra: clib_memcpy_u32() utilizing SIMD mask loads/storesDamjan Marion3-0/+158
Type: improvement Change-Id: I55c4688bd1feffae139ce12a66d15885373e5cd7 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-25vppinfra: add COMPILE_TIME_CONST() macroDamjan Marion2-1/+2
Type: improvement Change-Id: I10d7489f57bc60eb92049962b4e6ea84974f17b8 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-25vppinfra: AVX512 mask load/stores and compress storeDamjan Marion3-37/+55
Type: improvement Change-Id: Id6be598aade072653e408cca465e62931d060233 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-25vppinfra: add clear_lowest_set_bit() function, use BMI2 if availableDamjan Marion1-0/+10
Type: improvement Change-Id: I973cacd0cade0ca98e6261c1fb026a5eb38b44d3 Signed-off-by: Damjan Marion <damarion@cisco.com>