summaryrefslogtreecommitdiffstats
path: root/src/vlib
AgeCommit message (Collapse)AuthorFilesLines
2019-04-03pci: Fix the crash on deleting the pci deviceMohsin Kazmi1-2/+5
clib_file_index is 0 if it is not initialized result in following assertion on deleteing the pci device. vpp/src/vppinfra/file.h:122 (clib_file_del_by_index) assertion `! pool_is_free (um->file_pool, _e)' fails This patch fixes the issue by initializing the clib_file_index to -1. Change-Id: I51d23f18e7ccf3143a4765d05aafc1363a007737 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-04-02stat-segment: scaling improvementNeale Ranns1-8/+8
don't walk the entire list of entries each time a new one is added approximate/indicative numbers recorded on a VM: after: 50000 tunnels in 1.124443 secs, 44466.45 tunnels/sec before: 50000 tunnels in 5.202779 secs, 9610.25 tunnels/sec Change-Id: Ie1155416be76f55f2a0a88360ce53e15aeace785 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-04-01Enhance vlib_buffer_clone to change headroom space for packetJohn Lo1-7/+66
Add function vlib_buffer_clone_at_offset() so that the cloned packets' 1st buffer will have the original packet header copied at the specified offset (instead of current_data). This can be used to increase headroom in the cloned packet to allow large header encaps in case the stdandard 128B predata is not enough. The original vlib_buffer_clone() still works the same as before. Change-Id: I3b50c8ad7e3952568bc141710567c99a3dacddce Signed-off-by: John Lo <loj@cisco.com>
2019-03-28Punt InfraNeale Ranns6-2/+1063
A punt/exception path that provides: 1) clients that use the infra 2) clients can create punt reasons 3) clients can register to recieve packets that are punted for a given reason to be sent to the desired node. 4) nodes which punt packets fill in the {reason,protocol} of the buffere (in the meta-data) and send to the new node "punt-dispatch" 5) punt-dispatch sends packets to the registered nodes or drops Change-Id: Ia4f144337f1387cbe585b4f375d0842aefffcde5 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-28Typos. A bunch of typos I've been collecting.Paul Vinciguerra3-6/+6
Change-Id: I53ab8d17914e6563110354e4052109ac02bf8f3b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-26node: vector must be checked with vec_headerKingwel Xie1-1/+1
see register_node, node-name might be a vector Change-Id: I883ec51c1fa9aa4da4ba6cba415a39bb6a4331e1 Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2019-03-21Ignore SIGTERM during the vpp boot sequenceDave Barach2-12/+17
Call setjmp and mark the setjmp context valid just prior to entering the vpp main loop. Change-Id: I26d5cd6a624cb2a497d81eb85a62365621b3b469 Signed-off-by: Dave Barach <dave@barachs.net>
2019-03-20Re-enable aarch64 neon instruction in vlib_buffer_free_inlineLijian.Zhang1-3/+3
int vaddvq_u8 (uint8x16_t __a) is not appropriate to implement xxx_is_all_zero, as there may be overflow causing incorrect return value. Here's an example. u8x16 x = {0 <repeats 12 times>, 1, 255, 0, 0}; Change-Id: Ia6a10bdf8da360dec12db902d028751a1a77e9a4 Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com> Reviewed-by: Sirshak Das <Sirshak.Das@arm.com>
2019-03-13VPP-1576: fix a set of coverity warningsDave Barach1-1/+4
Change-Id: Ifd34aed8692d5acaa370d4976d974ac573e43705 Signed-off-by: Dave Barach <dave@barachs.net>
2019-03-13buffers: don't use clib_memcpy for copying buffer indicesDamjan Marion1-1/+37
Should be faster this way if n_indices is not constant value Change-Id: I6c34fd313daa2392199f3b9bd20d0cd6cf9ae21b Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-03-13Move the punt/drop nodes into vlibNeale Ranns2-0/+287
The core VLIB library now has a means to dispoe of buffers. the vlib punt/drop node counts node errors. the vnet punt/drop node counts interface errors. speed up both nodes with the usual reciepe. before: error-drop 8.33e1 after: drop 4.51e1 error-drop 6.81e0 Change-Id: If2e919458a3f2e9d71dbf9c6f1352dafb186a05b Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-13buffers: fix ref_count mask in vlib_buffer_free_inlineDamjan Marion1-1/+1
Credits to: Lollita Liu <lollita.liu@ericsson.com> Change-Id: I40f7ad9cc5220db7ac4571cb14feaf22fc02aa2e Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-03-13deprecate VLIB_NODE_FUNCTION_MULTIARCHFilip Tehlar1-4/+0
Change-Id: I403173846bc5b1bbbe2a2c41225b0f666f851cb9 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-13vmbus: not having uio_hv_generic is not an errorStephen Hemminger1-7/+20
If uio_hv_generic is not loaded, then the startup code will fallback to the older failsafe/tap method of initialization in DPDK. Therefore don't put out scary message in the log. Also, reorder startup to avoid manipulating lower device until/unless uio is going to work. Change-Id: Ie1cc77b4b5359c04f00a93d01a772eccf3bbab37 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2019-03-12Perf tune handoff queue pollingDave Barach3-3/+25
Change-Id: I5cfa0f6eee67156bf87907fcf8a39f16d68a0905 Signed-off-by: Dave Barach <dave@barachs.net>
2019-03-12ICMP46 error: Clone first buffer instead of "truncating" original bufferOle Troan1-0/+21
Previous code was walked buffer chain, effectively trying to "truncate" the chain, reset the length of first buffer and reused that as the ICMP error message. That could have issues in cases there were other users of the buffer chain. Update to clone the first buffer in chain, and use that for the ICMP error message instead. Change-Id: Ibc1a0bf2d854dae41874808c8297028ed93dd69d Signed-off-by: Ole Troan <ot@cisco.com>
2019-03-10Perf tune get_frame_size_infoDave Barach3-3/+14
It turns out that for scalar sizes 0..24, frames are always the same size. That range includes all current use-cases - and then some - so get rid of the hash table. Old code preserved under #ifdef VLIB_SUPPORTS_ARBITRARY_SCALAR_SIZES. Change-Id: Ic005c7143c9639f77d1a0fadd2fc0e90dccb68c1 Signed-off-by: Dave Barach <dbarach@cisco.com>
2019-03-06vmbus: fix bug that breaks multiple netvsc vdevsMatthew Smith1-2/+2
VPP supports two DPDK drivers for managing netvsc devices on Azure/Hyper-V. The new netvsc PMD looks a lot like other PCI-based PMDs but it requires recently added kernel support (>=4.17). The older vdev_netvsc is an abstraction that manages the mlx4 VF and tap device underlying the netvsc interface using the failsafe PMD. Distros with older kernels (e.g. RHEL/CentOS 7.x) have to use vdev_netvsc. At startup, netvsc devices are processed and an attempt is made to initialize them for management by the netvsc PMD. If that fails, then vlib_vmbus_bind_to_uio() returns early and the device can be initialized for management by vdev_netvsc. The operation that is supposed to fail if the netvsc PMD cannot be used is registration of the netvsc device type ID with the uio_hv_generic driver. This operation is attempted exactly once so it does not fail for netvsc devices processed after the first one and they end up in a state where they cannot be initialized for use by vdev_netvsc. Only unset uio_new_id_needed if uio_hv_generic registration succeeds. Change-Id: I6be925d422b87ed24e0f4611304cc3a6b07a34fd Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2019-03-06vlib: coverity woesSteven Luong1-2/+1
Remove logically dead code to keep coverity from complaining Change-Id: If27d6684d19ab3c8886732a67922c86e5f0b3554 Signed-off-by: Steven Luong <sluong@cisco.com>
2019-03-04buffers: support cases where numa node memory is not availableDamjan Marion3-40/+82
Change-Id: I550ef893e41d86310d4e5af16d6100b8e557b68a Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-03-04stats: fix crash on early initFilip Tehlar1-4/+18
Change-Id: I911b5070f544c3556ad1ca584d42689c00cc38f3 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-01Save signum and faulting address in static variablesDave Barach1-0/+6
Comes in handy when looking at core files from optimized images. Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I45c8400d15614d5a04a3dcfb9b7daccab47ab446
2019-02-27VPP-1576: fix Coverity issuesDave Barach1-27/+17
Change-Id: I8b59b2e1c0525abf4b0492e50a7af57df4cd3ce2 Signed-off-by: Dave Barach <dave@barachs.net>
2019-02-27Fix crash in barrier sync when vlib_worker_threads is zeroDamjan Marion2-3/+5
Change-Id: I6819dd9dbfc15c17740bdb98b51bdd639ef8c4d2 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-26stats: buffer gauge callbacks use index instead of name.Ole Troan1-26/+20
Change-Id: I500b8e72d7e021b9564dad0ffc087cb0e1ceb96f Signed-off-by: Ole Troan <ot@cisco.com>
2019-02-26Move pcap rx/tx trace code out of the dpdk pluginDave Barach1-0/+16
Moved code to the ethernet input node, and the interface output path(s). Since we no longer skip ethernet-input, there's no reason for device drivers to know anything about pcap rx tracing, etc. Change-Id: I08d32fb1b90cbee1bd4f609837d533e047b36fa4 Signed-off-by: Dave Barach <dave@barachs.net>
2019-02-25buffer chain linearizationKlement Sekera2-97/+125
Rewrite vlib_buffer_chain_linearize function so that it works as intended. Linearize buffer chains coming out of reassembly to work around some dpdk-tx issues. Note that this is not a complete workaround as a sufficiently large packet will still cause the resulting chain to be too long. Drop features from reassembly code which relies on knowing which and how many buffers were freed during linearization, buffer counts and tracing capabilities for these cases. Change-Id: Ic65de53ecb5c78cd96b178033f6a576ab4060ed1 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-02-22stats: add buffer gaugesFilip Tehlar2-4/+90
Change-Id: I7f7a459f25d64ea5fa36e30d7dccc667bc19c5a9 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-02-22Add no-append flag to vlib_frame_tDamjan Marion3-4/+15
Change-Id: I01c4f5755d579282773ac227b0bc24f8ddbb2bd1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-21physmem: keep physmem VA in 39-bit address space on x86_64Damjan Marion2-1/+34
Some x86 CPUs have IOMMU capable dealing only with 39-bit address space This patch also adds option to specify physmem base address from startup.conf Change-Id: I9e8abd26efb60e9c4ad54c035fb1751a4a61f4dc Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-20calculate per-thread time offsetDave Barach3-1/+66
The main thread squirrels away vlib_time_now (&vlib_global_main), worker threads use it to calculate an offset in f64 seconds from their own vlib_time_now(vm) value. We use that offset until the next barrier sync. Thanks to Damjan for the suggestion. Change-Id: If56cdfe68e5ad8ac3b0d0fc885dc3ba556cd1215 Signed-off-by: Dave Barach <dave@barachs.net>
2019-02-14buffer: bug fix vlib_buffer_free_inlineLollita Liu1-6/+7
buffer_pool_index, in case of buffer_pool_index change, should free buffers in queue before setting buffer_pool_index again Change-Id: I846ead947a7b2d940c8fc747976239d608597391 Signed-off-by: Lollita Liu <lollita.liu@ericsson.com>
2019-02-09buffers: fix typoDamjan Marion3-13/+15
Change-Id: I4e836244409c98739a13092ee252542a2c5fe259 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-06buffers: make buffer data size configurable from startup configDamjan Marion4-29/+43
Example: buffers { default data-size 1536 } Change-Id: I5b4436850ca18025c9fdcfc7ed648c2c2732d660 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-06buffers: improve buffer init performanceDamjan Marion1-17/+14
Change-Id: Ib59a3c32af754a898ade17c42e60a88f48b797ff Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-02CLI control of graph dispatch elogsDave Barach3-126/+214
Change-Id: I195c8eabc0ee67880f1e85fc7594b00be6b563e3 Signed-off-by: Dave Barach <dave@barachs.net>
2019-02-02Deprecate old mutliarch code, phase 1Damjan Marion1-24/+2
It is causing compilation sloness with gcc-7 so removing it before it was originally planned. So far macros are left in the tree so we can know which nodes to convert to new multiarch code. Change-Id: Idb14622ca61fdce1eba59723b20d98715b7971e6 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-31buffers: vallidate that buffer is allocated during buffer pool putDamjan Marion1-8/+5
Change-Id: I8044b34a37fe1994a8dfa1ca89929f3642c72e8d Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-31Add 'show vlib graphviz' commandBenoît Ganne4-16/+108
Add a new command to dump vlib graph as graphviz/dot file Change-Id: I43fc072cff8153ac500e5fbc6641a3705c2e995e Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-01-31assert on double-free in debug buildKlement Sekera1-4/+2
The assert allows easier debugging in gdb by aborting instead of exiting cleanly. Also a core is generated so a stack trace can be obtained. Change-Id: I2d05488c4522f4d4570fdfe0283130eb4c853d2a Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-01-31pci: get the number of interruptsMohsin Kazmi2-0/+21
Change-Id: I2cfb81b3c8809d027a3ee5f5f570668e60be08ef Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-01-31buffers: reinitialize metadata, add additional validationDamjan Marion2-13/+44
- DPDK overwrites metadata as part of rte_pktmbuf_init(...) so we need reinitialize it - additional checks added to ensure ref_count is never < 1 Change-Id: Ida336f81c4723e8f2e0ad4a70cb7b1ecfff978a0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-30buffers: major cleanup and improvementsDamjan Marion8-683/+591
This patch introduces following changes: - deprecated free lists which are not used and not compatible with external buffer managers (i.e. DPDK) - introduces native support for per-numa buffer pools - significantly improves performance of buffer alloc and free Change-Id: I4a8e723ae47056717afd6cac0efe87cb731b5be7 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-29Fix error while compiling using 'vlib/vlib.h' dependencie.Dmitry Vakhrushev1-0/+2
This variable without any needed 'define' becoming unused. Change-Id: I661a75a78dba03abb861ed918ad1e634a8ecd0af Signed-off-by: Dmitry Vakhrushev <dmitry@netgate.com>
2019-01-28Less intrusive way to capture numa_node and cpu_id changesDamjan Marion4-11/+13
Change-Id: I3a33fb81f31ed473811e9e7a6197b81135913865 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-27Fix issue with cpu_id and numa_code captured too earlyDamjan Marion4-5/+9
Change-Id: I79b213b34c6071d14acf1922f89037a4a5a36c45 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-27perfmon: collect data on selected thread(s)Dave Barach2-9/+43
Add missing pre-input node runtime fork and refork code. unix-epoll-input runs on all threads; each instance needs its own runtime stats. Change-Id: I16b02e42d0c95f863161176c4bb9f9917bef809d Signed-off-by: Dave Barach <dave@barachs.net>
2019-01-24move misc-drop-errors to vnetDave Barach1-31/+0
thanks, Eliot... Change-Id: I8d8fee09bf1fe24933e6ef4e126dba8e22fe62b1 Signed-off-by: Dave Barach <dave@barachs.net>
2019-01-24perfmon plugin: 2-way parallel stat collectionDave Barach4-58/+54
As a FUD reduction measure, this patch implements 2-way parallel counter collection. Synthetic stat component counter pairs run at the same time. Running two counters (of any kind) at the same time naturally reduces the aggregate time required by an approximate factor-of-2, depending on whether an even or odd number of stats have been requested. I don't completely buy the argument that computing synthetic stats such as instructions-per-clock will be inaccurate if component counter values are collected sequentially. Given uniform traffic pattern, it must make no difference. As the collection interval increases, the difference between serial and parallel component counter collection will approach zero, see also the Central Limit theorem. Change-Id: I36ebdcf125e8882cca8a1929ec58f17fba1ad8f1 Signed-off-by: Dave Barach <dave@barachs.net>
2019-01-24buffers: fix vector typesDamjan Marion2-3/+5
Change-Id: I9df96264e30806ac3daf7121f314f34f06232413 Signed-off-by: Damjan Marion <damjan.marion@gmail.com>