aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib
AgeCommit message (Collapse)AuthorFilesLines
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>
2019-01-23buffers: wrap vlib_buffer_t to union and expose vector typesDamjan Marion3-79/+98
Change-Id: I1c12e2941cae198ededbb65eb5be51a4eabe2c1b Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-20buffers: remove VLIB_BUFFER_DEFAULT_FREE_LIST macro and fl->n_data_bytesDamjan Marion5-61/+17
Change-Id: I0ba5175be077c40556f2a3ce629c5bbcd71e0a81 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-20buffers: remove vlib_buffer_delete_free_listDamjan Marion3-62/+0
Change-Id: I5fe01e918b534d1ac1d47f0d7610536f45c3158c Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-20buffers: don't init metadata, as it is already initializedDamjan Marion2-39/+1
Change-Id: Ia083050389853c25b069f0f8286d50d3f4aef527 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-20buffers: keep buffer_main in vlib_main_tDamjan Marion6-42/+45
Change-Id: I3bb1d9f83dd08f4b93acd4a281bfec0674e39c2e Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-20Store numa-noda and cpu-index in vlib_main_tDamjan Marion3-1/+8
Change-Id: If88ccd965122b9318a39a8d71b53334cd1fd81e4 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-20log: bug fix register class compare mismatchSu Wang1-1/+3
1. Otherwise, the log classes with same prefix, e.g. "abc" and "abc-de" will all be registered into log class "abc"; 2. Minor improvement for test log help string. Change-Id: I8d93be5e8fa67db6012198b3442a9e2bddcb744a Signed-off-by: Su Wang <su.z.wang@ericsson.com>
2019-01-18Fix GCC 8 compiler warnings on strncpy's truncated copy on debian distroSteven Luong1-2/+2
For some reason, GCC 8 in debian is pickier than GCC 8 in ubuntu. It complains about things in strncpy like this /home/sluong/vpp/src/vlib/linux/pci.c:485:7: error: ‘strncpy’ output may be truncated copying 15 bytes from a string of length 255 [-Werror=stringop-truncation] strncpy (ifr.ifr_name, e->d_name, sizeof (ifr.ifr_name) - 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/sluong/vpp/src/vlib/linux/pci.c: At top level: It also complains similar things in string_test.c The fix in pci.c is to convert strncpy to use clib_strncpy The fix in string_test.c is condiational compile the complained code for GCC 8. Change-Id: Ic9341ca54ed7407210502197a28283bc42c26662 Signed-off-by: Steven Luong <sluong@cisco.com>
2019-01-19buffers: remove free-list information from buffer metadataDamjan Marion4-70/+19
Change-Id: I6048c6a51efa826ac333f7d15919cb87dd766d74 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-18buffers: remove freelist argument from vlib_buffer_add_dataDamjan Marion2-12/+7
Change-Id: Idb224b807373128b78dc46f177b2d2e0ed288349 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-18Add vlib_buffer_copy_indices inline functionDamjan Marion2-8/+14
This reverts commit 1e59f9ddbdda14591967e1d66eab8623f9ba58e4. Change-Id: Iae1d372b887e170d28cac2fe4c61325ee5a5894a Signed-off-by: Damjan Marion <damarion@cisco.com>