aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
AgeCommit message (Collapse)AuthorFilesLines
2018-10-01fix packets redirect ineffective on af-packet interfacestable/1804chenxiang1-2/+1
Change-Id: Ibdc03c4c79632a61c5f36b8e907ec2bd7ebb0dc7 Signed-off-by: chenxiang <chenxndsc@163.com>
2018-07-09gcc8 and Wstringop-truncationMarco Varlese1-2/+2
gcc8 introduced a new warning (Wstringop-truncation) which in our case is being treated as error. Disabling the warning globally might introduce bugs related to string truncation which are not desired by the developer (e.g. bug). Instead, this patch disables the warning only for those occurences which have been verified to be non-bugs but the desired behaviour as per developer will. Change-Id: I0f04ff6b4fad44061e80a65af633fd7e0148a0c5 Signed-off-by: Marco Varlese <marco.varlese@suse.com> (cherry picked from commit 99d7a72cbcad959e805e8e8b5efb112e9def69c2)
2018-07-09node functions cannot be always_inlineDamjan Marion7-18/+18
Thanks to gcc-8 for highlighting this... Change-Id: I53bfab631a40fd1b680c76a48b0307a33fa2b154 Signed-off-by: Damjan Marion <damarion@cisco.com> (cherry picked from commit 2574d9f41aa0531d0182f83b5d803da32205d809)
2018-06-10Add reaper functions to want events APIs (VPP-1304)Neale Ranns2-4/+135
Change-Id: Iaeb52d94cb6da63ee93af7c1cf2dade6046cba1d Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-06-06BIER CLI show commands; no crash on non-existant objects (VPP-1303)Neale Ranns3-6/+27
DBGvpp# sh bier disp entry DBGvpp# sh bier disp entry 0 No such BIER disp entry: 0 DBGvpp# sh bier disp table DBGvpp# sh bier disp table 0 No such BIER disp table: 0 DBGvpp# sh bier disp table 11 No such BIER disp table: 11 DBGvpp# DBGvpp# sh bier bift no BIFT entries DBGvpp# sh bier bift set 0 no BIFT entries DBGvpp# sh bier bift set 0 sd 0 bsl 0 no BIFT entries DBGvpp# DBGvpp# sh bier fib No BIER tables DBGvpp# sh bier fib 0 DBGvpp# sh bier fib 0 4 DBGvpp# sh bier fmask DBGvpp# sh bier fmask 2 No BIER f-mask 2 DBGvpp# sh bier imp DBGvpp# sh bier imp 0 No such BIER imposition: 0 Change-Id: Ibadac3441dd8a6d1b96bd9ee4358e28498875b95 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 8f6e3218623ddbb836d6a47ed2678f8ab99f2471)
2018-05-30bond: performance harvesting [VPP-1298]Steven4-133/+183
- hash is great. But it is a bit too slow for the DP. Use direct array indexing to quickly retrieve the slave interface. - the algorithm used by flow hash is great. But it is a bit too slow for the DP. Use l2_hash_hash() extracted from lb_hash.h which ECMP is using. It makes use of intrinsic crc32 instruction set. - shortcut modulo arithmetic when the operand is 2**x (where x up to 4) to avoid division instruction. - special case for link count == 1 in bond_tx_fn() - use clib_mem_unaligned to access data for the packet to avoid alignment error - Fix some typos for packet tracing. Change-Id: I8eae3ad497061c5473aa675ba894ee0211120d25 Signed-off-by: Steven <sluong@cisco.com> (cherry picked from commit 0d88301a576191a0e330e539cf1dcb3837ee1bf6)
2018-05-29Revert "Fix the alignment of IP4 Fib Tables (VPP-1280)"Neale Ranns1-1/+0
This reverts commit 6a4b97a6162994a5759ab1014fa2005439bb3ee3. subsequent commit 01b2c23faecee4a60cccf8219bf37fa588009b8d added the same cache line alignment and resulted in a duplicate member causing a build failure. Change-Id: I6208095afe0d5da2a85147e8f70c80035e49092e Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-05-18Harmonize vec/pool_get_aligned object sizes and alignment requestsDave Barach36-14/+148
Object sizes must evenly divide alignment requests, or vice versa. Otherwise, only the first object will be aligned as requested. Three choices: add CLIB_CACHE_LINE_ALIGN_MARK(align_me) at the end of structures, manually pad to an even divisor or multiple of the alignment request, or use plain vectors/pools. static assert for enforcement. Change-Id: I41aa6ff1a58267301d32aaf4b9cd24678ac1c147 Signed-off-by: Dave Barach <dbarach@cisco.com>
2018-05-18Fix the alignment of IP4 Fib Tables (VPP-1280)Neale Ranns1-0/+1
Change-Id: I63cedfac3dcb6dec380d02325eeebb1f35518309 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-05-10DHCP4 client process replies when renewing leaseMatthew Smith1-16/+24
When a DHCP client is in the bound state, it wakes up halfway through it's lease (by default) to try and renew the lease. The ip4-dhcp-client-detect is not enabled as a feature at this point, so replies sent from the DHCP server do not get applied to the lease. Eventually the lease expires, the address is removed from the interface, a new discovery is performed and the same address is added back to the interface. Before sending a request to renew in the bound state, enable the feature to process the reply. Change-Id: I95332ee0596f47df6f3c8bf8e3f0698dde9a1fc5 Signed-off-by: Matthew Smith <mgsmith@netgate.com> (cherry picked from commit 7cb7bb3fa1eca927cd33d8b434ce0eac1d57a987)
2018-04-27TAP memory leaks:Neale Ranns4-28/+19
1 - use bit-map to re-use ID values and thus VLIB nodes 2 - free vrings 3 - free hw_address on HW interface delete (a HW * struct is memset on pool_get) 4 - free temporary node names during TX node setup Change-Id: Id114c8bb9c844fd4ceb02fbbeb4b511ecfeb61ce Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-04-24span: crash in span_mirror [VPP-1254]Steven1-2/+7
It is possible for span-input to get call with sw_if_index which is greater than sm->interfaces and crashes in span_mirror () in the following line span_interface_t *si0 = vec_elt_at_index (sm->interfaces, sw_if_index0); For example, span-input mirrors a main interface as source, it may actually get call for traffic coming in from the subinterface and crashes. The fix is simply to check if sw_if_index >= vec_len (sm->interfaces) and punt if it is. Change-Id: I8312eb321d638518e14ba2326fffd1a7919646ca Signed-off-by: Steven <sluong@cisco.com>
2018-04-24memory leakKingwel Xie1-0/+3
obvious leak of parent_indices Change-Id: I572b33de1756c8062a87c754117d990622fe12fe Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2018-04-24lacp: deleting the bond subinterface may cause lacp to lose the partner ↵Steven3-23/+2
[VPP-1251] Problem: When the bond subinterface is removed, it was observed that we lost the lacp partner. Show hardware shows rx counter goes up, but show interface does not for the slave interfaces. Cause: We reset the interface promiscuous mode when the bond subinterface is deleted. This causes dpdk not to accept any packet. Leave the interface in promiscuous mode fixes the problem. Other fixes: There are few places we use hw_if_index as if they are sw_if_index. But they don't necessarily have the same value. As soon as a subinterface is created, they start to diverge. The fix is to use the correct API for the hw_if_index and sw_if_index. Change-Id: I1e6b8bca0a4aae396d217a141271cbf968500c91 Signed-off-by: Steven <sluong@cisco.com>
2018-04-18SCTP: coverity scan warningsMarco Varlese3-30/+39
This patch addresses 182346, 182347, 182353. Change-Id: I59c3d74bd3a2122b836c93e22ddb632fa032f7fe Signed-off-by: Marco Varlese <marco.varlese@suse.com> (cherry picked from commit 216c35b2c6e5b4a728675f5141241420841cda34)
2018-04-18SCTP: coverity warningsMarco Varlese1-5/+2
This patch addresses the warning 182994 Change-Id: I071f3cbdf9965c7b57d444f79430ee75c66c856e Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-04-18Fixes for 'make UNATTENDED=yes CC=clang CXX=clang verify'Neale Ranns12-95/+42
Change-Id: I994649761fe2e66e12ae0e49a84fb1d0a966ddfb Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 756cd9441752fc8f84104c9ee19099506ba89f85)
2018-04-17vhost: show vhost-user <interface> may crash [VPP-1242]Steven1-0/+7
show vhost-user <interface> may cause a crash if interface is semi-bogus. Semi-bogus means it is a known vpp interface which has a hw_if_index, but it is bogus because it is not a vhost-user interface. The fix is to add a check to reject non vhost-user interface for the command. Change-Id: I63f1e8bfbf46f5ec4c30f9fb3546982b63cd7cc5 Signed-off-by: Steven <sluong@cisco.com> (cherry picked from commit 583f158b44d9644855441280e09afbf85a4557df)
2018-04-17VPP-1243: fix reassembly CLIKlement Sekera1-5/+6
Change-Id: Ie20aaf0eb1a5a338a54f0de4d6da661431be5163 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-04-13bond: ping fails between l2 BD [VPP-1238]Steven4-15/+91
In dpdk based bonding, when the bond interface is configured for l2, it automatically sets the bond interface to promiscuous mode and sets rx redirect to ethernet-input. This allows traffic to be bridged to non compute node facing interface when it is received from the compute node interface. For native vpp bonding, we need to do similar things. When the bond interface is configured for l2, we set the slave interfaces to promiscuous mode and set rx redirect to ethernet-input because dpdk does not know anything about the bond interface. Likewise, when a new interface is enslaved, we also need to do the same thing if the bond interface has already been configured for l2. Change-Id: I7e168008e8a4221be74929b2a20e6db0ce8f3110 Signed-off-by: Steven <sluong@cisco.com> (cherry picked from commit 4f8863b21405d1ab3e067e978a60be72a343358b)
2018-04-13bond: 1 packet/frame == bad performance [VPP-1236]Steven1-6/+8
While https://gerrit.fd.io/r/#/c/11316/ took care of 1 packet/frame for most of the bonding modes, it missed the broadcast mode. This patch is to fix the 1 packet/frame for the broadcast mode. Change-Id: Iac48a2977c7f702f341479cc712a6448090dbc60 Signed-off-by: Steven <sluong@cisco.com> (cherry picked from commit 22b5be06fae6f9a8b71c53fec548aabbdf69026b)
2018-04-11DVR: save the rewrite length in packet meta-data for featuresv18.04-rc2Neale Ranns1-3/+9
Change-Id: I0efd03bdb84bc9ff2334d398bfdb82486228114a Signed-off-by: Neale Ranns <neale.ranns@cisco.com> (cherry picked from commit 7bf3f9f70e8395c13ed235cb48ec1787b07cf2d9)
2018-04-11L2: no-flood interface type in the Bridge-DomainNeale Ranns5-11/+42
Change-Id: I50ff0cacf88182f8e0be19840c50f4954de586e2 Signed-off-by: Neale Ranns <neale.ranns@cisco.com> (cherry picked from commit 87dad11c8717735479e57cf6c065c7a7963c3aa3)
2018-04-10Change l2-fwd node to allow possible feature before UU-FLOODJohn Lo1-6/+14
If l2-fwd node does not find an L2FIB entry for DMAC of packet, use input feature bitmap to find next node instead of always sending packet to l2-flood node to perform unknow unicast flood. It provides possibilty of using other feature to forward unknow unicast packet instead of flooding the BD. Change-Id: I56b277050537678c92bd548d96d87cadc8d2e287 Signed-off-by: John Lo <loj@cisco.com> (cherry picked from commit 9a719298c3160b0c28aa7d74747ef206751c8cae)
2018-04-09IPIP: version.h is not neededNeale Ranns1-1/+0
Change-Id: I78a4176f98c2b4630a57ac5ddb7faf58ba0c4ee1 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-04-07BIER coveroty fix for unintialised return value on errorNeale Ranns1-1/+1
Change-Id: I2b1d1035f810cb58356626cf081d46eb289265b4 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-04-04Detailed stats collection featureNeale Ranns5-23/+290
Use device-input and interface-output feautre arcs to collect unicast, multicast and broadcast states for RX and TX resp. Since these feature arcs are present only for 'physical' interfaces (i.e. not su-interfaces) counter collection is supported only on parent interface types. Change-Id: I915c235e336b0fc3a3c3de918f95dd674e4e0e4e Signed-off-by: Neale Ranns <nranns@cisco.com> Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-04-04NAT added FIB entries have a preference lower than API/CLINeale Ranns2-0/+6
Change-Id: Ia99490180683e8649784f7d9d18c509c3ca78438 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-04-03reassembly: bug fixesKlement Sekera3-17/+22
This change fixes a bug which would corrupt features infra by making feature infra resistant to double-removal. It also fixes 'out of memory' issue by properly initializing the bihash tables. Change-Id: I78ac03139234a9a0e0b48e7bdfac1c38a0069e82 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-04-03session: use fib index in ip local testFlorin Coras1-1/+1
Change-Id: I148cb40c8bea55dabe54fa6a662d46862e571640 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-30tapv2: 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>
2018-03-30bond: show trace causes a crash if the interface is deletedSteven3-13/+32
For the debug image, if the interface is removed and the trace was collected prior to the interface delete, show trace may cause a crash. This is because vnet_get_sw_interface_name and vnet_get_sup_hw_interface are not safe if the interface is deleted. The fix is to use format_vnet_sw_if_index_name if all we need is to get the interface name in the trace to display. It would show "DELETED" which is better than a crash. Change-Id: I912402d3e71592ece9f49d36c8a6b7af97f3b69e Signed-off-by: Steven <sluong@cisco.com>
2018-03-29Coverity fixes (VPP-1204)Chris Luke5-12/+15
Minor bug fixes CID 183000: double close CID 180996: dead code CID 180995: NULL deref CID 181957: NULL deref CID 182676: NULL deref CID 182675: NULL deref Change-Id: Id35e391c95fafb8cd771984ee8a1a6e597056d37 Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-03-29ip6: fix ip6-local urpf checkingFlorin Coras1-4/+7
Use sw_if_index[VLIB_TX] if set as fib index when doing the urpf check. Change-Id: I5ec3e7f7a54c6782704d91e9a5614fd0f7f9e3de Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-29l2_input:optimize counter accessEyal Bari1-31/+16
only one counter update per frame (was updated per iteration) only access ethertype for casts (was always accessing ethertype) Change-Id: I3a3c3219ec63e975cf5bd8cf2d93103932a4aaa3 Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-03-29tcp: fix fib index buffer taggingFlorin Coras3-14/+19
Change-Id: I373cc252df3621d44879b8eca70aed17d7752a2a Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-29No need for this routine to be globalDave Barach1-1/+1
Causes subtle misbehavior elsewhere Change-Id: I3a0ade26e8e03b8c5dc8e722f6a01fb99ec7a1e0 Signed-off-by: Dave Barach <dave@barachs.net>
2018-03-28bond: cli renameSteven1-11/+10
rename "enslave interface <slave> to <BondEthernetx>" to "bond add <BondEthernetx> <slave> "detach interface <slave>" to "bond del <slave>" Change-Id: I1bf8f017517b1f8a823127c7efedd3766e45cd5b Signed-off-by: Steven <sluong@cisco.com>
2018-03-28SCTP: use custom fibMarco Varlese2-7/+12
Following TCP fixes from Florin (11430), this patch follows the same approach to indicate a fib (not just using the default one). Change-Id: Ib883aa0e9a1c6157acfea69c44426ba07d6c932a Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-03-27vxlan:refactor add del command functionEyal Bari1-102/+43
Change-Id: I33ba5a011100baf1c786f9a63a0cf3d2e1020493 Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-03-27bond: coverity woesSteven2-27/+32
coverity complains about statements in function A function A { x % vec_len (y) } because vec_len (y) is a macro and may return 0 if the pointer y is null. But coverity fails to realize the same statement vec_len (y) was already invoked and checked in the caller of function A and punt if vec_len (y) is 0. We can fix the coverity warning and shave off a few cpu cycles by caching the result of vec_len (y) and pass it around to avoid calling vec_len (y) again in multiple places. Change-Id: I095166373abd3af3859646f860ee97c52f12fb50 Signed-off-by: Steven <sluong@cisco.com>
2018-03-26VCL: add IPv6 to socket_test.sh and make testDave Wallace1-2/+4
Change-Id: If3827828062a46f1cce43642535333f677f06e62 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-03-26Restore the brief FIB entry printingNeale Ranns1-7/+7
Change-Id: I007d48aeb934e5d2f087ca3b8ddc6f7a0e48d411 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-03-26afpacket: Fix the reply if itf already exitsMohsin Kazmi1-1/+3
Change-Id: I47768ea50140222fec54e97cbaff2049bd3cb599 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-03-25session: fix local session disconnectsFlorin Coras3-22/+58
Select the right segment manager for local sessions established via global table. Change-Id: I88ad4bf70d0cae160a0c744950098a954dfbc911 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-23Drop dhcp pkts w/ hardware address mismatchesDave Barach2-11/+40
Add a few dhcp client rx packet/state counters Temporarily disable the dhcp client unit test, since it trips over the newly-added hardware address check. Change-Id: I7f68607e6ed3d738cba357c3fe76664a99b71cd8 Signed-off-by: Dave Barach <dave@barachs.net>
2018-03-23IPSEC_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>
2018-03-23tcp/session: sprinkle prefetchesFlorin Coras4-16/+37
Change-Id: Idef3c665580c13d72e99f43d16b8b13cc6ab746f Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-23session: allow builtin apps to register namesFlorin Coras6-20/+73
Change-Id: I4b428e170436671b329657283cf7653befc85c9f Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-22bond: performance enhancementSteven3-155/+220
We were only puting one packet per frame to the output node. Change to buffer multiple packets per frame. Performance is now on top of dpdk-based bonding. Put a spinlock in the tx thread in case the rug is pulled under us. Change-Id: Ifda5af086a984a7301972cd6c8e428217f676a95 Signed-off-by: Steven <sluong@cisco.com>