aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib
AgeCommit message (Collapse)AuthorFilesLines
2018-10-01thread: Add show threads apiMohsin Kazmi4-58/+40
Change-Id: I3124238ab4d43bcef5590bad33a4ff0b5d8b7d15 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-09-30vlib: barrier sync elog tracing improvementsDave Barach3-135/+113
Change-Id: I2d3b8d5a7192ff68bee443a99346ecb807b2d833 Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net>
2018-09-27Add logging to vfio codeDamjan Marion2-3/+23
Change-Id: Iacdff0a5006a0617e3c9559ce7b258f26e256abb Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-09-27"show log": print wall-clock timeDave Barach1-1/+14
Change-Id: I36f42c03f778955dd543da6c878be090d0443922 Signed-off-by: Dave Barach <dave@barachs.net>
2018-09-24Trivial: Clean up some typos.Paul Vinciguerra1-4/+4
Change-Id: I085615fde1f966490f30ed5d32017b8b088cfd59 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-09-19session: improve close procedureFlorin Coras1-0/+8
Change-Id: I6201a044e70ab6a58db8212960c57edc77c41f96 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-17STATS: Dynamically mapped shared memory segmentOle Troan5-16/+42
Move from using a hash to a vector with offsets into shared memory. Limit exposure of VPP data structures and include files to external stats library and applications. Change-Id: Ic06129f12d10cf4c4946a86d9bc734eacff2c7da Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-14vlib: introduce user flags in vlib_frame_tDamjan Marion3-16/+20
Those flags have local significance and they can be used for sending hints to the next node. Change-Id: Ic2596ee81c64cd16f96344365370e8fcdc465354 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-09-12Add and enable u32x4_extend_to_u64x2_high for aarch64 NEON intrinsics.Sirshak Das1-1/+5
This is the high version of extendto. This function accomplishes the same task as both shuffling and extending done by SSE intrinsics. This enables the NEON version for buffer indexes to buffer pointer translation. Change-Id: I52d7bbf3d76ba69c9acb0e518ff4bc6abf3bbbd4 Signed-off-by: Sirshak Das <sirshak.das@arm.com> Reviewed-by: Steve Capper <steve.capper@arm.com> Reviewed-by: Yi He <yi.he@arm.com> Verified-by: Lijian Zhang <lijian.zhang@arm.com>
2018-09-09vlib: crash in linux_epoll_input_inline for accessing free file index [VPP-1412]Steven1-2/+31
Under rare scenario, epoll may still post an event to VPP although the file descriptor is already deleted via epoll_ctl (EPOLL_CTL_DEL) and the file descriptor is close. VPP tries to access the free file index entry and crash. The fix is to throw away the events which the file descriptor is already deleted. Change-Id: Ieca3a1873aecb28630c3abc42c40341f27c2faa7 Signed-off-by: Steven <sluong@cisco.com> (cherry picked from commit aec7297ba012e1fe4bbf85cdaec8e810aa476cea)
2018-09-07Improve NTP / kernel time change event handlingDave Barach1-2/+14
clib_time_verify_frequency(...) rejects clock frequency changes greater than 1%. vlib_worker_thread_barrier_sync_int (...) continuously checks that the barrier hold-down timer is not unreasonably far in the future. Change-Id: I00ecb4c20e44de5d6a9c1499fa933e3dd834d11a Signed-off-by: Dave Barach <dbarach@cisco.com>
2018-09-07cmake: set packaging component for different filesDamjan Marion1-1/+5
Change-Id: I033a1f5cdb24f77462cb5ec90a62226d93f52925 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-09-07Silence warning over ignored return value (CID 187932)Chris Luke1-2/+2
- We deliberately ignore the return value. Change-Id: If467911b019e7336cf9dc6d4c95c2cd53a5af33f Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-09-06Fix Telnet option processing issueChris Luke1-1/+8
- A check for the length of the buffer should have used the provided 'len' variable, not 'vec_len' since the buffer pointer may be within a vector, but not the start of one. 'vec_len' reports 0 in that case, causing premature exit from the options processing loop and a wait for further input before it checks the next option. - Also add TCP_NODELAY to CLI sockets to disable Nagle on TCP connections for a possible improvement in interactive response. Change-Id: Ie1f53c003ca7d66bed51f437d298183215bad38c Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-09-03Deprecate old buffer replication schemeDamjan Marion3-64/+16
Change-Id: I1f54b994425c58776e1445c8d9fe142e7a644d3d Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-29STATS: stat_client updates.Ole Troan2-6/+7
New stat segment client library: vpp-api/client/stat_client.h New stat segment query app: vpp_get_stats [ls | dump | poll ] <pattern ...> Prometheus integration through: vpp_prometheus_export <pattern> Change-Id: I6f370cf599e9fcf066f22965a62d3a8acd529994 Signed-off-by: Ole Troan <ot@cisco.com>
2018-08-28vlib: add 'show node' and 'set node function' CLIDamjan Marion3-35/+262
Change-Id: I084d7c9e34329f10b5fe45e0b157c4defe0f2811 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-26cmake: add add_vpp_library and add_vpp_executable macrosDamjan Marion1-11/+5
Change-Id: I1382021a6f616571b4b3243ba8c8999239d10815 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-25Add int cast to fit '.*' printf expectationsPierre Pfister1-4/+5
Sometimes, compiler would throw an error: error: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 5 has type ‘u64 {aka long unsigned int}’ This change adds the requested cast. Change-Id: I43edeac0ee565a1fcee38b9d2942e49c8dd63116 Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2018-08-24Clean up packet tracer, especially "clear trace"Dave Barach3-25/+24
There are multiple trace enablement schemes. It's easy to end up in vlib_add_trace with tracing disabled insofar as the packet tracer is concerned. When that happens, return the address of a per-system dummy trace record. Change-Id: I929391b8be4ed57e26e291afdc509a15f09a3160 Signed-off-by: Dave Barach <dave@barachs.net>
2018-08-24Rename struct mallinfo -> struct dlmallinfoDave Barach1-1/+1
Also: don't #include /usr/include/malloc.h in dlmalloc.h Change-Id: Ic73ff8862cc8aba371488b912255e28dd96374ff Signed-off-by: Dave Barach <dave@barachs.net>
2018-08-17CMake as an alternative to autotools (experimental)Damjan Marion1-0/+98
Change-Id: Ibc59323e849810531dd0963e85493efad3b86857 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-14Run interior graph nodes before process nodesDave Barach1-14/+7
Reduces the chance of tripping over vectors in flight, especially in single-core cases. Change-Id: I132cdd3689f8e634f9a983af57219503817b8560 Signed-off-by: Dave Barach <dave@barachs.net>
2018-08-13Multiarch handling in different constructor macrosDamjan Marion3-0/+46
This significantly reduces need for ... in multiarch code. Simply constructor macros will jost create static unused entry if CLIB_MARCH_VARIANT is defined and that will be optimized out by compiler. Change-Id: I17d1c4ac0c903adcfadaa4a07de1b854c7ab14ac Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-03vlib: avoid double process dispatchFlorin Coras1-1/+9
Change-Id: I46467b1f149be9dfbd00e3ea6d60681d19acf235 Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-08-01Improve cpu { coremask-% } configure optionYi He1-20/+4
Accept any sized hexadecimal bitmask specification to support platforms with hundreds of cores. Change-Id: Ib881db0cf60f78bdeffa13acfc2fc7fe7e128cc4 Signed-off-by: Yi He <yi.he@arm.com>
2018-07-27128-bit SIMD version of vlib_get_buffersDamjan Marion1-0/+8
Change-Id: I1a28ddf535c80ecf4ba4bf31659ff2fead1d8a64 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-23Buffer clone: copy opaque2Neale Ranns1-0/+2
Change-Id: I06e1dbfa0782bc03f2d0e77295b38b4fde7df35e Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-07-20Add congestion drop in interface handoffDamjan Marion3-21/+57
This prevents deadlock in case when worker A sends to B and worker B sends to A Change-Id: Id9436960f932c58325fe4f5ef8ec67b50031aeda Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-20physmem: fix alloc when dlmaloc is usedDamjan Marion1-1/+5
Change-Id: I4b6cdf95ac694c8408eb6cf3259b335a8148b5aa Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-19Cleanup of handoff codeDamjan Marion1-0/+86
- removed handoff-dispatch node - removed some unused buffer metadata fields - enqueue to thread logic moved to inline function Change-Id: I7361e1d88f8cce74cd4fcec90d172eade1855cbd Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-18Add config option to use dlmalloc instead of mheapDave Barach6-18/+98
Configure w/ --enable-dlmalloc, see .../build-data/platforms/vpp.mk src/vppinfra/dlmalloc.[ch] are slightly modified versions of the well-known Doug Lea malloc. Main advantage: dlmalloc mspaces have no inherent size limit. Change-Id: I19b3f43f3c65bcfb82c1a265a97922d01912446e Signed-off-by: Dave Barach <dave@barachs.net>
2018-07-12Fix debug CLI node recycling bugsDave Barach1-5/+26
When creating a new - as opposed to recycled - debug CLI process node, perform a proper barrier sync and node runtime update. Otherwise, the graph replicas diverge for some period of time. That's not immediately fatal, but it's not a good idea, either. When renaming a debug cli process node, fix all of the name-vector replicas before freeing the [one-and-only] name vector. This fixes the so-called stats segment node runtime scraper crash, which tripped over a replicated dangling reference to the recently-freed debug CLI node name. Change-Id: Ieffabd9f003139e534b9d79b88370439907930e5 Signed-off-by: Dave Barach <dbarach@cisco.com>
2018-07-11threads: fix issue with setting main-core to 0Damjan Marion2-8/+15
Change-Id: Id3ccfcfa2a88cf7aa106f1202af7cd677de32575 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-04Do not override skip-cores if set in startup.confDamjan Marion1-4/+2
Change-Id: I97d75f58a46275fdad5add27dc59c731cc3ac64d Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-03Set main thread affinity before main heap is allocatedDamjan Marion1-7/+7
Change-Id: I524909570fc1736f51fd437d6d30566c461139bd Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-02Add per-numa page allocation info to 'show memory'Damjan Marion1-2/+7
Change-Id: I64e4e3d68c0f3958323f30b12a26cfaafa8bad85 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-06-30cli: Validate cli_file_index on quit commandSteve Shin1-0/+4
VPP crash happens with 'vppctl quit quit' command. The 2nd quit command tries to access the file index which is already freed by the first quit. This can be avoided to validate cli_file_index. Change-Id: I880514c93523db2a727d7510c97950582cd6a6c8 Signed-off-by: Steve Shin <jonshin@cisco.com>
2018-06-27gcc8 and Wstringop-truncationMarco Varlese1-2/+4
gcc8 introduced a new warning (Wstringop-truncation) which in our case is being treated as error. Disabling the warning globally might introduce bugs related to string truncation which are not desired by the developer (e.g. bug). Instead, this patch disables the warning only for those occurences which have been verified to be non-bugs but the desired behaviour as per developer will. Change-Id: I0f04ff6b4fad44061e80a65af633fd7e0148a0c5 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-06-26add backtrace in unix_signal_handlerKingwel Xie1-9/+49
crash stack backtrace will be directed to syslog 1. make use of glic backtrace in execinfo.h. the old clib_backtrace is removed 2. install SIGABRT in signal handler, but have to remove it when backtrace is done. reason is to capture stack trace caused by SIGABRT. vPP ASSERT always call os_exit then abort(). we definitely want to know the trace of this situation. It is a little tricky to avoid SIGABRT infinite loop 3. always load symbols by calling clib_elf_main_init () in main(). Otherwise, PC addresses instead of symbols will be displayed. Change-Id: I150e15b94a4620b2ea4f08c73dc3e6ad1856de1e Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2018-06-21configurable per-dispatch-cycle sleepDave Barach3-2/+25
Workaround for lack of driver interrupt support. Also quite handy for home gateway, laptop/vagrant, other use-cases not requiring maximum vectors/second for proper operation. Change-Id: Ifc4b98112450664beef67b89ab8a6940a3bf24b5 Signed-off-by: Dave Barach <dave@barachs.net>
2018-06-15STATS: Add more hierarchy to counters.Ole Troan1-1/+1
Put error counters under node_index. /err/<node-name>/<error-name> E.g: /err/ip4-lookup/Hash table collisions /err/ip6-rewrite/Buffer allocation error Error names are not globally unique, and this allows for walking all errors for a particular node. Put interface counters under the directory /if. E.g. /if/rx Put system counters under the directory /sys. E.g. /sys/vector_rate Change-Id: I5b794d16698f61bcb2063a8cd77a7c4ae36419b8 Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-14Use __attribute__((weak)) references where necessaryDave Barach1-4/+17
It should be possible to use vlib without the vlibmemory library, etc. Change-Id: Ic2316b93d7dbb728fb4ff42a3ca8b0d747c9425e Signed-off-by: Dave Barach <dave@barachs.net>
2018-06-13Stat segment / client: show run" works nowDave Barach4-14/+44
Seems to have minimal-to-zero performance consequences. Data appears accurate: result match the debug CLI output. Checked at low rates, 27 MPPS sprayed across two worker threads. Change-Id: I09ede5150b88a91547feeee448a2854997613004 Signed-off-by: Dave Barach <dave@barachs.net>
2018-06-13add end of string for format name in unix_physmem_region_alloclollita liu1-1/+1
Change-Id: I8cb4d5d90fb321de6e5037a3d0440507db79ec75 Signed-off-by: lollita liu <lollita.liu@ericsson.com>
2018-06-13cli: 'restart' should close open files (VPP-1068)Chris Luke1-2/+17
- On 'restart' close all registered files (except stdio) so that the new process has a clean start; in particular, CLI sockets, API sockets, tun/af_packet etc descriptors all need to close so they're not left open but unused by the new VPP process. To do this we iterate all the files registered for the polling mechanism and close() them.[1] - While we're here, retain the original environment on 'restart'; several things make use of it. [1] An alternative mechanism would be to mark all files with CLOEXEC on opening; I think that is a little fragile for this fairly esoteric use case. Change-Id: I81b4e261c4d3c4e2948981231be899824dd4e69f Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-06-10cli: Disable XON/XOFF in the ttyChris Luke1-0/+4
- CLI history forward-search is bound to ^S which is common, but that is also the tty's default control byte to pause output. So we disable XON/XOFF in the tty so that we can use ^S. Change-Id: I61717c77a11733d64eed7f8119677e7cd2e20029 Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-06-10cli: Fix reverse-line-wrap in terminals (VPP-1295)Chris Luke1-86/+195
- Terminals do not reverse-line-wrap when the cursor is at the left edge and \b tries to make it go left. - Instead, we have to track the cursor position if we need to emit \b's and if we are at the left edge emit an ANSI sequence to relocate the cursor. Previously we usually simply calculated the new cursor position after a bunch of output had completed. - Further trickiness is required since most xterm-like terminals also defer moving the cursor to the next line when at the right edge[1], and then if they receive a \b move the cursor back one character too many. - This requires intricate reworking of everywhere that \b is emitted by the CLI code during command line editing. [1] Bash counters this issue by tracking the cursor position as output is generated and forcing the cursor to the next line (by emitting a space followed by \r) if it gets to this phantom cursor position); here we effectively do that but only if the user tries to go left when in this state. Change-Id: I7c1d7c0e24c53111a5810cebb504ccfdac743086 Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-06-10cli: Fix off-by-one in the pagerChris Luke1-2/+2
- The last line in the pager buffer was sometimes missed when using space/pg-dn; simple off-by-one error. Change-Id: Id4e5f7cf0e5db4f719f87b9069d75427bc66d3f7 Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-06-09Fix bug in vlib_buffer_free_from_ring_no_nextDamjan Marion1-1/+1
Change-Id: I332bb4578d1a3c79770985bf1f315d2ed823a3e5 Signed-off-by: Damjan Marion <damarion@cisco.com>