aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib
AgeCommit message (Collapse)AuthorFilesLines
2020-08-18pci: fix non NULL-terminated vector used as C string overflowBenoît Ganne1-4/+5
Type: fix Change-Id: Iab512ba8c72c9e20aeba2d4265276bcabf095d46 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit e3a24300d08f04146935ec0d3b02e03276d6cc68)
2020-08-18buffers: fix non-default sized buffers initializationBenoît Ganne1-5/+21
Type: fix Change-Id: I4a93e1d9936414c514cb237a22624986b3ef5b3d Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit c16fe4689055242c64c71d83e41908a8fb6c2726)
2020-08-18vlib: node recyling and node deletion missing triggering graph node syncSteven Luong1-27/+1
When recycling a graph node vnet_register_interface, it is missing an explicit call to vlib_worker_thread_node_runtime_update(). However, there is an implicit call to vlib_worker_thread_node_runtime_update() via vnet_sw_interface_set_flags_helper() if it enables a new feature on the interface for the first time. But that implicit call is not guaranteed. For example, if an interface is created, deleted, and created, then it may skip the implicit call to vlib_worker_thread_node_runtime_update(). When that happens, the graph nodes on thread 0 are not sync'ed to the worker threads. So the worker thread's graph nodes are out of sync momentarily with the main thread's graph nodes until some other event happens which calls for a sync is needed. During this window, the worker thread's graph node is vulnerable and may experience a crash. When deleting a graph node, we never trigger a sync to the worker thread. A patch was committed 3 years ago via https://gerrit.fd.io/r/c/vpp/+/7523 to fix a show run crash. In hindsight, the approach taken by 7523 is not orthogonal. While at it, let's fix it right for both issues with a call to vlib_worker_thread_node_runtime_update() in the appropriate place and remove 7523. Type: fix Ticket: VPPSUPP-86 Fixes: gerrit 7523 / 19e9d954bd9eb4f04d48640d6540198e84ef65d7 Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ic9472bd2d3a212dbfeceb526506ed0400983a142 (cherry picked from commit 1eae8ecb7acc7d80d5c08e300295bec94bf78f0b)
2020-08-18fib: add barrier sync, pool/vector expand casesDave Barach2-0/+41
load_balance_alloc_i(...) is not thread safe when the load_balance_pool or combined counter vectors expand. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I7f295ed77350d1df0434d5ff461eedafe79131de (cherry picked from commit 8341f76fd1cd4351961cd8161cfed2814fc55103)
2020-08-18vlib: restore commands for non-interactive sessionsBenoît Ganne1-8/+13
'quit' and 'show terminal' are valid for non-interactive sessions too. Type: fix Fixes: a58be82dda89d6496f92e451b42eee31f0cf47b4 Change-Id: Ib63244c7b64ad2e30c257ed19e982295f59bfffa Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 10a22a629468b18f5b07316980e2761285283939)
2020-08-18vlib: fix unix cli commands crash without sessionBenoît Ganne1-15/+23
If a cli command is run while there are no cli session, then cm->cli_file_pool will not be initialized and we should not try to operate on it. Type: fix Change-Id: Iaea15a23f7efd5b17fab13e6c1cbb3a9a34080e0 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit a58be82dda89d6496f92e451b42eee31f0cf47b4)
2020-08-18vlib: fix u64 error counter cli printingFlorin Coras1-3/+3
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie35dc623394cfb6c358740361fd85aa0924ab187 (cherry picked from commit 1ae16c8f3bebe33b2404ad845a2f09f910a06390)
2020-08-18misc: fix coverity warningsDave Barach1-1/+1
Type: fix Ticket: VPP-1837 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I51660e4b02f449bd2db12a8cfd395c6c343d2dee (cherry picked from commit c72950e811880c22e5b350c4b1cb5e31b0735b4d)
2020-08-18vlib: use flexible array in vlib_buffer for GCC-10Benoît Ganne1-1/+1
GCC-10 increase overflows-related warnings but gets confused by 0-length arrays. Use C99 flexible length array instead. Type: fix Change-Id: Ie62cfa8faaa408479a598785fd3f06ffd0233c7a Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 049d0b438ef2971181549f195c7e0338cd1c60f4)
2020-08-18stats: add apis to delete simple/combined countersOle Troan3-0/+36
vlib_free_simple_counter() vlib_free_combined_counter() Frees the name and two dimensional vector from the stats segment. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: If1becf7d09520ba41a3d59e2df94958ecfcf6948 (cherry picked from commit a568a19b2956ed8b94b11c2ef041412473dc8442)
2020-08-13vlib: queue_hi_thresh fix to avoid deadlockElias Rudberg1-2/+4
Adapt queue_hi_thresh value using num_threads to avoid risk of deadlock between threads which could happen for example when different NAT threads try to handoff work to each other at the same time when their frame queues are congested. This change ensures that each thread can reserve a queue entry without causing problems even in the most extreme case when all threads attempt to add to the same queue simultaneously when the queue is nearly full. Type: fix Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net> Change-Id: I9e02f753bd00833d8dd500d181b0d4f9a454d703 (cherry picked from commit 368104d06ad6d667a8cce152426916fc654b6627)
2020-08-13misc: fix error handling in punt_replicateDave Barach1-2/+7
If vlib_buffer_clone (...) fails due to a buffer allocation error, update *n_dispatched with the actual number of clones, not the requested number of clones. Punt_replicate(...) should not set *to_next[0] = bi0. The original buffer is enqueued separately in punt_dispatch_node(...) Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I774ad8f8c1a0633de4cf8ae5530629201c229347 (cherry picked from commit 1adc7e78ad3eb7e800d0ce3ace56f53ab7aebffe)
2020-08-13vlib: complain if workers are configured twiceVladimir Isaev1-1/+10
Right now following configuration leads to crash: cpu { corelist-workers 2 workers 2 } because threads count will be set to 2, but we have only one core in coremask. Type: fix Signed-off-by: Vladimir Isaev <visaev@netgate.com> Change-Id: Ia93b892733971e7c8ddfceaaec5f4eb8bf9063ac (cherry picked from commit 18a4a371646bccfd299e6a509e801a524aeb4c92)
2020-08-13vlib: fix error when creating avf interface on SMP systemJieqiang Wang1-1/+13
On SMP architecture, '/sys/bus/pci/devices/<devices id>/numa_node' file will return -1 as a valid value if it does not have any NUMA node information. Using -1 as a valid node id to access data structures will cause memory issue. Fix the error by setting the value of numa_node to 0 if '/sys/bus/pci/devices/ <devices id>/numa_node' returns -1 and it is a SMP system. Type: fix Change-Id: Ib60e79c3656fe5b17e08fd9011122683e8b08b6f Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com> (cherry picked from commit 76c6159d83c2dfe29f84dc4b05d399cdbbdf2878)
2020-08-12vlib: Skip core 0 if workers are configured.Jon Loeliger1-0/+15
According to the description in the startup.conf, the assignment of worker threads starts with the lcore following the main_lcore. A non-zero skip_cores will correctly achieve this assignment. However, prior to this patch when workers are assigned, the code picks up and assigns core 0 even thought it shouldn't. This patch determins if a non-zero number of workers are desired and if so, marks CPU unavailable for a worker assignment. Type: fix Change-Id: I1fdf73a6f218dcbf146fda2efc90c553f7cd6d20 Signed-off-by: Jon Loeliger <jdl@netgate.com> (cherry picked from commit 4a06846dd668d7f687e6770215c38e8feb5f1740)
2020-08-12vlib: fix coverity warning / real bugDave Barach1-1/+1
The path must be next-to-impossible to hit, because the code has been wrong for at least 5 years. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I23b8c4e1631827e7931f353c561c1e19c596c598 (cherry picked from commit 5c944eef7012e7c5b363399ed92966fb659196b7)
2020-08-12misc: don't os_exit(1) causing core on SIGINTChristian E. Hopps1-1/+5
It's not typical for a program to core when it receives a SIGINT, so keep this from happening. Type: fix Signed-off-by: Christian E. Hopps <chopps@chopps.org> Change-Id: I2c15985a57e6ea898ff05c4001e4b30b41154eba (cherry picked from commit 10a8bda37eed33ada1e7c6ece7bda1fe066ba541)
2020-08-12vlib: fix startup-config-process stack overflowGordonNoonan1-0/+1
Type: fix Startup config setting an i40e/ice interface up in Debug VPP consumes more than the currently available stack space. Signed-off-by: GordonNoonan <gordon.noonan@intel.com> Change-Id: I98b52c5596799017b97f802a8661b76cd1bb3245 (cherry picked from commit b2dbb36fc265b8996fc7fa310dda447d5b0479cb)
2020-08-12vlib: fix an issue with show pciVratko Polak1-1/+1
The fix has been received over e-mail from Lijian Zhang. https://lists.fd.io/g/vpp-dev/message/14808 Type: fix Ticket: VPP-1805 Change-Id: I73e5fe7dcbe2b0b1c639d844f29183eab3b6dd66 Signed-off-by: Vratko Polak <vrpolak@cisco.com> (cherry picked from commit dea0b23fa73fe3d53b8f3b004f7b8a2a8456d7f7)
2020-08-12vlib: fix vector-as-C-string overflowBenoît Ganne2-3/+3
Type: fix Change-Id: If0419ff1a82d45e5b3326973008e1b9feb290c5a Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 62d9fda8e474f87459c6e24d13b09f7bfec146f3)
2020-06-12fib: IPv6 lookup data structure MP safe when prefixes change (VPP-1881)Neale Ranns3-1/+53
Type: fix adding routes should be MP safe. When new prefixes with differrent prefix lengths are added, adjust the sorted list in an MP safe way. Change-Id: Ib73a3c84d01eb86d17f8e79ea2bd2505dd9afb3d Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit aecb10b97fa97b215c415ceaa3cac4c97204922f)
2020-04-29vlib: add ASSERT to vlib_time_now(...)Dave Barach1-0/+7
Calling vlib_time_now (&vlib_global_main) from a worker thread is a bad mistake. ASSERT (vm->thread_index == __os_thread_index) will catch it. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I55af6de84e06143f8f43adc62103b77267a7a441 (cherry picked from commit 77d98382824ca211fb55fcf842931930ccfb3baa)
2020-04-13l2: handle complete clone fail in l2_floodDave Barach1-2/+2
vlib_buffer_clone(...) may not manage to produce any buffer clones at all. vlib_buffer_clone_256 should not smash the original buffer reference count if no clones are produced. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I14d9d53637a220485c7a0036cfc75a4149b264ea (cherry picked from commit 95e19253320ab07748787f4c8a7620704563f6b8)
2020-02-12classify: vpp packet tracer supportDave Barach3-1/+58
Configure n-tuple classifier filters which apply to the vpp packet tracer. Update the documentation to reflect the new feature. Add a test vector. Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Iefa911716c670fc12e4825b937b62044433fec36 (cherry picked from commit 87d24db65facb89ca524c951b8379ca2ec4dbc7a)
2019-11-28vlib: pci: fix non-NULL terminated C-stringBenoît Ganne1-2/+2
Type: fix Change-Id: I6f25d9295b973ab7133071b6dc325ecd86386898 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 0b91bd6c52460c3bff9ae7b1c0405d258a016c32)
2019-11-18vlib: fix handoff queue sequencing bugDave Barach1-1/+2
Set vm->check_frame_queues after actually enqueuing a frame. Under obscure circumstances, the code managed to set check_frame_queues so far in advance that 100 dispatch cycles could elapse before the frame enqueue succeeded. That resulted in permanent lack of queue service. Type: fix Ticket: VPP-1734 Fixes: 18191 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: If2d398202b4ba2b96581d25e8142daef3f74c9e5 (cherry picked from commit 320998a8126766c0db92d9c7652f765f9565a7b5)
2019-11-18vlib: fix for vlib_node_add_next_with_slotChristian Hopps1-1/+10
- vlib_node_add_next_with_slot was not cleaning the old next node references to the given slot when replacing it with new next node. This mostly worked until one tried to set the slot to a previously (but not currently) used next node for that slot. Type: fix Signed-off-by: Christian Hopps <chopps@labn.net> Change-Id: I7ee607625da874e320158b80f12ddc16e377f8e9 (cherry picked from commit 2e8b0618b12d317f2a4632e69a0663dcd8dde472)
2019-11-18vlib: Handle race in thread barrier processingAlexander Kabaev1-1/+1
When CLIB_DEBUG is enabled, vlib_foreach_main macro asserts that vlib_main it currently looks at is safely parked in barrier, by checkling that vlib_main->parked_at_barrier is not 0. Unfortunately, the check is racy - workers first increment the atomic counter to indicate that they have reached the barrier and _then_ set this_main->parked_at_barrier to 1. For the last worker to suspend this opens the race - main thread is free to execute and assert immediately after atomic counter has been incremented, before worker gets to write to own parked_at_barrier. Fix this by simply swapping the order of two operations. Type: fix Signed-off-by: Alexnader Kabaev <kan@FreeBSD.org> Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com> Change-Id: Iae47abd6ca0be1c5413f5ecaefabc64cd7eac2ed (cherry picked from commit feda545105106d673fdca61028331c86eeb1f408)
2019-11-15vlib: enhance the "show cli" debug CLI commandDave Barach2-49/+209
Dump the entire CLI, mp-safe commands, non-mp-safe commands, commands which have been executed. Optionally, clear the hit counters. Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ie38fc664b7deaabc35ca35be68db7e159272f551 (cherry picked from commit a1f5a956e5b2cfeb591dcdfb34d23ebed84d0bca)
2019-11-15vlib: Trivial - fix typo in short helpPaul Vinciguerra1-1/+1
Type: fix Change-Id: Ifada594088984291ce2e79da0bbbbd1f500640c9 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com> (cherry picked from commit 43d8cf6fad25ed8d53be38f824739c59a3aff716)
2019-11-15vlib: linux: fix wrong iommu_group value issue when using dpdk-pluginYulong Pei1-22/+19
When VPP work with dpdk-plugin, linux_vfio_main_t->container_fd is always -1 since it never have chance to run open("/dev/vfio/vfio") to get the fd. But this lead to a potential issue of VPP, that is, when start VPP without uio-driver field setup in /etc/vpp/startup.conf, VPP will run to automatical select uio driver in vlib_pci_bind_to_uio() and the function depend on iommu_group value to decide to work on vfio or vfio-noiommu mode. Since in vlib_pci_get_device_info() have the condition container_fd != -1, so the iommu_group value will be always -1 at this scenario, this caused that VPP mistake to run with vfio-noiommu driver on intel_iommu=on state. Actually in order to get iommu_group and iommu_group/name value, no need to depend on linux_vfio_main_t->container_fd value, so the fix remove the condition lvm->container_fd != -1, then it can get the correct iommu_group value. Type: fix Change-Id: I3f162fc4971b9a2b8717205f8f3b52e30c5e5b69 Signed-off-by: Yulong Pei <yulong.pei@intel.com> (cherry picked from commit 45495480c8165090722389b08075df06ccfcd7ef)
2019-11-05vlib: only dump 1st buffer in chain by defaultBenoît Ganne3-4/+15
Several nodes include buffers in their traces, but only the 1st. When formatting the trace we must not try to iterate through all chained buffers. Default to display only the 1st buffer. Type: fix Change-Id: Ib3c668bbf4ab70ae68eba2ac402c7b7329825b70 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 4354317bf3592d81fcafd94e33b320c3e49f45d3)
2019-11-05vlib: fix subclass name being truncated in outputPaul Vinciguerra1-1/+1
Type: fix Change-Id: I50816cca4eb88f58209138a348fc5954ab835f5b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com> (cherry picked from commit c9832e3df839d164a801b57cd5f4ee014efe496b)
2019-11-05vlib: unix trivial- clean up typos in docsPaul Vinciguerra1-2/+2
seen while reading through the code. Type: style Change-Id: I7a2f021b9f06d0eebb2ea3d0cafb6955ccb14781 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com> (cherry picked from commit d29422cbeeefb58d0213b295b35d04a673b380e7)
2019-10-29vlib: enable worker-thread dispatch pcap traceDave Barach1-3/+7
Needed a bit of foreach_vlib_main(...) action to turn on/off all instances of vm->dispatch_pcap_enable, and to pick up the pcap_main_t pointer from vlib_global_main. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I49b69b87934c7dc7a9835cd07aa2c5c4d3c79f18 (cherry picked from commit 349cd1af77a27962e9475e9fa9c0ed15e2af23de)
2019-10-27vlib: fix cli process stack overflowChenmin Sun1-1/+1
Type: fix Some cli processes, including configuring an test flow on an i40e interface consume more than the currently available stack space. Signed-off-by: Chenmin Sun <chenmin.sun@intel.com> Change-Id: I3df53d251cd43286f94647384d6e50a463bad15c (cherry picked from commit 2fd44a00aa26188ca75f0accd734f21758c199bf)
2019-10-18vlib: move thread barrier around mod of global node next dataChristian E. Hopps1-6/+5
The old code modified the node next array prior to obtaining the thread barrier. Then it updated the runtime node data, and upon barrier release caused reforking of each worker thread. The reforking clones the main thread nodes and reconstructs the runtime node structure. This cloning is not 100% "deep" in the sense that the node next array is shared (i.e., only the pointer is copied). So prior to the barrier being obtained the node's next array is being changed while workers are actively using it (bad). Treating the node next array as read-only in the workers and sharing it is a decent optimization so instead of trying to fix that just move the barrier a little earlier in the process to protect the node next array as well. This was tripping an assert in next frame ownership change by way of the ip4-arp node. The assert verifies that the node's next array length is equal to the runtime next node count. The race above was lost and the node next array data was updated in the main thread while the arp code was still executing in a worker. This was being hit when many arp requests were being sent from both ends of a tunnel during which the add next node function was called, which often led to an assert b/c the next node array was out of sync with the runtime next node count. - PS#2 update - move barrier sync to just above code that modifies state. Ticket: VPP-1783 Type: fix Signed-off-by: Christian E. Hopps <chopps@chopps.org> Change-Id: I868784e28f994ee0922aaaae11c4894a3f4f1fe7 Signed-off-by: Christian E. Hopps <chopps@chopps.org> (cherry picked from commit d3122ef4ecfa9a515cc39c1632d29e43fa771b2a)
2019-10-18misc: add "show run summary"Dave Barach1-11/+19
Prints the interior node vector rate, rx / tx / drop rates Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I57130db0f99e852a8498aa90d01e52f7ac33dcc9 (cherry picked from commit ac78f8a902fc61465edf657f7c7da7ff575210c8)
2019-10-15vlib: pci: set pci driver name to none when no driver is loadedBenoît Ganne1-0/+2
If no Linux PCI driver module is loaded, then the driver_name in the PCI info struct is NULL. This can triggers crash when checking driver name eg. in vlib_pci_device_open(). Default to "<NONE>" as driver name, which should never match. Type: fix Change-Id: I9e69889a7566467bd8220b92bbbaa72ada957257 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 0eae2bb1f1199f7dcb6a8c62b1ea612ed9ee4ae1)
2019-10-08vlib: fix old nodes vector overflow in reforkBenoît Ganne1-5/+2
Type: fix Change-Id: I81c4cf0ce87288bb2d3c7b9f31e9419290d588b4 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 5517bd34535e4ffffb838a835bb95ddcb77e2bba)
2019-10-04vlib: improve summary vector-rate statisticsDave Barach4-78/+54
Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I4b77879b0a84fdec3c1518a972cf003d5135222d Signed-off-by: Ole Troan <ot@cisco.com> (cherry picked from commit a8df85ce1fe957efa8301bd5b5ac3c03737d31f1)
2019-10-03vlib: add flag to explicitelly mark nodes which can init per-node packet traceDamjan Marion3-0/+14
Type: feature Change-Id: I913f08383ee1c24d610c3d2aac07cef402570e2c Signed-off-by: Damjan Marion <damarion@cisco.com> (cherry picked from commit 7ca5aaac10e95306f74ea4afd52110dd46aa0381)
2019-09-30vlib: fix cli process stack overflowAloys Augustin1-1/+1
Some cli processes, including bringing up an i40e interface with dpdk, consume more than the currently available stack space. Type: fix Fixes: VPP-1774 Signed-off-by: Aloys Augustin <aloaugus@cisco.com> Change-Id: I86ceb9e6e07523d5e0f760b5922467f09a8d4006 (cherry picked from commit 735d2e202b6d68059049a233b0a870ec3713564d)
2019-09-30vlib: cli support ctrl-w to erase left wordHiroki Shirokura1-0/+47
Type: fix Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com> Change-Id: I3ae7dc3858d0353764d629d6a9eff2bdab5f8768 (cherry picked from commit 67e4df144b8fd9ef45a188937441ce11260c8b67)
2019-09-28ipsec ip tcp l2: multiarch nodes cannot be declared as staticDamjan Marion1-0/+1
Credits to ray.kinsella@intel.com who spotted the issue and identified root cause. Type: fix Change-Id: I4afe74c47769484309f6aebca2de56ad32c8041f Signed-off-by: Damjan Marion <damarion@cisco.com> (cherry picked from commit d770cfc96257f9bd9e0c96c8ebe50e4531dc1bc5)
2019-09-27tap: fix tap interface not working on Arm issueLijian.Zhang2-1/+7
The VPP code tries to set all userspace memory in the table via IOCTL to VHOST_SET_MEM_TABLE. But on aarch64, the userspace address range is larger (48 bits) than that on x86 (47 bits). Below is an segment from /proc/[vpp]/maps. fffb41200000-fffb43a00000 rw-s 00000000 00:0e 532232 /anon_hugepage (deleted) Instead of setting all userspace memory space to vhost-net, will only set the address space reserved by pmalloc module during initialization. Type: fix Change-Id: I91cb35e990869b42094cf2cd0512593733d33677 Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com> Reviewed-by: Steve Capper <Steve.Capper@arm.com> (cherry picked from commit ba0da570f264785f6b50eff7829f6653c0924069)
2019-09-25misc: unify pcap rx / tx / drop traceDave Barach1-2/+9
Use a single vnet_pcap_t in vlib_global_main, specifically to support unified tracing Update sphinx docs, doxygen tags Type: refactor Ticket: VPP-1776 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Id15d41a596712968c0714cef1bd2cd5bc9cbdd55 (cherry picked from commit 33909777c63712ca397165cd92e7cc62208eb5c8)
2019-09-25misc: classifier-based packet trace filterDave Barach1-0/+1
See .../src/vnet/classify/trace_classify.h for the business end of the scheme. It would be best to hash pkts, prefetch buckets, and do the primary table lookups two at a time. The inline as given works, but perf tuning will be required. "At least it works..." Add "classify filter" debug cli, for example: classify filter mask l3 ip4 src dst \ match l3 ip4 dst 192.168.2.10 src 192.168.1.10 Add "pcap rx | tx trace ... filter" to use the current classify filter chain Patch includes sphinx documentation and doxygen tags. Next step: device-driver integration Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I05b1358a769f61e6d32470e0c87058f640486b26 (cherry picked from commit 9137e5400699bed9f7c0095187839a8b38273100)
2019-09-25interface: use the correct condition for checking if the pcap fd is openAndrew Yourtchenko1-1/+1
The 9af7e2e87e used a comparison that fd is >= 0 to check that the pcap needs closing. While the pcap_close() function does reset the file descriptor to -1, the freshly initialized structure has it equal to 0. This causes the VPP to close stdin if the packets are being seen on pg interface without the capture file being opened. This triggers the vpp attempting to read from STDIN (another bug), which results in running out of memory. Change-Id: I11d61422701500a9b3e0dd52d59383f297d57f54 Type: fix Fixes: 9af7e2e87e Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com> (cherry picked from commit 4da1506d39eb8f67ed2c48c76916bb6bcca6fbf1)
2019-09-25vlib: fix null pointer crash on strncmpSteven Luong1-2/+2
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff4b71de0 in __strncmp_sse42 () from /lib64/libc.so.6 (gdb) up up vm=0x7ffff6664d40 <vlib_global_main>, addr=0x7fffb4bec6d0, ids=0x7fffb31675f0 <avf_pci_device_ids>, handle=0x7fffb4bec594) at /usr/src/debug/vpp-20.01/src/vlib/linux/pci.c:1250 1250 if (strncmp ("vfio-pci", (char *) di->driver_name, 8) == 0) (gdb) p di p di $1 = (vlib_pci_device_info_t *) 0x7fffb6446164 (gdb) p di->driver_name p di->driver_name $2 = (u8 *) 0x0 (gdb) driver_name may be null. strncmp is not forgiving. Change to use C11 safeC version. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I1777a5966ceee7409d7bde86c30b14dc75534a5a (cherry picked from commit ab4899257a77edecfbf9a97cf67acc26a2133119)