aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
AgeCommit message (Collapse)AuthorFilesLines
2018-03-31tapv2: Sporadic SIGABRT in ethernet_input [VPP-1183]Steven2-5/+6
virtio_free_rx_buffers uses the wrong slot in the vring to get the buffer index. It uses desc_next. It should be last_used_idx which is the slot number for the first valid descriptor. Change-Id: I6b62b794f06869fbffffce45430b8b2e37b1266c Signed-off-by: Steven <sluong@cisco.com> (cherry picked from commit 074f698be5c2e6afc9df776b56a366bc3f404d95)
2018-03-26IPSEC_AH: broken initialization (VPP-1208)Marco Varlese1-1/+1
The init-path for IPSEC_AH where the CTX gets initialized is broken since the for-loop never executes due to the wrong usage of tm->n_vlib_mains which being subtracted by 1. Change-Id: I4d967f52cd3ca061aa60d824d65f446e06162403 Signed-off-by: Marco Varlese <marco.varlese@suse.com> (cherry picked from commit 4631610a20e6ae3181cb517db27a93b2a3e07eff)
2018-03-14At AF_PACKET socket create, do intf bind before rx ring cfg to avoid ↵Chaoyu Jin1-12/+12
receiving pkts from other interfaces Change-Id: Ie40ee9129edaac717e716b469f4d10f3c29a4932 Signed-off-by: Chaoyu Jin <chjin@cisco.com>
2018-03-08at af_packet input, drop partial packets to prevent l4 checksum deadloop at ↵Chaoyu Jin1-4/+17
ouptut Change-Id: I6f75b7328fd0aa71d00a701e36c8b4ad06bff3c4 Signed-off-by: Chaoyu Jin <chjin@cisco.com>
2018-03-08ip4_forward: set pkt error in case potential memory corruptChun Li1-0/+2
Change-Id: Ib9eb65d2ba166f5883a8ce8d37298c696113f2be Signed-off-by: Chun Li <chunl2@cisco.com>
2018-02-28tapv2: abort in tap_create_if (VPP-1179)Steven1-0/+1
The following command sequences cause the crash: create tap id 0 rx-ring-size 1024 tx-ring-size 1024 create tap id 1 rx-ring-size 1024 tx-ring-size 1024 set interface state tap0 up set interface state tap1 up delete tap tap0 delete tap tap1 create tap id 0 rx-ring-size 1024 tx-ring-size 1024 0: /home/sluong/vpp2/vpp/build-data/../src/vnet/interface_funcs.h:46 (vnet_get_hw_interface) assertion `! pool_is_free (vnm->interface_main.hw_interfaces, _e)' fails The reason for the crash is because when the tap interface is deleted, the code does not remove the entry from the device queue. But the interface is deleted anyway from vnet_main.interface_main.hw_interfaces. When an interface is created again, it may encounter the deleted entry in the device queue and crash. Notice create and delete a single entry does not cause a crash. Need to create and delete 2 interfaces to create a "hole" in the device queue. Change-Id: I42ce0b7943d73b3eab32a16751a0a3183de62d9f Signed-off-by: Steven <sluong@cisco.com> (cherry picked from commit 0b8567331c3edf8b6aee51c849b8391a2922d9ab)
2018-02-25virtio: add missing tx lock when running multithreadedDamjan Marion3-0/+10
Change-Id: I373f429c53c6f66ad38322addcfaccddb7761392 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-24virtio: reset vnet header on txDamjan Marion1-0/+3
Change-Id: Ib04a8787038fb536470a04d99fdc165102edfb5a Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-22Fix DHCP client crash with worker threadsMatthew Smith3-38/+54
Crash occurring With a worker thread configured and dhcp client active on an interface. When a DHCP reply packet is received, call to ethernet_get_main() from dhcp_proxy_to_client_input() was causing a crash. Replaced with a call to vnet_get_ethernet_main(). Once that was resolved, calling dhcp_client_acquire_address() from a worker thread also caused a crash. Changed so the main thread will do the address/route configuration. Change-Id: Ib23984787102dea8cf6cfcde86188a751f15c1e1 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-02-15VPP-1169: reenable dhcp client detect when lease expiresDave Barach1-1/+50
We disable the client detect feature when we bind a DHCP address. Turn it back on again when the lease expires. Otherwise, if the DHCP server replies after an outage, we'll never see the reply. Add dhcp packet tx counters, by packet type Change-Id: Id54b05647d5d7bd8d3ab99e6584ee86d9e4ff7f9 Signed-off-by: Dave Barach <dave@barachs.net> (cherry picked from commit 4941fcc23ab01f5ca918e56489d404b92d8bde90)
2018-02-02Improve tunnel interface creation performanceJohn Lo7-76/+81
Modify interface creation to allow creation of tunnel interfaces without dedicated per tunnel output and tx nodes which are not used for most tunnel types. Also changed interface-output node function vnet_per_buffer_interface_output() so it does not rely on hw_if_index as the next node index which is not flexible nor efficient for large scale tunnel interfaces. The improvenemts are done for VXLAN, VXLAN-GPE, GENEVE and GTPU tunnels. GRE tunnel is still using per tunnel output nodes which will be changed in a separate patch with other GRE enhencements. Change-Id: I4123c01c0d2ead814417a867adb8c8a407e4df55 Signed-off-by: John Lo <loj@cisco.com> (cherry picked from commit e5453d0fa29f39a7f78a7e22815566a7f4c9e5ef)
2018-01-30lisp-cp: fix handling of ndp without source link addr VPP-1159Florin Coras1-4/+21
Change-Id: Idddb60bbc7fcc701d39212f6422a6b2f6dc75221 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-29vlib: allocating buffers on thread-x and freeing them on thread-y causesSteven1-2/+1
a crash on debug image (VPP-1151) In debug image, there is extra code to validate the buffer when it is freed. It uses the hash table to lookup the buffer index with spinlock to prevent contention. However, there is one spinlock for each worker thread. So allocating the buffer on thread-x and freeing the same buffer on thread-y causes the validation to fail on thread-y. The fix is to have only one spinlock, stored in vlib_global_main. Change-Id: Ic383846cefe84a3e262255afcf82276742f0f62e Signed-off-by: Steven <sluong@cisco.com>
2018-01-18Sub-Interface deletion not cleanup hash's properly (VPP-1136)John Lo2-14/+18
On deleting sub-interfaces, functions vnet_delete_sub_interface() and vnet_delete_hw_interface() are not cleaning up sub-interface related hash tables and memory properly. Change-Id: I17c7c4b2078c062c77bfe48889beb677610035ca Signed-off-by: John Lo <loj@cisco.com>
2018-01-11tapv2: deleting tap interface may leak buffers (VPP-1124)Steven4-11/+34
Buffers may be allocated for indirect descriptors by tx thread and they are freed when tx thread is invoked in the next invocation. This is to allow the recipient (kernel) to have a chance to process them. But if the tap interface is deleted, the tx thread may not yet be called to clean up the indirect descriptors' buffers. In that case, we need to remove them without waiting for the tx thread to be called. Failure to do so may cause buffers leak when the tap interface is deleted. For the RX ring, leakage also exists for vring->buffers when the interface is removed. Change-Id: I3df313a0e60334776b19daf51a9f5bf20dfdc489 Signed-off-by: Steven <sluong@cisco.com>
2018-01-10VPP-1120 SRv6 bug with SID list containing only one SID and no srhPablo Camarillo1-26/+65
Packets with a SR policy of one SID list create a malformed packet. Outer IPv6 header points to a routing extension header that does not exist since the SID list contains only one SID. Change-Id: I1effee0457453bab95706a8a24fdabfbd843d5b7 Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
2018-01-09VPP-1113 SR MPLS path.frp_label_stackPablo Camarillo1-17/+16
provide one label stack per fib_table_entry_path_add2 call. otherwise multiple mheap releases take place. Change-Id: I475ca1b801fc85dddda0b540c69ad628a274df7f Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
2018-01-09BIER: missing endian swap for imposition object in API returnNeale Ranns1-1/+1
Change-Id: Iddd754d00ace3d042336e5c2c40431566275051a Signed-off-by: Neale Ranns <neale.ranns@cisco.com> (cherry picked from commit eea537a288721b867d65b736363ab3f71ba6116c)
2018-01-09BIER: crash in show command when no tables are presentNeale Ranns1-0/+1
Change-Id: Ie291468ea9d05c47cefe39c4ff7fea3e016bacf2 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 0e8cb6c475b616a3296b08d25bcaa1eed3ab0084)
2018-01-08GRE tunnel key should use fib_index instead of fib_id (VPP-1118)John Lo1-12/+1
Follow up fix - vl_api_gre_add_del_tunnel_t_handler should pass outer_fib_id from API message to vnet_gre_add_del_tunnel() and not convert it to fib_index, since vnet_gre_add_del_tunnel() already perform the lookup to get fib_index from fib_id. Change-Id: I24967a97f82ce018ddef596e556bd3eb1706cb63 Signed-off-by: John Lo <loj@cisco.com>
2018-01-07VPP-1110 BVI reply ARP that doesn't request BVI loacl IP.zhaoqingling1-0/+6
Change-Id: I66ae618edaa12c2b4e4afe276da689673b02c9cd Signed-off-by: zhaoqingling <zhao.qingling@zte.com.cn> (cherry picked from commit b4c42cdc6bbbf464f3f0034b2b39d4e20fd23a25)
2018-01-06Unify/cleanup usage of hash_set/unset_mem by tunnels (VPP-1117)John Lo3-78/+30
Move the functions hash_set_key_copy() and hash_unset_key_free() which are dupilicated in various tunnel support code modules to hash.h as hash_set_mem_alloc() and hash_unset_mem_free() to be used by all. Change-Id: I40723cabe29072ab7feb1804c221f28606d8e4fe Signed-off-by: John Lo <loj@cisco.com> (cherry picked from commit e6bfeab1c352ae73a19361c038e2a06a58c035db)
2018-01-06GRE tunnel key should use fib_index instead of fib_id (VPP-1118)John Lo1-2/+11
The code path in src/vnet/gre/interface.c uses fib_id as a component to generate hash key for GRE tunnel. This should be fib_index as the GRE rx/decap data path will be using fib_index to generate the hash key to lookup the GRE tunnel. Change-Id: Ia7f0892d84f9dac79223a6e016775892b61eb5fb Signed-off-by: John Lo <loj@cisco.com>
2017-12-22tcp: add builtin server/client transfer testFlorin Coras4-33/+60
Change-Id: Iab0baabf2f27bc7ad7fbf2d2789a493752b07d8a Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-12-21fib: make deag entries urpf extemptFlorin Coras5-0/+19
Change-Id: Ie8f6bb4fcd3e4fa269e86a77d2f21c87f372b783 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-12-21VPP-1109 Fix loop for some CLI (code review)Swarup Nayak1-0/+3
Change-Id: I518387ab479bee4778d45a33c95f7b0f72aa1b72 Signed-off-by: Swarup Nayak <swarupnpvt@gmail.com>
2017-12-20L2 EmulationNeale Ranns2-1/+2
L2 Emulation is a feautre that is applied to L2 ports to 'extract' IP packets from the L2 path and inject them into the L3 path (i.e. into the appropriate ip[4|6]_input node). L3 routes in the table_id for that interface should then be configured as DVR routes, therefore the forwarded packet has the L2 header preserved and togehter the L3 routed system behaves like an L2 bridge. Change-Id: I8effd7e2f4c67ee277b73c7bc79aa3e5a3e34d03 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-20Fix MPLS local-label CLI help stringMarek Gradzki1-1/+1
CLI parsing code (unformat_fib_route_path) does not recognise 'resolve-via-connected'. However it understands 'resolve-via-attached'. Change-Id: I57e5eb75199cb8ae72c0fc8642a41f042b022201 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2017-12-20VPP-1083 "ip punt redirect add" crashed if not mentioned any other parameterSwarup Nayak2-8/+28
Change-Id: Ibb6f450783d0ab64bd943c19f12d0954b0a94b24 Signed-off-by: Swarup Nayak <swarupnpvt@gmail.com>
2017-12-19BIER coverity fix in route downlaodNeale Ranns2-3/+3
Change-Id: I9341f1554d804dfeeecef656e59e8598704863dc Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-19FIB memory leak during recursive loop detectionNeale Ranns1-0/+2
Change-Id: I5ecd43330b3329b072e6da62a4eed1641eb17f8f Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-19VPP-1032: fix coverity warning in bierDave Barach1-2/+2
Change-Id: I0f8d2d9be78d4d936ed61538aee1b7207871347b Signed-off-by: Dave Barach <dave@barachs.net>
2017-12-19Fix passing bad context for callback functionJuraj Sloboda1-2/+2
Change-Id: I61e6019ab34f52c82bf3f1e5327501a613f58bd9 Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
2017-12-19lldp: Fix Coverity Warnings CID 177942, CID 177945Dave Wallace1-1/+1
Change-Id: Ic1ab32c5df3f7a613fe0dcd6bfc15037fa2a008b Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-12-18session api: Fix Coverity Warning CID 180115Dave Wallace1-1/+1
Change-Id: I87e3de556910851d16af343bfcbede49500843ff Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-12-18SR-MPLS: binary API and automated steeringPablo Camarillo8-502/+1675
Change-Id: Iacfbaaa91ea8bd92790dec9fce567063bdbc5d64 Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
2017-12-18VPP-269 Coding standards cleanup - vnet/vnet/policerKrishanpal singh1-11/+14
Change-Id: Ib92794205027d3242c6f0c8962fe02ac38c7129b Signed-off-by: Krishanpal singh <krish.singh03@gmail.com>
2017-12-16GRE tunnel key includes the FIB tableNeale Ranns4-137/+219
- GRE tunnels with the same src,dst addresses are not the same tunnel - Two data-plane improvements: - the cached key was never updated and so useless - no need to dereference the tunnel's HW interface to get the sw_if_index Change-Id: I2f2ea6e08c759a810b753cec22c497e921a2ca01 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-16Use crc32 wrapper (VPP-1086)Gabriel Ganne1-4/+4
This allows arm platforms to also take advantage of crc32 hardware acceleration. * add a wrapper for crc32_u64. It's the only one really used. Using it instead of a call to clib_crc32c() eases building symmetrical hash functions. * replace #ifdef on SSE4 by a test on clib_crc32c_uses_intrinsics. Note: keep the test on i386 * fix typo in lb test log Change-Id: I03a0897b70f6c1717e6901d93cf0fe024d5facb5 Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2017-12-15Fix icmp/udp/tcp punt/drop pathsVijayabhaskar Katamreddy14-63/+79
Send packets to ip4/6_punt/drop nodes instead of error-drop/punt nodes dbarach: clean up an annoying checkstyle issue: indent 2.2.10 (OpenSUSE version) and indent 2.2.11 (Ubuntu / CentOS versions) had an artistic disagreement about ip_frag.c. Change-Id: I660bee28a064af9c6c70371363081e941d1c3a94 Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net>
2017-12-15fib: fix show fib path-list and pathFlorin Coras2-4/+4
Change-Id: I465282e513b6a0482e96dd02fc7e0e4ed3e3731a Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-12-15ESP_AH_test_automation_scripts rev1“mystarrocks”1-7/+0
Change-Id: I941abdc4a02e4c52c66b9d299e380b27caca7c1d Signed-off-by: “mystarrocks” <mystarrocks@yahoo.com>
2017-12-14VPP-1100 Fix loop in "set punt tcp/udp command"Swarup Nayak1-5/+17
Change-Id: I23081ea25a8d40d8ebe1fcb6efe4143e9c5a0fc6 Signed-off-by: Swarup Nayak <swarupnpvt@gmail.com>
2017-12-14tap_v2: include host-side parameters in the dump binary APIMilan Lenco8-7/+114
Change-Id: I097a738b96a304621520f1842dcac7dbf61a8e3f Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
2017-12-14BIER disposition default routeNeale Ranns3-8/+20
Change-Id: I7196ad8bf6afaf356674789c05e23ac000bc038e Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-14session: cleanup attach flagsFlorin Coras11-67/+66
Change-Id: I39d21d15677f57e10b69b8842f2cbca277abddf0 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-12-13IP bi-direction multicast - same cable check on egressNeale Ranns2-1/+17
Change-Id: I655382f7f74181dd7c795a2b22f151f76b50e793 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-13make "test-all" target pass againGabriel Ganne3-2/+11
The "test-all" target is still never called as part of any continuous test (as it probably should) but at least it can now be expected to succeed. VXLAN-GPE: * decapsulate Ethernet to "l2-input" instead of "ethernet-input" otherwise the inner mac address get checked against the interface one (external) and packet gets dropped (mac mismatch) * set packet input sw_if_index to unicast vxlan tunnel for learning TEST: * VXLAN: * reduce the number of share tunnels: => reduce test duration by half => no functional change * VXLAN-GPE: * fix test TearDown() cli: command is "show vxlan-gpe" only * remove vxlan-gpe specific tests as the were a duplicated of the BridgeDomain one and already inherited. * disable test_mcast_rcv() and test_mcast_flood() tests * P2PEthernetAPI: * remove test: "create 100k of p2p subifs" there already is a "create 1k p2p subifs" so this one is a load test and not a unit test. See: lists.fd.io/pipermail/vpp-dev/2017-November/007280.html Change-Id: Icafb83769eb560cbdeb3dc6d1f1d3c23c0901cd9 Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2017-12-13BIER: API documentation fixes.Neale Ranns1-10/+5
Change-Id: I497305d9a4fd556ed8b4a7ceb3654df94ff98f56 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-13Separate heap for IPv4 mtriesNeale Ranns7-44/+73
Change-Id: I497e9f6489dd35219bcf2b51ac992467aac4c8eb Signed-off-by: Neale Ranns <nranns@cisco.com>