vpp.git
7 years agoBD:unify bridge domain creation code 98/6098/5
Eyal Bari [Fri, 7 Apr 2017 20:14:17 +0000 (23:14 +0300)]
BD:unify bridge domain creation code

Change-Id: I29082e7a0c556069180a157e55b3698cf8cd38c7
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agoBFD: disable gcc6 warnings in helper macros 70/6370/3
Klement Sekera [Mon, 24 Apr 2017 02:30:53 +0000 (02:30 +0000)]
BFD: disable gcc6 warnings in helper macros

Change-Id: Ibec3f1a2619d593accd8c560fb29d39d5617e16a
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoMove emacs stuff to extras/ 92/6292/6
Damjan Marion [Thu, 20 Apr 2017 09:42:28 +0000 (11:42 +0200)]
Move emacs stuff to extras/

Change-Id: Ibbb7d8500e9064215cf912bd00bdf72a748f8a27
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agovhost: remove socket linked file when deleting vhost interface 47/6347/3
Steven [Fri, 21 Apr 2017 20:31:50 +0000 (13:31 -0700)]
vhost: remove socket linked file when deleting vhost interface

- Unlink the file created for the socket when deleting vhost interface
if we are the server mode.
- Remove all vhost interfaces when VPP process is exitting.

Change-Id: Id9b676cd027bbd67b473bbd01901d1ecc4d8e6cb
Signed-off-by: Steven <sluong@cisco.com>
7 years agoDebug CLI to magically create / delete a TCP session 08/6308/4
Dave Barach [Thu, 20 Apr 2017 21:50:39 +0000 (17:50 -0400)]
Debug CLI to magically create / delete a TCP session

The session ends up in established state, and is hand-crafted to look
like it was created by the builtin_server.

This will come in handy for injecting packets into tcp46-established,
along with ancillary debug CLI to adjust connection parameters.

Immediate applications include screwball window cases, out of order
segments, paws checking, and so on and so forth.

Debug CLI script:

loop create
set int ip address loop0 6.0.1.1/8
set int state loop0 up
set ip arp loop0 6.0.1.2 feed.face.babe
test tcp server
test tcp session

packet-generator new {
  name tcp
  limit 1
  node ip4-input
  size 100-100
  interface loop0
  no-recycle
  data {
    TCP: 6.0.1.2 -> 6.0.1.1
    TCP: 11234 -> 1234
    ACK window 2000
    seqnum 0
    acknum 0
    incrementing 100
  }
}

Change-Id: I866c2159376064b7d14f70531022c1fe949258c2
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agomake test: mark all BFD tests as extended 40/6340/3
Klement Sekera [Fri, 21 Apr 2017 07:49:14 +0000 (09:49 +0200)]
make test: mark all BFD tests as extended

Change-Id: Iaed59cca1c9fd69eadb86c15be6417a956cb9d5a
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoImprove Load-Balance MAPs 05/6305/2
Neale Ranns [Tue, 18 Apr 2017 16:09:40 +0000 (09:09 -0700)]
Improve Load-Balance MAPs

- only build them for popular path-lists (where popular means more than 64 children)
   the reason to have a map is to improve convergence speed for recursive prefixes - if there are only a few this technique is not needed
- only build them when there is at least one path that has recursive constraints, i.e. a path that can 'fail' in a PIC scenario.
- Use the MAPS in the switch path.
- PIC test cases for functionality (not convergence performance)

Change-Id: I70705444c8469d22b07ae34be82cfb6a01358e10
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoSession layer improvements 09/6309/7
Florin Coras [Wed, 19 Apr 2017 20:00:05 +0000 (13:00 -0700)]
Session layer improvements

Among others:
- Moved app event queue to shared memory segment
- Use private memory segment for builtin apps
- Remove pid from svm fifo
- Protect session fifo (de)allocation
- Use fifo event for session disconnects
- Have session queue node poll in all wk threads

Change-Id: I89dbf7fdfebef12f5ef2b34ba3ef3c2c07f49ff2
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoFix multicast enable on the bonded interface 53/6353/1
Steve Shin [Sat, 22 Apr 2017 13:58:23 +0000 (06:58 -0700)]
Fix multicast enable on the bonded interface

Multicast enable flag should be set when the bonded interface is up.
This flag allows multicast packets to be processed from the slave devices
of the bonded interface. Also promiscuous mode for all-multicast should
be correctly displayed as part of 'show hardware detail' output.

Change-Id: Ief0157c4c030a28afb9c45ebf3d6a12710083724
Signed-off-by: Steve Shin <jonshin@cisco.com>
7 years ago[VPP-703]uri_tcp_test segment fault when mp->retval reply -30 85/6285/2
flyingeagle23 [Thu, 20 Apr 2017 06:46:08 +0000 (14:46 +0800)]
[VPP-703]uri_tcp_test segment fault when mp->retval reply -30

Change-Id: I9d2e1f3434f66d9ae9cf40fe9043d0c4b384ef44
Signed-off-by: flyingeagle23 <wang.hui56@zte.com.cn>
7 years ago[VPP-704]./uri_tcp_test slave , uri test segment fault 91/6291/3
flyingeagle23 [Thu, 20 Apr 2017 10:38:48 +0000 (18:38 +0800)]
[VPP-704]./uri_tcp_test slave , uri test segment fault

Change-Id: I19dcc3fcf85c63dc7a7f35e023f6269c9f233d3b
Signed-off-by: flyingeagle23 <wang.hui56@zte.com.cn>
7 years ago[vpp-705]uri_cli issue:show session get nothing tips when session management disable 10/6310/3
flyingeagle23 [Thu, 20 Apr 2017 12:01:14 +0000 (20:01 +0800)]
[vpp-705]uri_cli issue:show session get nothing tips when session management disable

Change-Id: I6844732adcfdd534512f0925059d92b70dcdc080
Signed-off-by: flyingeagle23 <wang.hui56@zte.com.cn>
7 years agovlib: add cli command to dump all CLI commands 35/6335/2
Damjan Marion [Fri, 21 Apr 2017 11:56:40 +0000 (13:56 +0200)]
vlib: add cli command to dump all CLI commands

To be used for bash completion

Change-Id: I8f4702f24c2b7e223945e00a1b3560dec6ef39fd
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agovppinfra: clib_memcpy improvement 26/6326/1
Ray Kinsella [Fri, 21 Apr 2017 10:08:43 +0000 (11:08 +0100)]
vppinfra: clib_memcpy improvement

In the case where n is a constant 16 bytes, the second load/store is
ignored by the load/store unit - it has neglible/zero cost. In the case
where  n is variable and greater than 512 bytes, the extra if (n == 16)
branch has a very small performance impact.

Change-Id: I04b313cf022c18fee31b1d9bcf6a128414659a99
Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
7 years agoCGN: IPFIX logging 31/6231/5
Matus Fabian [Tue, 18 Apr 2017 12:29:59 +0000 (05:29 -0700)]
CGN: IPFIX logging

maximum entries per user exceeded event

Change-Id: Ie35d7f40f55001e2ef4a38f934f176594f25b189
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agovpp-api: rename libpneum to libvppapiclient 04/6204/9
Damjan Marion [Thu, 13 Apr 2017 17:13:47 +0000 (19:13 +0200)]
vpp-api: rename libpneum to libvppapiclient

Change-Id: Ie6d2c769b316b43c40632aa9009c4ff6442cf658
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agodocs: Forward-port missing 17.01 release notes 84/6284/2
Chris Luke [Wed, 19 Apr 2017 22:31:00 +0000 (18:31 -0400)]
docs: Forward-port missing 17.01 release notes

Change-Id: I834df7661d2cc80c18f3879bb30e26091c28064f
Signed-off-by: Chris Luke <chrisy@flirble.org>
7 years agomake test: improve bfd reliability 94/6294/2
Klement Sekera [Wed, 19 Apr 2017 07:10:58 +0000 (07:10 +0000)]
make test: improve bfd reliability

Change-Id: Iaf446a2d7d8e595c3379fb9ed61a954351c17b90
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoMove vagrant stuff to extras/ 93/6293/3
Damjan Marion [Thu, 20 Apr 2017 09:43:56 +0000 (11:43 +0200)]
Move vagrant stuff to extras/

Change-Id: I7e3d6ecc3f23d862004c273e23e36e234ceb6015
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoExtend ebuild to specify "configure" subdir, enable verify for sample-plugin 62/6262/5
Damjan Marion [Wed, 19 Apr 2017 12:09:07 +0000 (14:09 +0200)]
Extend ebuild to specify "configure" subdir, enable verify for sample-plugin

Change-Id: I2056e5d19bc3713e7a13e015dabf3b2431800973
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoTemporary workaround for the bug VPP-698. 61/6261/3
Milan Lenco [Wed, 19 Apr 2017 08:34:53 +0000 (10:34 +0200)]
Temporary workaround for the bug VPP-698.

Change-Id: I220b0b95449f24cc547206e38ab8e10019115ec0
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
7 years agoClean up old datapath code in ACL plugin. 33/6233/2
Andrew Yourtchenko [Tue, 18 Apr 2017 13:28:28 +0000 (13:28 +0000)]
Clean up old datapath code in ACL plugin.

Change-Id: I3d64d5ced38a68f3fa208be00c49d20c4e6d4d0e
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
7 years agodisable extended BFD tests in verify job 67/6267/2
Klement Sekera [Wed, 19 Apr 2017 06:09:01 +0000 (08:09 +0200)]
disable extended BFD tests in verify job

Change-Id: I14484137fde8d6e77fc5905943657089347629fb
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoLearn IP6 link-local ND entries from NSs sourced from link-local address 64/6264/2
Neale Ranns [Wed, 19 Apr 2017 12:24:40 +0000 (05:24 -0700)]
Learn IP6 link-local ND entries from NSs sourced from link-local address

Change-Id: I4c3ce4d58df7977490fc94991291422ea1e31ee3
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoFix "make dist" to include version number, docouple it from rpm packaging 44/6244/3
Damjan Marion [Tue, 18 Apr 2017 13:26:39 +0000 (15:26 +0200)]
Fix "make dist" to include version number, docouple it from rpm packaging

Change-Id: If2f9976d668089026c97b897cf449bff09050631
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoAdd more svm fifo unit tests 48/6248/2
Florin Coras [Wed, 19 Apr 2017 05:07:29 +0000 (22:07 -0700)]
Add more svm fifo unit tests

Change-Id: Ifc07b3f90ac155c26c3a216e073b474b499ebd44
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agomake test: python interpreter customization 63/6163/3
vagrant [Fri, 7 Apr 2017 01:48:47 +0000 (01:48 +0000)]
make test: python interpreter customization

Allow using custom python interpreter via 'PYTHON' env variable.
E.g. env PYTHON=pypy make test.
Get latest pip automatically to properly function in environments,
where old pip is available and a proxy is required. This allows
testing pypy in a centos vagrant-provided vm.

Change-Id: I67a658fc927303468cc67f0ac192317ca2907625
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoSupport ping from outside network in 1:1 NAT (VPP-695) 22/6222/4
Juraj Sloboda [Fri, 14 Apr 2017 01:24:45 +0000 (03:24 +0200)]
Support ping from outside network in 1:1 NAT (VPP-695)

Change-Id: Iec8fd4c2bd26874bd8bda82172af797e9b92592c
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
7 years agoCGN: additional tests 69/6169/9
Martin Gálik [Fri, 31 Mar 2017 06:21:51 +0000 (23:21 -0700)]
CGN: additional tests

Change-Id: Ib9ae10e0fdc6de08120d92c3eebd76e71b379a06
Signed-off-by: Martin Gálik <magalik@cisco.com>
7 years agoMemory leak in load-balance maps 47/6247/1
Neale Ranns [Tue, 18 Apr 2017 19:56:45 +0000 (12:56 -0700)]
Memory leak in load-balance maps

Change-Id: Iec67ae1232e346d5e0000e0b4c997fdc31865bc6
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoACL-plugin does not match UDP next-header, VPP-687 25/6225/2
Pavel Kotucek [Tue, 18 Apr 2017 11:12:20 +0000 (13:12 +0200)]
ACL-plugin does not match UDP next-header, VPP-687

Change-Id: Ide4f9bd6158fb64d069540fb43f4e593e39d6ff3
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
7 years agoFix fifo ooo bugs and improve testing 08/6208/9
Dave Barach [Fri, 14 Apr 2017 20:46:44 +0000 (16:46 -0400)]
Fix fifo ooo bugs and improve testing

Change-Id: If3c01e318bcb740ca5b240c63f712e2167082a80
Signed-off-by: Dave Barach <dave@barachs.net>
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoSocket API echo server 13/6213/1
Dave Barach [Mon, 17 Apr 2017 19:56:17 +0000 (15:56 -0400)]
Socket API echo server

Change-Id: I67ee8bbcad12e272193ac9e5bc6e39c43ce453ed
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agoSet lower bound on persist timer 14/6014/3
Florin Coras [Tue, 4 Apr 2017 01:00:00 +0000 (18:00 -0700)]
Set lower bound on persist timer

Change-Id: Ie98ecb8944e4d27e943797948fad41ec074d6720
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agotcp: completed trace functions 70/6170/6
Clement Durand [Thu, 13 Apr 2017 11:27:04 +0000 (13:27 +0200)]
tcp: completed trace functions

* Populated the trace struct that weren't used before
* Modified and created format functions to format tcp packets and
connections
* Completed the node definitions to add the format_trace function
* Filled the tracing parts with `vlib_add_trace' calls in each tcp node
function

For the nodes in tcp_input.c, there is a verbose trace and a non-verbose
trace. Each packet goes through tcp[4-6]-input which is traced with
`format_tcp_rx_trace', and the other nodes are traced with
`format_tcp_rx_trace_short'.

Change-Id: I4f2eed023f5973c14343132a33b06131cf063aa2
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Signed-off-by: Clement Durand <clement.durand@polytechnique.edu>
7 years agoSession layer refactoring 67/6067/10
Florin Coras [Wed, 5 Apr 2017 06:08:23 +0000 (23:08 -0700)]
Session layer refactoring

Major refactoring of the session layer api
- Add attatch api for application binding to the the session layer
- Simplify listen/connect calls
- Update application CLI
- Add transport endpoint to accept callback
- Associate segment manager to application and allow for multiple
  binds/connects per app

Additional:
- svm fifo cleanup
- add fifo free, format fns
- add fifo offset enqueue unit test

Change-Id: Id93a65047de61afc2bf3d58c9b544339c02065af
Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agotcp builtin_client: bug correction and short_help 68/6168/3
Clement Durand [Wed, 12 Apr 2017 14:33:55 +0000 (16:33 +0200)]
tcp builtin_client: bug correction and short_help

The missing call to `vnet_session_enable_disable' would cause segfaults
because of an uninitialized session pointer. Just as in the builtin
server the session needs to be enabled for the client.

The `short_help' of the CLI command was also populated with the
arguments that are accepted in the parsing function
`test_tcp_clients_command_fn'.

Change-Id: I88c16efa80597dd19b406e8cf1c87aec1ec73573
Signed-off-by: Clement Durand <clement.durand@polytechnique.edu>
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
7 years agoRemove unsed parameter from fib_table_entry_special_add() (only used in FIB tests... 80/6180/2
Neale Ranns [Thu, 13 Apr 2017 07:44:52 +0000 (00:44 -0700)]
Remove unsed parameter from fib_table_entry_special_add() (only used in FIB tests). The DPO was incorrectly initialised with FIB_PROTO_MAX

Change-Id: I962df9e162e4dfb6837a5ce79ea795d5ff2d7315
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoLISP: make statistics thread safe 89/6089/7
Filip Tehlar [Fri, 7 Apr 2017 08:41:42 +0000 (10:41 +0200)]
LISP: make statistics thread safe

Change-Id: I056dc6246f79d887d69ad459a6b8b3092a099baa
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoHandle multiple flows with the same client port in deterministic NAT 18/6118/4
Juraj Sloboda [Wed, 5 Apr 2017 13:59:21 +0000 (15:59 +0200)]
Handle multiple flows with the same client port in deterministic NAT

Handle situation when client tries to connect to multiple hosts/ports
from the same client port. Extend matching to include remote host/port
when searching for existing session and create session for each flow
even when originating from the same client port.

Change-Id: I4f54ded930e59e7196843c6bc1d2d2386c57cd3c
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
7 years agoacl-plugin: missing "deny" parameter in API 52/6152/2
Pavel Kotucek [Wed, 12 Apr 2017 07:01:43 +0000 (09:01 +0200)]
acl-plugin: missing "deny" parameter in API

Change-Id: Ie2ab844ad27b5ddb552bad9b19e7029cf91e4071
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
7 years agomake test: don't rely on cPython GC to close fds 62/6162/2
Klement Sekera [Tue, 11 Apr 2017 04:01:53 +0000 (06:01 +0200)]
make test: don't rely on cPython GC to close fds

This code improvement allows running in pypy (and other interpreters)
without exhausting file descriptors.

Change-Id: Icb692a0fe1343c12cbbb15af6c58753420e74330
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoCGN: configurable timeouts 58/6158/2
Matus Fabian [Wed, 12 Apr 2017 10:36:13 +0000 (03:36 -0700)]
CGN: configurable timeouts

add API and CLI configuration of deterministic NAT session timeout for TCP, UDP
and ICMP protocol

Change-Id: I577440452e7eaedcb5d80501a7fd4b76e31e8c9c
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agoSupport ICMP session timeout in deterministic NAT 32/6032/5
Juraj Sloboda [Mon, 3 Apr 2017 06:49:47 +0000 (08:49 +0200)]
Support ICMP session timeout in deterministic NAT

Change-Id: I0306bc0ab87908adb79c594c657d579cb34b3ec1
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
7 years agoLISP: show mapping negative action in CLI 36/6136/3
Filip Tehlar [Tue, 11 Apr 2017 12:00:58 +0000 (14:00 +0200)]
LISP: show mapping negative action in CLI

Change-Id: I26087cbde40cc5f2f1cb501ca6e791292e02badf
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agomove binary-api client-only routines to memory_client.c 46/6146/3
Dave Barach [Tue, 11 Apr 2017 17:12:48 +0000 (13:12 -0400)]
move binary-api client-only routines to memory_client.c

Change-Id: I0755f731b1b01e6a1a231948d498c625a2c966b7
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agoDevices: set interface placement does not remove the old interface placement 47/6147/2
Steven [Tue, 11 Apr 2017 19:24:47 +0000 (12:24 -0700)]
Devices: set interface placement does not remove the old interface placement

The command set interface placement is supposed to remove the existing
interface placement and add a new interface placement based on the given
options. My quick test for the CLI shows that the old interface placement
continues to exist. But the new interface placement is also added.

The bug exists in vnet_device_input_unassign_thread which checks
the old thread index is the same as the passed thread index and skips the
deletion if they are the same.

The fix is to remove the check which is not supposed to be there.

Change-Id: Ib055721fad47513949a03b3cb6dc292bd19fd1e8
Signed-off-by: Steven <sluong@cisco.com>
7 years agoAdd ICMP support for deterministic NAT 31/6031/5
Juraj Sloboda [Mon, 3 Apr 2017 06:43:58 +0000 (08:43 +0200)]
Add ICMP support for deterministic NAT

Change-Id: I9a6bcb7d173a2c13d89784e7ff8a6e42dcee201f
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
7 years agoMPLS Mcast coverity fixes 41/6141/2
Neale Ranns [Tue, 11 Apr 2017 15:56:53 +0000 (08:56 -0700)]
MPLS Mcast coverity fixes

Change-Id: Ic07ec5d4c2560a414d5f4f7eb37e10faf591664a
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoMTRIE coverity fixes 43/6143/2
Neale Ranns [Tue, 11 Apr 2017 16:13:39 +0000 (09:13 -0700)]
MTRIE coverity fixes

Change-Id: If98355bebe823f45b11b0908a8d7700ab273a6db
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoRemove usued, redundant and deprecated code from lookup.h 45/6145/2
Neale Ranns [Tue, 11 Apr 2017 16:55:19 +0000 (09:55 -0700)]
Remove usued, redundant and deprecated code from lookup.h

Change-Id: Ic16bc10d0b2877b2afdf052615f9334f31b9519f
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agodpdk: use common interface placement infra 54/6054/7
Damjan Marion [Wed, 5 Apr 2017 10:28:38 +0000 (12:28 +0200)]
dpdk: use common interface placement infra

This pathch deprecates "show dpdk placement" and
"set dpdk placement" CLI commands.

Change-Id: I4e052ec3e8b8e6c54b4816e1e689e5b7a24892db
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoFix bug in configure 'pcap drop trace on file xx.cap' command (VPP-691) 15/6115/3
jerryian [Mon, 10 Apr 2017 10:48:07 +0000 (18:48 +0800)]
Fix bug in configure 'pcap drop trace on file xx.cap' command (VPP-691)

Change-Id: Id9cc1fbe18099fae483a823dc7c2b16d6bc46a8c
Signed-off-by: jerryian <gu.jian1@zte.com.cn>
7 years agovhost: interrupt mode enhancements 37/6037/4
Steven [Tue, 4 Apr 2017 23:56:54 +0000 (16:56 -0700)]
vhost: interrupt mode enhancements

- Add cpu index to the vring structure for quick lookup
- Reduce the code that needs to be protected by
vlib_worker_thread_barrier_sync
- Set minimum timer no less than 1 ms

Change-Id: Iafef4bf6879a8efb350abf4e0f517e38f7ff7a8b
Signed-off-by: Steven <sluong@cisco.com>
7 years agoFix typo in minimal epoll polling time 39/6039/4
Pierre Pfister [Tue, 4 Apr 2017 14:55:21 +0000 (15:55 +0100)]
Fix typo in minimal epoll polling time

epoll was supposed to not sleep when timeout
is less than 1ms, but a typo made it not sleep
any time the requested timeout is lower than
1000 seconds (in practice, never...).

This patch replaces "1e3" with "1e-3", which
represents 1ms.

Change-Id: I731851b27a6bf6ab8e41586e017e94b962b09bf3
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
(cherry picked from commit ec06222ae189fe8d84b63410130fff04bf446573)

7 years agoRefactor SNAT code 30/6030/6
Juraj Sloboda [Mon, 3 Apr 2017 06:08:48 +0000 (08:08 +0200)]
Refactor SNAT code

Change-Id: I71f34dc64d4ddc5f2ec1164cb3c353d0fe2d95ab
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
7 years agomake test: automatic "vpp finishes startup" check 17/6117/2
Klement Sekera [Mon, 10 Apr 2017 04:30:17 +0000 (06:30 +0200)]
make test: automatic "vpp finishes startup" check

Add code which checks if vpp doesn't crash/exit immediately after
startup to aid debugging stuff like mistyped graph node name or so.
Refuse to run tests if the vpp is unable to start, complain loudly
and print vpp's stderr at critical log level if this happens to make
spotting these problems in jenkins easy.

Change-Id: I40d3fbd05c822c0534713bae6bef05ecfb0e0c1d
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoCommon device-input interrupt infra 62/6062/5
Damjan Marion [Wed, 5 Apr 2017 16:15:45 +0000 (18:15 +0200)]
Common device-input interrupt infra

Change-Id: I23b588eb56a3f5690158449a1f9bc8053cd3d251
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoHandle ICMP echo with TTL=1 in deterministic and fast SNAT nodes 29/6029/5
Juraj Sloboda [Mon, 3 Apr 2017 05:34:57 +0000 (07:34 +0200)]
Handle ICMP echo with TTL=1 in deterministic and fast SNAT nodes

Change-Id: Icd25ec2e5faf69898178199aa44f21790ce664e1
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
7 years agoMake fixes in SNAT code 28/6028/4
Juraj Sloboda [Mon, 3 Apr 2017 04:33:23 +0000 (06:33 +0200)]
Make fixes in SNAT code

Change-Id: I691d1bfb2923a07c0003485b1d0272aaf9ed27ee
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
7 years agoFix init of ENIC driver to allow receiving of jumbo packets 01/6101/1
John Lo [Sat, 8 Apr 2017 03:32:32 +0000 (23:32 -0400)]
Fix init of ENIC driver to allow receiving of jumbo packets

Set rxmode.enable_scatter field in DPDK port config parameter so ENIC
driver will use multiple mbuf's for receiving jumbo packets.
Also remove ENIC driver check to disable setting ENIC MTU as this
capability is now working with the new ENIC driver, subject to 9002B
limit.

Change-Id: I563976201c4968d4538c0759505cef2de876934a
Signed-off-by: John Lo <loj@cisco.com>
7 years agoVXLAN/TEST:validate vxlan del reply has valid sw_if_index 65/6065/4
Eyal Bari [Thu, 6 Apr 2017 00:31:00 +0000 (03:31 +0300)]
VXLAN/TEST:validate vxlan del reply has valid sw_if_index

Change-Id: Icf7420b7ee212e9341f63f005dc287d019fd8e4c
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agoMPLS Mcast 53/5653/8
Neale Ranns [Wed, 1 Mar 2017 23:12:11 +0000 (15:12 -0800)]
MPLS Mcast

 1 - interface-DPO
        Used in the Data-plane to change a packet's input interface
 2 - MPLS multicast FIB entry
        Same as a unicast entry but it links to a replicate not a load-balance DPO
 3 - Multicast MPLS tunnel
        Update MPLS tunnels to use a FIB path-list to describe the endpoint[s]. Use the path-list to generate the forwarding chain (DPOs) to link to .
 4 - Resolve a path via a local label (of an mLDP LSP)
        For IP multicast entries to use an LSP in the replication list, we need to decribe the 'resolve-via-label' where the label is that of a multicast LSP.
 5 - MPLS disposition path sets RPF-ID
        For a interface-less LSP (i.e. mLDP not RSVP-TE) at the tail of the LSP we still need to perform an RPF check. An MPLS disposition DPO performs the MPLS pop validation checks and sets the RPF-ID in the packet.
 6 - RPF check with per-entry RPF-ID
       An RPF-ID is used instead of a real interface SW if index in the case the IP traffic arrives from an LSP that does not have an associated interface.

Change-Id: Ib92e177be919147bafeb599729abf3d1abc2f4b3
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoFix gpe dp args to allow for 32 bit bridge domain ids, VPP-690 77/6077/2
Florin Coras [Thu, 6 Apr 2017 22:27:35 +0000 (15:27 -0700)]
Fix gpe dp args to allow for 32 bit bridge domain ids, VPP-690

Change-Id: I4e3df197eed33acbceaff495279def8716773303
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoVPP-684.Add ip which mask length exceeding upper limit,ping segmentfault 68/6068/2
flyingeagle23 [Thu, 6 Apr 2017 08:47:46 +0000 (16:47 +0800)]
VPP-684.Add ip which mask length exceeding upper limit,ping segmentfault

Change-Id: I2d1c5e4dbdcab2a81d6c88801183ca0bbc83e1d9
Signed-off-by: flyingeagle23 <wang.hui56@zte.com.cn>
7 years agoacl-plugin: make the IPv4/IPv6 non-first fragment handling in line with ACL (VPP... 35/6035/2
Andrew Yourtchenko [Tue, 4 Apr 2017 14:10:40 +0000 (14:10 +0000)]
acl-plugin: make the IPv4/IPv6 non-first fragment handling in line with ACL (VPP-682)

This fixes the previously-implicit "drop all non-first fragments" behavior
to be more in line with security rules: a non-first fragment is treated
for the purposes of matching the ACL as a packet with the port
match succeeding. This allows to change the behavior to permit
the fragmented packets for the default "permit specific rules"
ruleset, but also gives the flexibility to block the non-initial
fragments by inserting into the begining a bogus rule
which would deny the L4 traffic.

Also, add a knob which allows to potentially turn this behavior off
in case of a dire need (and revert to dropping all non-initial fragments),
via a debug CLI.

Change-Id: I546b372b65ff2157d9c68b1d32f9e644f1dd71b4
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 9fc0c26c6b28fd6c8b8142ea52f52eafa7e8c7ac)

7 years agojvpp: remove unused print&endian headers (fixes VPP-688) 69/6069/3
Marek Gradzki [Thu, 6 Apr 2017 07:37:00 +0000 (09:37 +0200)]
jvpp: remove unused print&endian headers (fixes VPP-688)

Change-Id: I97e03d98758a08b1f75a9a1f35f0181385a10ae8
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
7 years agoBFD-FIB interactions 63/6063/5
Neale Ranns [Wed, 5 Apr 2017 15:11:14 +0000 (08:11 -0700)]
BFD-FIB interactions

- single-hop BFD: attach a delegate to the appropriate adjacency
- multi-hop BFD [not supported yet]: attach a delegate to the FIB entry.

adjacency/fib_entry state tracks the BFD session state. when the state is down the object does not contribute forwarding hence and hence dependent objects will not use it.
For example, if a route is ECMP via two adjacencies and one of them is BFD down, then only the other is used to forward (i.e. we don't drop half the traffic).

Change-Id: I0ef53e20e73b067001a132cd0a3045408811a822
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoVPP-686: create bridge-domain 50/6050/3
Choonho Son [Wed, 5 Apr 2017 10:09:52 +0000 (19:09 +0900)]
VPP-686: create bridge-domain

- update default flags
- add missing flag learn

Change-Id: I50a1a001848769836468838775b59d3414d27710
Signed-off-by: Choonho Son <choonho.son@gmail.com>
7 years agoUse thread local storage for thread index 11/6011/4
Damjan Marion [Wed, 5 Apr 2017 17:18:20 +0000 (19:18 +0200)]
Use thread local storage for thread index

This patch deprecates stack-based thread identification,
Also removes requirement that thread stacks are adjacent.

Finally, possibly annoying for some folks, it renames
all occurences of cpu_index and cpu_number with thread
index. Using word "cpu" is misleading here as thread can
be migrated ti different CPU, and also it is not related
to linux cpu index.

Change-Id: I68cdaf661e701d2336fc953dcb9978d10a70f7c1
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoVXLAN:fix tunnel delete not returning sw_if_index 64/6064/2
Eyal Bari [Thu, 6 Apr 2017 00:26:59 +0000 (03:26 +0300)]
VXLAN:fix tunnel delete not returning sw_if_index

when tunnel is deleted reply should include the tunnel's sw_if_index
instead of ~0

Change-Id: Ie5e04f4feab9cf2c90f0e155ec0fb9ca839a956d
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agoL2FIB:add l2fib_flush_bd l2fib_flush_int apis 38/6038/4
Eyal Bari [Wed, 5 Apr 2017 02:33:21 +0000 (05:33 +0300)]
L2FIB:add l2fib_flush_bd l2fib_flush_int apis

Change-Id: I0a6989c6963956f3e60e8c50835c57845fccef8c
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agoBFD: add ARP-awareness, fix bugs 58/6058/2
Klement Sekera [Tue, 4 Apr 2017 14:19:48 +0000 (16:19 +0200)]
BFD: add ARP-awareness, fix bugs

Make BFD ARP-aware when sending out packets.
Fix a few one-liner bugs discovered while integrating with cisco
nexus. Enhance CLI view to better observe session state.

Change-Id: I266c29492f351207b84328ab665d9d697969da9c
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoacl-plugin: fix pretty-printing in "api trace custom-dump" (VPP-683) 49/6049/2
Andrew Yourtchenko [Tue, 4 Apr 2017 20:38:33 +0000 (20:38 +0000)]
acl-plugin: fix pretty-printing in "api trace custom-dump" (VPP-683)

Change-Id: Id15b401223aabe7dacb7566c871ebefc17fbb1fc
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 7fd3f513c7df198c45204eba0a3e9a3abe509593)

7 years agoFix two more memif coverity issues 55/6055/2
Milan Lenco [Wed, 5 Apr 2017 12:42:42 +0000 (14:42 +0200)]
Fix two more memif coverity issues

Change-Id: I935620798d6fe82b99b6bd564749e20a189b4ae3
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
7 years agoFix name typo 57/6057/2
Sergio Gonzalez Monroy [Wed, 5 Apr 2017 14:12:38 +0000 (15:12 +0100)]
Fix name typo

Change-Id: Ic7128d4f8a13c021e0fd4731a717193d050431d2
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
7 years agoLISP: fix crash when GPE interface is re-added, VPP-685 42/6042/2
Filip Tehlar [Wed, 5 Apr 2017 08:06:03 +0000 (10:06 +0200)]
LISP: fix crash when GPE interface is re-added, VPP-685

Change-Id: Ib83baf6ddec4ac192f6b4123d9eb599fb370fd0c
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoLISP: fix crash when adding a negative forwarding entry, VPP-681 23/6023/3
Filip Tehlar [Tue, 4 Apr 2017 13:26:54 +0000 (15:26 +0200)]
LISP: fix crash when adding a negative forwarding entry, VPP-681

Change-Id: I190696da5555c05074ee0eee32eb914bd16e38fb
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoGRE over IPv6 24/3224/9
Ciara Loftus [Fri, 30 Sep 2016 14:47:03 +0000 (15:47 +0100)]
GRE over IPv6

Refactors the GRE node to work with both IPv4 and IPv6 transports.

Note that this changes the binary configuration API to support both
address families; each address uses the same memory for either
address type and a flag to indicate which is in use.

The CLI and VAT syntax remains unchanged; the code detects whether
an IPv4 or an IPv6 address was given.

Configuration examples:

IPv4 CLI: create gre tunnel src 192.168.1.1 dst 192.168.1.2
IPv6 CLI: create gre tunnel src 2620:124:9000::1 dst 2620:124:9000::2

IPv4 VAT: gre_add_del_tunnel src 192.168.1.1 dst 192.168.1.2
IPv6 VAT: gre_add_del_tunnel src 2620:124:9000::1 dst 2620:124:9000::2

Change-Id: Ica8ee775dc101047fb8cd41617ddc8fafc2741b0
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
7 years agoFix issue with gre protocol registration when running multithreaded 13/6013/4
Damjan Marion [Mon, 3 Apr 2017 23:28:26 +0000 (01:28 +0200)]
Fix issue with gre protocol registration when running multithreaded

Change-Id: Ic5bd7da08f8a46b548d56516e4633f0b8badf2a1
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoFix issue with udp port registration when running multithreaded 08/6008/2
Damjan Marion [Mon, 3 Apr 2017 12:56:08 +0000 (14:56 +0200)]
Fix issue with udp port registration when running multithreaded

Change-Id: I16606757176649e61f0a51895329586311144766
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoBD/API:add bridge_domain_set_mac_age api 16/6016/5
Eyal Bari [Tue, 4 Apr 2017 01:46:32 +0000 (04:46 +0300)]
BD/API:add bridge_domain_set_mac_age api

Change-Id: Ic2d33b31ba88f6d9602a22439865637d98cf4a33
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agoClear pid-vector, to avoid spurious track selection 21/6021/2
Dave Barach [Tue, 4 Apr 2017 12:00:23 +0000 (08:00 -0400)]
Clear pid-vector, to avoid spurious track selection

Change-Id: Ibc293aa1305126920c0b2c44df1f7a7d5ae9ea9d
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agovlib: make vlib_node_interrupt_pending(...) thread safe 91/5891/5
Damjan Marion [Tue, 28 Mar 2017 12:16:15 +0000 (14:16 +0200)]
vlib: make vlib_node_interrupt_pending(...) thread safe

Change-Id: I24577bd32ae23fbe8515cc8d960eab5448ce3b5c
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoVXLAN:fix api dump flipped src<->dst 15/6015/2
Eyal Bari [Tue, 4 Apr 2017 01:23:52 +0000 (04:23 +0300)]
VXLAN:fix api dump flipped src<->dst

Change-Id: I48bf6c46d78773669e76dc4749be3b1af80782f4
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agomake test: relax BFD time intervals 09/6009/2
Klement Sekera [Mon, 3 Apr 2017 06:10:08 +0000 (08:10 +0200)]
make test: relax BFD time intervals

Increased time intervals mean longer test runs, but also reduce
the chance of getting annoying (especially in gerrit) random failures.
Now that tests are split into `basic' and `all', the increased runtime
of BFD tests (of which majority doesn't run in basic case) doesn't
matter too much..

Change-Id: I4a15bb4facad634f123bc9cc6f45eddbf4976fd1
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agog2: add multi-track time-slew controls 10/6010/2
Dave Barach [Mon, 3 Apr 2017 14:22:17 +0000 (10:22 -0400)]
g2: add multi-track time-slew controls

Create an elog_merge utility, extracted from test_elog.

Change-Id: Ide137b4858c88b3a2885583b7fbb15ddc4963af9
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agomake test: tweak helper scripts 07/6007/2
Klement Sekera [Mon, 3 Apr 2017 04:21:46 +0000 (04:21 +0000)]
make test: tweak helper scripts

Change-Id: Iee6016757e45c832e8868f0bdcfd4192dd3380c8
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoFix memif coverity issues 82/5982/5
Milan Lenco [Fri, 31 Mar 2017 12:51:18 +0000 (14:51 +0200)]
Fix memif coverity issues

Change-Id: I844ec53b55ceaa1e00996f5cf8a018537ea8b481
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
7 years agoUpdate CSIT tests 170313 -> 170403 97/5997/2
Jan Gelety [Mon, 3 Apr 2017 07:37:00 +0000 (09:37 +0200)]
Update CSIT tests 170313 -> 170403

- update of CSIT operational branch to be used for VPP-patch test

Change-Id: I4bf32bc12c7417f7c19b23287a2b2899eb8fb02d
Signed-off-by: Jan Gelety <jgelety@cisco.com>
7 years agovnet: remove vnet/rewrite.h from vnet.am 05/6005/1
Damjan Marion [Mon, 3 Apr 2017 10:02:32 +0000 (12:02 +0200)]
vnet: remove vnet/rewrite.h from vnet.am

Change-Id: I2a1246061e57c4caae0a1a1b861c459d115860cd
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoAdd an API call to set interface MAC addresses. 44/5844/6
Jon Loeliger [Thu, 30 Mar 2017 13:39:33 +0000 (08:39 -0500)]
Add an API call to set interface MAC addresses.

Change-Id: I316862e1d33e5d10c058317cc4827304e55ceba4
Signed-off-by: Jon Loeliger <jdl@netgate.com>
7 years agoAdjacency layout change and move to vnet/adj 24/5924/3
Neale Ranns [Mon, 20 Feb 2017 22:19:51 +0000 (14:19 -0800)]
Adjacency layout change and move to vnet/adj

Change-Id: I03195a86c69f84a301051c6b3ab64456bbf28645
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoTCP cc/window management fixes and debugging 49/5949/11
Florin Coras [Thu, 30 Mar 2017 09:54:28 +0000 (02:54 -0700)]
TCP cc/window management fixes and debugging

- added persist timer
- update rcv_las whenever sending an ack
- moved fifo size to its own cache line
- improved session and builtin client debugging

Change-Id: Ia649cf942cf0c061a713e8b67f0eb6974a6cd55b
Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agomake test: add scripts for easy test looping 73/5973/2
Klement Sekera [Mon, 13 Mar 2017 06:39:08 +0000 (06:39 +0000)]
make test: add scripts for easy test looping

Allows easy running of test(s) in a loop with configurable
action (e.g. git pull) run between test runs and possible
email notification on failure.

Usage:

test-loop.sh [-p <pre-exec-cmd>] [-m <email>] -- <make test options>

Example:

Run 'make test-debug' in a loop until a failure is encountered,
upon which an email is fired to ksekera@cisco.com. In between test
runs, update the workspace using via 'git pull' and if anything changed,
perform 'git clean' before running another 'make test-debug':

test/scripts/test-loop.sh -p test/scripts/git_pull_or_clean.sh \
-m ksekera@cisco.com -- test-debug

Change-Id: I114321c6c152d2c7e181e915fc8c51aab1ff3693
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoCLI: create/delete bridge-domain 09/5909/6
Choonho Son [Wed, 29 Mar 2017 11:07:45 +0000 (20:07 +0900)]
CLI: create/delete bridge-domain

Added new CLI command
- create bridge-domain <bridge-domain-id>
- create bridge-domain <bridge-domain-id> del

Change-Id: I1a7d632c7daa3c37b7f424a184e8fabd489518e9
Signed-off-by: Choonho Son <choonho.son@gmail.com>
7 years agoARP/ND/API:fix arp reg + nd no identical regs 90/5990/3
Eyal Bari [Sat, 1 Apr 2017 00:55:08 +0000 (03:55 +0300)]
ARP/ND/API:fix arp reg + nd no identical regs

fixed arp registration without allocating the event
added protection against identical ND registrations

Change-Id: I4e2db4913b35d895d8686ada1f0818920f276ad6
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agoClean up event log merge code 91/5991/2
Dave Barach [Sat, 1 Apr 2017 15:07:40 +0000 (11:07 -0400)]
Clean up event log merge code

Fix a decade-old ridiculous qsort function bug. Managed to subtract
floating-point numbers as if they were integers, leading to
manufactured time-paradoxes. That completely confuses g2, leading to
the summary disappearance of entire tracks' worth of data at high zoom
levels.

Add a manual alignment tweak parameter to elog_merge, users can
dial-out time paradoxes caused by NTP-grade clock synchronization.
The event-logger has a precision of O(100ns), whereas NTP
synchronization is O(1ms).

Change-Id: I69dedabaa314f69f9df74ec9ee66e21e6c87f703
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agoMTRIE Optimisations 2 89/5889/6
Neale Ranns [Tue, 28 Mar 2017 10:49:52 +0000 (03:49 -0700)]
MTRIE Optimisations 2

1) 16-8-8 stride. Reduce trie depth walk traded with increased memory in the top PLY.
2) separate the vector of protocol-independent (PI) fib_table_t with the vector of protocol dependent (PD) FIBs. PD FIBs are large structures, we don't want to burn the memory for ech PD type
3) Go straight to the PD FIB in the data-path thus avoiding an indirection through, e.g., a PLY pool.

Change-Id: I800d1ed0b2049040d5da95213f3ed6b12bdd78b7
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoARP/API:protect against identical registrations 64/5964/3
Eyal Bari [Thu, 30 Mar 2017 23:15:17 +0000 (02:15 +0300)]
ARP/API:protect against identical registrations

Change-Id: Ia3acf87d3e07a7d41c047869de504e1972334b55
Signed-off-by: Eyal Bari <ebari@cisco.com>