summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/clib.h
AgeCommit message (Collapse)AuthorFilesLines
2023-02-06vppinfra: refactor clib_socket_init, add linux netns supportDamjan Marion1-0/+6
Type: improvement Change-Id: Ida2d044bccf0bc8914b4fe7d383f827400fa6a52 Signed-off-by: Damjan Marion <dmarion@me.com>
2022-04-08vppinfra: introduce clib_perfmomDamjan Marion1-0/+3
Type: improvement Change-Id: I85a90774eb313020435c9bc2297c1bdf23d52efc Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-05vppinfra: refactor address sanitizerDamjan Marion1-0/+15
Type: refactor Change-Id: I5ca142ec1557d5b5c3806b43553ad9d3b5ea1112 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-31vppinfra: vectors with non-default heapDamjan Marion1-0/+1
Type: improvement Change-Id: Ic675ad4edbf27b7230fc2a77f00c90c46d6350c3 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-09vat: fix vat_suspend crashDamjan Marion1-0/+6
Deadly combination is clib_{set,long}jmp + lazy linking + tail call compiler optimization. On the first call to clib_setjmp, dynamic linker executes loader code which then calls clib_setjmp, so stored stack position contains dynamic loader data. Tail call optimization simply jumps back to the calling code when clib_longjump is called and that results in wrong return address used from the stack. Change-Id: Ia7d8dbd5b2c425cdd0449374aa07ab6b684a330e Type: fix Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-16vppinfra: bitops cleanupDamjan Marion1-70/+1
Type: refactor Change-Id: I7fa113e924640f9d798c1eb6ae64b9c0a9e2104c Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-12-16vppinfra: clang doesn't know about attribute nocloneDamjan Marion1-0/+4
Type: fix Fixes: 88019c40 Change-Id: I219597c95883f49b6ff51e65e6c6c80e3c1518b7 Signed-off-by: Damjan Marion <dmarion@me.com>
2021-12-15vppinfra: toeplitz hash four in parallelDamjan Marion1-0/+1
Type: improvement Change-Id: Icb3f39f42d01c51d7b03543cb7d6b5dabad11866 Signed-off-by: Damjan Marion <dmarion@me.com>
2021-11-02vppinfra: add CLIB_ASSUME() macroDamjan Marion1-0/+7
This macro privides a way to tell compiler that it is safe to assume that specified expression is true so it can optimize code accordingly. i.e. CLIB_ASSUME (n < 3); while (n) { /* ... */ } Will tell compiler that n is never going to be >= 3 so instead of creating loop it will just unroll loop 2 times. Type: improvement Change-Id: I718a9b95ff7980d7ac68eb9a88357a4ab6eee74a Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-10-27vppinfra: use bzhi in pow2_mask when availableDamjan Marion1-0/+3
Saves one clock.... Type: improvement Change-Id: I43da40fb4887b77ac851f759c50a7ca2814f8f40 Signed-off-by: Damjan Marion <damarion@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-04-28vppinfra: don't fail if config.h is missing, fallback to defaults insteadDamjan Marion1-0/+3
Type: improvement Change-Id: Idc82d40a16cbc8a401a8fb359bc63083f47361b9 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-27vlib: improve enqueue_to_next buffer indices extractionDamjan Marion1-0/+1
Type: improvement Change-Id: Ib7b2fa7d821f6d2708f6dc378a0f36f68c843f57 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-25vppinfra: add COMPILE_TIME_CONST() macroDamjan Marion1-0/+1
Type: improvement Change-Id: I10d7489f57bc60eb92049962b4e6ea84974f17b8 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>
2020-12-01session: allow small pacer burstsFlorin Coras1-0/+8
Instead of enforcing a "strict" release of data, which relies on frequent rescheduling of sessions, allow some pacer coalescing, i.e., short bursts, that can minimize load on scheduler/session layer and potentially leverage tso. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I67e38e5b8dc335bd214113b70c68c27ae92bd6da
2020-10-17vppinfra: explicitly export symbolsDamjan Marion1-0/+1
Type: improvement Change-Id: I57a9f85f7df1fc48656b72592349f4c544302f77 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-07-16vppinfra: enable STATIC_ASSERT with clangBenoît Ganne1-2/+3
For some reason clang does not support &((struct foo*)0)->field in static assertion contrary to gcc. Use offsetof() macro implementation provided by both compilers instead. Type: fix Change-Id: I3311cdd29c5861e45dc0ef92f2bbd66242ca73b8 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-06-30tcp: avoid rcv wnd more than RX fifo can enqueueRyujiro Shibuya1-0/+6
Type: fix Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie358b731f8ecb1fcaebd6e79f5ce5c10802c2814
2020-05-21vlib: enforce buffer alloc return value checkDamjan Marion1-0/+1
Type: improvement Change-Id: I33cd702f9c4d995520509fdb16e3b8f8fd50e535 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-07rdma: fix alignment issueDamjan Marion1-0/+3
Type: fix Change-Id: I0ff7a6f3354066c2252c1ebd0d43ac59db278bf0 Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
2020-04-23vppinfra: more bihash optimizatonsDamjan Marion1-0/+13
* Avoid doing expensive bit extraction for most likely case where bucket .log2_page_size == 0 and .linear_search == 0, saves 3-5 cycles for lookup, data_prefetch and add operation * use bextr instruction when available (x86 BMI instruction set) Type: improvement Change-Id: I163df36a29287482c5f133be8b21d62a2f7440de Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-03-16rdma: introduce direct verb for Cx4/5 txBenoît Ganne1-0/+8
Direct Verb allows for direct access to NIC HW rx/tx rings. This patch introduce TX direct verb support for Mellanox ConnectX-4/5 adapters. 'dv' mode must be explicitely selected at interface creation to benefit from this. Type: feature Change-Id: If830ba9f33db73299acdbddc68b5c09eaf6add98 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-01-02Fixes for buliding for 32bit targets:David Johnson1-0/+3
* u32/u64/uword mismatches * pointer-to-int fixes * printf formatting issues * issues with incorrect "ULL" and related suffixes * structure alignment and padding issues Change-Id: I70b989007758755fe8211c074f651150680f60b4 Signed-off-by: David Johnson <davijoh3@cisco.com>
2018-10-19vppinfra: add atomic macros for __sync builtinsSirshak Das1-0/+1
This is first part of addition of atomic macros with only macros for __sync builtins. - Based on earlier patch by Damjan (https://gerrit.fd.io/r/#/c/10729/) Additionally - clib_atomic_release macro added and used in the absence of any memory barrier. - clib_atomic_bool_cmp_and_swap added Change-Id: Ie4e48c1e184a652018d1d0d87c4be80ddd180a3b Original-patch-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Sirshak Das <sirshak.das@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com> Reviewed-by: Steve Capper <steve.capper@arm.com>
2018-08-01Store USE_DLMALLOC in vppinfra/config.hDamjan Marion1-0/+2
Change-Id: Ib596e7f525b83dc7e830bcf6a126cd210216ce86 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-10vppinfra: use count_trailing_zeros in sparse_vec_indexDamjan Marion1-57/+6
It is much cheaper to use ctzll than to do shift,subtract and mask in likely case when we are looking for 1st set bit in the uword. Change-Id: I31954081571978878c7098bafad0c85a91755fa2 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-11-18Call a plugin init function by nameDave Barach1-0/+3
Use this macro to arrange init function ordering between friend plugins. Fails in the usual manner if the plugin doesn't exist, or if the init function symbol is AWOL. clib_error_t * thisplug_init (vlib_main_t *vm) { clib_error_t *error = 0; if ((error = vlib_plugin_init_function ("otherplug.so", otherplug_init))) return error; <etc> return error; } VLIB_INIT_FUNCTION(thisplug_init); Change-Id: Ideecaf46bc0b1546e85096e54be8ddef87946565 Signed-off-by: Dave Barach <dave@barachs.net>
2017-11-13dpdk: introduce AVX512 variants of node functionsDamjan Marion1-0/+5
Change-Id: If581feca0d51d0420c971801aecdf9250c671b36 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-03-22Add memif - packet memory interface for intra-host communicationDamjan Marion1-0/+6
Change-Id: I94c06b07a39f07ceba87bf3e7fcfc70e43231e8a Signed-off-by: Damjan Marion <damarion@cisco.com> Co-Authored-By: Milan Lenco <Milan.Lenco@pantheon.tech>
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+359
Change-Id: I7b51f88292e057c6443b12224486f2d0c9f8ae23 Signed-off-by: Damjan Marion <damarion@cisco.com>