summaryrefslogtreecommitdiffstats
path: root/src/vlib
AgeCommit message (Collapse)AuthorFilesLines
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>
2018-06-08export counters in a memfd segmentDave Barach4-1/+82
also export per-node error counters directory entries implement object types Change-Id: I8ce8e0a754e1be9de895c44ed9be6533b4ecef0f Signed-off-by: Dave Barach <dave@barachs.net>
2018-06-05VPP API: Memory traceOle Troan1-9/+49
if you plan to put a hash into shared memory, the key sum and key equal functions MUST be set to constants such as KEY_FUNC_STRING, KEY_FUNC_MEM, etc. -lvppinfra is PIC, which means that the process which set up the hash won't have the same idea where the key sum and key compare functions live in other processes. Change-Id: Ib3b5963a0d2fb467b91e1f16274df66ac74009e9 Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-03dpdk: improve buffer alloc perfomanceDamjan Marion2-3/+0
This is ~50% improvement in buffer alloc performance. For a 256 buffer allocation, it was ~10 clocks/buffer, now is < 5 clocks. Change-Id: I97590e240a79a42bcab5eb26587fc2d11e6eb163 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-31fix missing void pointer explicit type castZhiyong Yang1-1/+1
Change-Id: I5098e5d966abc44db045783883424b63083f08ee Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2018-05-31Add src/vlib/config.h.in templateDamjan Marion1-0/+21
Change-Id: I9b81dcb9250cab09b88f161366da9475a7ee5dd6 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-29Add VLIB_NODE_FN() macro to simplify multiversioning of node functionsDamjan Marion2-0/+48
Change-Id: Ibab5e27277f618ceb2d543b9d6a1a5f191e7d1db Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-29Fixed vlib_buffer_clone with stale chained buffersYoann Desmouceaux1-2/+7
When calling vlib_buffer_clone() on a source vlib_buffer with no next buffer but whose total_length_not_including_first_buffer hadn't been properly zeroed out, the total_length_not_including_first_buffer of the clone was set to a wrong value. (see https://lists.fd.io/g/vpp-dev/topic/19869395) Change-Id: I4b503ece804e3933bb259be4c2148f84dafbea3e Signed-off-by: Yoann Desmouceaux <ydesmouc@cisco.com>
2018-05-19log: Validate the size of vec in vlib_logMohsin Kazmi1-0/+1
Change-Id: I6d1218c17ee055275596b9a49767f15994aa1b2b Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-05-19Disable vector code in vlib_buffer_enqueue_to_next if no msb mask functionDamjan Marion1-1/+1
This fixes ARM64 build where we dont have defined u16x8_msb_mask(...) Change-Id: I864f5134a0d951601810c800f587d173b3b7ef41 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-18Add vlib_buffer_enqueue_to_next inline functionDamjan Marion1-0/+115
Change-Id: I1042c0fe179b57a00ce99c8d62cb1bdbe24d9184 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-18session: add session process nodeFlorin Coras1-1/+3
Add a session process node that handles main thread tx and retransmit in order to avoid having a polling input node. Change-Id: I3357e987c023a84b533b32793e37ab4204420f64 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-05-17Add buffer pointer-to-index and index-to-pointer array functionsDamjan Marion1-0/+143
Change-Id: Ib3fcc3ceb7f315389bcdecbb7d9632540a5dd6ba Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-17vlib: Fix WARN-ING macro in functionMohsin Kazmi1-1/+1
Change-Id: I238106c2afc46904fb0eb17164f30dbd1378892e Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-05-04Harmonize vec/pool_get_aligned object sizes and alignment requestsDave Barach1-0/+1
Object sizes must evenly divide alignment requests, or vice versa. Otherwise, only the first object will be aligned as requested. Three choices: add CLIB_CACHE_LINE_ALIGN_MARK(align_me) at the end of structures, manually pad to an even divisor or multiple of the alignment request, or use plain vectors/pools. static assert for enforcement. Change-Id: I41aa6ff1a58267301d32aaf4b9cd24678ac1c147 Signed-off-by: Dave Barach <dbarach@cisco.com>
2018-04-27A bit of buffer metadata reshuffling to accommodate flow_idDamjan Marion2-19/+12
Change-Id: I2794384557c6272fe217269b14a9db09eda19220 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-26vlib: set log tap level <level> does not work for some keywordsSteven1-2/+2
While some levels such as debug and emerg work, others don't. See below. DBGvpp# set log class tap level warn set log class tap level warn set logging class: unknown input `level warn' DBGvpp# set log class tap level debug set log class tap level debug DBGvpp# set log class tap level info set log class tap level info set logging class: unknown input `level info' DBGvpp# set log class tap level err set log class tap level err DBGvpp# set log class tap level crit set log class tap level crit set logging class: unknown input `level crit' DBGvpp# set log class tap level emerg set log class tap level emerg DBGvpp# Cause: The reason for the failure for the shorter keywords is level_str is unformatted with %v which is not null terminated. For example, the character after "info" could be anything in level_str. The memcmp with size of the macro keyword __##uc which includes the null character or 5 in this case and thus the comparison fails. Fix: Use %s which insure level_str is null terminated. Use strcmp to rule out false positve match like "debugxxx" against keyword "debug". Change-Id: I7a2d97a0f7f618df105da7eca791618dce04d21e Signed-off-by: Steven <sluong@cisco.com>
2018-04-18vlib: logging improvementsDamjan Marion2-32/+74
Change-Id: I1c72d9ddefdc83c7d5ab2564f89d83ffd3fa6110 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-17Add logging supportDamjan Marion3-0/+737
Change-Id: Ieac9cf50156dbbb4962411e900d59256441915ef Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-04-12Fixes for 'make UNATTENDED=yes CC=clang CXX=clang verify'Neale Ranns1-1/+2
Change-Id: I994649761fe2e66e12ae0e49a84fb1d0a966ddfb Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-04-09features: don't break linked list, create separate one for arcDamjan Marion1-9/+11
We need to keep original linked list so destructire can remove entries. Change-Id: I5ff5ca0e1a417d88707255207725bba46433c943 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-09plugins: unload plugin if early init failsDamjan Marion8-2/+111
Change-Id: I32f68e2ee8f5d32962acdefb0193583f71d342b3 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-04memif: zero copy slaveDamjan Marion1-0/+24
Change-Id: I65306fb1f8e39221dd1d8c00737a7fb1c0129ba8 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-29Coverity fixes (VPP-1204)Chris Luke1-1/+2
Minor bug fixes CID 183000: double close CID 180996: dead code CID 180995: NULL deref CID 181957: NULL deref CID 182676: NULL deref CID 182675: NULL deref Change-Id: Id35e391c95fafb8cd771984ee8a1a6e597056d37 Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-03-27vlib: gcc-7 -O3 uninitialized valuesDamjan Marion1-5/+5
Change-Id: I59b4142daab439d60a1ebd48b2c1366df0160288 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-27vlib: make cloned structures cacheline alignedDamjan Marion2-13/+24
This address crash with gcc-7 observed when -o3 is used. Change-Id: I10e87da8e5037ad480eba7fb0aaa9a657d3bf48d Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-26vlib: add support for vfio no-iommu modeDamjan Marion4-33/+51
Change-Id: Ic83971d8d9d8d0bb90a35932e60761cd728457f3 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-26plugin: Add plugin 'default' disable/enableMohsin Kazmi2-0/+11
How to use: plugins { plugin default {disable} plugin dpdk_plugin.so {enable} plugin acl_plugin.so {enable} } It also preserves the old behavior. Change-Id: I9901c56d82ec4410e69c917992b78052aa6a99e0 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-03-16cli: make q work againFlorin Coras1-0/+8
After the addition of "qos" cli, "quit" command is not the only match for "q". Therefore, add a separate "q" cli to avoid ambiguity. Change-Id: I84f6ddce14ef7d5fa7089537cb62adfecea0e501 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-16Fix a long-latent bi=0 bug in vlib_buffer_add_dataDave Barach2-2/+2
Change vlib_buffer_add_data() so it interprets ~0 to mean please allocate a new buffer, instead of 0. Fixed a couple of calls to pass ~0 instead of 0. Zero has always been a valid buffer index, we never happened to actually use it until recent buffer allocator changes. The presenting symptom: ASSERT failure when running "make TEST=test_mpls test-debug" Change-Id: Ic909913c1d464b3434d6d47e0c58f978806854d5 Signed-off-by: Dave Barach <dave@barachs.net>
2018-03-14vlib: internal buffer manager reworkDamjan Marion6-251/+170
- buffer_main is no longer part of vlib_main_t - pool of free lists is still part of vlib_main_t - mheap is not used anymore for buffer allocation - simple bitmap bassed buffer alloc scheme is introduced Change-Id: I3e1e6d00e2c8122293ed0a741245eb841315a1ff Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-13Rationalize plugin symbol error reportingDave Barach1-1/+1
Change-Id: I64f2b2007f30fc1c6bd2990ba0d7ccbcd43cdb38 Signed-off-by: Dave Barach <dave@barachs.net>
2018-03-09Correct address calculation for VPP-1168Lee Roberts1-1/+1
Use (u64) cast to ensure proper address calculations. Change-Id: I6bad50010b140189f1b0af177e55da0045bd7a93 Signed-off-by: Lee Roberts <lee.roberts@hpe.com>
2018-03-09dpdk: move DPDK vfio hack to dpdk pluginDamjan Marion3-48/+3
Change-Id: I806cbf8c6c49643fe6c317bcceab93c1b9d441ab Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-07fix physmem mappingsDamjan Marion1-0/+2
Change-Id: Ie0763e20c36a29a8ef866511903c85027dd133c3 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-06vlib: avoid crash if fill_free_list returns 0 buffersDamjan Marion1-1/+2
Change-Id: If1284696e10df71b4029191b5e3adb32c21c0c5f Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-05physmem: keep only one physmem_mainDamjan Marion6-9/+10
We don't need per vlib_main physmem_main, so keep it separatelly instead of trying to keep them in sync. Change-Id: I0fbeecf4d9672d31af7a43c640a7d8f05dd6e46f Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-05vlib: add functions to dynamically open/close PCI deviceDamjan Marion2-3/+126
Old code was only allowing PCIdevices to be scanned during startup, now driver can open and close device without restart of vpp. Change-Id: I1a06511e3f16f896101b43dac2bad420b6e6c35e Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-05vlib: vlib_buffer_free_internal optimizationsDamjan Marion1-53/+88
Change-Id: Ia819b630b824002c59680836a8833df7e5af90e9 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-05vlib: vfio code reworkDamjan Marion8-221/+406
Change-Id: I99cf3e7cc991aa7d32385a155c707a6516516117 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-05vlib: rework PCI INTx supportDamjan Marion2-96/+75
Change-Id: I6df5a01416993c213e06645a6d9b48dfe77c8227 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-04vlib: add PCI MSI-X interrupt support (vfio only)Damjan Marion2-6/+197
Change-Id: Iae2ddf93d1705354175e3dcae26b66e6f98a5c32 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-04vlib: map pci region by using vfio FD when vfio is usedDamjan Marion2-46/+88
Change-Id: Ib94e9e9e9fcdad9cdb0e3402b3de7d78bd644abe Signed-off-by: Damjan Marion <damarion@cisco.com>