summaryrefslogtreecommitdiffstats
path: root/src/vnet/l2
AgeCommit message (Collapse)AuthorFilesLines
2018-09-19L2-fib-dump: send 1 or 0 rather than flag valueNeale Ranns1-3/+3
Change-Id: I487b3b480347f60ffe3af4029adfb22b6700cea7 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-18Fix documentation for SHG in bridge domainYichen Wang1-1/+1
Change-Id: If094971cf011d09fa0daf3ff393f490e584c1151 Signed-off-by: Yichen Wang <yicwang@cisco.com>
2018-09-14Revert "L2-input: use vlib_buffer_enqueue_to_next"John Lo1-317/+239
The patch did not improve single input link performance and degrade performance with multiple input links. This reverts commit b1232555e91b286feab5667b5a22f29aa8e96626. Change-Id: Ib9336a2e0610088b9145a43cacbdadb52dabd522 Signed-off-by: John Lo <loj@cisco.com>
2018-09-13L2-FWD: use vlib_buffer_enqueue_to_next and cache prefetch fixNeale Ranns3-199/+153
before: l2-fwd ... 1.72e1 256.00 after: l2-fwd ... 1.49e1 256.00 Change-Id: I24b29b799435776abc6e60df0dd0301b74aac99b Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-13L2-input: use vlib_buffer_enqueue_to_nextNeale Ranns1-239/+317
use the same trick as l2-ouput to group the processing of packets on the same interface. Change-Id: Ib2a6a1b5f362372936197f5bb2fdd0fe9439226b Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-12L2-Learn: use vlib_buffer_enqueue_to_nextNeale Ranns1-195/+147
before: l2-learn ... 2.00e1 256.00 after: l2-learn ... 1.77e1 256.00 Change-Id: I22fe9ab4ec995ee22c547cfe16bf88c04838520c Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-11L2-learn; cache prefetch fixNeale Ranns2-15/+20
the header is written (STORE) the data is only read (LOAD) Change-Id: Ia3ac0c81224a0db736c329ed3e2e55b7417f08a0 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-08L2 BVI/FIB: Update L2 FIB table when BVI's MAC changesNeale Ranns5-6/+31
also some moving of l2 headers to reduce dependencies Change-Id: I7a700a411a91451ef13fd65f9c90de2432b793bb Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-07L2-FIB: replace bit-fields with flagsNeale Ranns6-69/+132
Change-Id: Ic31da442a0e0477569d53b4a72627bbb25e93365 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-04l2_output:skip processing if no features are enabledEyal Bari1-2/+6
Change-Id: I7fcc082376b451c6179ec2ef58f98c931adfed27 Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-09-03Deprecate old buffer replication schemeDamjan Marion1-1/+0
Change-Id: I1f54b994425c58776e1445c8d9fe142e7a644d3d Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-24l2:bvi-dont aceess sup hw int for broadcastsEyal Bari1-20/+11
sup hw int is needed only for unicast validation Change-Id: I5e5753c09d1c16fdb2435b4db5628a2379fe6f96 Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-08-23coverity: l2 arp termination dumpMohsin Kazmi1-4/+5
This patch resolves the coverity warning. Change-Id: I3f5e664b442fa9bcafd28c67283596570dc1244d Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-08-22l2:remove unused members of input, output configsEyal Bari2-16/+7
reorder structs for less padding Change-Id: Id05123f5bac870e1c585b3aa2177d9e3a6f8d70b Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-08-17l2: arp termination dumpMohsin Kazmi2-0/+106
VPP-1368 Change-Id: I6373f76ba87184a91b517712eafb4ee1f5cea59e Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-08-13Multiarch handling in different constructor macrosDamjan Marion1-11/+5
This significantly reduces need for ... in multiarch code. Simply constructor macros will jost create static unused entry if CLIB_MARCH_VARIANT is defined and that will be optimized out by compiler. Change-Id: I17d1c4ac0c903adcfadaa4a07de1b854c7ab14ac Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-10Use the bihash walk functionNeale Ranns1-126/+130
... rather than re-implementing the loop Change-Id: I20bede8403c804cbec654db9b7020a4d01e5bc18 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-08-09Fix L2 flooding to BVI with error return not workingJohn Lo1-4/+3
Change-Id: Id0b0e9bf1a7ba02144ec75783378352423f7a4b9 Signed-off-by: John Lo <loj@cisco.com>
2018-08-07Fix dangling reference in l2fib_scan(...)Dave Barach1-0/+8
Deleting a bihash kvp frees the bucket's backing storage when the bucket reference count reaches zero. l2fib_scan MUST check for that condition, and stop scanning the bucket if it occurs. One of the L2 FIB extended "make test" vectors caused this issue 100% of the time. Change-Id: I250bcc4c1518e16042120fbc4032227a759a602e Signed-off-by: Dave Barach <dave@barachs.net>
2018-07-26L2 Flood: use the buffer clone API rather than buffer recycleNeale Ranns1-260/+168
Change-Id: I40e4efd8061369efc535f0d49b2f63668b6d1d15 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-07-23L2 EFP: byteswap sw_if_index, enable flag can be u8 on .apiNeale Ranns3-4/+7
Change-Id: Ib99d02e84e468726feae4c386733da405b298e4f Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-07-15VPP-1341: fix loopback interface graph arcsDave Barach1-15/+0
Remove broken special case from l2_input.c:set_int_l2_mode(), which turns out to confuse the graph dispatch engine. The loopback TX function needs to push packets to either ethernet-input or to l2-input, based on bridge / BVI configuration. Rather than overloading a single graph arc - and making vain attempts to reconfigure it - create both arcs and use the correct one. Rewrote the loopback tx function as an idosyncratic multi-arch quad/single loop fn. Change-Id: I15b56ce641d90a11e7b3c7d23859f40e168dd7b2 Signed-off-by: Dave Barach <dave@barachs.net>
2018-07-11bridge-domain:fix no_flood countEyal Bari1-0/+3
no_flood count was not updated on removal might couase a negative insertion index when adding new members Change-Id: I2caf2c453dfef1a9f16fb8fa2e5af42b4e653a69 Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-05-31Improve L2FIB delete entry handling and "show l2fib" CLI optionsJohn Lo4-54/+69
Improve deletion of L2FIB MAC entry using l2fib_add_del API. If sw_if_index param specified in th API is non-zero, check that its value match that of the MAC entry to proceed with deletion. Improve "show l2fib" CLI to allow display of all entries, learned entries only, or added ovia CLI/API entries only. For added entry, show "no" under the age column to indicate entry does not age. Change-Id: I0bd2582c2b6bac268e551e4f8ca6dab2be4400ad Signed-off-by: John Lo <loj@cisco.com>
2018-05-29Add VLIB_NODE_FN() macro to simplify multiversioning of node functionsDamjan Marion1-22/+6
Change-Id: Ibab5e27277f618ceb2d543b9d6a1a5f191e7d1db Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-24Rewrite of l2-output nodeDamjan Marion1-332/+280
Change-Id: I8cbd1eac80ae4aeb173d02786e9ccf3b4877304d Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-11Periodic scan and probe of IP neighbors to maintain neighbor poolsJohn Lo1-5/+2
Scan IPv4 and IPv6 neigbor pool entries once a minute to keep them up to date. The neighbor of an entry is probed if its time-stamp is older than 1 minute. If the neighbor respond, its time-stamp will be updated. If there is no response from a neighbor, its entry will be deleted when the time-stamp of the entry become more than 4 minutes old. Static neighbor entries are not probed nor deleted. Implemented CLI and API to enable and disable priodic scan of IPv4, IPv6 or both types of IP neighbors. CLI is "ip scan-neighbor" and API is "ip_scan_neighbor_enable_disable". Other IP neighbor scan parameters can also be changed from their defaults via the CLI/API. Change-Id: Id1a0a934ace15d03db845aa698bcbb9cdabebfcd Signed-off-by: John Lo <loj@cisco.com>
2018-05-10vppinfra: use count_trailing_zeros in sparse_vec_indexDamjan Marion1-1/+1
It is much cheaper to use ctzll than to do shift,subtract and mask in likely case when we are looking for 1st set bit in the uword. Change-Id: I31954081571978878c7098bafad0c85a91755fa2 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-24Support QOS_SOURCE_IP recording from L2 input node.Igor Mikhailov (imichail)1-0/+1
Some scenarios not involving ip[4,6]-input paths might benefit from IP header QOS fields recorded and applied. An example: L2 (overlay) traffic being encapsulated by VPP in VXLAN and transmitted on another (underlay) interface might want the QOS information carried over in the outer IP header. Change-Id: I4d9462c47ae6ba97680edb1e53340b17cfd7845b Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
2018-04-18typo fix: UNKOWN -> UNKNOWNAndrey "Zed" Zaikin1-1/+1
Change-Id: I008a4d7ad7160d1f07e7ceef712a5318a9368308 Signed-off-by: Andrey "Zed" Zaikin <zed.0xff@gmail.com>
2018-04-13GBP V2Neale Ranns3-1/+6
update the GBP plugin to implement the full NAT feature set of opflex agent Change-Id: Ic06a039c889445ed0b9087fa1f292634192b0f8d Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-04-13bond: ping fails between l2 BD [VPP-1238]Steven1-0/+7
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>
2018-04-09L2: no-flood interface type in the Bridge-DomainNeale Ranns3-10/+33
Change-Id: I50ff0cacf88182f8e0be19840c50f4954de586e2 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-04-06Change 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>
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-14Improve l2_macs_events API to provide MAC move informationJohn Lo4-8/+22
Change mac_entry layout in l2_macs_event API message so the MAC entry can be either add, delete or move where the sw_if_index of an existing MAC entry changed. Also added a 8-bit flags field in mac_entry for any future expansion. Change-Id: I3bf9e1cf2556f2938202025a5d0772c2ce2fc99f Signed-off-by: John Lo <loj@cisco.com>
2018-03-11vnet: l2-classify: prefetch (n+2, n+3) rather than (n+1, n+2) inside dual ↵Andrew Yourtchenko2-10/+10
loop code The dual loop within the L2 classifier processes the (n, n+1) packets, the prefetching was trying to prefetch (n+1, n+2) - thus half of the prefetches were not used - because the next iteration needs (n+2, n+3). Change-Id: I827d20845dbdd0dcdcf463ee25661a7921428992 Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-03-06API: Add service definitions for events and singleton messages (second attempt)Marek Gradzki1-0/+5
Based on https://gerrit.fd.io/r/#/c/10920/ Updates service definition in stats.api with correct reply message names. Change-Id: I3282bee5304e667e23bc1fab3f43d967a50d880d Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2018-03-05Revert "API: Add service definitions for events and singleton messages."Ole Trøan1-5/+0
This reverts commit f7b7fa53b7eaec81d8c00c1023fb7d01f1f9761f. Change-Id: I87496342943248e94f01ada31459f387c0a3a610 Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-05API: Add service definitions for events and singleton messages.Ole Troan1-0/+5
Change-Id: I7de987c30b263d43521e6280c5273f30b5f6e11c Signed-off-by: Ole Troan <ot@cisco.com>
2018-02-26Fix current data offset to use vlib_buffer_get_current in input/output ACLSteve Shin1-5/+5
vlib_buffer_get_current() should be used for current data offset in ACL. This is required for output ACL where packets are decoded through a vxlan tunnel rx node. Change-Id: I6f739f251c3eb0d59ee4ae0da97aa04ddf667468 Signed-off-by: Steve Shin <jonshin@cisco.com>
2018-02-07classifier-based ACL: refactor + add output ACLAndrew Yourtchenko3-380/+144
For implementation of MACIP ACLs enhancement (VPP-1088), an outbound classifier-based ACL would be needed. There was an existing incomplete code for outbound ACLs, it looked almost exact copy of input ACLs, minus the various enhancements, trying to sync that code seemed error-prone and cumbersome to maintain in the longer run. This change refactors the input+output ACLs processing into a unified routine (thus any changes will have effect on both), and also adds the API to set the output interface ACL, with the same format and semantics as the existing input one (except working on output ACL of course). WARNING: IP outbound ACL in L3 mode clobbers the ip.* fields in the vnet_buffer_opaque_t, since the code is using l2_classify.* The net_buffer (p0)->ip.save_rewrite_length is rescued into l2_classify.pad.l2_len, and used to rewind the header in case of drop, so that ipX_drop prints something sensible. Change-Id: I62f814f1e3650e504474a3a5359edb8a0a8836ed Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-01-23VPPAPIGEN: vppapigen replacement in Python PLY.Ole Troan1-1/+1
This is a version of the VPP API generator in Python PLY. It supports the existing language, and has a plugin architecture for generators. Currently C and JSON are supported. Changes: - vl_api_version to option version = "major.minor.patch" - enum support - Added error checking and reporting - import support (removed the C pre-processor) - services (tying request/reply together) Version: option version = "1.0.0"; Enum: enum colours { RED, BLUE = 50, }; define foo { vl_api_colours_t colours; }; Services: service { rpc foo returns foo_reply; rpc foo_dump returns stream foo_details; rpc want_stats returns want_stats_reply events ip4_counters, ip6_counters; }; Future planned features: - unions - bool, text - array support (including length) - proto3 output plugin - Refactor C/C++ generator as a plugin - Refactor Java generator as a plugin Change-Id: Ifa289966c790e1b1a8e2938a91e69331e3a58bdf Signed-off-by: Ole Troan <ot@cisco.com>
2018-01-11api: fix handlers that explicitly depend on svm queueFlorin Coras1-8/+8
Fixes the remainig apis that explicitly check svm queue length. Change-Id: I6055c7c50050affee3098e162e15fb12c205e5db Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-11api: remove transport specific code from handlersFlorin Coras1-19/+20
This does not update api client code. In other words, if the client assumes the transport is shmem based, this patch does not change that. Furthermore, code that checks queue size, for tail dropping, is not updated. Done for the following apis: Plugins - acl - gtpu - memif - nat - pppoe VNET - bfd - bier - tapv2 - vhost user - dhcp - flow - geneve - ip - punt - ipsec/ipsec-gre - l2 - l2tp - lisp-cp/one-cp - lisp-gpe - map - mpls - policer - session - span - udp - tap - vxlan/vxlan-gpe - interface VPP - api/api.c OAM - oam_api.c Stats - stats.c Change-Id: I0e33ecefb2bdab0295698c0add948068a5a83345 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-09api: refactor vlibmemoryFlorin Coras2-8/+7
- separate client/server code for both memory and socket apis - separate memory api code from generic vlib api code - move unix_shared_memory_fifo to svm and rename to svm_fifo_t - overall declutter Change-Id: I90cdd98ff74d0787d58825b914b0f1eafcfa4dc2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-12-20L2 EmulationNeale Ranns1-0/+1
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-11-10Break up vpe.apiNeale Ranns2-5/+273
- makes the VAPI generated file more consumable. - VOM build times improve. Change-Id: I838488930bd23a0d3818adfdffdbca3eead382df Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2017-11-10Further fix to SHG handling for ARP/ICMPv6 from BVI in a BDJohn Lo1-6/+25
For ARP/ICMPv6 packets received from a BVI in a BD, allow flood to all remote VTEPs via VXLAN tunnels irrespective of SHG check for ARP request or ICMPv6 neighbor solicitation packets only. All other packets types will flood normally as per SHG check. Change-Id: I17b1cef9015e363fb684c2b6506ed6c4efe70bba Signed-off-by: John Lo <loj@cisco.com> (cherry picked from commit 5b99133cff1ff0eb9043dd8bd3648b0b3aafa47e)
2017-11-08Fix SHG handling for ARP/ICMPv6 received from BVI in a BDJohn Lo1-0/+8
This change makes sure ARP/ICMPv6 brodcast packets received from the BVI of a BD can be flooded to all remote VTEPs via its VXLAN tunnels irrespective of SHG setting. Similar processing was done for unicast packets already and needs to be extpanded to ARP and ICMPv6 broadcast packets. Change-Id: I26ac43ecdbc81a769f742a583a156506f7e70d49 Signed-off-by: John Lo <loj@cisco.com> (cherry picked from commit c97b4aca0db8d84b17ceb03a14ab44346a2b3466)