summaryrefslogtreecommitdiffstats
path: root/src/vppinfra
AgeCommit message (Collapse)AuthorFilesLines
2021-01-15vlib: fix counter_will_expand predictionMiklos Tirpak1-0/+15
vlib_validate_combined_counter_will_expand() was calling _vec_resize_will_expand() with wrong arguments, which resulted in false return value. Apart from the initial call, it never indicated a vector resize. The callers relying on this function did not perform a barrier sync because of the wrong prediction even if the vector got extended by a subsequent vlib_validate_combined_counter() call. The fix introduces a new, simplified macro that is easier to call. vec_resize_will_expand() accepts the same arguments as vec_resize(). Type: fix Signed-off-by: Miklos Tirpak <miklos.tirpak@gmail.com> Change-Id: Ib2c2c8afd3e665e0e3d6ae62ff5cfa287acf670f
2020-12-23vppinfra: mem bulk testFlorin Coras1-1/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Icd44ede9604c29839af250a2be93ecf467467aa0
2020-12-23svm: remove fifo segment heapFlorin Coras1-0/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I518e096fe13847759806ff62009e73fd8f7451b7
2020-12-22vppinfra: add bulk memory allocatorDamjan Marion3-0/+249
Small fixed size object memory allocator. Type: improvement Change-Id: I727705d9d4292b6b38d41e239871103b15aa9038 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-18misc: deprecate old perfmonDamjan Marion2-47/+0
Type: refactor Change-Id: I1303219f9f2a25d821737665903b0264edd3de32 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-16vppinfra: fix vec_max_lenFlorin Coras1-1/+2
Return 0 if the supplied vector pointer is NULL. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Icb0aab70e0b7c9c1ddcf607c9dfb7e5715f177d1
2020-12-14misc: refactor clib_bitmap_foreach macroDamjan Marion3-9/+15
Type: refactor Change-Id: I077110e1a422722e20aa546a6f3224c06ab0cde5 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-14misc: move to new pool_foreach macrosDamjan Marion6-70/+70
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-14vppinfra: simpler and faster pool_foreachDamjan Marion1-15/+31
- reduces number of instructions generated 4 times compared to old code - adds pool_foreach2 which is more friendly to clang-format Type: improvement Change-Id: I51e9c7fb09655c60d883987dadf5b2666c12b3f7 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-11-25vlib: add elog events for vlib log entriesDave Barach2-6/+18
Pretty interesting to see how long plugins take to load. Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: If496eb73b2e1fd9dd714142cd5195fa7ccd93ebd
2020-11-25api: vat2 and json autogeneration for api messagesOle Troan3-0/+3395
VAT2: A completely auto-generated replacement of VAT. Reads input message in JSON from stdin and outputs received messages in JSON. A VAT2 plugin is automatically built for a .api file. There no longer a need for a separate _test.c. Example: vat2 show_version {} { "_msgname": "show_version_reply", "retval": 0, "program": "vpe", "version": "21.01-rc0~411-gf6eb348a6", "build_date": "2020-11-19T09:49:25", "build_directory": "/vpp/autogen3" } vat2 sw_interface_dump '{"sw_if_index": -1, "name_filter_valid": 0, "name_filter": ""}' [{ "_msgname": "sw_interface_details", "sw_if_index": 0, "sup_sw_if_index": 0, "l2_address": "00:00:00:00:00:00", "flags": "Invalid ENUM", "type": "IF_API_TYPE_HARDWARE", "link_duplex": "LINK_DUPLEX_API_UNKNOWN", "link_speed": 0, "link_mtu": 0, "mtu": [0, 0, 0, 0], "sub_id": 0, "sub_number_of_tags": 0, "sub_outer_vlan_id": 0, "sub_inner_vlan_id": 0, "sub_if_flags": "Invalid ENUM", "vtr_op": 0, "vtr_push_dot1q": 0, "vtr_tag1": 0, "vtr_tag2": 0, "outer_tag": 0, "b_dmac": "00:00:00:00:00:00", "b_smac": "00:00:00:00:00:00", "b_vlanid": 0, "i_sid": 0, "interface_name": "local0", "interface_dev_type": "local", "tag": "" }] This is the first phase and vat2 is not integrated in packaging yet. Type: feature Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Ib45ddeafb180ea7da8c5dc274a9274d7a4edc876 Signed-off-by: Ole Troan <ot@cisco.com>
2020-11-24buffers: add page-size configNathan Skrzypczak1-31/+18
Type: feature Add a `buffers {page-size}` parameter to specify page size for buffers. This also fixes an issue with the parsing in unformat_log2_page_size. Change-Id: I7d7b1fa0bb7febaa7509cf2c625882f07eeafaad Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-11-19svm: move chunk locks to linked listFlorin Coras1-0/+3
Type: improvement We only need to protect the linked lists. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie1542073f3993acfc66d99096b08bf9ecd10a49b
2020-11-16tests: move bihash tests to src/vppinfra/testDave Wallace1-0/+71
- Refactor make test code to be co-located with the vpp feature source code. Type: test Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: I0133a00def595fe1c08ab881633ef9f89148a286
2020-11-10vpp: use vpp heap for libcBenoît Ganne1-5/+7
This makes libc use vpp main heap instead of the default libc heap. This gives better visibility (accounting, tracing) on allocations happening in external libraries called from vpp (eg. OpenSSL). Type: feature Change-Id: I5d8a673472145a4e090bedb443b8c58a967d1cca Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-11-05vppinfra: mspace_get_aligned should respect MALLOC_ALIGNMENTDamjan Marion1-22/+1
While underlying mspace_malloc() respects MALLOC_ALIGNMENT (16) mspace_get_aligned moves start of data for 4 bytes making final result not aligned to MALLOC_ALIGNED. Type: fix Change-Id: Ib1584f315e3658b3b748ebf4886fb7389ce640fe Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-11-05build: link time optimization for release buildsDamjan Marion1-0/+1
Type: improvement Change-Id: I0e24f1d2ad5c7a11a8bd40125428f86aca867bec Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-26vppinfra: clib_mem_vm_{un}map thread safeDamjan Marion2-0/+25
Type: improvement Change-Id: I1ab1b100000b4d7212c58e10312e16e7527bd333 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-23vppinfra: add bihash_8/24_16 to headers listjiangxiaoming1-0/+2
Type: improvement Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com> Change-Id: Ic67977995dbcba97240009373a4b9e9b57c63706
2020-10-22vppinfra: missing __clib_export va_unformatJuraj Linkeš1-1/+1
Fix an issue observed on aarch64 systems when running with dpdk plugin: dpdk_plugin.so: undefined symbol: va_unformat Type: fix Fixes: dae1c7ed38e9f7a86e66f3674de62778cc981331 Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech> Change-Id: I22b7ee842dc606f96effdeb7aa4e161496986aed
2020-10-21vppinfra: missing __clib_exportNathan Skrzypczak1-1/+1
Type: fix Change-Id: I2dbd435d04a09f632286e5d669edc5fafd384f94 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-10-21vlib: print logs to stderr if interactive or nosyslog setDamjan Marion1-1/+3
If VPP is started in interactive mode, instead of sending logs to syslog server we print them directly to stderr. Output is colorized, but that can be turned off with unix { nocolor } Type: improvement Change-Id: I9a0f0803e4cba2849a6efa0b6a86b9614ed33ced Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-21ipsec: Add to the SA info directly in the bihashNeale Ranns2-0/+211
Type: improvement this save the cache miss on the protect structure. Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I867d5e49df5edfd6b368f17a34747f32840080e4
2020-10-21vppinfra: fix ASAN annotationBenoît Ganne1-0/+1
Type: fix Change-Id: I90b537eba7f56dbb1928f0ab5f157218affb43f5 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-10-20vppinfra: export elog_read_file_not_inline()Dave Barach1-1/+1
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ib9fb1723b55bf322c9fd9f928a3e3b4a529bca5b
2020-10-19vppinfra: minor refactor in lock.hDave Barach1-2/+4
For whatever reason, "typedef struct { ... } *foo_t" gives cgo a horrible case of indigestion. A minor refactor makes the pain go away. Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I856b2abf9b16348d2f6145178e683e722914c756
2020-10-18vppinfra: add export symbolsDave Barach2-3/+3
format_one_elog_event() vec_len_not_inline() vec_free_not_inline() Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I0432c1b41b985de380e0b73886d0b03ecc19c703
2020-10-17vppinfra: export elog_get_events()Dave Barach1-1/+1
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ifc1bcbd8b5f8597796c993a2a5caf3a6c8d2471c
2020-10-17vppinfra: explicitly export symbolsDamjan Marion40-225/+229
Type: improvement Change-Id: I57a9f85f7df1fc48656b72592349f4c544302f77 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-08vppinfra: memory leak be goneDave Barach1-1/+1
Type: fix Fixes: ab1a50cf7407e31097b550226c2b6954d6371bea / gerrit 29272 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ic8146a66b54bb9ac6223cf984d4566554b73276d
2020-10-08vppinfra: fix coverity warningsDave Barach2-5/+5
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I654747d618cc4fe99b7774827303769fe43392ed
2020-10-06vppinfra: add heap header in front of dlmalloc spaceDamjan Marion7-188/+220
This patch adds smal header in front of dlmalloc space, and it stores some additional information about the heap. Immediate benefit of this patch is that we know the underlying page size si we can display heap page statistics / real memory usage. Type: improvement Change-Id: Ibd6989cc2f2f64630ab08734c9552e15029c5f3f Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-06misc: add xxx_not_inlineDave Barach1-2/+2
vlib_main_t *vlib_get_main_not_inline(void) vlib_thread_main_t *vlib_get_thread_main_not_inline(void) elog_main_t *vlib_get_elog_main_not_inline() Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I6de306d567283ad28ef34c9be0cf27452aecbf6c
2020-10-05vppinfra: address sanitizer: do not instrument dlmalloc internalsBenoît Ganne1-0/+1
Type: fix Change-Id: I8b50777b6ce7df461e5256921591a58e52877628 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-10-02vppinfra: use clib_mem_create_heap() to create numa heap(s)Damjan Marion3-216/+0
Type: improvement Change-Id: Ie04302c576869bc7bfaa9f13ed2ea8a403a393d4 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-02vppinfra: Function to check if a bihash has been initialisedNeale Ranns2-0/+7
Type: improvement Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Ic31f7721f326ca9d78d645abcea63ce58df5bd5b
2020-10-02vppinfra: fix legacy huge pages creation for default sizeBenoît Ganne1-1/+14
Type: fix Change-Id: I941b92ebec66ccd9c9e9a12d485844313c9f117b Signed-off-by: Benoît Ganne <bganne@cisco.com> Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-10-01svm: simplify memfd client segment mappingFlorin Coras2-59/+0
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I33c6a5d1686cc32a6cde149083256d6cf0770fc5
2020-09-30vpp: update 'show bihash' commandDamjan Marion2-14/+18
Type: improvement Change-Id: I6d00ba840d2168af0658f97c45a42d39be7cbbad Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-30vppinfra: use heap to store bihash dataDamjan Marion7-25/+196
Type: improvement Change-Id: Ifb0fa114414aa2fdc244f964612ca3ac3e29b5e1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-28vppinfra: don't call dlmalloc API directly from the codeDamjan Marion6-87/+50
- it is confusing from end consumer perspective that some thing is somewhere called heap and somewhere mspace - this is base for additional work where heap pointer is not the same thing like mspace Type: improvement Change-Id: I644d5a0de17690d65d164d8cec3c5654571629ef Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-25vppinfra: dont complain about linux-vdso.so.1Dave Barach1-1/+7
It's not an elf file, yadda yadda. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ie02a058adab1068260d9baa0a19398dab8d912d1
2020-09-25vppinfra session: file platform independent private dataFlorin Coras1-1/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id43b0b6db2b42ee5801236df0bd7f7225e1e081c
2020-09-25vppinfra: add clib_mem_set_numa_affinity()Damjan Marion2-8/+60
Type: improvement Change-Id: I81a7fb71c8ce0c0d22e326a4ddd01bc1c1aea5f7 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-18virtio: fix txq lockingBenoît Ganne1-0/+17
Initialize txq lock only if some txq are shared and check if another worker is already operating on the txq before processing gro timeouts in input node. Type: fix Change-Id: I89dab6c0e6eb6a7aa621fa1548b0a2c76e6c7581 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-09-17stats: configurable page sizeDamjan Marion4-78/+140
Type: improvement Change-Id: I9973bce20a0a2a8a7e227cf96518de5b79374425 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-17vlib: show FD in 'show memory map'Damjan Marion2-0/+4
Type: improvement Change-Id: I04752c011e4ca58f56aa53f6ae27bae93a5c4590 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-17vppinfra: support main heap with different page sizesDamjan Marion6-77/+450
Type: improvement Change-Id: I381fc3dec8580208d0e24637d791af69011aa83b Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-17vppinfra: detect memory attributes on clib_mem_initDamjan Marion3-4/+82
Type: improvement Change-Id: I298aadfdf17d98dfb1ada1ec4f87e0821e6aeb7f Signed-off-by: Damjan Marion <damarion@cisco.com>