summaryrefslogtreecommitdiffstats
path: root/src/vlib
AgeCommit message (Collapse)AuthorFilesLines
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
2023-01-30vlib: chdir to runtime_dirDamjan Marion1-0/+3
Type: improvement Change-Id: Id8ab75ef4384a1029ab7ee84048f347708307830 Signed-off-by: Damjan Marion <dmarion@me.com>
2023-01-21vlib: make pending_interrupts valid for AddressSanitizerBenoît Ganne1-1/+1
vec_alloc_aligned() pre-allocates the vector memory but does not update its size, making ASan unhappy when trying to access it. Type: fix Change-Id: I80e753cf2458cf516d1180a24cfaca4f382339d5 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-01-18pci: fix musl crashBenoît Ganne1-8/+9
The musl libc does not support closedir(0) resulting in a crash. Only call closedir() if we successfully opened it. Type: fix Change-Id: I3198454f44735501047afc42b94b2fea273212f4 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-01-17vlib: install dma.h to fix out-of-tree pluginsMohammed Hawari1-0/+1
Change-Id: I7888ab58abced93859ce15d0dbd1c3d7c94a02f5 Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: fix Fixes: 0654242d1ef51566f0d58445a16053cf376e5a6e
2023-01-14vlib: add const to char* params of several funcsSergey Nikiforov2-2/+3
These functions do not need modifiable strings. It helps with linker sections as well as C++ compatibility. It is a good style to use const where approriate. Type: refactor Signed-off-by: void234@gmail.com Change-Id: Ib437a01663aa61860c6a938d869ed1111da71ec7
2023-01-12misc: use right include for fctnl.h and poll.hGuillaume Solignac1-1/+1
Musl is stricter than glibc and has a warning that including fctnl.h and poll.h should be prefered rather than their sys/ counterparts, which breaks -Wall setups. Type: fix Signed-off-by: Guillaume Solignac <gsoligna@cisco.com> Change-Id: Id101e999371951b0927cc8c4109f8f1536de1bc2
2023-01-11pci: add option to force uio bindingBenoît Ganne2-62/+66
Type: improvement Change-Id: Ifea4badd58f7e2b5e792d7506f6747851a08587f Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-12-02buffers: revert protect against bad thread indicesBenoît Ganne1-4/+1
This change was introduced to workaround a bug in the NAT code, but we should not woraround plugin bugs in infra. Type: fix Fixes: f8631ce7e8886136b4543a7926ffdf1bc760fb11 Change-Id: Id6ee281cf1fe8466b6522905fc2a176716e3d52f Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-11-30stats: add boot time in stats segmentOle Troan2-1/+5
Write time into /sys/boottime on VPP start. This allows a stateless control plane agent to validate if it's reconnecting to the same VPP instance. Type: improvement Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Iba7f334339c46142045e43da6efab11612e7b9c0 Signed-off-by: Ole Troan <ot@cisco.com>
2022-10-17vlib: Counter free needs to NULL the allocated counter vectorNeale Ranns1-2/+8
otherwise the next time the counter is validated this is dangling. Type: fix Fixes: 58fd481d73 Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: Ifa8d5ff27175cf6dfb30cbf023fa3251fe5c780e
2022-10-12misc: fix issues reported by clang-15Damjan Marion2-3/+4
Type: improvement Change-Id: I3fbbda0378b72843ecd39a7e8592dedc9757793a Signed-off-by: Damjan Marion <dmarion@me.com>