378 Commits

Author SHA1 Message Date
Damjan Marion
6b1d7c55d6 Make automake silent rules default
Change-Id: Ia504ccdac1deac20f20cf7fb76f78b2d8c505474
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-26 19:36:59 +00:00
Damjan Marion
fa6935594d Fix clang warnings in api code
Change-Id: I7a4bc4678fea723c35bbeac1b893c5c52235aa67
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-26 19:35:12 +00:00
Mohsin Kazmi
f2ba9aadbb MTU: set interface mtu tap
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-26 16:43:30 +00:00
Damjan Marion
e39a7b8347 Fix compile errors reported by clang
For using clang as a compiler it is enough
to specify CC=clang in the make command line

Change-Id: I06f1c1d418b68768f8119de5bdc8748c51f90c02
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-26 16:16:44 +00:00
Pierre Pfister
1dabaafceb Port glean neighbor entry support to IPv6
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-26 14:09:00 +00:00
Hongjun Ni
0371807f7b Fix decap's second-loop failure issue within nsh-vxlan-gpe
Change-Id: I7c5c93b6490baa05b9b203b6d065d9c31f36d531
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2016-04-26 12:32:04 +00:00
Dave Barach
fed985c898 Build vpp w/ dpdk-16.04 by default
Change-Id: I82cdd82213517c51064eb439c44068d8977e5619
Signed-off-by: Dave Barach <dave@barachs.net>
2016-04-26 09:58:54 +00:00
Damjan Marion
106f0eda8d Gernerate dpdk config out of target specific files
DPDK 16.04 introduced new config parameter RTE_ARCH_X86
which was missing in the dpdk/Makefile

That caused issues with virtio devices on older kernels
(observed on 3.13.0).

This patch changes the source of generated config so
it will also include all defines in config/defconfig_TARGET
file.

Change-Id: Idc6ccbef1d01da84235281ea1078c081846446de
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-26 09:58:19 +00:00
John Lo
350dc1cd78 Put back VMXNET3 driver init for DPDK 2.2.0 or older versions
Change-Id: I3fb9441fb7272072aba9721ca729d6ce5f2c00af
Signed-off-by: John Lo <loj@cisco.com>
2016-04-25 19:52:52 +00:00
Shesha Sreenivasamurthy
423f723a5a Disable TSO/CSUM offloading
Enabling these features breaks L4 traffic when a VHOST
  interface is bridged with a hardware interface which
  does not support such offloading. (Eg: enic)

Change-Id: Ife3d292a8860eb60b82f1473e2d0dd7329e51d5e
Signed-off-by: Shesha Sreenivasamurthy <shesha@cisco.com>
2016-04-25 19:09:31 +00:00
Shesha Sreenivasamurthy
cbdd897846 Fix vpp crash in DBG mode
virtio-vhost driver was specifying wrong prefetch
    size. This caused VPP to assert in DBG mode.

Change-Id: Icbe3d5574bd2463b98dfc618a001b16198ab82be
Signed-off-by: Shesha Sreenivasamurthy <shesha@cisco.com>
2016-04-25 14:38:33 -04:00
Ed Warnicke
d6a0fc5ea6 Break boostrap.sh into pieces
In order to make it easier for folks who have existing
Centos or Ubuntu boxes to utilize the same
'Getting started' scripting that is used in Vagrant,
as well as enable us to use that scripting in CI,
broke up bootstrap.sh into

update.sh - Things like apt-get update
build.sh - Install any dependencies and build vpp
clearinterfaces.sh - Clean off any non-default gateway
                   interfaces.  Used by vagrant.
run.sh - Start vpp as a service on the box.

A user (or CI) just wanting to get going and build
on an existing Ubuntu or Centos image (ie, not via
vagrant) can simply run

build.sh

Change-Id: I8f19342f163cad07c6c05def943a5fb8e394b879
Signed-off-by: Ed Warnicke <eaw@cisco.com>
2016-04-25 17:27:09 +00:00
Damjan Marion
108c731385 Add native NETMAP driver
This is first drop of native NETMAP driver.
It is mainly tested with NETMAP pipes but also
support for native interfaces should work.

New CLI:
create netmap [<intf name>|valeXXX:YYY] [hw-addr <mac>] [pipe]
[master|slave]

Following example creates NETMAP pipe where VPP acts as master:

 create netmap name vale00:vpp1 pipe master

then NETMAP pkt-gen tool can be used to send traffic:

 pkt-gen -i vale00:vpp1}0  -f tx

Change-Id: Ie0ddaa5facc75285b78467420e8a9f9c8dfc39e5
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-25 14:24:03 +00:00
Bud Grise
68adab9267 Allow the number of elements in a frame queue to be specified per thread.
Change-Id: I026a61a943960dc52539565968a942fbd851da93
Signed-off-by: Todd Foggoa <tfoggoa@cisco.com>
2016-04-25 13:27:45 +00:00
Todd Foggoa (tfoggoa)
a30d40d33c Add APIs to access dpdk information
- Add an API to get the number of DPDK mbufs
- Add an API to detemrine if the io thread has been released
- Add an API to get the DPKD pmd type
- Add an API to get the cpu socket of a device

Change-Id: I926401891fb6053c676125c9d0621cc9ed1f80bb
Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com>
2016-04-25 13:25:22 +00:00
Hongjun Ni
2acdb58d92 Change ethernet's result within unformat_decap_next
Change-Id: Ib3f9d1a03930842063ebfbfcfeefca533a678416
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2016-04-25 13:19:04 +00:00
Florin Coras
577c3553dd Convert lisp-gpe encap to interface tx node
With this change, one lisp-gpe interface is created per vrf/overlay
tenant and its tx node is used as encapsulator (or tunnel ingress). For
all intents and purposes, the tx node inherits all functions previously
performed by the lisp-gpe-encap node and it maintains said node's
position in lisp-gpe's data-path graph. Chiefly, this opens the
possibility to chain interface features, like IPSec, transparently with
LISP. Furthermore, it brings basic data plane support for vrfs and LISP
instance-ids (or virtual network instances as per RFC7364).

Other changes include improvements to lisp-gpe enable and disable
sequences and corresponding API/VAT fixes.

Change-Id: I085500450660a976b587b1a720e282f6e728d580
Signed-off-by: Florin Coras <fcoras@cisco.com>
2016-04-25 13:05:49 +00:00
John Lo
405e41b50e Improve mechanism for using loopback interface as BVI for BDs
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-25 12:58:41 +00:00
Ole Troan
d06b9f9cbf Python-API: Python 2 support.
Change-Id: I6bc656caf22e284233e27f9e003f11502f306c11
Signed-off-by: Ole Troan <ot@cisco.com>
2016-04-25 13:11:19 +02:00
Ole Troan
fc6cf287c4 Python-API: Support for zero-length arrays from caller to VPP. (Previously only VPP to caller was supported.)
Change-Id: Id660caeb780f3b26cc091467291463980f485178
Signed-off-by: Ole Troan <ot@cisco.com>
2016-04-25 12:37:12 +02:00
Keith Burns (alagalah)
8a1a19b8b6 Updated .gitignore for Python API generated file
Change-Id: I7c08b52124b44feb36e04a7fd417fe14b367cb44
Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2016-04-24 11:13:49 -07:00
Damjan Marion
f1213b8277 Add clib_memcpy macro based on DPDK rte_memcpy implementation
Change-Id: I22cb443c4bd0bf298abb6f06e8e4ca65a44a2854
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-22 17:29:47 +02:00
Dave Barach
2b836cf4d1 Add a vpp_restart command
vpp_restart solves the problem of restarting vpp and not exiting until
the new vpp instance is sufficiently established to allow immediate
binary API connections. The point is to avoid using arbitrary "sleep
N" commands e.g. in CSIT shell scripts.

We send SIGTERM to the current vpp process, and expect / depend on the
process-monitor du jour to remove the vpp-api shared-memory segment.

vpp_restart exits w/ status 0 if all is well, non-zero upon failure.

In trying to make vpp_restart reliable, we discovered a
recently-introduced heap corruption bug in .../dpdk/init.c, which
caused vpp to crash on startup once every 20 times on a particular
rig.

If possible, we should check /var/log/syslog for evidence of
unexpected multiple restarts during regression-testing.

Change-Id: Ic48c74b1a94a4368066ba2e326d4b12d51192088
Signed-off-by: Dave Barach <dbarach@cisco.com>
2016-04-22 09:54:33 -04:00
Dave Barach
daede64544 Fix duplicate free
Change-Id: Ifda07e476c74da9bfd7e21f02aa09160a0212e24
Signed-off-by: Dave Barach <dbarach@cisco.com>
2016-04-22 13:26:15 +00:00
Damjan Marion
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
Damjan Marion
7cd98ea5ad Removing dpdk socket-mem from startup.conf
We allocate 512M of memory on each available cpu socket
by default so this is not needed anymore in startup.conf

Change-Id: Ib28b25df8d6722777a006aaddd1d56f21ab7b58a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-21 19:53:25 +00:00
Damjan Marion
7c1ef81480 Fix warning in vppapigen
Change-Id: I6301ece0d772fd5a6271edd07765b05ef0b63f21
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-21 14:04:10 +00:00
Damjan Marion
bd4b590561 Add Broadwell-EP/EX to the uarch list
Change-Id: I2ab84846ac88d3170b8c847914749e2a728dfa2b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-21 14:03:55 +00:00
Damjan Marion
c843ddcbec Remove execute flags from some dpdk patch files
Change-Id: I972b784082de45480baf1d1f07845743afddea40
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-20 21:02:16 +00:00
Srivatsa Sangli
0777915b2a ubuntu 16.04 build support. Supporting systemd with vpp.service files.
Incorporating review comments : modified debian/control dependencies

Change-Id: Ib2fe85d81eb7f1803ef8f54294c7c18cd07c61ba
Signed-off-by: Srivatsa Sangli <srivrama@cisco.com>
2016-04-20 18:44:41 +00:00
John Lo
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
Ole Troan
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
Alpesh S. Patel
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
Keith Burns (alagalah)
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
Hongjun Ni
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
Damjan Marion
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
Dave Barach
ec177abc1a Add TAG=vpp_gcov which compiles vpp to produce .gcda files
Change-Id: Ib6a0940e08f9e0983f3ec70f9e8488c2185ca4da
Signed-off-by: Dave Barach <dave@barachs.net>
2016-04-20 03:13:54 +00:00
Dave Barach
dae88b9a53 VPP-6: set epoll wait-time to zero when binary API messages are waiting
Change-Id: I629ef98ecd3b729d2564b3a1ba8c6039f854f86c
Signed-off-by: Dave Barach <dave@barachs.net>
2016-04-19 09:38:53 -04:00
Sean Hope
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
Christophe Fontaine
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
Damjan Marion
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
rangan
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
John Lo
6bfd2633a1 ENIC driver patch to fix rx miss or drop counters
Change-Id: Ic05d182a5659417e91b85c0ae20b6822a5445945
Signed-off-by: John Lo <loj@cisco.com>
2016-04-16 00:00:17 -04:00
Peter Lei
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
Dave Barach
51c02a4778 Remove historical netconf message switch APIs
The scheme is unused, and never to be used again; it was a bad idea in
the first place.

Change-Id: I1479a1fa9191e0374e00f7326545d216c3a11e32
Signed-off-by: Dave Barach <dave@barachs.net>
2016-04-15 08:25:20 -04:00
rangan
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
Andrej Kozemcak
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
Damjan Marion
95db563571 Fix dependency install on Ubuntu 16.04
Change-Id: I2a915a64c65ee78658ee782c0f16963024b8b2eb
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-04-14 23:29:48 +00:00
Damjan Marion
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
Damjan Marion
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