aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/ethernet
AgeCommit message (Collapse)AuthorFilesLines
2016-06-04VPP-113: BVI shall filter unicast DMAC for L2 to L3 forwadingJohn Lo2-8/+8
As BVI receive a packet with unicast DMAC from the BD, including unknown unicast flood packet, the packet should not be L3 forwarded unless its DMAC matches the MAC of the BVI. Change-Id: I46e18629c901062592c8ebe3a238c5cfdc1096b4 Signed-off-by: John Lo <loj@cisco.com>
2016-05-31VPP97: Flooding of pkts with multiple buffers in BD with BVI crashes VPPJohn Lo1-0/+1
The loopback interface should use vnet_interface_output_no_flatten so follow-on buffers of a jumbo packet do not get put on the output frame and be sent back to ethernet-input or l2-input node. The replication_recycle_callback() function should not assume follow-on buffers of a jumbo packet are on the buffer free list. Change-Id: Ide646a6d9b43e82782c0581ea3022a9e70f82582 Signed-off-by: John Lo <loj@cisco.com>
2016-04-28Add ability to set l2_mode_noprotChristian Dechamplain (cdechamp)2-0/+36
Change-Id: I3767a1bbe55452600863e145cbc12b114d6d1024 Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com>
2016-04-28Track number of ethernet vlans in a frameChris Luke2-1/+51
Adds flags to the packet buffer to track the number of VLANs in the current Ethernet frame. We use two bits to signify 0, 1 or 2 VLANs. The value 3 signififies an unknown quantity of VLANs, which includes "three or more" which is not widely supported. We place the bits in the vlib_buffer section; that is not the opaque section, so that all subordinate nodes can use it. For background, see the discussion thread at https://lists.fd.io/pipermail/vpp-dev/2016-March/000354.html The helper macro ethernet_buffer_header_size(buffer) uses these bits stored in "buffer" to calculate the Ethernet header size. The macro ethernet_buffer_set_vlan_count(buffer, count) sets the appropriate bit values based on the number in "count". By current frame we are referring to the case where a packet that arrives from the wire is carrying an encapsulated Ethernet packet. Once decapsulated that inner packet becomes the current frame. There are two places where this value is set; For most Ethernet frames this will be in the "ethernet-input" node when that node parses the Ethernet header. The second place is whenever vnet_update_l2_len() is used to update the layer 2 opaque data. Typically this function is used by nodes just before they send a packet into l2-input. These bits are zeroed in vlib_buffer_init_for_free_list() meaning that wherever the buffer comes from they have a reasonable value (eg, if ip4/ip6 generates the packet.) Primarily this VLAN counter is used by nodes below "ethernet- input" and "l2-input" to determine where the start of the current Ethernet header is. There is opaque data set by "ethernet-input" storing the offset of the current Ethernet header but, since this is opaque, it's not usable by downstream nodes. Previously several nodes have made assumptions regarding the location of the Ethernet header, including that it is always at the start of the packet buffer (incorrect when we have encapsulated packets) or that it is exactly sizeof(ethernet_header_t) away (incorrect when we have VLAN tags.) One notable case where this functionality is required is in ip6_neighbor when it generates a response to a received neighbor soliciation request; it reuses the incoming Ethernet header in-situ and thus needs to reliably know where that header begins. Also, at the suggestion of Dave Barach, this patch removes definition of HGSHM bits in the buffer flags since they are unused and unlikely to ever be. Change-Id: I00e4b9ced5ef814a776020c395d1774aba6185b3 Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-04-26MTU: set interface mtu tapMohsin Kazmi1-2/+2
This patch introduces standard command line 'set interface mtu' for setting the MTU for tap devices. It allows user to set the mtu in between 68 to 65535 bytes aligned to what linux kernel supports for tun/tap devices. Right now tapcli set the same MTU size for each tap interface. But it should be set and configure to per interface rather than per tap instance. Change-Id: I81b7f3ad95ca56d585907ff8f51d9935a428e01b Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2016-04-26Port glean neighbor entry support to IPv6Pierre Pfister1-5/+6
This patch is more or less a port of I71f3ba0c8192 to IPv6. In practice it allows creating a route via a neighbor which is not resolved yet. It also adds static flag to IPv6 neighbor entries. And as Damjan suggested, it formalizes ip46_address_t by using the IPv4 embedded IPv6 address format. Change-Id: Ifa7328a03380ea4ff118b7ca4897b4ab23a3e57c Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2016-04-25Improve mechanism for using loopback interface as BVI for BDsJohn Lo1-10/+38
When loopback interface is configured as BVI, instead of changing its output node from loopN-output to l2-input, the loopN-output node is now kept while its next tx node is changed from ethernet-input to l2-input. The packet setup previously done in bvi_to_l2 as part of l2-input is now performed in the loop output node. This change adds an extra node in the BVI output path but provides the following improvements: 1. IP address/route created on loopback prior to it being configured as BVI will still work properly. The requirement to (re)configure IP/route on loopback after it is configured as BVI is removed. 2. The output stats for loopback interfaces are always provided irrespective of their BVI configuration. 3. The loopback-BVI output stats can be batch updated outside the packet loop in output node, instead of per packet update in l2-input node, making l2-input node more efficient for BVI packets. 4. Restore original node property as implemented in node.c function vlib_node_add_next_with_slot() where next node indices stored in next slots of each node will remain unique. 5. Packet trace for BVI output includes loopN output node which provides useful packet data. Change-Id: I7f5bc72ef953a367363a179088210596881f9e73 Signed-off-by: John Lo <loj@cisco.com>
2016-04-22Add clib_memcpy macro based on DPDK rte_memcpy implementationDamjan Marion4-30/+30
Change-Id: I22cb443c4bd0bf298abb6f06e8e4ca65a44a2854 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-20delete loopback interface cliAlpesh S. Patel1-0/+6
(to be consistent with other delete interface commands) Change-Id: I41f63cc5b11d9fa9489edc54b17a4d857b711b66 Signed-off-by: Alpesh S. Patel <apatel9191@hotmail.com>
2016-04-20Move "ethernet" debug cli commands to "set interface"Damjan Marion2-126/+0
Following two commands are changed: ethernet mtu -> set interface mtu ethernet promiscuous -> set inteface promiscuous Change-Id: I5037e021933156c06044fb723a05ad330f8162b7 Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-14Change ARP and IP6-ND nodes to use interface-output node for outputJohn Lo1-40/+12
The current mechanism for setting up arp-input and ip6-discover-neighbor output nodes for interfaces using their interface link up/down callback function is inefficient and has potential timing issue, as observed for bonded interface. Now both nodes will setup output interface sw_if_index in the the sw_if_index[VLIB_TX] field of current packet buffer and then use the interface-ouput node to tx the packet. One side effect is that vlib_node_add_next_with_slot() needs to be modified to allow the same output node-id to be put at the specified slot, even if another slot contain that same node-id already exist. This requirement is caused by BVI support where all loopback interfaces set up as BVIs will have the same output node-id being l2-input while, for output-interface node, the output slot must match the hw_if_index of the interface. Change-Id: I18bd1d4fe9bea047018796f7b8a4d4c20ee31d6e Signed-off-by: John Lo <loj@cisco.com>
2016-04-12Creating a new CLI to create loopback interfaces to make the interfaceAlpesh Patel1-0/+6
creation cli consistent Change-Id: I72f074bb8c771511cb5203af6905adccefbb4197 Signed-off-by: Alpesh Patel <apatel9191@hotmail.com>
2016-04-01Add support for installing ipv4 routes via unresolved next hopDamjan Marion2-14/+183
Change-Id: I71f3ba0c8192fe0ac3b5b81fb1275b64ec02876a Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-03-14Declare node, hw_interface_class and device_class instances as externalDamjan Marion1-1/+1
This fixes issue observed on Ubuntu 16.04 where dynamic loader is not finding correct instance of specific structure. Change-Id: I618d0933c7e171b8a9b40495b36894785af7790a Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-03-14fix declaration of symbol of different sizeJean-Mickael Guerin1-1/+1
I got many warnings at the link step with gcc version 5.3.1 20160225 (Ubuntu 5.3.1-10ubuntu2): /usr/bin/ld: Warning: size of symbol `cop_input_node' changed from 112 in vnet/cop/.libs/cop.o to 168 in vnet/cop/.libs/node1.o /usr/bin/ld: Warning: size of symbol `ethernet_input_node' changed from 112 in vnet/.libs/interface.o to 136 in vnet/ethernet/.libs/node.o /usr/bin/ld: Warning: size of symbol `l2output_node' changed from 112 in vnet/l2/.libs/l2_efp_filter.o to 120 in vnet/l2/.libs/l2_output.o /usr/bin/ld: Warning: size of symbol `srp_input_node' changed from 112 in vnet/srp/.libs/format.o to 136 in vnet/srp/.libs/node.o /usr/bin/ld: Warning: size of symbol `vxlan_encap_node' changed from 112 in vnet/vxlan/.libs/vxlan.o to 128 in vnet/vxlan/.libs/encap.o /usr/bin/ld: Warning: size of symbol `vxlan_input_node' changed from 112 in vnet/vxlan/.libs/vxlan.o to 144 in vnet/vxlan/.libs/decap.o ... Looking at vlib_node_registration_t, I think the reason is that the char * next_nodes[] could be bigger where the variable is defined in .c file. We should mark global variables as external in header files. Some of them can be made static. Change-Id: Ieb6961fd08180c9a69e1d884852703f3eb23f23f Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
2016-03-11Set hardware iface state for loopback interfacesPierre Pfister1-0/+10
So unless I have missed something, loopback interfaces are spawned hardware-down and never set up. This patch uses the same process as tapcli interfaces by mirroring sw state to hw state. Change-Id: I94198c1c880de773daccbb63ca8d32c4c7e26a74 Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2016-03-03Change default L3 MTU to allow jumbo packets for non-DPDK interfaces.John Lo1-1/+1
Note that L3 MTU for DPDK interfaces is derived from DPDK port_conf in vnet/devices/dpdk/init.c. Change-Id: I9633a1887347a18d05598435baceb6a62cd7b19a Signed-off-by: John Lo <loj@cisco.com>
2016-02-29-O3 warnings be goneDave Barach1-1/+1
Note that compiling -O3 doesn't improve performance as of this writing, might as well clean up warnings in any event. Change-Id: Ic2f4982d12fbbf36f5324075183982731759dc94 Signed-off-by: Dave Barach <dave@barachs.net>
2016-02-24Link the vpp application against libvnet.so, not libvnet.aDave Barach4-0/+30
Turn of srp, mainly as an example of how to restructure a featurette for selective disablement. Change-Id: Id3364c58a8711b103939f4434adfa67177380f67 Signed-off-by: Dave Barach <dave@barachs.net>
2016-02-12Fix ARP show exception when not ARP entries as found.Keith Wiles1-8/+11
The fix tests if the ARP table exist before attempting to interate over the entries. Change-Id: I22cad5ba3a01c3fba1feac33745a29ff1f7f8fe1 Signed-off-by: Keith Wiles <keith.wiles@intel.com>
2015-12-18Fix warnings/errors reported by clangDamjan Marion1-1/+1
Change-Id: Ifb2de64347526e3218e22067452f249ff878fd32 Signed-off-by: Damjan Marion <damarion@cisco.com>
2015-12-14Warnings be goneDave Barach1-0/+2
Change-Id: Id1dcb9d50c3cc516bd2f74bb815eab1c7c55cdb3 Signed-off-by: Dave Barach <dave@barachs.net>
2015-12-08Initial commit of vpp code.v1.0.0Ed Warnicke13-0/+5341
Change-Id: Ib246f1fbfce93274020ee93ce461e3d8bd8b9f17 Signed-off-by: Ed Warnicke <eaw@cisco.com>