aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp
AgeCommit message (Collapse)AuthorFilesLines
11 daysvppinfra: Add method for getting current executable nameTom Jones1-10/+16
Add a unix method for getting the current executable name. This is implemented to match the readlink api for existing calls. Type: improvement Change-Id: Id06a55892d09d0b305a56b55a424f53ffb685a72 Signed-off-by: Tom Jones <thj@freebsd.org> Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-05api: fix [un]formatting in vpp/api/types.cKlement Sekera1-26/+23
vl_api_prefix_t.len is 1 byte only, but unformat %d writes 4 bytes add helper functions unformat_u(8|16) which don't write more than appropriate amount of bytes fix other similar errors in vpp/api/types.c Type: fix Change-Id: I74a61a377147c373f8c25ed083052b2287763c39 Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2024-03-13misc: fix the static vppctl buildAndrew Yourtchenko1-1/+3
Change I58e1ae1c91f4a62e80eaf4e16e9932d8bab17c74 has introduced a reference to config.h, which is not there in a case of building a static standalone vppctl. Solution: add a variable STATIC_VPPCTL which, when defined, avoids including the missing include file. Thanks a lot to Damjan for the suggestion. Type: fix Change-Id: I133235ba07e5c2e0d5669be9c2292cab0fdf436f Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2024-03-12misc: remove GNU Indent directivesDamjan Marion7-19/+0
Type: refactor Change-Id: I5235bf3e9aff58af6ba2c14e8c6529c4fc9ec86c Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-12vpp: set asan default optionsDmitry Valter2-0/+20
set asan default options in vppctl and vpp_get_stats Type: improvement Signed-off-by: Dmitry Valter <d-valter@yandex-team.com> Change-Id: I58e1ae1c91f4a62e80eaf4e16e9932d8bab17c74
2024-03-05vpp: fix stdin vs non-interactive command clashVladislav Grishenko1-10/+13
In case of both stdin and non-interactive inputs are there vppctl parses them all, causing mixed corrupted output: $ echo foo | vppctl sh bar show: unknown input `bar' unknown input `foo' This is not desired, stdin should be ignored if there's a command but still allow stdin commands - following cases are still equal: $ vppctl foo $ echo foo | vppctl Type: fix Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Change-Id: I98667391627150c98a57d49ae544e48ef3351f34
2024-02-23build: Discover libepoll-shim on FreeBSDTom Jones1-3/+3
FreeBSD doesn't offer epoll, but an implementation which uses kqueue is available as an external library. On FreeBSD in subsystems which require epoll have cmake look for libepoll-shim. Type: improvement Change-Id: Iafd5406a9e2ebaa53fd94034489ffbbf87a7d040 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18vnet: Add required header for pthread_npTom Jones1-0/+3
Type: improvement Change-Id: Ia9295b79340a18de6eb5fe80877dcf4ce97b35eb Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18vpp: Add required socket headers on FreeBSDTom Jones1-0/+5
Type: improvement Change-Id: I948e447082233187d9ca794ca56a62fad4592e13 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18vpp: Add platform specific headers for socket and inetTom Jones1-0/+5
Type: improvement Change-Id: Idcedc14089a49483d83c28a82ecb79d1b856f225 Signed-off-by: Tom Jones <thj@freebsd.org>
2024-01-16stats: Add optional labels to prometheus metricsPim van Pelt1-59/+255
* Refactor the existing prometheus exporter to function print_metric_v1() * Add a 'v2' flag which instead uses metric names with labels, example: nodes_clocks{node="ip4-lookup",index="0",thread="4"} 30198798628761 nodes_vectors{node="ip4-lookup",index="0",thread="4"} 298176625181 nodes_calls{node="ip4-lookup",index="0",thread="4"} 119789874274 nodes_suspends{node="ip4-lookup",index="0",thread="4"} 0 interfaces_rx_packets{interface="tap0",index="0",thread="1"} 79582338270 interfaces_rx_bytes{interface="tap0",index="0",thread="1"} 16265349667188 * For stat names that we don't know, print their v1 equivalent, which keeps backwards compatibility. Details in https://ipng.ch/s/articles/2023/04/09/vpp-stats.html Type: improvement Signed-off-by: pim@ipng.nl Change-Id: I53ed3ede8cc7853eb46c354834d89eb788ece3b1
2023-12-22vlib: add error checks to thread pinninghsandid1-1/+7
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-10-03stats: added optional CLI arg "port" to specify non-default portFahad Khan1-6/+8
There are cases where default port for prometheus exporter is not available e.g. when multiple vpp are running on single node. Type: improvement Change-Id: I39701486f9dfaf4dc9f08aab56e88126687b507a Signed-off-by: Fahad Khan <fahadnaeemkhan@gmail.com>
2023-09-06api: fix mp-safe mark for some messages and add moreVladislav Grishenko1-0/+7
Several api messages were not mp-safe although marked as such because non-zero base id was not taken into account, and therefore some other (from zero base id) were falsely mp-safe instead. Keep messages as mp-safe, as they falsely were before: 10 get_first_msg_id 0 1 12 api_versions 0 1 Messages that are no longer mp-safe as they weren't marked: 15 sockclnt_create 0 1 33 proxy_arp_intfc_dump 0 1 Fix messages to be really mp-safe: 809 bridge_domain_dump 0 1 920 ip_route_add_del 0 1 921 ip_route_add_del_v2 0 1 1362 get_node_graph 0 1 1671 create_vhost_user_if 0 1 1675 create_vhost_user_if_v2 0 1 Additionally mark messages as mp-safe, seems they need no barrier: 1360 show_threads 0 1 1370 show_version 0 1 1372 show_vpe_system_time 0 1 Type: fix Change-Id: Ie6c1e3aa89f26bf51bfbcb7e7c4d9fee885487b7 Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
2023-08-04vpp: detect early nosyslog and interactive flagsDamjan Marion1-0/+4
So error logs are displayed on console earlier.... Type: improvement Change-Id: If31b76c9d06254b0fec5b5b3f4e92a881b4cf786 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-04-18vpp: install version.hOle Troan1-0/+6
To make out of tree plugins require a particular version, they need access to the version they are built with. Install version.h. Type: fix Change-Id: I5916d0a16aed7e054ede452af956fee56cd078f0 Signed-off-by: Ole Troan <ot@cisco.com>
2023-04-17stats: check if stats vector entry is emptyOle Troan1-0/+2
When a stats entry is removed it is marked empty. The stats client did not check for that and returned an empty string. This resulted in blank lines in vpp_get_stats. Fix by returning null instead and checking value. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I08a39ba3ef4421bf275747a6300f97fe36791b50
2022-10-13session: make session code compile with SESSION_DEBUG enableSteven Luong1-0/+1
Session debug code does not compile anymore due to vlib_mains global variable disappearing over time. Replace it with vlib_get_main_by_index call. Add a cmake variable and pass it from make command line to enable session debug. Notice transport debug is required for session debug. make rebuild VPP_EXTRA_CMAKE_ARGS=-DVPP_TCP_DEBUG_ALWAYS=ON VPP_EXTRA_CMAKE_ARGS+=-DVPP_SESSION_DEBUG=ON Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ic2e887c6b10b77cbabd56934f4931fcfa04a6751
2022-10-11vppinfra: fix AddressSanitizerBenoît Ganne1-0/+1
When checking for CLIB_SANITIZE_ADDR to enable specific behavior for AddressSanitizer, we must have vppinfra/clib.h included as it is defined there. Type: fix Change-Id: I9060c3c29c1289d28596c215a1d1709b2ea7c84e Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-10-07tcp: build image with TCP_DEBUG_ALWAYS via makeSteven Luong1-0/+1
Add cmake option to enable TCP_DEBUG_ALWAYS. make rebuild VPP_EXTRA_CMAKE_ARGS=-DVPP_TCP_DEBUG_ALWAYS=ON make rebuild VPP_EXTRA_CMAKE_ARGS=-DVPP_TCP_DEBUG_ALWAYS=OFF Type: improvement Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I911a8d615f76516ae0a988bc6135c3b0d8fcb3df
2022-08-25vlib: introduce DMA infrastructureMarvin Liu1-0/+6
This patch introduces DMA infrastructure into vlib. This is well known that large amount of memory movements will drain core resource. Nowadays more and more hardware accelerators were designed out for freeing core from this burden. Meanwhile some restrictions still remained when utilizing hardware accelerators, e.g. cross numa throughput will have a significant drop compared to same node. Normally the number of hardware accelerator instances will less than cores number, not to mention that applications number will even beyond the number of cores. Some hardware may support share virtual address with cores, while others are not. Here we introduce new DMA infrastructure which can fulfill the requirements of vpp applications like session and memif and in the meantime dealing with hardware limitations. Here is some design backgrounds: Backend is the abstract of resource which allocated from DMA device and can do some basic operations like configuration, DMA copy and result query. Config is the abstract of application DMA requirement. Application need to request an unique config index from DMA infrastructure. This unique config index is associated with backend resource. Two options cpu fallback and barrier before last can be specified in config. DMA transfer will be performed by CPU when backend is busy if cpu fallback option is enabled. DMA transfer callback will be in order if barrier before last option is enabled. We constructs all the stuffs that DMA transfer request needed into DMA batch. It contains the pattern of DMA descriptors and function pointers for submission and callback. One DMA transfer request need multiple times batch update and one time batch submission. DMA backends will assigned to config's workers threads equally. Lock will be used for thread-safety if same backends assigned to multiple threads. Backend node will check all the pending requests in worker thread and do callback with the pointer of DMA batch if transfer completed. Application can utilize cookie in DMA batch for selves usage. DMA architecture: +----------+ +----------+ +----------+ +----------+ | Config1 | | Config2 | | Config1 | | Config2 | +----------+ +----------+ +----------+ +----------+ || || || || +-------------------------+ +-------------------------+ | DMA polling thread A | | DMA polling thread B | +-------------------------+ +-------------------------+ || || +----------+ +----------+ | Backend1 | | Backend2 | +----------+ +----------+ Type: feature Signed-off-by: Marvin Liu <yong.liu@intel.com> Change-Id: I1725e0c26687985aac29618c9abe4f5e0de08ebf
2022-06-15stats: fix prometheus exporter crash on large number of FIB entriesAlexander Chernavin1-2/+2
Type: fix Currently, prometheus exporter may crash because of memory exhaustion when dumps metrics if the FIB contains large number of routes. With this fix, increase memory size for prometheus exporter to be able to handle large number of FIB entries. Signed-off-by: Alexander Chernavin <achernavin@netgate.com> Change-Id: Ia2b9a665368883c87448deee9bcf8d2ac1168357
2022-04-24build: fix 16-8-8 mtrie build optionBenoît Ganne1-1/+1
VPP_IP_FIB_MTRIE_16 should be defined only if the option is enabled instead of being defined as "ON" or "OFF". Type: fix Change-Id: Ib4e29a827bcbd84c8012f05ad264c1408ffccee7 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-04-14vlib: disable cpu pinning if not configuredBenoît Ganne1-4/+7
In some environment like when running a lot of functional tests, it can be useful to run more VPP instances than CPU and let the Linux scheduler decide what to do. This change disable cpu pinning altogether in the single-threaded case, provided that no main-core is explicitely specified in the config Type: improvement Change-Id: I8c2f36fdd49c00f9adaaeb4c81aefb27c3420a9b Signed-off-by: Benoît Ganne <bganne@cisco.com> Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-04-04vppinfra: make _vec_len() read-onlyDamjan Marion2-2/+2
Use of _vec_len() to set vector length breaks address sanitizer. Users should use vec_set_len(), vec_inc_len(), vec_dec_len () instead. Type: improvement Change-Id: I441ae948771eb21c23a61f3ff9163bdad74a2cb8 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-04vlib: improve exec path searchDamjan Marion1-1/+2
Fixes VPP invocation with relative path, i.e.: $ bin/vpp unix interactive Type: improvement Change-Id: I0278710bb472b92e31389b2d28955c3d33550230 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-31stats: convert error counters to normal countersDamjan Marion2-22/+0
Change-Id: I9794da718805b40cc922e4f3cf316255398029a9 Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
2022-03-30vppinfra: vector allocator reworkDamjan Marion1-1/+1
- support of in-place growth of vectors (if there is available space next to existing alloc) - drops the need for alloc_aligned_at_offset from memory allocator, which allows easier swap to different memory allocator and reduces malloc overhead - rework of pool and vec macros to inline functions to improve debuggability - fix alignment - in many cases macros were not using native alignment of the particular datatype. Explicitly setting alignment with XXX_aligned() versions of the macro is not needed anymore in > 99% of cases - fix ASAN usage - avoid use of vector of voids, this was root cause of several bugs found in vec_* and pool_* function where sizeof() was used on voids instead of real vector data type - introduce minimal alignment which is currently 8 bytes, vectors will be always aligned at least to that value (underlay allocator actually always provide 16-byte aligned allocs) Type: improvement Change-Id: I20f4b081bb13bbf7bc0ace85cc4e301787f12fdf Signed-off-by: Damjan Marion <damarion@cisco.com>
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-09stats: refactorDamjan Marion5-1543/+0
Type: refactor Change-Id: Ifd533a095d979dc55bfbe5fac7e0b7510a4d900c Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-09vat: fix vat_suspend crashDamjan Marion1-2/+2
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-02-10stats: Remove unsolicited clib_warningSteven Luong1-1/+1
It is annoying to see unsolicited message like this spew out to the console which an end-user cares less about. vlib_stats_rename_symlink:301: RENAME new name: /nodes/unix-cli-local:52/clocks Type: fix Fixes: I92a62bb1cb799e8fdc3ec4110ae3428825254f8a Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I071f3d3736c06cd95a38ec46c7e2222caad01283
2022-02-06stats: fix memory leaksOle Troan1-32/+66
Type: fix Fixes: 72e31bc2d9 Fixes: db02380 Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I92a62bb1cb799e8fdc3ec4110ae3428825254f8a Signed-off-by: Ole Troan <ot@cisco.com>
2022-01-28misc: vppctl - fix coverity warningKlement Sekera1-4/+8
Calculate space left to silence coverity. Type: fix Fixes: 31f192434660 Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I9cd2e91ce74444e2625bf86721a8d3e44bf6afdd
2022-01-28misc: vppctl - fix coverity warningKlement Sekera1-0/+7
Check that provided path fits into defined buffer. Don't write too many bytes to avoid having an unterminated string. Type: fix Fixes: 31f192434660 Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I1ea8b6d6a3474c032e542b6980ed14bac72093a8
2022-01-18misc: fix coverity warningsDave Barach1-1/+1
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I8ea0193ebb2a721a0582451ffd64c4063ac6d233
2022-01-05dpdk: remove vlan-strip offload codeFilip Varga1-4/+0
This code was actually never working. It was just used as workaround for Cisco ENIC issue with tagged default vlan frames. Today Cisco ENIC provides solution to this problem with devargs flags... Change-Id: Ia8284274117cb200bf6c7f7911d945d5a093d878 Type: refactor Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-12-14misc: vppctl fix heap-buffer-overflow & memleaksTianyu Li1-0/+8
1. Malloc may return not zero buffer, causing strncat buffer overflow 2. Malloc buffer not freed Type: fix Fixes: 31f192434660 ("misc: vppctl - remove the dependency on vppinfra") Signed-off-by: Tianyu Li <tianyu.li@arm.com> Change-Id: I5aebaccf3d0f8b7e3617068267f62cc2aa39d827
2021-11-24misc: vppctl - fix coverity warningKlement Sekera1-1/+4
Check the return value and log failure in case send() fails. Type: fix Fixes: 31f192434660 Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I1809598ff4816f67c28a88264b6524b10d7ff6ce
2021-11-15misc: vppctl - remove the dependency on vppinfraAndrew Yourtchenko1-89/+158
56f54af21d18f9fdd471b81db77a3942b0aa4d9c introduced the new memcpy. It also made a vector support mandatory in order to compile anything that depends on vppinfra. This broke extras/scripts/build_static_vppctl.sh Since the vppctl is just a two-pronged epoll+basic telnet client handler, remove dependencies on the vpp infra libs, and trim the build script accordingly. Change-Id: I394bc65c485cbf8e7143a818ca0c86367bb15d90 Type: improvement Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2021-10-30build: add missing fib headers in packagesBenoît Ganne1-0/+6
Type: fix Fixes: d6953332db225d5355f50348ef3b09f0525d5282 Change-Id: Ib85fee40e71ebe5bc2b84c62e37298b5e390d520 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-18interface: add api test fileFilip Tehlar1-2/+29
Type: improvement Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: Ib07029204ecf12bf2adb5a39afa54bc98fb81f34
2021-10-13docs: convert vpp doc md->rstNathan Skrzypczak4-151/+203
Type: improvement Change-Id: If453321785b04f9c16e8cea36fb1910efaeb2c59 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-10-11vat: move memset after initFilip Tehlar1-1/+1
Type: fix Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: Ia65fd2f99dfe6538411c247aeb9691c590c2e00b
2021-10-05build: don't hardcode triplet, allow specifying custom lib dirDamjan Marion2-4/+4
Type: fix Change-Id: I33f364fda88914f88f9b976cb83e6d3ff466f0bb Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
2021-09-28misc: vpe.api messages dynamically allocatedOle Troan9-1927/+116
This is the last in the series of moving API messages from vpp/api/vpe.api to vlibmemory/memclnt.api. This patch makes the remaining vpe.api messages dynamic, to help VAT2 binary-api command. Moves the VAT test code to a separate file and removes the now unnused API meta files. Type: improvement Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I01dd78eaff1d3715dff17d2643bf0f7f0089935b Signed-off-by: Ole Troan <ot@cisco.com>
2021-09-28stats: add name vectors to prometheus exporter outputAlexander Chernavin1-0/+9
Type: improvement Counters are labeled with interface indices in the Prometheus exporter output. For example: # TYPE _if_drops counter _if_drops{thread="0",interface="0"} 0 _if_drops{thread="0",interface="1"} 0 _if_drops{thread="0",interface="2"} 2112 [..] Currently, it's unable to map interface indices to the interface names using only output provided by the Prometheus exporter. However, this mapping is present in the vpp_get_stats output: # vpp_get_stats dump /if/names [0]: local0 /if/names [1]: GigabitEthernet0/8/0 /if/names [2]: GigabitEthernet0/9/0 /if/names [..] With this change, add name vectors to Prometheus exporter output as info metrics. Thus exposing interfaces and their indices: # TYPE _if_names_info gauge _if_names_info{index="0",name="local0"} 1 _if_names_info{index="1",name="GigabitEthernet0/8/0"} 1 _if_names_info{index="2",name="GigabitEthernet0/9/0"} 1 [..] Signed-off-by: Alexander Chernavin <achernavin@netgate.com> Change-Id: Iff86c4d6fea8805e71fb04fccf278bae855e88d1
2021-09-27misc: api move continuedFlorin Coras2-41/+0
Move control ping and change dependencies from vpe.api_types to memclnt.api_types Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I9f8bc442e28738c48d64d1f6794082c8c4f5725b
2021-09-27misc: move part of vpe apis to vlibmemoryFlorin Coras3-595/+17
VPE apis are actually vlib apis. This moves those that are not tightly coupled with vapi to vlib_api Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I456a64ce49a0cdeff4a0931c6ea513cb639f683e Signed-off-by: Ole Troan <ot@cisco.com>
2021-09-23stats: revert stat_validate_counter_vector3 non-staticRay Kinsella2-4/+1
This reverts commit c30157811e4c8e870d2680b08ecd3a38dff2d53b. Type: refactor Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: Id011c8e5acb1613e09fd339ce614159c0acd651a