aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
AgeCommit message (Collapse)AuthorFilesLines
2019-11-25vlib: address vlib_error_t scaling issuestable/1901Steven Luong1-6/+6
Encoding the vpp node index into the vlib_error_t as a 10-bit quantity limits us to 1K graph nodes. Unfortunately, a few nodes need 6 bit per-node error codes. Only a very few nodes have so many counters. It turns out that there are about 2K total error counters in the system, which is (approximately) the maximum error heap index. The current (index,code) encoding limits the number of interfaces to around 250, since each interface has two associated graph nodes and we have about 500 "normal, interior" graph node This patch adds an error-index to node-index map, so we can store error heap indices directly in the vlib_buffer_t. Type: refactor Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ic2e91a5b344c9df3b98b264cacda246e06092a94
2019-11-20vlib: convert frame_index into real pointersSteven Luong3-4/+4
The fast path almost always has to deal with the real pointers. Deriving the frame pointer from a frame_index requires a load of the 32bit frame_index from memory, another 64bit load of the heap base pointer and some calculations. Lets store the full pointer instead and do a single 64bit load only. This helps avoiding problems when the heap is grown and frames are allocated below vm->heap_aligned_base. Type: refactor Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I616fe3fbe501c4e2205cd74840eb95c550603508
2019-10-05bonding: traffic traversing the wrong interfaceSteven Luong1-0/+1
Missing an increment in the while loop. Hashes not stored in the array. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I603027f5a7305478f48a102ac8035ffde9102c53 (cherry picked from commit 0471cdbd3fe04a88a8b70b5f0eff0c378e19abf7)
2019-08-14devices: VPP crash when doing packet trace dumpSteven Luong1-0/+8
VPP recycles the graph node index when the interface is deleted. Most tx graph nodes have format_tx_function. tapcli does not. If tapcli happens to recycle a tx graph node index which has format_tx_function, problem will arise when showing the trace buffer which was collected for the node index that tapcli recycles. The fix is nothing fantasy, just add a format_tx_trace function which does nothing in case it it called. tapcli is deprecated in 19.04. There is no need to cherrypick this to later releases. Type: fix Ticket: VPP-1742 Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I010b3f35e59a474cb134a8b1bc718c242e3aa93c
2019-07-23devices: vhost handling VHOST_USER_SET_FEATURESSteven Luong1-0/+1
Some combinations of new qemu (2.11) and old dpdk (16.10) may send VHOST_USER_SET_FEATURES at the end of the protocol exchange which the vhost interface is already declared up and ready. Unfortunately, the process of VHOST_USER_SET_FEATURES will cause the interface to go down. Not sure if it is correct or needed. Because there is no additional messages thereafter, the hardware interface stays down. The fix is to check the interface again at the end of processing VHOST_USER_SET_FEATURES. If it is up and ready, we bring back the hardware interface. Type: fix Change-Id: I490cd03820deacbd8b44d8f2cb38c26349dbe3b2 Signed-off-by: Steven Luong <sluong@cisco.com> (cherry picked from commit 545866b5b3115b7de114bdb7883f5ece59b702d4)
2019-07-12ip: Punt node does not free iovecsNeale Ranns2-9/+19
Type: fix Fixes: f7a55ad74c Change-Id: Ic3474e746887f880a8f6246bebc399715bac8e80 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 13a6ddf353261fd0439646b71c832f4f44c9de71)
2019-06-14acl vnet vlib: memory leaksSteven Luong1-0/+1
Fix memory leaks in acl, vnet, and vlib components. Type: fix Change-Id: I61c84ebbacbbf3215db0d4aaa7699e8d5f8df2da Signed-off-by: Steven Luong <sluong@cisco.com>
2019-05-25tcp: handle disconnects in rcv-processFlorin Coras1-0/+1
Change-Id: I86b025d36aedad2bf4afd6137f5b708677720f0e Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-05-25tcp: handle fin+rst in same frameFlorin Coras1-1/+8
Change-Id: Ie7a6c7b92a6beeb356f01384216a4982fb3d420e Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-05-24Fix congestion recovery checkv19.01.3-rc0John Lo1-2/+4
Change-Id: Ia9347c8cb6175c6bec3f9c27a7e0a71c4e58fe28 Signed-off-by: John Lo <loj@cisco.com>
2019-05-02mp_safe SW_INTERFACE_DUMP, SW_INTERFACE_DETAILS, SW_INTERFACE_TAG_ADD_DEL,Steven Luong3-0/+9
BRIDGE_DOMAIN_DUMP, CONTROL_PING, CONTROL_PING_REPLY, and show interface CLI Change-Id: I2927573b66bb5dd134b37ffb72af0e6676750917 Signed-off-by: Steven Luong <sluong@cisco.com>
2019-03-30SPAN: Add pending frame on current thread, not on mainIgor Mikhailov (imichail)1-6/+5
Previously, all frames were put for next node on the main thread, even if the execution was happening on a worker thread. Also, refactor to use API function vnet_get_main() Change-Id: Ibefb1b3871563a78aa30352a37b9216537e15bf7 Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com> (cherry picked from commit 2d6fc6b082c9b4bf9481b58f68def13792822805)
2019-03-26Callback functions must have the correct signatureNeale Ranns3-4/+8
Change-Id: I642823bdc3c7006a0b719ec1e3a9cd75b2b37253 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 8f215b4a03a98bf94931a09b23ab0fbd8ccd1ab9)
2019-03-24ADJ: more thorough link up checkNeale Ranns2-7/+22
Change-Id: I04dbfb914706b25fcc3bd6ee0d19cfdc810234ae Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 3e2e1907d485ed321f99350dd46e6822db6ac4d4)
2019-03-13FIB: path parsing, table-id not fib-index (VPP-1586)Neale Ranns1-1/+11
Change-Id: Ib27952935393163eaabf005c69b1cbc2feca2b98 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-13vhost: potential crash in map_guest_mem using debug imageSteven Luong1-1/+14
map_guest_mem may be called from worker-thread/dataplane. It has a call to vlib_log and may crash inside vlib_log's ASSERT statement /* make sure we are running on the main thread to avoid use in dataplane code, for dataplane logging consider use of event-logger */ ASSERT (vlib_get_thread_index () == 0); The fix is to convert the vlib_log call in map_guest_map to event logger Change-Id: Iaaf6d86782aa8a18d25e0209f22dc31f04668d56 Signed-off-by: Steven Luong <sluong@cisco.com> (cherry picked from commit b0789106cb4f4c7ac529c02a5ff1ac346f0913dd)
2019-03-13vhost-user: restart vpp may cause vhost to crashSteven Luong1-1/+1
Fix a typo in vhost_user_rx_discard_packet which may cause txvq->last_avail_idx to go wild. Change-Id: Ifaeb58835dff9b7ea82c061442722f1dcaa5d9a4 Signed-off-by: Steven Luong <sluong@cisco.com>
2019-03-07assign flood_class to vnet_sw_interface_t template in subif api handle functionv19.01.2-rc0Joe Zhou1-0/+2
Change-Id: I352f4a4adcf8771c21530657efcaecb532416612 Signed-off-by: Joe Zhou <zhouyoucn@qq.com> (cherry picked from commit 715f94ed94638ea883f919361bff7a3f46fd1d1b)
2019-03-01tcp: allow future acks if in windowFlorin Coras1-4/+9
Change-Id: I84ad1830b8db43f6031cf2876cd94f6a71216b83 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 5fd3210be3a043c12c598df3d75dbe0aa606bfe5)
2019-02-28IPSEC: crash on SA dump when SA are bound to tunnelsNeale Ranns1-2/+5
Change-Id: I1c8256af838e6d4f371549ca91b8b0a4c0c44c65 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-02-27buffer chain linearizationKlement Sekera4-336/+91
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-22vhost: VPP stalls with vhost performing control plane actions [VPP-1572]Steven Luong3-214/+259
Symptom ------- With NDR traffic blasting at VPP, bringing up a new VM with vhost connection to VPP causes packet drops. I am able to recreate this problem easily using a simple setup like this. TREX-------------- switch ---- VPP |---------------| |-------| Cause ----- The reason for the packet drops is due to vhost holding onto the worker barrier lock for too long in vhost_user_socket_read(). There are quite a few of system calls inside the routine. At the end of the routine, it unconditionally calls vhost_user_update_iface_state() for all message types. vhost_user_update_iface_state() also unconditionally calls vhost_user_rx_thread_placement() and vhost_user_tx_thread_placement(). vhost_user_rx_thread_placement scraps out all existing cpu/queue mappings for the interface and creates brand new cpu/queue mappings for the interface. This process is very disruptive and very expensive. In my opinion, this area of code needs a makeover. Fixes ----- * vhost_user_socket_read() is rewritten that it should not hold onto the worker barrier lock for system calls, or at least minimize the need for doing it. * Remove the call to vhost_user_update_iface_state as a default route at the end of vhost_user_socket_read(). There is only a couple of message types which really need to call vhost_user_update_iface_state(). We put the call to those message types which need it. * Remove vhost_user_rx_thread_placement() and vhost_user_tx_thread_placement from vhost_user_update_iface_state(). There is no need to repetatively change the cpu/queue mappings. * vhost_user_rx_thread_placement() is actually quite expensive. It should be called only once per queue for the interface. There is no need to scrap the existing cpu/queue mappings and create new cpu/queue mappings when the additional queues becomes active/enable. * Change to create the cpu/queue mappings for the first RX when the interface is created. Dont remove the cpu/queue mapping when the interface is disconnected. Remove the cpu/queue mapping only when the interface is deleted. The create vhost user interface CLI also has some very expensive system calls if the command is entered with the optional keyword "server" As a bonus, This patch makes the create vhost user interface binary-api and CLI thread safe. Do the protection for the small amount of code which is thread unsafe. Change-Id: I4a19cbf7e9cc37ea01286169882e5603e6d7eb77 Signed-off-by: Steven Luong <sluong@cisco.com> (cherry picked from commit 67f935ec6eb9ec37b7d73029c5afa89cbf4a9aa2)
2019-02-22tcp: free sack block list on connection cleanupFlorin Coras1-0/+2
Change-Id: I7152b4ae64528082765726d5844580aad54c0c70 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-22Add no-append flag to vlib_frame_tDamjan Marion2-0/+2
Change-Id: I01c4f5755d579282773ac227b0bc24f8ddbb2bd1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-20IP route local and connectedNeale Ranns2-3/+14
allow routes that are local and connected to be added via the API. this emulates the addition of a second address in the same subnet added to an interface. Change-Id: Ib18a08c26956be9a07b3360664210c8cf6734c84 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 7425f9289bdc17d330044b0df0fc31cdeeca626b)
2019-02-20FIB: pass a copy the walk contextNeale Ranns1-1/+3
since it can realloc when new ctx are added. If not we can get some nasty memory corruption. Change-Id: I617709c3013acbcb8aee07dc147894f0de896555 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 58085f2f6757e464196b283cc8335ab5cf34a012)
2019-02-19Revert "bond: problem switching from l2 to l3"Peter Mikus1-11/+0
During CSIT testing we discovered that LACP tests were failing and producing coredumps. Reverting this patch fix the problem with VPP crashing. This reverts commit f23890138e02d4218c828c427f687f8ecdb0e165. Change-Id: Icf97053ce1473350add885cbebe591f7f3efcbea Signed-off-by: Peter Mikus <pmikus@cisco.com>
2019-02-07tcp: fix reset sending in syn-sentFlorin Coras3-6/+7
Change-Id: I468b1015bca5f95b162fb49e904aa4e4d38db75e Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit d4c49be5e20406220cf89083c9df86c3c0761a81)
2019-01-30ipsec: fix check support functionsKlement Sekera2-5/+17
Change-Id: If94c57fbb07a7376a9f2873e1489c00b28152620 Signed-off-by: Klement Sekera <ksekera@cisco.com> (cherry picked from commit 4fd5a9d3e6abdf61f266da8400a299fe5b0eb0ed)
2019-01-25IP6 FIB: walk table for dump (VPP-1553)Neale Ranns1-12/+7
Change-Id: Iaa57ace6df96bfacd1235c80ec7bb08e5f335530 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 5c1f559b1bf32acd528664e7674a2d46f2aed947)
2019-01-23bond: packet drops on VPP bond interface [VPP-1544]Steven2-20/+21
We register callback for VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION and VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION to add and remove the slave interface from the bond interface accordingly. For static bonding without lacp, one would think that it is good enough to put the slave interface into the ective slave set as soon as it is configured. Wrong, sometimes the slave interface is configured to be part of the bonding without ever bringing up the hardware carrier or setting the admin state to up. In that case, we send traffic to the "dead" slave interface. The fix is to make sure both the carrier and admin state are up before we put the slave into the active set for forwarding traffic. Change-Id: I93b1c36d5481ca76cc8b87e8ca1b375ca3bd453b Signed-off-by: Steven <sluong@cisco.com> (cherry picked from commit e43278f75fe3188551580c7d7991958805756e2f)
2019-01-20session: add support for vrf in session unformat (VPP-1546)Florin Coras1-7/+22
Change-Id: Ic5ba751c2bd2db9af4a21d3db40cc305d1208c30 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit baee8d498830bbbf54ec76e7c0c887c6373fe985)
2019-01-20tcp: fix debugging without cc stats (VPP-1547)Florin Coras1-0/+1
Change-Id: I376856fcadce570bb555064435f5876eefb2befa Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 0702554639e5149d9012cc196aa43c3c8d0d7f9b)
2019-01-20fix data_length in IpSec API call (VPP-1548)Michal Cmarada1-4/+6
Change-Id: Idb2839f6082bd2e052be2bc5417f0ebb43d1c0a6 Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
2019-01-18tcp: allow data in passive open ack (VPP-1545)Florin Coras1-2/+3
Change-Id: Iceb99d3f8b7029bd1b1e9ebafb1e0b3790c573e4 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 865872ebdb2bbaf3f157e2a9889405b84114d2eb)
2019-01-13bonding: support custom interface IDsAlexander Chernavin5-3/+40
Change-Id: I78fe58144fa3ba2e1c7135897a13a2541f235c91 Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2019-01-12session: generate wrong thread errors instead of crashingFlorin Coras6-22/+45
Change-Id: I7e59ae718d2722c49d42b22a0874e1645a191e89 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-11Fix 'show interface span' field lengthIgor Mikhailov (imichail)1-2/+2
Allow to display longer interface names, e.g. VirtualEthernet0/0/0.102 The field length (32) is now the same as for 'show interface'. Change-Id: I1cb1efd459acb800bfaeeec40b672c8b17cd8c3d Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
2019-01-10session/vcl: improve fifo tx notificationsFlorin Coras3-49/+50
Change-Id: Ied476c417c8ba5b4d7c615125c36eecd9ca64fbc Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-10ARP/ND: copy opaque2 persistent fields to new packetNeale Ranns3-4/+16
Change-Id: Ic65f686aaccaf8450732d88d7471b587faccaa9d Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-01-09VXLAN: Prevent duplicate bypass graph nodes.Jon Loeliger2-4/+37
Change-Id: I68cc509b594b09751ff5e0e09bbca187a4a88edd Signed-off-by: Jon Loeliger <jdl@netgate.com>
2019-01-08Fix name of ipv6-n-tupleHongjun Ni1-1/+1
Change-Id: Ia95a75295e4865b4720573f164ccba8bcc7679ae Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2019-01-08virtio: fix kick race issueDamjan Marion3-10/+29
Change-Id: I25b2a28513821bc5eab9ac6890a3964d412b0399 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-07tapv2: add "tap_flags" field to the TAPv2 interface APIAndrew Yourtchenko3-0/+8
Change-Id: I26f99d95f52c9fe107d17dcbbf5c6185523beade Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-01-07VOM: mroutesNeale Ranns4-6/+31
- fixes in ip.api for dumping mroute path flags Change-Id: I13b0cfb15d374250ed71bd4e13dda9b798c18204 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-01-07L2 BD API to flush all IP-MAC entries in the specified BDJohn Lo4-12/+83
Implement API/CLI to clear IP-MAC tables used for ARP-termination in the specified bridge domain. The CLI to flush MAC IP tables for a BD is: set bridge-domain arp entry <bd-id> del-all The API added is bd_ip_mac_flush. Change-Id: I34ceb87c0f480c7102f6559312c24081ed485af8 Signed-off-by: John Lo <loj@cisco.com>
2019-01-07Handle buffer alloc failure in vlib_buffer_add_dataDave Barach3-34/+72
It's not OK to crash due to a transient buffer allocation failure. Return 1 if the requested operation failed, otherwise 0. Buffer index parameter change to a value-result, so the caller can differentiate between partial and complete allocation failure: callers which request an initial allocation (inbound bi = ~0) need to check the (out) value to decide whether or not to call vlib_buffer_free(...). Change-Id: I03029d7f2714c17dca4630dfd95a1eb578b68384 Signed-off-by: Dave Barach <dave@barachs.net>
2019-01-07Fix TCP checksum.Andrej Kozemcak1-1/+4
Set TCP checksum to zero, before calculate the TCP checksum. Change-Id: Id96743334481804b8ebb74afef2f1dbfed29e0cb Signed-off-by: Andrej Kozemcak <andrej.kozemcak@pantheon.tech>
2019-01-06pktgen: support mixed multi/single chunk pcap replayDave Barach3-71/+165
Change-Id: I3d387b5e2b17f89ed688ea6cfee3fb6d782fe326 Signed-off-by: Dave Barach <dave@barachs.net>
2019-01-05vcl/session: add api for changing session app workerFlorin Coras5-15/+176
In case of multi process apps, after forking, the parent may decide to close part or all of the sessions it shares with the child. Because the sessions have fifos allocated in the parent's segment manager, they must be moved to the child's segment manager. Change-Id: I85b4c8c8545005724023ee14043647719cef61dd Signed-off-by: Florin Coras <fcoras@cisco.com>