summaryrefslogtreecommitdiffstats
path: root/src/vlib
AgeCommit message (Collapse)AuthorFilesLines
2022-03-28vlib: use pthread_attr_setstack() to set thread stackDamjan Marion1-12/+26
Type: improvement Change-Id: I4c7f2f63651df4362ce1e0e36d885fedf55595c6 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23vlib: send full error message to syslogJing Peng1-22/+6
Currently the last character of the error message string is temporarily changed to a null byte '\0' before the string is sent to syslog(3), resulting in confusingly incomplete log entries. This patch changes the syslog format to "%.*s" so that the maximum number of characters to be printed could be controlled. Type: improvement Signed-off-by: Jing Peng <pj.hades@gmail.com> Change-Id: I1bd6295c19b51b962a3d8ee3016cd91ffb2a4eaf
2022-03-23vppinfra: change vlib_register_node so it takes format string for node nameDamjan Marion3-23/+13
This allows specifying both c string and vector for node name and removes need for crafting temporary string. Type: improvement Change-Id: I0b016cd70aeda0f68eb6f9171c5152f303be7369 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23vlib: avoid use of vector of voidsDamjan Marion2-3/+3
Type: fix Change-Id: I76e28854db8a1e9134c816c0c5d81b031dc4e27d Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23vlib: mitigate outdated new cli session eventsVladislav Grishenko1-1/+5
Possible races while concurrent additon to the new sessions vector in a one process and remove from it in an another need to be avoided. Let the vector be changed in the new session process function only. Also cli_file_pool element may be freed already at the new session event arrive timepoint, still causing unexpected cli banner for noninteracive cli sessions. Type: fix Fixes: 17a67218587d40541ff522c6a86f354720481fbb Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Change-Id: I022d16dd3aad9c9330834d35c58938f04b015b08
2022-03-23vlib: fix memory leak on process nodes reforkingVladislav Grishenko1-0/+1
The processes vector leaked on reforking and needs to be freed before recloning from main node processes. Type: fix Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Change-Id: Id69bc3fd42e2efacfcd521f98e6e51a9c712fef5
2022-03-23vlib: leave SIGCONT signal with its default handlerVladislav Grishenko1-0/+1
Systemd always sends SIGCONT after KillSignal, to ensure that even suspended tasks can be terminated cleanly. However, the default action of SIGCONT handler in VPP such as unix_signal_handler() is process termination with coredump, what is not really desired. So, leave it alike SIGSTOP with its default handler. Type: feature Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Change-Id: I54c06d21669ec3c709322d746db9e28448c31bb8
2022-03-23stats: fix crash due to pointer taken before validateDamjan Marion1-2/+4
Type: fix Change-Id: Iee9eab18da142bfe0645761deea13b0fe911a43b Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-21stats: fix vlib_stats_validate_will_expand_internalDamjan Marion1-2/+2
Type: fix Change-Id: If4c0b23aaa4fc57c0783efcbe349aba5e5885b30 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-18vppinfra: use stored vec header size to find headerDamjan Marion1-1/+1
Type: refactor Change-Id: Iaa1e43c87c5725ab33ea8489bff2a7bda18b9c79 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-17vlib: fix vlib_mains vector alignmentFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib3d1ac6c82bc0c00e445b15d4102e4fd755f8e2d
2022-03-15vlib: add vlib_frame_bitmap_andDamjan Marion1-0/+8
Type: improvement Change-Id: I531115f32c484e4c4794173d24e15f3b5b8f547b Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-14stats: refactor vlib countersDamjan Marion6-161/+217
Change-Id: I09d2da73eff42c52ba1373acc99ff28f283a6725 Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-14stats: support recursive lockingDamjan Marion3-5/+32
Type: improvement Change-Id: I85dd3d34bcb175dd68dda34a58cd454848a0fc2b Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-11vlib: remoove unused fieldDamjan Marion3-24/+0
Type: refactor Change-Id: Ieb7a595e40d801af5349c83b128fa92c7698a346 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-10vlib: init logging eearlierDamjan Marion3-5/+9
Type: improvement Change-Id: I2eb5543aa470094d4c5ad420a2fcc9873b7808e1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-09stats: refactorDamjan Marion17-168/+1467
Type: refactor Change-Id: Ifd533a095d979dc55bfbe5fac7e0b7510a4d900c Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-02-10vlib: vlib frame bitmapsDamjan Marion2-14/+94
Special bitmaps with VLIB_FRAME_SIZE bits. Type: improvement Change-Id: I48747e422e519e7b5e930fa720397459d3adbb8e Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-18vlib: allow bigger scalar data sizeDamjan Marion1-1/+2
Type: improvement Change-Id: I1031c6ce80d90814edda7b52b11039874b95714f Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-11vlib: fix the total len not including first buffer formatingMohsin Kazmi1-1/+1
Type: fix total len not including first buffer is in vlib_buffer_t second cacheline. It is not reset after the buffer has been consumed. It leads to printing garbage in packet trace for subsequent use of this buffer. This patch fixes the issue to only print when VLIB_BUFFER_NEXT_PRESENT flag is set. Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ied72308bdb907a5e1ca16d181f2add062807e968
2021-12-31vlib: remove external thread management supportDamjan Marion2-53/+6
Now DPDK have API to register external threads so we can remove this mess... Type: improvement Change-Id: I71a21f0cd94bd668aa406710c75a0bcc63fdc840 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-12-24vlib: introduce vlib frame aux dataDamjan Marion6-117/+122
Type: improvement Change-Id: I53890a13210cfb0d2b2d9d8cfd9b15118d3bb273 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-12-22vlib: null terminate elog stringDamjan Marion1-1/+1
Type: fix Fixes: bc867c3 Change-Id: Ibcdb46d3b322195f5573e5ec93b31e177acaca49 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-11-22vlib: add virtual time supportBenoît Ganne4-15/+121
Type: feature Change-Id: Iabd76558e9c72ed8286cfeeb1fbaa4fde4832a90 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-11-22vlib: fix coverity warningKlement Sekera1-1/+1
Use correct signed type to allow testing for a failure (-1) from readlinkat(). Type: fix Fixes: 5714a49f14 Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I06f1c8d91e907c151012ff9758c6b52caca4d625
2021-11-16vlib: fix coverity warningKlement Sekera1-1/+0
Remove now unused computation result. Type: fix Fixes: 3f8b8d30cade20afa8975a5e7a6d79346cec8f3e Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: Iea142cb044d31e364fdc5b8b6dd69681e77d745f
2021-11-08vppinfra: vectorized index to pointer functionDamjan Marion1-92/+29
Type: improvement Change-Id: I05e1a8fa31761b113355123429d72da18881d4b0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-11-08perfmon: fix iio-bw coverity issuesRay Kinsella2-2/+2
Fixes an number of coverity issues associated with the iio-bw feature. Type: fix Fixes: e15c999c3 Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I9ad2b336694132545d90a3483200a510226e9198
2021-11-06vppinfra: move clib_count_equal_* codeDamjan Marion1-0/+1
Type: refactor Change-Id: Ib9e8abdbf745ad6563fc79c9ebb6b2ea65917d08 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-11-05pci: remove dead codeDamjan Marion1-4/+0
Type: refactor Change-Id: Ic79e38aa6cf4ffe1eb677e7cef34351e7917d97b Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-11-05vlib: remove dead codeDamjan Marion1-7/+0
Type: refactor Change-Id: I818bacdb068e825b38acdceb2566972819c64e82 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-11-03pci: allocate and set length pci product nameRay Kinsella1-1/+1
Original fix for this issue, allocated sufficent memory but didn't set the vector length correctly. Type: fix Fixes: 7d0ca6af0 Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I3c8ce310d7a6266840a2d8d6b8620254acd042ab
2021-11-02vlib: retrieve the root bus of a given pci deviceRay Kinsella3-3/+70
Added a function to parse sysfs, determine the root bus & domain of a given pci device. Type: improvement Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I36778116ecaa2d591617450fe5ae0bdb46b4424b
2021-11-02vlib: add format pci link portRay Kinsella2-0/+14
Added a function to nicely format pci link ports. Similar to the existing link_speed etc format functions. Type: improvement Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: Ic1f104e0cb34dad274f6c959e776a32c0bab697d
2021-11-02vlib: allocate pci product_name with vec_allocRay Kinsella1-1/+1
The pci device product_name array was being allocated with vec_validate, not vec_alloc. This was allocating an additional byte at the end of the array, which was causing a spurious '\0' to be returned in the middle of format strings. Type: fix Fixes: cef87f1a5e Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: I21e0aa4f0455ee03bd0acc675d0deae02eddea2b
2021-10-13vlib: fix vmbus error logBenoît Ganne1-3/+3
struct dirent *e is freed when calling closedir(). Use ifname instead. Type: fix Change-Id: Icc9ca52c33ecc1dee7a9e28802149e4e3e4c8ac0 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-06tcp: fix severity infoFilip Tehlar1-3/+3
Type: fix Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibe39bc045c3b154209a83b59ef95a37c61b32c0c
2021-10-06vlib: doc nitfixesNathan Skrzypczak2-2/+2
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 Marion2-1/+9
Type: fix Change-Id: I33f364fda88914f88f9b976cb83e6d3ff466f0bb Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
2021-09-29ipsec: Record the number of packets lost from an SANeale Ranns1-0/+14
Type: feature Gaps in the sequence numbers received on an SA indicate packets that were lost. Gaps are identified using the anti-replay window that records the sequences seen. Publish the number of lost packets in the stats segment at /net/ipsec/sa/lost Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I8af1c09b7b25a705e18bf82e1623b3ce19e5a74d
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-15vlib: add option to plugin registration to prefer deep bindingDamjan Marion2-6/+7
Type: improvement Change-Id: I9ce7e1ee7e7afe8e9befe36ae8c59291beaaaf36 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-09-14vlib: add graceful termination with statusPierre Pfister2-1/+12
This commit allows a non-VPP thread to request VPP to gracefully shutdown and return a specific process status value. Type: improvement Change-Id: I9bf52b789e7ee28eb272630eaea495fd94349f79 Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2021-09-09vlib: fix vlib_buffer_enqueue_to_next() overflowBenoît Ganne1-0/+25
vlib_buffer_enqueue_to_next() requires to allow overflow of up to 63 elements of 'buffer' and 'nexts' array. - add helper to compute the minimum size - fix occurences in session and async crypto Type: fix Change-Id: If8d7eebc5bf9beba71ba194aec0f79b8eb6d5843 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-08-31vlib: fixed the issue of vpp crash caused by interface up/downfangtong1-1/+1
When the interface status changes, the api of vnet_hw_interface_set_flags_helper calls the event processing function (vlib_process_signal_event_helper) for event processing. When the opinter data_vec is NULL, the _ven_len operation of an illegal address will cause vpp crash. Type:fix Signed-off-by: fangtong <fangtong2007@163.com> Change-Id: I7106b2aed7a1fc17f74bf6cb513912af97584f45
2021-08-27vlib: vpp banner is outputted to non-interactive vppctl sessionSteven Luong1-0/+11
Running a batch file which contains many vppctl commands, occasionally, VPP may spit out the banner for some of the commands. This happens when VPP erroneously views the vppctl session as interactive. A simple way to recreate the problem is to run a batch script as followed while [ 1 ] do vppctl create loopback interface vppctl delete loopback interface intfc loop0 done We have two processes which may display the banner, unix_cli_new_session_process and unix_cli_process. Normally, unix_cli_process parses the input tokens and displays the banner after it negotiates the terminal type with the vppctl app. unix_cli_new_session_process only displays the banner just in case the client fails to negotiate terminal type. It runs on a timer and expires in 1 second to display the banner if by then the terminal type is still not yet negotiated. The problem is when the session is killed or exitted, VPP does not remove the element that was enqueued for cli_new_session_process. The index for the connection (cf) is recycled. The timer for the queue element continues to run. When the timer expires for the queue element, it finds the wrong new session due to index recycling. If the new session has not had negotiated the terminal type, the banner is printed erroneously to the new session from cli_new_session_process. The fix is to clean up the queue element to stop cli_new_session_process from processing the wrong connection when the session is killed. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ife2f1b1c95661e442f0fc6b73505e330e6641fc1
2021-08-27bufmon: add buffer monitoring pluginBenoît Ganne3-24/+55
This plugin allow to keep track of buffer usage in VPP graph nodes. The main use is to detect buffer leakages. Type: feature Change-Id: Iadcf4ab98207fab6e2fa375060879bc2a25b711e Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-08-20buffers: fix buffer linearizationBenoît Ganne1-95/+104
vlib_buffer_chain_linearize() truncates partial data in chained buffers in corner cases when current_data is negative. Strengthen test cases to reproduce the errors and fix it. Type: fix Change-Id: Ida621923711c5755508224bdc3842b31003c6c0b Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-07-27vlib: don't ASSERT(vm) in worker thread bootstrapDave Barach1-2/+4
Otherwise, threads declared with .no_data_structure_clone=1 crash on startup. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I5dcb25d1b61330fc9eee5427b815fcfcb9bf2153
2021-07-15misc: replace CLIB_PREFETCH with clib_prefetch_{load,store}Damjan Marion2-3/+3
Type: refactor Change-Id: Id10cbf52e8f2dd809080a228d8fa282308be84ac Signed-off-by: Damjan Marion <damarion@cisco.com>