167 Commits

Author SHA1 Message Date
daede64544 Fix duplicate free
Change-Id: Ifda07e476c74da9bfd7e21f02aa09160a0212e24
Signed-off-by: Dave Barach <dbarach@cisco.com>
2016-04-22 13:26:15 +00:00
ae605265d2 Use memory from other CPU sockets if there is no local
This fixes crash when local socket memory is not available
so rx/tx queue setup fails. Here we simply retry operation
without being so picky about memory location.

Change-Id: I5bae47defe3c0fe120853378ed13141893284a5a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-22 12:02:26 +00:00
e5055d21a9 Allow L3 forwarded jumbo packets on Bonded Interfaces
Set max L3 packet size allowed to the lowest value of the slave links.
Also cleanup FIXME's for VMXNET3 driver.

Change-Id: Ia5cf742f2ab13b8cdc8ea6286f56464ee4f8c51d
Signed-off-by: John Lo <loj@cisco.com>
2016-04-20 17:25:27 +00:00
6855f6cdfe Python-API: Inital commit of Python bindings for the VPP API.
See: https://wiki.fd.io/view/VPP/Python_API

Change-Id: If135fc32208c7031787e1935b399d930e0e1ea1f
Signed-off-by: Ole Troan <ot@cisco.com>
2016-04-20 16:50:29 +00:00
633951c3d8 delete loopback interface cli
(to be consistent with other delete interface commands)

Change-Id: I41f63cc5b11d9fa9489edc54b17a4d857b711b66
Signed-off-by: Alpesh S. Patel <apatel9191@hotmail.com>
2016-04-20 16:25:19 +00:00
c02f02d64e Cleaned up formatting in device.c - no functionality changes.
Change-Id: Ia7d83784d50b3651117201b876464528d015edea
Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2016-04-20 11:24:50 +00:00
514f651eae Change from nsh-encap to nsh-vxlan-gpe within nsh vxlan tunnel's short_help
Change-Id: Ifeba2e9857a112139b7be6436b59f05858f1abf9
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2016-04-20 03:47:00 +00:00
8358ff95ee Move "ethernet" debug cli commands to "set interface"
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-20 03:21:51 +00:00
a4f16a0e57 Add API to get the dpdk interface stats delta.
Internally change the clearing and displaying of the dpdk stats to be
based on deltas.

Change-Id: I76605ac67492a374ff5522ff44d4a0190cf94e18
Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com>
2016-04-18 14:26:48 +00:00
fef15b4bb8 Add support for AArch32
gcc version 4.9.2 (Raspbian 4.9.2-10)
Tested on Linux raspberrypi 4.4.6-v7+ #875 SMP Tue Apr 12 16:33:02 BST 2016 armv7l GNU/Linux

CPUs may be little or big endian, detect with gcc flags, not the processor architecture
Add a new flag $(PLATFORM)_uses_openssl which allows to disable the link with openssl lib.

vlib/vlib/threads.c:
startup.conf must:
- specify the heapsize as we don't have hugepages on raspbian

cpu {
  main-core 3
}
heapsize 64M

Corrects in various files the assumption uword == u64 and replaces 'u64' cast with 'pointer_to_uword' and 'uword_to_pointer' where appropriate.
256 CPUs may create an OOM when testing with small memory footprint ( heapsize 64M ), allows the number of VLIB_MAX_CPUS to be set in platforms/*.mk

vppinfra/vppinfra/longjmp.S:
ARM - copy r1 (1st parameter of the setjmp call) to r0 (return value)

vppinfra/vppinfra/time.h:
On ARMv7 in AArch32 mode, we can access to a 64bit register to retreive the cycles count.
gcc on rpi only declare ARM_ARCH 6. Override this info, and check if it is possible to use 'mrrc'.
/!\ the time function will NOT work without allowing the user mode access to the PMU.
You may download the source of the kmod here:
https://github.com/christophefontaine/arm_rdtsc

Change-Id: I8142606436d9671a184133b935398427f08a8bd2
Signed-off-by: Christophe Fontaine <christophe.fontaine@qosmos.com>
2016-04-18 13:20:57 +00:00
7a2a378d2d dpdk socket-mem handling optimizations
- introduces default socket-mem size of 512 MB per socket
 - default socket-mem value is applied to all discovered CPU sockets
 - fixes bug when < 1024 socket-mem parameter is specified
 - for socket-mem < 1024 code prefers 2 MB pages
 - improves handling of manualy specified socket-mem values

Change-Id: I9ef848108d7dd1228fbd82a5be49eb5277a93683
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-17 18:26:17 +02:00
f5bf6ddbf2 Using classifier/ACL from now on. Changes pertaining to that.
Change-Id: I682b9a361c7308d6d0abb9d7d0320215f0d91e50
Signed-off-by: rangan <rangan@cisco.com>
2016-04-16 17:33:19 +00:00
007622cfd6 af_packet: clear bitmap entries when processing input
Need to clear the bitmap entry when processing each input file
descriptor.

This becomes an issue on interface deletion. A crash occurs due
to assertion in a debug image

https://gerrit.fd.io/r/#/c/615/ - removed the code when this was set
again, but the bitmap needs to be cleared

Change-Id: I7cccb9bf8b9b2eb5a7f60ecda7530784a9512116
Signed-off-by: Peter Lei <peterlei@cisco.com>
2016-04-15 15:04:48 +00:00
595395d47b Took care of code review comments. Extended the fix to other files.
Change-Id: I24e688884cd5896b317efb53e1d193f7d363715a
Signed-off-by: rangan <rangan@cisco.com>
2016-04-15 11:00:39 +00:00
b92feb6bd3 Add LISP API
SET API:
	lisp_add_del_locator_set
	lisp_add_del_locator
	lisp_add_del_local_eid
	lisp_gpe_add_del_fwd_entry
	lisp_add_del_map_resolver
	lisp_gpe_add_del_iface

SHOW API:
	lisp_locator_set_dump
	lisp_local_eid_table_dump
	lisp_gpe_tunnel_dump
	lisp_map_resolver_dump

Change-Id: Ie7f521e7e64ad2736b8417852b38454bfdef3728
Signed-off-by: Andrej Kozemcak <akozemca@cisco.com>
2016-04-15 09:07:08 +02:00
a42cd34f10 Rework of DPDK PCI device uio driver binding process
This is complete rework of DPDK PCI initialization. It drops
previous scheme where lspci/route/awk/sed are used and instead
sysfs is solely used for discovering Ethernet PCI devices. Criteria
for blacklisting device is changed from exsiting routing table entry
to simple interface state obtained by SIOCGIFFLAGS ioctl().
It checks for IFF_UP flag, so as long as interface is declared
up and even when carrier is down interface will be blacklisted.

Change-Id: I59961ddcf1c19c728934e7fe746f343983741bf1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-14 23:29:13 +00:00
550b5f6252 Init rte_mbuf length fields in af_packet driver
Change-Id: I30cdad9585c1457c0d8ceecb3e5110ad40740021
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-14 23:29:04 +00:00
d1f5d04798 Change ARP and IP6-ND nodes to use interface-output node for output
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-14 23:06:54 +00:00
a991e50f7d Move autogenerated vnet files to config folder
This cleans up vnet folder however it doesn't clean the existing
autogenerated files. I'm not aware of any automated solution to achieve
this without involving git.

Change-Id: Ib29869e08e1d3bd87b7b54bc414f88bd9c632372
Signed-off-by: Florin Coras <fcoras@cisco.com>
2016-04-14 14:02:58 +00:00
0930649eb6 Opaque index is not populated when ACL is configured. Fixed it.
This is inline with ip6_classify.c

Change-Id: Ib6e1f6fa3e4669e0a94e4ae2da48eacb240d192b
Signed-off-by: rangan <rangan@cisco.com>
2016-04-14 14:00:02 +00:00
25fd944a08 VHOST counters reversed
VHOST counters are reversed. RX packet count
    are shown as TX and vise-versa in "show hardware"
    statistics.

Change-Id: Ie1d41f1f0845edf495cdf34ca65466fc307940c6
Signed-off-by: Shesha Sreenivasamurthy <shesha@cisco.com>
2016-04-13 11:16:09 -07:00
b270789741 Create macro for next_nodes used in lookup family of nodes
This should help when adding new adjacency types

Change-Id: I1832c6b7a80b6bc69ed83423a60511b7932f336f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-13 13:42:07 +00:00
370a24e36e Creating a new CLI to create loopback interfaces to make the interface
creation cli consistent

Change-Id: I72f074bb8c771511cb5203af6905adccefbb4197
Signed-off-by: Alpesh Patel <apatel9191@hotmail.com>
2016-04-12 16:01:40 +02:00
b3e80947dc IP6 FIB: Micro optimization in lookup
The mask is increasingly small.
This saves a few cycles and becomes significant when there are many
prefix lengths.

Change-Id: Ibd0c9331f675697bb4e90e8ad617994f83edec9c
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2016-04-12 12:12:50 +00:00
254b036dff Add unit test infrastructure for LISP protocol
Change-Id: I802700ad832de1dc6f4a1981e8985aa6e926c8ad
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2016-04-12 11:47:39 +00:00
e41b49490d Add a counter for unknown IPv6 hop-by-hop options.
Change-Id: I3db82b71ae5e32e0f2230662497a05e57ddb6755
Signed-off-by: Yoann Desmouceaux <ydesmouc@cisco.com>
2016-04-11 17:04:29 +02:00
f53b7d5e97 Fix possible infinite loop in IPv6 hop-by-hop header parsing
Unknown hop-by-hop options are currently not processed, which triggers an
infinite loop due to the pointer not advancing further in the header.

Change-Id: Idf9176090e042b17aac1baa25a6cb4beb8c199d8
Signed-off-by: Yoann Desmouceaux <ydesmouc@cisco.com>
2016-04-11 14:49:56 +00:00
608d1edf74 Add vnet_rename_interface API
Change-Id: I9a8e1ed310aa9a72644540856426c77f61f4b4bb
Signed-off-by: Todd Foggoa <tfoggoa@cisco.com>
2016-04-11 13:18:02 +00:00
5ba5f83b79 Bump DPDK 16.04 to RC4
Change-Id: Ia9affeee54e860b6039d7ee0f411bd022b1dc76c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-11 13:04:16 +00:00
dba76f29e6 Add option to delete af_packet (host) interfaces
Change-Id: Iab76951758ae9b9a99d679a223941a4b8c683078
Signed-off-by: Alpesh S. Patel <apatel9191@hotmail.com>
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-11 11:38:28 +00:00
d530445067 fix uninitialized vars warnings with -Os
Change-Id: I15a16ba9751b6b612bac61a160b5da394ed2e15c
Signed-off-by: Benoît Ganne <bganne@kalrayinc.com>
2016-04-08 22:25:44 -07:00
b2cdd2f5f0 Add Rx and Tx statistics within nsh-vxlan-gpe node
PatchSet2: Modify the code according to review comments.

PatchSet3: modify sw_if_index1 in encap.c.

Change-Id: Ic4d3ee19a0ba0fa10568e570a79a3cb85cfbc9ab
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2016-04-08 14:38:43 +00:00
639b4bded6 Change encap-fib-id and decap-fib-id within create_nsh_vxlan_gpe_tunnel_command
Change-Id: Ied5275fcea21ae2e0b346931f9e2f520a73afd67
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2016-04-07 15:04:27 +00:00
08fa373d2b Add key.pad=0 within vnet_nsh_vxlan_gpe_add_del_tunnel
Change-Id: Ieed704ed0c3d747afc9836671f2ea9cc396ee09d
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2016-04-07 15:02:56 +00:00
e1ed8bddb4 Change key.src=a->dst.as_u32 within vnet_nsh_vxlan_gpe_add_del_tunnel
Change-Id: Ica062e532d116cc1806d73f2fa85db89402928a4
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2016-04-07 15:01:36 +00:00
bcebbb988d Enhance CLI/API Support for Bonded Interface
For interfaces which are slave links to a bounded interface, do not
allow sub-interface creation nor interface state to be changed.
Change "show interface" to display interface state as "bond-slave"
for slave links to a bonded interface.
Change "show hardware" to support a "bond" keyword and display slave
links to a bonded interface.

Change-Id: I4db3cae6985bcb1489ab16a07c72c5ee9b2f2dd3
Signed-off-by: John Lo <loj@cisco.com>
2016-04-07 14:33:05 +00:00
2fa6beff57 Classify node should pay attention to dynamically-added arcs
Change-Id: I65bc03dbb5fedfc75f4ce7153eae116fe599730c
Signed-off-by: Dave Barach <dbarach@cisco.com>
2016-04-07 10:17:31 -04:00
df2b0fd802 Fix ip4 udp encap length type
Change-Id: If666cda99a5fd92e904898ced40bcf2b5ac2d3a5
Signed-off-by: Florin Coras <fcoras@cisco.com>
2016-04-06 08:05:17 -07:00
83cc4e140d host-interface admin down/up does not bring the interface up
Change-Id: I4c9ae5d88e885ccbc85b64cadc052563529c762d
Signed-off-by: Alpesh Patel <apatel9191@hotmail.com>
2016-04-05 13:00:01 -07:00
aff04a0921 Fix DPDK check in udp.h
Change-Id: I4734b248f512e223703d234d28542257af1a8074
Signed-off-by: Florin Coras <fcoras@cisco.com>
2016-04-02 20:33:41 +02:00
e127a7e452 LISP GPE: initial CP commit and DP improvements
Control Plane
-------------
In essence, this introduces basic support for map-request/reply
processing, the logic to generate and consume such messages, including
SMRs, a control-plane backend, consisting of an eid-table, locator and
locator-set tables, and CLI to interact with it. Naturally, we can now
serialize/deserialize LISP specific types: addresses, locators,
mappings, messages. An important caveat is that IPv6 support is not
complete, both for EIDs and RLOCs.

Functionally, the DP forwards all packets it can't handle to the CP
(lisp_cp_lookup node) which takes care of obtaining a mapping for the
packet's destination from a pre-configured map-resolver using the LISP
protocol. The CP then caches this information and programs the DP such
that all new packets with the same destination (or within the covering
prefix) are encapsulated to one of the locators retrieved in the
mapping. Ingress traffic-engineering is not yet supported.

Data Plane
----------
First of all, to enable punting to the CP, when LISP GPE is turned on a
default route that points to lisp_cp_lookup is now inserted. The DP
also exposes an API the CP can use to program forwarding for a given
mapping. This mainly consists in allocating a tunnel and programming the
FIB such that all packets destined to the mapping's prefix are forwarded
to a lisp-gpe encapsulating node.

Another important change done for lisp forwarding is that both source
and destination IP addresses are considered when encapsulating a packet.
To this end, a new FIB/mtrie is introduced as a second stage, src
lookup, post dst lookup. The latter is still done in the IP FIB but for
source-dest entries, in the dest adjacency the lookup_next_index points
to a lisp lookup node and the rewrite_header.sw_if_index points to the
src FIB. This is read by the lisp lookup node which then walks the src
mtrie, finds the associated adjacency, marks the buffer with the index
and forwards the packet to the appropriate next node (typically,
lisp-gpe-encap).

Change-Id: Ibdf52fdc1f89311854621403ccdd66f90e2522fd
Signed-off-by: Florin Coras <fcoras@cisco.com>
2016-04-02 17:20:44 +00:00
aa04a0ff8e Add option to link DPDK dynamically
Change-Id: Ie2b47f9020c8260b199d141103318a0261e16832
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-01 16:38:33 +02:00
102ec52bc4 Add support for installing ipv4 routes via unresolved next hop
Change-Id: I71f3ba0c8192fe0ac3b5b81fb1275b64ec02876a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-01 10:38:42 +00:00
0df78dda5a Add DPDK 16.04-rc2 support
Can be used by specifying DPDK_VERSION=16.04-rc2 in the make command line

Change-Id: I657b44d7ca22f1ef57756e7703088020fab12bc6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-03-29 21:25:12 +00:00
13f3c450cc Support per-interface packet rx redirection
Change-Id: I8bb6124efa5665053620b48d11c8160472103c29
Signed-off-by: Dave Barach <dave@barachs.net>
2016-03-29 11:56:55 -04:00
f1bd8bec87 Move classify_table_index under the union
Fields needed only by specific adj type should
be shared.

Change-Id: I59ee15a29d2f5f527f46910a1a63866b291734c7
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-03-29 12:50:53 +00:00
b2ef4dde97 Adjacency allocator
Change-Id: Ieacbfa4dbbfd13b38eaa2d37f618f212cef4e492
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-03-29 12:46:42 +02:00
a69318b7f7 Increment MRU if hardware supports CRC stripping
Change-Id: I46bd007c3c75e5fb872c1beba557e6140fa8d715
Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com>
2016-03-29 08:59:46 +00:00
ad8b4728cb Allow vlans to be programmed on 40GE VF interfaces
Change-Id: Ia3a1bf7cb482f0aa98628b23d88de01cf60c46a9
Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com>
2016-03-29 08:52:27 +00:00
4b9fb50010 Mark some show commands as mp safe
Change-Id: I92cd378370feeddf27832acde06f186fbdf64908
Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com>
2016-03-29 08:51:59 +00:00