vpp.git
7 years agosilence l2fib_init() invalid read of size 2 found by address-sanitizer 82/8982/6
Gabriel Ganne [Tue, 24 Oct 2017 08:24:57 +0000 (10:24 +0200)]
silence l2fib_init() invalid read of size 2 found by address-sanitizer

l2fib_make_key() casts and reads the input 6-Bytes mac_address as u64,
therefore if the mac_address is declared with 6 Bytes only, address-sanitizer
rightly triggers an invalid read on the last two Bytes.

However, l2fib_make_key() does a 16 bits shift to discard those 2 values,
therefore, this invalid read is of no consequence (and so can be silenced safely).

Change-Id: I38646fe60073093d25cdf135185d4c96136d55d0
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
7 years agovppinfra: make _vec_resize_will_expand read-only 06/9206/2
Florin Coras [Thu, 2 Nov 2017 23:28:09 +0000 (19:28 -0400)]
vppinfra: make _vec_resize_will_expand read-only

Change-Id: Ibcc20c24f6feb2b91245b0d88830a6c730d704e6
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agosession: support drop action in rules table 11/9211/2
Florin Coras [Fri, 3 Nov 2017 04:31:46 +0000 (21:31 -0700)]
session: support drop action in rules table

Change-Id: Ided2980373ed5329c68f958f61be893428bccd31
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoSet up P2P flag to gtpu interface 07/9207/2
Hongjun Ni [Fri, 3 Nov 2017 10:28:10 +0000 (18:28 +0800)]
Set up P2P flag to gtpu interface

Change-Id: Id01a363bf2b574376651de7bc8f3f7b2bb58c615
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
7 years agosession/udp: init rw locks 05/9205/2
Florin Coras [Thu, 2 Nov 2017 22:14:17 +0000 (18:14 -0400)]
session/udp: init rw locks

Change-Id: I68152d7338ce0d7805e50ccf9e9046de02cfd206
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoVCL: application proxy configuration 88/9188/5
Dave Wallace [Thu, 2 Nov 2017 00:07:40 +0000 (20:07 -0400)]
VCL: application proxy configuration

- Add support to configure VCL to set
  application proxy transport types
  and app_is_proxy flag via vcl
  config file or env vars.
- Clean up debug output.
- Rename session_scope -> app_scope.

Change-Id: I6e35f3cdd84daf0112133af8f33acd0152f87ca3
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoLISP: fix negative mapping timeout, VPP-1043 93/9193/2
Filip Tehlar [Thu, 2 Nov 2017 08:38:49 +0000 (01:38 -0700)]
LISP: fix negative mapping timeout, VPP-1043

Change-Id: Ie57b81f8743f14182813558887d84d6667c81d43
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoAdd replicate DPO header to export list for VPPSB 01/9201/2
Neale Ranns [Thu, 2 Nov 2017 14:39:24 +0000 (07:39 -0700)]
Add replicate DPO header to export list for VPPSB

Change-Id: I0b437ac5fecc81c7762d9cad0f33e977fcf3aa27
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agoAdd builtin http server option to return static reply 87/9187/3
Florin Coras [Wed, 1 Nov 2017 22:05:49 +0000 (15:05 -0700)]
Add builtin http server option to return static reply

Change-Id: I9f4d1c7ee7b460a93198930a5a935fa90177cdad
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agosession: fix proxy coverity warnings 89/9189/1
Florin Coras [Thu, 2 Nov 2017 01:19:22 +0000 (18:19 -0700)]
session: fix proxy coverity warnings

Change-Id: I8d233d2301fb0da0fe27fa36ba870484bb290b7b
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoA bit of cleanup, updated the README, started vhost test. 83/9183/2
John DeNisco [Wed, 1 Nov 2017 16:37:47 +0000 (12:37 -0400)]
A bit of cleanup, updated the README, started vhost test.

Change-Id: I49b998644b8b79c778c1186fc09831b1cd8fc015
Signed-off-by: John DeNisco <jdenisco@cisco.com>
7 years agoVPP-959: Support old version of CFFI 74/9174/2
Ole Troan [Wed, 1 Nov 2017 09:49:03 +0000 (10:49 +0100)]
VPP-959: Support old version of CFFI

Change-Id: I3d3e5dff5b22fca58a50da6a9d0aaf1182e736dd
Signed-off-by: Ole Troan <ot@cisco.com>
7 years agovom: fix build with gcc7 75/9175/2
Damjan Marion [Wed, 1 Nov 2017 10:20:50 +0000 (11:20 +0100)]
vom: fix build with gcc7

Change-Id: I0b5806dd1d8cb45f40354cfe6cae7f4e76309f92
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoVOM fixes for 9090 - ships in the night commits 76/9176/1
Neale Ranns [Wed, 1 Nov 2017 10:29:13 +0000 (03:29 -0700)]
VOM fixes for 9090 - ships in the night commits

Change-Id: I4b03a4f86a7e0e47874715398ca9f8ff0f5386ee
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
7 years agofix clib_mem_unaligned() invalid read 80/8980/2
Gabriel Ganne [Tue, 24 Oct 2017 07:58:45 +0000 (09:58 +0200)]
fix clib_mem_unaligned() invalid read

clib_mem_unaligned + zap64 casts its input as u64, computes a mask
according to the input length, and returns the casted maked value.
Therefore all the 8 Bytes of the u64 are systematically read, and
the invalid ones are discarded.
For example, for a 5-Bytes string, we will do an invalid read of size 3,
even though those 3 Bytes are never used.

This patch proposes to only read what we have at the cost of reading as
a u64 in one call, but that way, we do not trigger an invalid read
error.

Change-Id: I3e0b31c4113d9c8e53aa5fa3d3d396ec80f06a27
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
7 years agonat plugin - fix test logic 40/9040/2
Gabriel Ganne [Thu, 26 Oct 2017 08:10:42 +0000 (10:10 +0200)]
nat plugin - fix test logic

warning found by clang:
  warning: logical not is only applied to the left hand side of
  this bitwise operator [-Wlogical-not-parentheses]

Change-Id: I964651a4444b11da145edc329da83675cd830f78
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
7 years agoClean up a few historical anomalies 70/9170/2
Dave Barach [Tue, 31 Oct 2017 20:28:11 +0000 (16:28 -0400)]
Clean up a few historical anomalies

Change-Id: I5d36a8a54fa6f73ea2b3761413098867dae1df74
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agosession: add support for proxying apps 33/9133/5
Florin Coras [Tue, 31 Oct 2017 08:51:04 +0000 (01:51 -0700)]
session: add support for proxying apps

To enable this, applications set the proxy flag in their attach requests
and pass the transport protocols they want to act as proxies for as part
of the attach options.

When proxy is enabled, session rules that point incoming packets to the
proxy app are addedd to the local and global session tables, if these
scopes are accessible to the app. In particular, in case of the former,
the rule accepts packets from all sources and all ports destined to the
namespace's supporting interface address on any port. While in case of
the latter, a generic any destination and any port rule is addedd.

Change-Id: I791f8c1cc083350f02e26a2ac3bdbbfbfa19ece3
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agodpdk/ipsec: align memory 58/9158/2
Sergio Gonzalez Monroy [Tue, 31 Oct 2017 15:58:57 +0000 (15:58 +0000)]
dpdk/ipsec: align memory

Change-Id: I2feb3e07c3070e8a525c539dd2feffa0dd1bca21
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
7 years agodpdk/ipsec: fix digest physical address 59/9159/2
Sergio Gonzalez Monroy [Tue, 31 Oct 2017 15:55:39 +0000 (15:55 +0000)]
dpdk/ipsec: fix digest physical address

VPP-1034

Change-Id: I02b4db9e52446ab8578df1f011dd27f39de64c70
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
7 years agoVPP Object Model (VOM) 36/8836/17
Neale Ranns [Mon, 16 Oct 2017 11:20:13 +0000 (04:20 -0700)]
VPP Object Model (VOM)

The VOM is a C++ library for use by clients/agents of VPP for programming
state. It uses the binary APIs to do so. Various other common client side
functions are also provided. Please see om.hpp for a more detailed description.

Change-Id: Ib756bfe99817093815a9e26ccf464aa5583fc523
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Co-authored-by: Mohsin Kazmi <sykazmi@cisco.com>
7 years agoFix "l2fib add" CLI to allow adding of filter MAC entries 65/9165/2
John Lo [Tue, 31 Oct 2017 17:26:02 +0000 (13:26 -0400)]
Fix "l2fib add" CLI to allow adding of filter MAC entries

When adding a filter MAC entry, the default sw_if_index of -1
was incorrectly validated and rejected.

Change-Id: Id7f122b6269ea7c299a4335b05b748afaf01383c
Signed-off-by: John Lo <loj@cisco.com>
7 years agoFix set interface mac address API to be endian neutral 68/9168/2
John Lo [Tue, 31 Oct 2017 18:31:10 +0000 (14:31 -0400)]
Fix set interface mac address API to be endian neutral

Store and pass MAC address as 6 byte u8 array instead of u64 to
make MAC address handling in set interface MAC endian neutral.
The previous API handler only works for little endian.

Change-Id: Ie4ec33a840bc5122ab1f17e25977e58f3466253b
Signed-off-by: John Lo <loj@cisco.com>
7 years agoVPP PAPI: Error in unserializer for non-array compound types. 49/9149/3
Ole Troan [Tue, 31 Oct 2017 13:50:13 +0000 (14:50 +0100)]
VPP PAPI: Error in unserializer for non-array compound types.

A bug in the decoder of messages when there was a non-array compound type.
The typical result was an error message from the struct library:
 "error:unpack_from requires a buffer of at least 4 bytes"

Change-Id: Ie30fec6fc39b9f4177b54fa4adc4fc69674f0e12
Signed-off-by: Ole Troan <ot@cisco.com>
7 years agoUpdate CSIT tests 171017 -> 171030 55/9155/2
Jan Gelety [Tue, 31 Oct 2017 15:07:44 +0000 (16:07 +0100)]
Update CSIT tests 171017 -> 171030

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

Change-Id: I818bb7f1778cd92716feeaeb9fc1af59c62bdbc2
Signed-off-by: Jan Gelety <jgelety@cisco.com>
7 years agoLISP: add P-ITR/P-ETR/xTR API handlers, ONE-24 94/8994/4
Filip Tehlar [Mon, 16 Oct 2017 12:48:23 +0000 (05:48 -0700)]
LISP: add P-ITR/P-ETR/xTR API handlers, ONE-24

Change-Id: I25937cd7470c826d1e833e65530ae959c39139d8
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agol2fib: MAC: Fix uint64 to u8 byte array 90/9090/7
Mohsin Kazmi [Fri, 27 Oct 2017 19:28:07 +0000 (21:28 +0200)]
l2fib: MAC: Fix uint64 to u8 byte array

As per proposal on the mailing list, this patch fixes
the represntation of MAC address in VPP API calls for
   ·  L2fib_add_del
   ·  L2_fib_table_details

Change-Id: I31e17efd1a6314cded69666e693cb8fc33158d02
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
7 years agoFix typo (double unlock) 40/9140/1
Dave Barach [Tue, 31 Oct 2017 12:45:52 +0000 (08:45 -0400)]
Fix typo (double unlock)

Change-Id: If4a128186a732266eb27b6aa3caf6f1feff449bf
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agophysmem: register region with IOMMU 27/9127/3
Damjan Marion [Mon, 30 Oct 2017 21:38:47 +0000 (22:38 +0100)]
physmem: register region with IOMMU

VFIO file descriptor is extracted in a hackish way, as DPDK doesn't
provide imethod to retrieve it.

This fixes issue with DPDK drivers not working correctly when IOMMU is
enabled and external buffer memory is used.

Change-Id: I5eaa8e78741c50504d87d44e706b5997c8189554
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoRefactor IP input checks for re-use at MPLS disposition 49/8949/4
Neale Ranns [Sat, 21 Oct 2017 16:37:55 +0000 (09:37 -0700)]
Refactor IP input checks for re-use at MPLS disposition

Change-Id: I7aafdecd6f370411138e6ab67b2ff72cda6e0666
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agolb plugin tests - wipe flowtable after each unit test 67/9067/5
Gabriel Ganne [Mon, 30 Oct 2017 14:44:31 +0000 (15:44 +0100)]
lb plugin tests - wipe flowtable after each unit test

Add new cli api: "test lb flowtable flush" which flushes everything.
Call this new cli function after the end of each lb unit test.

Change-Id: I71d04a7bfba398f7d4dd9cc3ed24bba786943663
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
7 years agoMinor copyedit fixes to ACL Hash doc. 25/9125/1
Jon Loeliger [Mon, 30 Oct 2017 20:04:26 +0000 (15:04 -0500)]
Minor copyedit fixes to ACL Hash doc.

Change-Id: I7fe34e99f566dd2e0a36a9ba38f894973989ca8a
Signed-off-by: Jon Loeliger <jdl@netgate.com>
7 years agoAdd the bihash_vec8_8 variant 09/9109/2
Dave Barach [Mon, 30 Oct 2017 13:42:54 +0000 (09:42 -0400)]
Add the bihash_vec8_8 variant

This is an all-purpose octet-vector memory hash, intended as a
thread-safe replacement for hash_create_mem / hash_create_string.  All
u8 * key vectors are memorized by the hash table.

Change-Id: I22944daea8fda07dde8ba118a6529a6d382491f9
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agoRemove old Python vppctl script 16/9116/2
Chris Luke [Mon, 30 Oct 2017 14:17:50 +0000 (10:17 -0400)]
Remove old Python vppctl script

- The binary API method for executing commands was superceded
  by the unix-socket CLI approach used by the C vppctl utility.
  The API call it makes will soon be deprecated.
- This Python vppctl script was still being copied to the install
  directory, and then later overwritten by the binary vppctl.

Change-Id: I0a4b09b7c733049d0545b4c83b9ac5ac499a7300
Signed-off-by: Chris Luke <chrisy@flirble.org>
7 years agoLISP: improve updating the dataplne when locators change 79/9079/7
Filip Tehlar [Fri, 27 Oct 2017 06:57:09 +0000 (23:57 -0700)]
LISP: improve updating the dataplne when locators change

Change-Id: Ifc0296834e25ddbdd0ad8283c061f309801b053c
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agojvpp: bugfix for deadlock in java future API (VPP-1037) 57/8957/9
Matej [Mon, 23 Oct 2017 10:55:11 +0000 (12:55 +0200)]
jvpp: bugfix for deadlock in java future API (VPP-1037)

- message sending method inside synchronization blocks causes
deadlock between sending and receiving part
- breaking atomicity of sending message and putting future with
corresponding id to map needs additional handling by writer and receiver,
regardless which part get access to sync block first will create
new future and second one will complete it and remove from map,
in case of dump calls where control ping reply is required
as confirmation that all information were send, if ping reply is
received before writer put future in map, reader will create
regular control ping future instead and writer needs to made association
between these two futures

Change-Id: Id29a19be7a5319291a5e07cf931080610178f00c
Signed-off-by: Matej <matej.perina@pantheon.tech>
7 years agolibmemif: perf optimization 98/9098/2
Jakub Grajciar [Mon, 30 Oct 2017 09:34:54 +0000 (10:34 +0100)]
libmemif: perf optimization

Change-Id: Ie3bd75e0e98c7ecb4c66dba701131363e5ec89a2
Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
7 years agovcl: fix compiling on newer systems 93/9093/4
Damjan Marion [Sun, 29 Oct 2017 18:28:31 +0000 (19:28 +0100)]
vcl: fix compiling on newer systems

Build fails on ubuntu 17.10...

Change-Id: I98dfffa3f8f5f9bca2ba97a856709714fbeec49c
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agodevices: Add binary API for set interface <interface> rx-mode 94/9094/1
Steven [Mon, 30 Oct 2017 05:10:46 +0000 (22:10 -0700)]
devices: Add binary API for set interface <interface> rx-mode

Also add vat test code to test the subject API. The format is

sw_interface_set_rx_mode sw_if_index <index> [queue <id>]
<polling|nterrupt|adaptive>

Change-Id: Ib810d85d430077865bead8cc08a070f8ae478225
Signed-off-by: Steven <sluong@cisco.com>
7 years agosession: fix coverity warnings 92/9092/1
Florin Coras [Sun, 29 Oct 2017 17:56:15 +0000 (10:56 -0700)]
session: fix coverity warnings

Change-Id: Ib87eccb853cafceea5f5513f6bb51c2364449afa
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agosession: rules tables 65/8865/21
Florin Coras [Tue, 17 Oct 2017 07:03:13 +0000 (00:03 -0700)]
session: rules tables

This introduces 5-tuple lookup tables that may be used to implement
custom session layer actions at connection establishment time (session
layer perspective).

The rules table build mask-match-action lookup trees that for a given
5-tuple key return the action for the first longest match. If rules
overlap, ordering is established by tuple longest match with the
following descending priority: remote ip, local ip, remote port, local
port.

At this time, the only match action supported is to forward packets to
the application identified by the action.

Change-Id: Icbade6fac720fa3979820d50cd7d6137f8b635c3
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoFix for vppctl and interactive commands (VPP-1038) 62/9062/2
Chris Luke [Thu, 26 Oct 2017 14:44:43 +0000 (10:44 -0400)]
Fix for vppctl and interactive commands (VPP-1038)

- Interactive commands like "ping" read extra input from the
  input stream.
- In the case of "ping" it is simply a signal to cease the current
  operation.
- "vppctl", in non-interactive mode, will issue a "quit" immediately
  after the requested command to queue up closing of the session.
- This resulted in "ping" thinking a keypress was seen and returning
  control to the CLI; the "quit" command however is consumed by the
  keypress event handler and thus the session does not close.

- This patch reworks vppctl slightly to only issue "quit" after the
  command has completed. In particular it uses the fact that VPP issues
  NUL bytes as a surrogate prompt between output of commands to signal
  acknowledgement that the command has completed; vppctl now flags
  that the quit should be issued after the next such acknowledgement.
- Since input it still accepted, the user can still terminate the
  "ping" early, if desired.

Change-Id: I7e3dbe767f32f8e364ccb5f81799759b311585df
Signed-off-by: Chris Luke <chrisy@flirble.org>
7 years agoVCL-LDPRELOAD: Fix CID 178271 87/9087/3
Dave Wallace [Fri, 27 Oct 2017 17:42:05 +0000 (13:42 -0400)]
VCL-LDPRELOAD: Fix CID 178271

- Pointer to local outside scope

Change-Id: I84a7958e10dbc9369ffa5172cbad5dbade9b2bc9
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agosession: instantiate appns lookup table only once 70/9070/2
Florin Coras [Thu, 26 Oct 2017 21:25:12 +0000 (14:25 -0700)]
session: instantiate appns lookup table only once

Change-Id: I39d634b7691a524e5221c28997a737102298c281
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoLDPRELOAD: Fix out-of-scope variable coverity error 86/9086/2
Steven [Fri, 27 Oct 2017 16:34:57 +0000 (09:34 -0700)]
LDPRELOAD: Fix out-of-scope variable coverity error

>>>    CID 178271:  Memory - illegal accesses  (RETURN_LOCAL)
>>>    Using "ep", which points to an out-of-scope variable "_ep".

Change-Id: Icf21e602bc2718bfedd9480e9da41aff8693048e
Signed-off-by: Steven <sluong@cisco.com>
7 years agoacl-plugin: increase the amount of memory for classifier tables used by MACIP ACLs 85/9085/1
Andrew Yourtchenko [Fri, 27 Oct 2017 15:03:34 +0000 (15:03 +0000)]
acl-plugin: increase the amount of memory for classifier tables used by MACIP ACLs

The classifier tables upper bound of memory was just big enough
to cause the unittests pass most of the time but not always.
Increase the amount of space and run several hundred iterations
of unittests to ensure they always pass.

Change-Id: Ieb7876c6ebdde1f8c5273dbb9b090f12f2c38915
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
7 years agoVCL: refactor session close / disconnect. 33/9033/2
Dave Wallace [Thu, 26 Oct 2017 06:51:07 +0000 (02:51 -0400)]
VCL: refactor session close / disconnect.

Change-Id: Ib0797faaa3f21c7577330bb8d0e801d43e01110e
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoVCL-LDPRELOAD: Fix more coverity warnings 69/9069/2
Dave Wallace [Thu, 26 Oct 2017 20:12:04 +0000 (16:12 -0400)]
VCL-LDPRELOAD: Fix more coverity warnings

vcom.c:
  CID 178227: Logically dead code in vcom.c

vcom_socket.c:
  CID 178254: Dereference after null check
  CID 178250: Out-of-bounds access

vppcom.c:
  CID 178252: Unused value
  Suppress vppcom_session_attr() debug output.

Change-Id: I1d47bafb84fc0ad00c642392ae3cb6761fd3fb17
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoVCL-LDPRELOAD: Fix CID 178251 & CID 178253 68/9068/3
Dave Wallace [Thu, 26 Oct 2017 18:47:06 +0000 (14:47 -0400)]
VCL-LDPRELOAD: Fix CID 178251 & CID 178253

- CID 178251 Dereference after null check in vcom_socket.c
- CID 178253 Logically dead code in vppcom.c

Change-Id: I2a24cd53727fec76cf1a6d60f90414ff92567818
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoConsolidate short_help for classify table with memory-size 06/9006/3
Hongjun Ni [Wed, 25 Oct 2017 12:47:56 +0000 (20:47 +0800)]
Consolidate short_help for classify table with memory-size

When creating 32K classify sessions, VPP crashes.
Default heap size is 2MB.
Need to configure it when requiring large number sessions.

Change-Id: I16678ee4a9e0ba61cbd2d3b38c43d10c59325968
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
7 years agoNAT: delete session API/CLI (VPP-1041) 50/9050/2
Matus Fabian [Thu, 26 Oct 2017 10:37:38 +0000 (03:37 -0700)]
NAT: delete session API/CLI (VPP-1041)

Administratively delete NAT44 session for specific inside/outside addresses and port pair.

Change-Id: If5ab500ac3592c7153d6d8f2cc0297df7309fbc3
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agoacl-plugin: refactor the "show acl-plugin" CLI, use vlib_cli_output() vs. format() 61/9061/2
Andrew Yourtchenko [Thu, 26 Oct 2017 14:26:18 +0000 (14:26 +0000)]
acl-plugin: refactor the "show acl-plugin" CLI, use vlib_cli_output() vs. format()

The vppctl was getting upset with large chunks of info generated
by repeated format() functions, so convert to use vlib_cli_output instead.
Also, refactor the show functionality into smaller functions,
separate from the input handling.

Change-Id: I5d0db5ac45ce4c1b59cd41526b837412e06b1ce0
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
7 years agosession: swap appns secret to host byte order 64/9064/2
Florin Coras [Thu, 26 Oct 2017 15:16:59 +0000 (08:16 -0700)]
session: swap appns secret to host byte order

Change-Id: I355433e0f07b328c441ed642705b31ca5157fabe
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agofib test - fix undefined behavior warning found by clang 43/9043/2
Gabriel Ganne [Thu, 26 Oct 2017 08:35:28 +0000 (10:35 +0200)]
fib test - fix undefined behavior warning found by clang

warning: passing an object that undergoes default argument promotion
to 'va_start' has undefined behavior [-Wvarargs]

Change-Id: Ic9cfd61e38983bd67f30bf92f605e6c87d103ca5
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
7 years ago17.10 Release Notes 34/9034/2
Florin Coras [Mon, 23 Oct 2017 07:04:53 +0000 (00:04 -0700)]
17.10 Release Notes

Change-Id: I0c2a8412c9946e4d18b37db907735ac0b2ea2f6e
Signed-off-by: Florin Coras <fcoras@cisco.com>
7 years agoVCL: add session namespace support. 35/9035/2
Dave Wallace [Thu, 26 Oct 2017 07:29:30 +0000 (03:29 -0400)]
VCL: add session namespace support.

Change-Id: I04f1b63e66260d99c0dd180b0295a55a9b750df7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoAllow IPsec interface to have SAs reset 94/8794/5
Matthew Smith [Thu, 12 Oct 2017 17:06:59 +0000 (12:06 -0500)]
Allow IPsec interface to have SAs reset

Make it easier to integrate with external IKE daemon.
IPsec interfaces can have one or both SAs replaced after
creation. This allows for the possibility of setting a
new child SA on an interface when rekeying occurs. It also
allows for the possibility of creating an interface ahead
of time and updating the SA when parameters that are
negotiated during IKE exchange become known.

Change-Id: I0a31afdcc2bdff7098a924a51abbc58bdab2bd08
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
7 years agoopensuse support: reworked SUSE DEPS variables 96/8996/2
Marco Varlese [Tue, 24 Oct 2017 15:02:04 +0000 (17:02 +0200)]
opensuse support: reworked SUSE DEPS variables

Change-Id: I782541719db59daf02f0a7bd2842384dfe42c32a
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
7 years agoVCL: Return data for recvfrom(MSG_PEEK) 27/9027/4
Steven [Wed, 25 Oct 2017 19:33:12 +0000 (12:33 -0700)]
VCL: Return data for recvfrom(MSG_PEEK)

Implement recvfrom(MSG_PEEK) by returning data in the provided buffer
without moving the read pointer

Change-Id: Idc1b22632d78e8a499cce7d48c15e8bab0b0bf88
Signed-off-by: Steven <sluong@cisco.com>
7 years agolldp: protection code to check a valid interface index 26/9026/2
Steve Shin [Wed, 25 Oct 2017 18:16:45 +0000 (11:16 -0700)]
lldp: protection code to check a valid interface index

When lldp interface is set, it's better to check valid interface index.

Change-Id: I0db0ab6483ad73d28c69893576aa9b719c3b087c
Signed-off-by: Steve Shin <jonshin@cisco.com>
7 years agoVCL-LDPRELOAD: statically link VPP objects into libvcl_ldpreload.so 23/9023/2
Dave Wallace [Wed, 25 Oct 2017 16:30:37 +0000 (12:30 -0400)]
VCL-LDPRELOAD: statically link VPP objects into libvcl_ldpreload.so

Change-Id: If8fb5484b64a5b1c04e34573490fedcf63feabc9
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoVCL: Fix vcl test scripts to check vcl.am instead of uri.am 02/9002/2
Dave Wallace [Tue, 24 Oct 2017 19:39:44 +0000 (15:39 -0400)]
VCL: Fix vcl test scripts to check vcl.am instead of uri.am

Change-Id: I34ab79ddf0a612be1f2a4223e46811516e5b317e
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agovlib: add support for multiple buffer pools 82/8782/6
Damjan Marion [Thu, 12 Oct 2017 11:09:26 +0000 (13:09 +0200)]
vlib: add support for multiple buffer pools

Change-Id: Icaf7d7ad47284aea7a56e8006b69f45874d64202
Signed-off-by: Damjan Marion <damarion@cisco.com>
7 years agoDo not include x86intrin.h if unavailable 52/8952/2
Gabriel Ganne [Mon, 23 Oct 2017 06:54:50 +0000 (08:54 +0200)]
Do not include x86intrin.h if unavailable

This fixes compilations on arm platforms.

The call to the function itself was protected, and used clib_xxhash instead.
Only the header protection was missing.

Change-Id: I9fac252a5732e1a9808cf7de93fa3d5f07bcebe6
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
7 years agoVPP-1033: Python API support arbitrary sized input parameters. 36/8936/6
Ole Troan [Fri, 20 Oct 2017 11:28:20 +0000 (13:28 +0200)]
VPP-1033: Python API support arbitrary sized input parameters.

Dynamically calculate the required buffer size to pack into based on
message definition. Also add input parameter length checking.

Change-Id: I7633bec596e4833bb328fbf63a65b866c7985de5
Signed-off-by: Ole Troan <ot@cisco.com>
7 years agoL3 proxy FIB source for container networking 67/8967/3
Andrew Yourtchenko [Wed, 25 Oct 2017 12:50:37 +0000 (05:50 -0700)]
L3 proxy FIB source for container networking

Change-Id: I4164c4c19c8dbfd73e6ddf94a12056325cc093b9
Signed-off-by: Neale Ranns <nranns@cisco.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
7 years agoOne armed NAT (VPP-1035) 88/8988/2
Matus Fabian [Tue, 24 Oct 2017 11:13:49 +0000 (04:13 -0700)]
One armed NAT (VPP-1035)

Use a single physical interface in order to accomplish NAT44/NAT64.

Change-Id: I0c8138953a7a4075df306172e125abad771315e4
Signed-off-by: Matus Fabian <matfabia@cisco.com>
7 years agoVCL/LDPRELOAD: Add support for getsockopt, sendto, and recvfrom 04/9004/3
Steven [Tue, 24 Oct 2017 23:03:58 +0000 (16:03 -0700)]
VCL/LDPRELOAD: Add support for getsockopt, sendto, and recvfrom

Add support for getsockopt, sendto, and recvfrom. Not all options
for the system calls are supported yet. Only the options used by
curl and wget are supported for now.

Change-Id: I2e0ed7349a0273616b3831c201e7c117725ca287
Signed-off-by: Steven <sluong@cisco.com>
7 years agoVCL-LDPRELOAD: Fix coverity warnings. 05/9005/1
Dave Wallace [Wed, 25 Oct 2017 00:47:45 +0000 (20:47 -0400)]
VCL-LDPRELOAD: Fix coverity warnings.

- CID 178225: Constant expression result
- CID 178220: Logically dead code
- CID 178222: Logically dead code
- CID 178227: Logically dead code
- CID 178223: Same on both sides
- CID 178226: Same on both sides

Change-Id: Ie0c80edb41390cf2308e54938be85d865e292138
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoVCL-LDPRELOAD: statically link vppcom into libvcl-ldpreload.so 79/8979/7
Dave Wallace [Tue, 24 Oct 2017 08:12:18 +0000 (04:12 -0400)]
VCL-LDPRELOAD: statically link vppcom into libvcl-ldpreload.so

- Move VCL & VCL-LDPRELOAD source into src/vcl
- Statically link vppcom into libvcl-ldpreload.so

Change-Id: I778300b37e8b06640d9dbc01caf297edf7a6edb7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoUpdate L2 header offset after VLAN tag rewrite 93/8993/2
Neale Ranns [Tue, 24 Oct 2017 14:55:53 +0000 (07:55 -0700)]
Update L2 header offset after VLAN tag rewrite

Change-Id: I5c1df59bce7c9654101672a12981e5bd62e9adc4
Signed-off-by: Neale Ranns <nranns@cisco.com>
7 years agofix test_lb_ip4_gre6() cleanup 92/8992/1
Gabriel Ganne [Tue, 24 Oct 2017 13:18:57 +0000 (15:18 +0200)]
fix test_lb_ip4_gre6() cleanup

missing "del" keyword, and as a result, we were trying to add the as
twice.

Change-Id: If78ce03f0c71591c05ff6f4748fd9c929d0f861f
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
7 years agoAdd extern to *_main global variable declarations in header files. 72/8972/1
Dave Wallace [Tue, 24 Oct 2017 05:32:41 +0000 (01:32 -0400)]
Add extern to *_main global variable declarations in header files.

- 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>
7 years agoaf_packet: invalid TCP/UDP offload checksum on RX node recalculation 38/8938/4
Jakub Grajciar [Fri, 20 Oct 2017 11:37:28 +0000 (13:37 +0200)]
af_packet: invalid TCP/UDP offload checksum on RX node recalculation

Change-Id: I1075e5d2a1b6dfe3a443b40b41b8458a30505680
Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
Signed-off-by: Jakub.Grajciar@pantheon.tech <Jakub.Grajciar@pantheon.tech>
7 years agoVXLAN:small refactor to vxlan input 17/8917/6
Eyal Bari [Thu, 19 Oct 2017 12:27:51 +0000 (15:27 +0300)]
VXLAN:small refactor to vxlan input

Change-Id: I2e7e08e1de20ab57e3f899b080b90a3082219ae5
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agotest bfd - DPO_PROTO_IP6 is part of DpoProto 21/8921/2
Gabriel Ganne [Thu, 19 Oct 2017 07:54:46 +0000 (09:54 +0200)]
test bfd - DPO_PROTO_IP6 is part of DpoProto

Change-Id: I63d336a1ba366a60a2a8f1124e3f37f742cccb65
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
7 years agoThread_index for thread0 in vlib_global_main not initialised 48/8948/1
Keith Burns (alagalah) [Fri, 20 Oct 2017 20:55:18 +0000 (13:55 -0700)]
Thread_index for thread0 in vlib_global_main not initialised

Change-Id: Ie49ee865b197e8fe7bba170c115a4ccbf1013e5f
Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
7 years agoVCL: Fix converity warning CID 177864 46/8946/2
Dave Wallace [Fri, 20 Oct 2017 17:23:40 +0000 (13:23 -0400)]
VCL: Fix converity warning CID 177864

Change-Id: Id8578321381d14f9de827767ef0acf627f1535e4
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoVCL-LDPRELOAD: Refactor vcom_socket* and fix crash in vppcom_select 43/8943/3
Dave Wallace [Fri, 20 Oct 2017 16:30:38 +0000 (12:30 -0400)]
VCL-LDPRELOAD: Refactor vcom_socket* and fix crash in vppcom_select

- filter verbose debug output with VCOM_DEBUG > 2
- clean up nomenclature, renaming vppcom_*() functions to
  vcom_session_*()
- fix vppcom_select crash with NULL maps.

Change-Id: I6e416a096d6fd800aa26991c2439e24e8fc38cc5
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoAdd reverse DNS (ip to name) resolution 42/8942/1
Dave Barach [Fri, 20 Oct 2017 13:21:35 +0000 (09:21 -0400)]
Add reverse DNS (ip to name) resolution

Change-Id: Ic531d820b1846ff7363e5c396ac0b1176e87b401
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agonull-terminate some formatted string 22/8922/5
Gabriel Ganne [Thu, 19 Oct 2017 13:10:46 +0000 (15:10 +0200)]
null-terminate some formatted string

Any u8* variable created by format() is NOT null-terminated.
Add the null terminating byte with vec_terminate_c_string().

If that variable is used by (at least) hash_get_mem(), then it needs to
be null-terminated, as it will go through string_key_sum() which makes a
call to strlen.

Change-Id: I4e51e1b6668f557e53af3bb897cd281598eedbc0
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
7 years agoadd cuckoo hash 20/5920/10
Klement Sekera [Wed, 8 Mar 2017 04:21:24 +0000 (05:21 +0100)]
add cuckoo hash

Change-Id: I78215041588014e9e5c3599c60471ced610735bb
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoLD_PRELOAD poll implementation 27/8827/6
shrinivasan ganapathy [Sun, 15 Oct 2017 22:46:09 +0000 (15:46 -0700)]
LD_PRELOAD poll implementation

- add poll implementation
- implementation based on vppcom_poll
- implementation based on vppcom_select
- currently vppcom_select implementation is picked

Change-Id: If6c2862ae72e9969335aca5b8085957c98287dc0
Signed-off-by: shrinivasan ganapathy <shrinivasanganapathy@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoVCL: cleanup misc. issues in vppcom 02/8902/2
Dave Wallace [Thu, 19 Oct 2017 07:53:57 +0000 (03:53 -0400)]
VCL: cleanup misc. issues in vppcom

- Fix vppcom_select crash when n_bits == 0
- Enhance debug output
- Remove port byte-swapping during accept

Change-Id: I6ccd1040ceb82908d924220f558df803ab5eea30
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agovcl-ldpreload: test script enhancements 01/8901/2
Dave Wallace [Thu, 19 Oct 2017 07:47:42 +0000 (03:47 -0400)]
vcl-ldpreload: test script enhancements

Change-Id: Iff302a35cd5d35bf0671a63e8ba81a0c60a231eb
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agomake test: control sanity via SANITY=yes|no option 57/8857/2
Klement Sekera [Tue, 17 Oct 2017 05:59:31 +0000 (07:59 +0200)]
make test: control sanity via SANITY=yes|no option

Allow skipping sanity when using DEBUG=gdb/gdbserver options to speed
up development process by supplying SANITY=no option to make test.

Change-Id: I6e619229f6866b22bdeb75654b4e750232ae22bd
Signed-off-by: Klement Sekera <ksekera@cisco.com>
7 years agoAdd GENEVE tunnel maintainer. 98/8898/3
Marco Varlese [Thu, 19 Oct 2017 06:42:02 +0000 (08:42 +0200)]
Add GENEVE tunnel maintainer.

Change-Id: I30bbba4119accee2c157fb5b8202da3c87c59805
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
7 years agoRemove unused 'not_last' parameter from ip_add_del_route 26/8826/4
Marek Gradzki [Fri, 13 Oct 2017 08:22:59 +0000 (10:22 +0200)]
Remove unused 'not_last' parameter from ip_add_del_route

Vat supports setting value for the parameter, but
'not_last' is ignored by ip_add_del_route handler,
so can be removed.

This patch
- updates ip.api,
- removes vat handlers
- updates vpp_papi_provider.py
  (also mpls_route_add_del with unused not_last)

Change-Id: Ife15de123db4bc8247103a29b90bce1988e46534
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
7 years agoVPP-1024: rewrite buffer trajectory tracer 88/8888/2
Dave Barach [Wed, 18 Oct 2017 22:48:11 +0000 (18:48 -0400)]
VPP-1024: rewrite buffer trajectory tracer

Use a proper u16 * vector to capture node indices, since vpp w/
plugins now exceeds 255 graph nodes

Change-Id: Ic48cad676fa3a6116413ddf08c083dd9660783f1
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agoVCL-LDPRELOAD: fix iperf3 socket_test.sh 89/8889/2
Dave Wallace [Thu, 19 Oct 2017 01:15:48 +0000 (21:15 -0400)]
VCL-LDPRELOAD: fix iperf3 socket_test.sh

Change-Id: Ib6b52917af717d3341429163fb9ecc903cf717fb
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoTEST,SPAN:add broadcast+QiniQ tests 30/8830/5
Eyal Bari [Mon, 16 Oct 2017 10:38:21 +0000 (13:38 +0300)]
TEST,SPAN:add broadcast+QiniQ tests

Change-Id: I89c6923370af97bbd09db81a33b6d17f9424a049
Signed-off-by: Eyal Bari <ebari@cisco.com>
7 years agoLISP: fix crash when sending NSH map-request message, ONE-32 79/8879/2
Filip Tehlar [Wed, 18 Oct 2017 14:10:25 +0000 (07:10 -0700)]
LISP: fix crash when sending NSH map-request message, ONE-32

Change-Id: Ief8c3d3bec116e9f884981fb52af528f98b5f6ff
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
7 years agoPlugin for IP-Address to Interface Punting 64/8564/4
Pierre Pfister [Wed, 27 Sep 2017 14:17:31 +0000 (16:17 +0200)]
Plugin for IP-Address to Interface Punting

This plugin provides per-ip address to interface punting.

When at least one rule is defined, the plugin receives all packets
which destination is one of VPP's address but which was not processed
by VPP (e.g., a TCP packet on a port that is not open, or a packet
for a protocol which is not attached).

Based on the set of configured rules, the destination address of each
packet is used to send the packet on the associated interface.

This plugin allows multiple containers to use
VPP's TCP stack (or other features provided by VPP) while still
being able to receive additional packets.

Change-Id: I3e69bb7d98183bf5163cb9ecb564cb482de252ce
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
7 years agoVPP-930: add missing ntohl to send_ip6_fib_details(...) 81/8881/1
Dave Barach [Wed, 18 Oct 2017 14:54:12 +0000 (10:54 -0400)]
VPP-930: add missing ntohl to send_ip6_fib_details(...)

Change-Id: I0c1671f3eaf2dad084e3ac9fb124c9ed78273f50
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agoipsec: use boolean or vs. bitwise or to avoid compiler error 70/8870/2
Andrew Yourtchenko [Wed, 18 Oct 2017 10:21:34 +0000 (12:21 +0200)]
ipsec: use boolean or vs. bitwise or to avoid compiler error

Ubuntu 17.04, gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2),
"make build" fails with the few of the errors below:

error: suggest parentheses around comparison in operand of ‘|’
[-Werror=parentheses]
        is_aead = (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 |

Solution: use the logical rather than the bitwise or.

Change-Id: Iffcc1ed2e68b14b248159cb117593d32c623c553
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
7 years agoCSIT-844: fix binary api rx pthread heap push/pop 62/8862/2
Dave Barach [Tue, 17 Oct 2017 15:48:29 +0000 (11:48 -0400)]
CSIT-844: fix binary api rx pthread heap push/pop

We need to push/pop the rx pthread's heap without affecting other
thread(s).

Search clib_per_cpu_mheaps, locate an unused slot. Duplicate the main
thread heap pointer in that slot, and set __os_thread_index
appropriately.

Miscellaneous cleanups. Print exec_inband results as a vector, instead
of as a format string. Don't bail out of vpp_api_test with results
pending, e.g. at the end of a vpp_api_test script. Even though vpp
will eventuallly garbage-collect them, We don't want to leave
allocated reply messages lurking in the api message allocation
rings...

Change-Id: I0e8a25d1ff0d3700249dc330d079db16c2fcbc55
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agosession: fix connect corner case crash. 64/8864/2
Dave Wallace [Tue, 17 Oct 2017 20:19:41 +0000 (16:19 -0400)]
session: fix connect corner case crash.

Change-Id: I54ced42749432335183ee3085a9ccc5f95a87ae9
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
7 years agoVPP-1032: fix coverity warnings 63/8863/1
Dave Barach [Tue, 17 Oct 2017 17:13:42 +0000 (13:13 -0400)]
VPP-1032: fix coverity warnings

Change-Id: Ic3a0c51e5408921051deaf2e50372d9654574b27
Signed-off-by: Dave Barach <dave@barachs.net>
7 years agoInitial commit for phase 2, Add some simple validation. 61/8861/2
John DeNisco [Tue, 17 Oct 2017 15:07:22 +0000 (11:07 -0400)]
Initial commit for phase 2, Add some simple validation.

Change-Id: I5b1d5600cdef4b05cc7c2f1cddb60aed2cc49ac2
Signed-off-by: John DeNisco <jdenisco@cisco.com>
7 years agoTEST,SPAN: add rx+tx span test 18/8818/3
Eyal Bari [Sun, 15 Oct 2017 13:55:11 +0000 (16:55 +0300)]
TEST,SPAN: add rx+tx span test

also refactored verify function

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