aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib
AgeCommit message (Collapse)AuthorFilesLines
2024-02-18vlib: Only init vfio on LinuxTom Jones1-0/+2
Type: improvement Change-Id: Id1c72928324b85bc67860e600722bf8baeff45b2 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-12buffers: bring back cache occupancy improvementVratko Polak1-0/+4
The improvement was removed in 40129, causing 5-40% regressions in AVF tests. There is a memory-speed trade-off, this change prefers speed over memory efficiency. Ideally, the choice should be configurable, but that is not easy to achieve, considering how early is vlib_buffer_main_init called. Type: fix Fixes: 038dad7ef29b0b724071edb5f8cc7a9845584454 Change-Id: I4746f3634abe6d233c9d092a372de05b3d1ae4b6 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2024-02-02vlib: flush rpcs on worker syncFlorin Coras1-0/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I89624254649089e497d119eb6cee2cecf3dc11f3
2024-02-02vlib api: move wrkr rpc flushing to vlibFlorin Coras3-7/+18
Move vlib worker rpc flushing to main worker from memclnt api into vlib. RPCs are no longer delivered via binary api queues Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5b8761a57d1f4a1f2220e860cfb2e6b980f46f6d
2024-01-20buffers: add compile-time option to set buffer alignmentDamjan Marion4-8/+10
Type: improvement Change-Id: I88c4c45bed0bdd8686e17e4f77a7d32a08c995aa Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-01-16vlib: remove unused codeDamjan Marion1-16/+0
Type: improvement Change-Id: I2c54cb3eb41ed35f114eca75fb6e2be3eb3f4ca1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-12-22vlib: lowercase vmbus device namesAlexander Skorichenko1-5/+5
Use lowercased hex in uuid in sysfs/vmbus names Type: fix Change-Id: Ic4b7b995441723dc1b29ff8a75346cc8ba7f85f1 Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
2023-12-22vlib: add error checks to thread pinninghsandid1-7/+14
Type: fix Added error checks around pthread_setaffinity_np calls to stop vpp launch if pinning fails. Change-Id: Iec391c485d1832b6c2ff20fbf789608f6bcf7b57 Signed-off-by: hsandid <halsandi@cisco.com>
2023-12-21buffers: add vlib_buffer_unalloc_to_pool()Damjan Marion1-0/+17
Change-Id: Icd616989a525ef0be6c73a2ad91ae4871cf3921d Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-12-14bpf_trace_filter: allow use whithout classifierMohammed Hawari1-7/+0
Change-Id: I7ac5693ca547fe7249e7b6297bade70a6052b169 Type: improvement Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2023-11-13ena: Amazon Elastic Network Adapter (ENA) native driverDamjan Marion1-0/+1
Type: feature Change-Id: Icd9de05f2cbac0e5a6dfb1f1414f21dc4b893104 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-07misc: silence -Wmaybe-uninitialized warningsJieqiang Wang1-1/+1
GCC 12 complains about such errors while the code itself looks good. Type: fix Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com> Change-Id: I021719fdbf7d9bd93a12eac76aeac8cbca13a810
2023-11-06pci: remove unnecessary ioctl() call and improve logging in vfio_set_irqsDamjan Marion3-34/+49
Type: improvement Change-Id: Ic8e2785bf375882defe5a1d299948d522cdd4895 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-06pci: fix VFIO set IRQ codeDamjan Marion1-2/+2
Type: fix Fixes: 599a16b Change-Id: I954e037ab944028798f9aa2a93f45322c8c7b4bb Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-03vppinfra: refactor interrupt codeDamjan Marion4-18/+9
Type: improvement Change-Id: Ie6987736faf7d8a641762e276775da8ee0c03ea4 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-11-02dev: new device driver infraDamjan Marion2-0/+53
Type: feature Change-Id: I20c56e0d3103624407f18365c2bc1273dea5c199 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-25buffers: buffer name is vector, not c stringDamjan Marion1-6/+7
Type: fix Fixes: 8973b07 Change-Id: Iba6e29bab35be0148b469965c3af8391b5ab9140 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-17buffers: introduce vlib_buffer_template_tDamjan Marion3-69/+81
Type: improvement Change-Id: Ie86a5edf2ada21355543e9a0382052b16ff86927 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-13vlib: properly replicate nexts when sibling node is created on runtimeDamjan Marion1-32/+33
Change-Id: I5aff21b5ca32e7eb84b11cca8387e7ac42fbbe23 Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-13vlib: allow unpriviledged vlib_pci_get_device_info()Damjan Marion2-3/+4
When running unpriviledged sysfs allows reading only first 64 bytes of PCI config space. Change-Id: I62d18328925a2e4936406c2842154b20182cacb9 Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-09buffers: buffer allocation improvementsDamjan Marion2-38/+47
- pass buffer pool name trough va - make buffers naturaly aligned - fix calculation of total number of buffers Type: improvement Change-Id: I6aebf249ebd67823b4632ac08905bfa3aa7d1ee5 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-09-13vlib: deuglify the offset finding loop in pci.cVratko Polak1-5/+2
Type: style Fixes: 054229ebbdeb3f87d96c1abf93b511c86cd6ff0f Change-Id: I7c3080db94566af249e5082d59a4e6373c616888 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-09-13pci: fix coverity issue CID-322372Dave Wallace1-1/+1
Type: fix Change-Id: Iaf16bb720d76ea3ae04afb8123b7cac15771ef2b Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-08-07vlib: support sibling node creation with vlib_register_node()Damjan Marion1-20/+54
Type: improvement Change-Id: I7e82a262692b2b6513f81889d78a43c10ca7bfb2 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-08-07vppinfra: add clib_file_get_resolved_basenameDamjan Marion3-17/+8
more generic version of clib_sysfs_link_to_name with support for format strings... Type: improvement Change-Id: I0cb263748970378c661415196eb7e08450370677 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-08-02vlib: remove dependency on libuuidDamjan Marion2-30/+55
Type: improvement Change-Id: I4e2b2e4f227dfcb3df36166db13c8aa5c0b603f5 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-07-28vlib: fix gcc build breakageDave Wallace1-1/+3
Type: fix Fixes: 00ea98ad6 Change-Id: I4ac8c9c5902299d5f283ba4912d52d9bfcedef5c Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-07-28vlib: pci cleanup and improvementsDamjan Marion4-458/+527
Change-Id: Ieafbed6f2db3dec65e4b43d84a4661f6a1bbe891 Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-07-28vlib: fix coverity issue in vlib_node_set_interrupt_pendingDamjan Marion1-2/+5
Type: fix Fixes: cc8249c Change-Id: Iebfbbd1e00782c4097cc840460b5177d18921131 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-07-26vlib: rename vnet_log_get_class_dataVratko Polak2-3/+3
It is a function in vlib, so no reason to mention vnet. Type: fix Fixes: bf179a91d8d224c64d08643a2bb52580f68ce96b Change-Id: Ic5f601d94d88b667f7ce44a017a0e1d5b4db5da1 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-07-25vlib: interrupt mode support for pre-input nodesDamjan Marion6-17/+53
Type: improvement Change-Id: Ic6e60597d2be63e3a0ae4399a81dbbd72392f30d Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-07-25classify: add bpf support to pcap classifierMaxime Peim2-2/+2
Type: feature Change-Id: I28fb38e49c89f4c4d4cc58c1a5c0aa8502678472 Signed-off-by: Maxime Peim <mpeim@cisco.com>
2023-06-30vlib: introduce trace filter functionsMohammed Hawari3-17/+179
Change-Id: I7a988fafe98599e4fcf7cdaa307a69b9d76650f0 Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: improvement
2023-06-22tests docs: fix lcov code coverage report generationDave Wallace1-11/+0
- Updated/rebased version of https://gerrit.fd.io/r/c/vpp/+/34199 Type: test Change-Id: I43913ecfd11a4578bdb10c4be76253fe38d57976 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-05-27vlib: add vlib_log_is_enabledDamjan Marion2-20/+34
Type: improvement Change-Id: I052e0d56cc6d89cd66c83a9bb81e2273d396d510 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-04-12vlib dhcp: default to logging without elogsFlorin Coras1-1/+1
Some components, like dhcp, log constantly changing strings which in turn forces elog string table to grow unbound. To avoid this, as a workaround, only turn on elog logging if requested. Actual fix that adds configuration for logging subclasses should come in a later patch. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie8b26251fb7115d866c2bd65353daa33cdab1ab6
2023-04-10vlib:process node scheduling use timing_wheel have problem.jinsh2-2/+6
The time wheel should not be started in the loop while processing expired events. can be set p->stop_timer_handle = ~0 to solve. Type: fix Signed-off-by: jinsh <jinsh11@chinatelecom.cn> Change-Id: Ie9a4293f39f981f50d280b39a5d958d319ee2300 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2023-04-06vlib: reset stop_timer_handle on expired processesMatthew Smith1-8/+23
Type: fix The main loop populates a vector of suspended process nodes to dispatch by calling TW (tw_timer_expire_timers_vec), which identifies expired timers and appends the user handle for each one to the vector. Subsequently, the vector is iterated and the process node corresponding to each handle is dispatched. The vast majority of the time, the process node will end up suspending itself again to wait for a new timer or event. Given a process node A whose timer has expired, between the point when the timer expired and the point when A is dispatched and suspends itself again, its stop_timer_handle contains a stale value. If another process node B is dispatched before A is dispatched, it may end up using the timer ID that A formerly used. If another process node C is dispatched after B and before A and calls vlib_process_signal_event() to signal A, the timer started by B can be deleted by vlib_process_signal_event_helper(). After getting the vector of process node IDs for expired timers, reset the stop_timer_handle on each of those nodes. Change-Id: I266da438e76e1fc356016da0b9b4941efac1c28a Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2023-04-06vppinfra: refactor uword bitmapsDamjan Marion1-24/+22
Type: improvement Change-Id: I4f05a0435825cd23b8ad8a6f8f1397e60c522319 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-04-02vlib: add vlib_frame_bitmap_{set,clear}_bit_at_indexDamjan Marion1-0/+16
Type: improvement Change-Id: I5703728f680f0c8431e4099b398827bd094b60df Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-30vlib: fix segfault on panic in workerMikhail Sokolovskiy1-1/+7
Vlib panic uses longjmp to exit main loop, but workers don't set main_loop_exit field on initialization, so this jump corrupts registers and causes segfault. There I add clib_warning and abort if longjmp context hasn't been set. Type: fix Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com> Change-Id: I0d705f1f139c4083af75066aeb525964ed0aa202
2023-03-14vlib: pre-alloc dma backend batchesMarvin Liu1-0/+1
Allocate and initialize dma batch structure when adding dma config. The number of required dma batches is set by max_batches parameter. Thus dma batches are not allocated dynamically in worker thread. Application need to check the return value of vlib_dma_batch_new. Type: improvement Signed-off-by: Marvin Liu <yong.liu@intel.com> Change-Id: I5d05a67b59634cf2862a377d5ab77cb1040343ce
2023-03-10vlib: 512-bit SIMD version of vlib_buffer_freeLeyi Rong1-1/+69
Process 8 packets perf batch in vlib_buffer_free_inline() when CLIB_HAVE_VEC512 is enabled. Type: improvement Signed-off-by: Leyi Rong <leyi.rong@intel.com> Change-Id: I78b8a525bce25ee355c9bf0e0f651698a8c45bda
2023-03-07vlib: stop worker threads on main loop exitVladislav Grishenko1-1/+2
If not, worker threads may continue own loops after deinit and/or thread0 exit with related crashes due no rpc capability, unmapped shared memory, etc. Main loop exit handlers that uses barrier sync will be happy too as long as recursive barrier sync is supported. Type: feature Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Change-Id: I255a796b06936d96715683e3f062128060233dc6
2023-03-06vlib: fix vlib_log for elogluoyaozu1-8/+8
test output before fix: DBGvpp# event-logger clear DBGvpp# test log warn cli log test-log for-elog cli/log [warn ]: test-log for-elog DBGvpp# test log info cli log test-log for-elog cli/log [info ]: test-log for-elog DBGvpp# show event-logger 2 of 131072 events in buffer, logger running 53.022586433: log-notice: test-log for-elog 60.318329361: log-debug: test-log for-elog DBGvpp# test output after fix: DBGvpp# event-logger clear DBGvpp# test log warn cli log test-log for-elog cli/log [warn ]: test-log for-elog DBGvpp# test log info cli log test-log for-elog cli/log [info ]: test-log for-elog DBGvpp# show event-logger 2 of 131072 events in buffer, logger running 18.362721151: log-warn: test-log for-elog 25.124570555: log-info: test-log for-elog DBGvpp# Type: fix Signed-off-by: luoyaozu <luoyaozu@foxmail.com> Change-Id: Ie1122787f9efb611cdafc671b4ccf68b43984924
2023-03-06vlib: avoid non-mp-safe cli process node updatesVladislav Grishenko1-56/+34
Node renames, clone and node_by_name hash updates should be done in vlib_node_register() / vlib_node_rename() under barrier, or else runtime per-node stats can be either inaccurate or lead to UB. Drop cli process nodes renaming rather than adding barrier syncronization on reuse, nodes will get "unix-cli-process-ID" stable names, description and terminal names are preserved and can be obtained with "show cli-sessions" and "show terminal" commands. Also fix insufficient name width for "show cli-sessions" with table formatting, output sample: DBGvpp# sh cli-sessions PNI FD Name Flags 708 14 unix-cli-local:10558 iSLpa 710 15 unix-cli-127.0.0.1:33252 ISlpA DBGvpp# sh terminal Terminal name: unix-cli-127.0.0.1:33252 Terminal node: unix-cli-process-1 Terminal mode: char-by-char Terminal width: 158 Terminal height: 43 ANSI capable: yes Interactive: yes History enabled: yes History limit: 50 Pager enabled: yes Pager limit: 100000 CRLF mode: CR+LF Type: improvement Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Change-Id: I40af4c0a5e5be92d5e3ebcd440fa55390aeb0e8b
2023-03-06vlib: fix macro define command not work in startup config exec scriptXiaoming Jiang1-81/+8
Type: fix Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com> Change-Id: Idb34490199a78d5b0c1fe2382b6483a6e3a6fd1f
2023-03-06vlib: fix ASAN fake stack size set error when switching to processXiaoming Jiang1-1/+2
Type: fix Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com> Change-Id: I2add6cb8dba837e47596983ec8303883aba3a138
2023-03-06vppinfra: display only the 1st 50 memory traces by defaultBenoît Ganne1-1/+1
When using memory traces it can take a long time to display all traces bigger than 1k if there are lots of them, especially as we need to resolve symbols. It is better to display only the 1st 50 by default, unless verbose is used. Also fix the help string. Type: improvement Change-Id: I1e5e30209f10d2b05c561dbf856cb126e0cf513d Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06stats: fix node name compare error when updating stats segmentXiaoming Jiang1-1/+1
Type: fix Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com> Change-Id: Ib39aa345415720dd05a1b3e12e3e03eac43c5606