aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet
AgeCommit message (Collapse)AuthorFilesLines
2018-07-21Loopback tx: support multiple tx intfcs per frameDave Barach1-153/+197
Can happen if code bypasses the per-interface output node, and dispatches packets directly to the tx node. Switch to vlib_get_buffers(...) ... vlib_buffer_enqueue_to_next (...), quad/single loop coding pattern. Change-Id: Ic0e5d3b9748230f4e545a54186e6e64e7a782bb1 Signed-off-by: Dave Barach <dave@barachs.net>
2018-07-20IP directed broadcastNeale Ranns1-0/+9
with ip direct broadcast enable a packet to the interface's subnet broadcast address with be sent L2 broadcast on the interface. dissabled, it will be dropped. it is disabled by default, which preserves current behaviour Change-Id: If154cb92e64834e97a541b32624354348a0eafb3 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-07-20QoS: marking and recording for MPLS and VLANNeale Ranns1-0/+8
Change-Id: Icec79aa9039d5d7835d311fde0b7c1a0c76c9eb1 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-07-19Remove unused argument to vlib_feature_nextDamjan Marion1-3/+3
Change-Id: Ieb8b53977fc8484c19780941e232ee072b667de3 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-17loopback:fix delete to check interface classEyal Bari1-13/+6
Change-Id: Ia563b279e85b5da93f79db5a2a4d9b8c04f5be99 Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-07-15VPP-1341: fix loopback interface graph arcsDave Barach1-50/+173
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-14Improve IP4 ARP and IP6 ND Events Notificationv18.10-rc0John Lo1-10/+25
For L2 ARP termination, use both brodcast ARP request and reply packets to provide MAC/IP binding events. For IP4/IP6 neighbor adress resolution, send resolution events if there is an address resolution attemp with a static neighbor entry where both IP and MAC matches. This allow probe of an IP neighbor with a static entry to confirm it is responding with a reply matching that of the static entry. Change-Id: Iffb923bb5aea3f9021436735d5ca06e7b24f966f Signed-off-by: John Lo <loj@cisco.com>
2018-07-11avoid using thread local storage for thread indexDamjan Marion2-2/+2
It is cheaper to get thread index from vlib_main_t if available... Change-Id: I4582e160d06d9d7fccdc54271912f0635da79b50 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-07PipesNeale Ranns2-3/+15
A pipe resembles a unix pipe. Each end of the pipe is a full VPP interface. pipes can be used for e.g. packet recirculation, inter-BD, etc. Change-Id: I185bb9fb43dd233ff45da63ac1b85ae2e1ceca16 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-06-25Add checks for bad ARP request packets in arp-termination nodeJohn Lo1-12/+9
Check ARP request packet with bad requester MAC/IP address and drop these packets. Also removed useless VRRP check in the node. Change-Id: I2c8a774d291928eb623b3a515f1edf7e338fa760 Signed-off-by: John Lo <loj@cisco.com>
2018-06-19Check get packet template allocation failure (VPP-1321)John Lo1-0/+6
After calling vlib_packet_template_get_packet(), make sure packet buffer is allocated before using it. Change-Id: Idb5199f4e2c9596137b2101e502d611f474a6ffe Signed-off-by: John Lo <loj@cisco.com>
2018-06-11MTU: Software interface / Per-protocol MTU supportOle Troan1-3/+1
This patch separates setting of hardware interfaec and software interface MTU. Software MTU is L2 payload MTU (i.e. not including L2 header). Per-protocol MTU for IPv4, IPv6 and MPLS can also be set. Currently only IP4, IP6 are enabled in adjacency / rewrite code. Documentation in src/vnet/MTU.md Change-Id: Iee2fd6f0bbc8210748dd8e073ab9fab87d323690 Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-08Gratuitous ARP packet handlingNeale Ranns1-8/+33
only learn from a GARP packet if it is an update to an existing entry. Change-Id: I4c1b59cfedb911466e5e4c9756cf53a6676e1909 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-06-07Revert "Allow arp-input node to learn IPv4 neighbors from GARP packets"John Lo1-5/+0
This reverts commit d018870d1b02109fc8b328446f15312fdd2fcd11. Change-Id: I700ade7a25ae5ed72cfed586e50b02492a4f11de Signed-off-by: John Lo <loj@cisco.com>
2018-06-07Allow arp-input node to learn IPv4 neighbors from GARP packetsJohn Lo1-0/+5
Change-Id: I86019f4ff9b0c8c633638fa23341d8ce49099ba6 Signed-off-by: John Lo <loj@cisco.com>
2018-06-05bond: send gratuitous arp when the active slave went down in active-backup modeSteven2-14/+16
- Modify the API send_ip6_na and send_ip4_garp to take sw_if_index instead of vnet_hw_interface_t and add call to build_ethernet_rewrite to support subinterface/vlan - Add code to bonding driver to send an event to bond_process when the first interface becomes active or when the active interface is down - Create a bond_process to walk the interface and the corresponding subinterfaces to send garp/ip6_na when an event is received. - Minor cleanup in bonding/node.c Note: dpdk bonding driver does not send garp/ip6_na for subinterfaces. There is no attempt to fix it here. But the infra is now done and should be easy to add the support. Change-Id: If3ecc4cd0fb3051330f7fa11ca0dab3e18557ce1 Signed-off-by: Steven <sluong@cisco.com>
2018-05-28Fix IP neighbor/arp pool full and static entry handlingJohn Lo1-69/+69
Move handling of IP neighbor pool full into main thread on entry creation and make sure static entriesare not deleted for reuse. Fix IPv6 neighbor handling on interface down and up so that static entries are not deleted. Change-Id: I073794949a41a5b86201e519ebe479febfc506c8 Signed-off-by: John Lo <loj@cisco.com>
2018-05-25ARP proxy dumpsNeale Ranns3-20/+78
Change-Id: I8335ebf266becf2f42bb3f28a17dfed8d9b08f97 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-05-18ARP: Ensure STATIC and DYANMIC ARP flags are mutually exclusive.Jon Loeliger1-3/+9
Change-Id: I44278dea2ee1daa147b0928bfe26e861907a209f Signed-off-by: Jon Loeliger <jdl@netgate.com>
2018-05-11Periodic scan and probe of IP neighbors to maintain neighbor poolsJohn Lo2-4/+15
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-04-27TAP memory leaks:Neale Ranns1-1/+0
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-19Minor optimzation/cleanup to ethernet-input nodeJohn Lo1-5/+5
Change-Id: Ibf3ef82950f50b746394a731cd2e7cba1cd16ec4 Signed-off-by: John Lo <loj@cisco.com>
2018-04-18Mcast rewrite optimisationsNeale Ranns1-3/+2
hard code the address mask offsets. This are protocol specific and only used on ethernet when used at all. Change-Id: Ib1f6f33682f53254ffbb5a241a1583e65420e0c7 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-04-13Revert "MTU: Setting of MTU on software interface (instead of hardware ↵Damjan Marion1-1/+4
interface)" This reverts commit 70083ee74c3141bbefb185525315f1b34497dcaa. Reverting as this patch is causing following crash: 0: /home/damarion/cisco/vpp3/build-data/../src/vnet/devices/devices.h:131 (vnet_get_device_input_thread_index) assertion `queue_id < vec_len (hw->input_node_thread_index_by_queue)' fails Aborted Change-Id: Ie2a365032110b1f67be7a9d832885b9899813d39 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-13MTU: Setting of MTU on software interface (instead of hardware interface)Ole Troan1-4/+1
Change-Id: I98bd454a761a1032738a21edeb0fe847e801f901 Signed-off-by: Ole Troan <ot@cisco.com>
2018-04-13GBP V2Neale Ranns2-3/+17
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-12Fixes for 'make UNATTENDED=yes CC=clang CXX=clang verify'Neale Ranns1-1/+0
Change-Id: I994649761fe2e66e12ae0e49a84fb1d0a966ddfb Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-04-09L2: no-flood interface type in the Bridge-DomainNeale Ranns1-0/+4
Change-Id: I50ff0cacf88182f8e0be19840c50f4954de586e2 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-04-04Detailed stats collection featureNeale Ranns1-0/+45
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-03-20FIB Interpose SourceNeale Ranns1-1/+1
The interpose source allows the source/provider to insert/interpose a DPO in the forwarding chain of the FIB entry ahead of the forwarding provided by the next best source. For example if the API source (i.e the 'control plane') has provided an adjacency for forwarding, then an interpose source (e.g. a monitoring service) couold interpose a replicatte DPO to copy the traffic to another location AND forward using the API's adjacency. To use the interose feature an existing source (i.e FIB_SOURCE_PLUGIN_HI) cn specifiy as a flag FIB_ENTRY_FLAG_INTERPOSE and provide a DPO to interpose. One might also consider using interpose in conjunction with FIB_ENTRY_FLAG_COVER_INHERIT to ensure the interpose object affects all prefixes in the sub-tree. Change-Id: I8b2737b985f8f7c08123406d0491881def347b52 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-03-16QoS recording and markingNeale Ranns1-0/+9
Change-Id: Ie5a50def4ec1e4a3b3404a8b6ab9ec248bc16744 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-03-07Fix Avoid crash in vnet_delete_sub_interface routineSteve Shin1-1/+2
vnet_get_sw_interface shoud be called after sw_if_index is validated. Change-Id: I36f1d90999c740803386404ba9b32703b659cd54 Signed-off-by: Steve Shin <jonshin@cisco.com>
2018-02-20Fix reset the vlan flags when main interface is deleted.Steve Shin1-0/+2
The dot1q_vlans & dot1ad_vlans should be reset to 0 when main interface is deleted. Otherwise, VPP will crash if the same interface index is reused without attaching the sub interface on it. Change-Id: I484d4a8892ff4241a3a32b22189746193d5f2594 Signed-off-by: Steve Shin <jonshin@cisco.com>
2018-02-20vppinfra: CLIB_HAVE_VEC128 mandates SSE4.2Damjan Marion1-0/+2
Change-Id: I6511110d0472203498a4f8741781eeeeb4f90844 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-19Use neutral vector code for ethernet_frame_is_taggedDamjan Marion2-41/+43
Also it removes ethernet_frame_is_any_taged implemebntation which seems to be equally costly compared to two invocations of ethernet_frame_is_tagged. Change-Id: If1c95f8267cd34b807ec07e0d675cbd0db2fdf9f Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-16Allow providers to override glean behaviourNeale Ranns1-1/+9
and update glean address on local interface MAC change Change-Id: I530826d60c7e9db2b0fa2d45754139d82c5ea807 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-02-15Revert "Allow interface types to override glean adjacency behaivour"Ole Trøan1-5/+1
This reverts commit 8b30e471df4d42214619e1d6c50cc8298426b45f. Change-Id: I99edb236eb0a7f8ba3fba333c3481a710ebcb59c Signed-off-by: Ole Troan <ot@cisco.com>
2018-02-15Allow interface types to override glean adjacency behaivourNeale Ranns1-1/+5
update the glean adj on a local interface MAC change Change-Id: Ia5c5cde424ed0fea3431532cc5abf22b364bbab5 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-02-06Fix clang implicit conversion errorsDamjan Marion2-14/+16
Change-Id: I1771a1cca2a4bc394677b2a18f14c47f0633fa77 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-01-23VPPAPIGEN: vppapigen replacement in Python PLY.Ole Troan1-2/+2
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-19Sub-Interface deletion not cleanup hash's properly (VPP-1136)John Lo1-10/+7
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> (cherry picked from commit 7f5bec647c9dc743c015d461d040e63a77fd0a08)
2018-01-17Fix checksum offload sssue caused by overwriten lX_hdr_offsetDamjan Marion1-2/+2
This happens when 2 packets belonging to 2 different interfaces hit dual loop in the ethernet-input. Packets go to slow path which doesn't set l2 hdr offset correctly for l3 packets. Change-Id: I61d87c079db0b2e21f8af6f6b600bff14030535d Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-01-06VPP-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>
2017-12-08tapv2: multiple improvementsDamjan Marion1-0/+6
- change interface naming scheme - rework netlink code - add option to set link address, namespace Change-Id: Icf667babb3077a07617b0b87c45c957e345cb4d1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-12-06Remove unused, uninteresting codeDave Barach1-397/+0
Move elog_sample.c to src/examples/vlib Change-Id: I7d32c83c424b9ca4a057372c7fc6a6e2b7dab034 Signed-off-by: Dave Barach <dave@barachs.net>
2017-12-04vnet: set vnet_buffer l2_hdr_offset and l3_hdr_offsetSteven1-0/+22
Changes made in ethernet_input to set l2_hdr_offset,l3_hdr_offset, and their corresponding flags. Please note that ethernet_input, as a critical DP, incurs a few extra cpu cycles due to this patch, but for a worthy cause. Change-Id: Ie9ae352ea62959d2779ebcca98a1898e3d9e1d6f Signed-off-by: Steven <sluong@cisco.com>
2017-10-24Add extern to *_main global variable declarations in header files.Dave Wallace1-1/+1
- Global variables declared in header files without the use of the 'extern' keword will result in multiple instances of the variable to be created by the compiler -- one for each different source file in which the the header file is included. This results in wasted memory allocated in the BSS segments as well as potentially introducing bugs in the application. Change-Id: I6ef1790b60a0bd9dd3994f8510723decf258b0cc Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2017-10-09vppapigen: support per-file (major,minor,patch) version stampsDave Barach1-0/+2
Add one of these statements to foo.api: vl_api_version 1.2.3 to generate a version tuple stanza in foo.api.h: /****** Version tuple *****/ vl_api_version_tuple(foo, 1, 2, 3) Change-Id: Ic514439e4677999daa8463a94f948f76b132ff15 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Ole Troan <ot@cisco.com>
2017-10-04[aarch64] Fixes CLI crashes on dpaa2 platform.Christophe Fontaine3-3/+3
- always use 'va_args' as pointer in all format_* functions - u32 for all 'indent' params as it's declaration was inconsistent Change-Id: Ic5799309a6b104c9b50fec309cba789c8da99e79 Signed-off-by: Christophe Fontaine <christophe.fontaine@enea.com>
2017-10-03Repair vlib API socket serverDave Barach1-1/+2
- Teach vpp_api_test to send/receive API messages over sockets - Add memfd-based shared memory - Add api messages to create memfd-based shared memory segments - vpp_api_test supports both socket and shared memory segment connections - vpp_api_test pivot from socket to shared memory API messaging - add socket client support to libvlibclient.so - dead client reaper sends ping messages, container-friendly - dead client reaper falls back to kill (<pid>, 0) live checking if e.g. a python app goes silent for tens of seconds - handle ping messages in python client support code - teach show api ring about pairwise shared-memory segments - fix ip probing of already resolved destinations (VPP-998) We'll need this work to implement proper host-stack client isolation Change-Id: Ic23b65f75c854d0393d9a2e9d6b122a9551be769 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Signed-off-by: Florin Coras <fcoras@cisco.com>