vpp.git
4 years agoreassembly: prevent long chain attack 43/19643/3
Klement Sekera [Thu, 16 May 2019 12:35:46 +0000 (14:35 +0200)]
reassembly: prevent long chain attack

limit max # of fragments to 3 per packet by default
add API option to configure the limit at runtime

Change-Id: Ie4b9507bf5c6095b9a5925972b37fe0032f4f9e8
Signed-off-by: Klement Sekera <ksekera@cisco.com>
4 years agobonding: clean up redundant code 42/19442/2
Zhiyong Yang [Thu, 9 May 2019 02:57:53 +0000 (22:57 -0400)]
bonding: clean up redundant code

1. remove unnecessary cast for void * pointer.
2. remove the unused input parameter.

Change-Id: Ic0324364fc0c772200d30fb18a0ba959ed4f7ea4
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
4 years agoconsolidate all mutux opertion 98/18198/4
Ping Yu [Tue, 12 Mar 2019 09:28:16 +0000 (05:28 -0400)]
consolidate all mutux opertion

replace all pthread_mutex_lock/unlock to be svm_queue_lock/unlock
So there all operation is based on defined mutux, and it can help us
to debug or replace mutux locking method

Change-Id: I9aeeb03bbbbf3d7a824c06a535e5d6a6b463b42c
Signed-off-by: Ping Yu <ping.yu@intel.com>
4 years agoapi: export ip_types.api for out-of-tree plugins 78/19678/2
Benoît Ganne [Fri, 17 May 2019 12:24:17 +0000 (14:24 +0200)]
api: export ip_types.api for out-of-tree plugins

Out-of-tree plugins can refer to IP types in their API. The .api and
associated headers must be exported.

Change-Id: I75004343b040defd9eebac6a8a95c2ecf3c8079a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agoemacs-lisp: add missing '\' in template 96/19696/1
Dave Barach [Sat, 18 May 2019 18:52:54 +0000 (14:52 -0400)]
emacs-lisp: add missing '\' in template

Fixes the generated setup_message_id_table(...)
implementation. Without a level of quoting in the emacs lisp skeleton,
the underscore macro used to generate calls to
vl_msg_api_add_msg_name_crc produces "fooCRC" instead of "foo_CRC".
That confuses the Python language binding.

Punctuation saves lives: "Let's eat Grandma" vs. "Let's eat, Grandma."
Or some such.

Change-Id: Ibecc20337092199d6757165ac96b70c830511bb3
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agoAdd a debug-CLI leak-checker 90/19690/4
Dave Barach [Fri, 17 May 2019 14:46:40 +0000 (10:46 -0400)]
Add a debug-CLI leak-checker

leak-check { <any-debug-cli-command-and-args> }

Hint: "set term history off" or you'll have to sort through a bunch of
bogus leaks related to the debug cli history mechanism.

Cleaned up a set of reported leaks in the "show interface" command. At
some point, we thought about making a per-thread vlib_mains vector,
but we never did that. Several interface-related CLI's maintained
local static cache vectors. Not a bad idea, but not useful as things
shook out. Removed the static vectors.

Change-Id: I756bf2721a0d91993ecfded34c79da406f30a548
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agoTrivial typo. punt_node.c 82/19582/2
Paul Vinciguerra [Wed, 15 May 2019 03:51:45 +0000 (23:51 -0400)]
Trivial typo. punt_node.c

Change-Id: I1455cb507f6ecffbb053b0e3e2de833dd40fa5f5
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoTests: Refactor. Remove copies of enums. 87/19687/2
Paul Vinciguerra [Fri, 17 May 2019 13:48:15 +0000 (09:48 -0400)]
Tests: Refactor. Remove copies of enums.

Use the enums provided from the api definitions instead.

Change-Id: I43b7591df920c984e439efc4b3ec3c4121c539d8
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agomake test: Add QUIC serial transfer test 24/19624/5
Dave Wallace [Thu, 16 May 2019 01:41:23 +0000 (21:41 -0400)]
make test: Add QUIC serial transfer test

Change-Id: I7ed68dd199daa31269d45d67e0a4fa632e1a08d1
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
4 years agoTests: Raise exception if API cli_inband command fails. 23/19523/8
Paul Vinciguerra [Sat, 11 May 2019 00:41:08 +0000 (20:41 -0400)]
Tests:  Raise exception if API cli_inband command fails.

* Configure tests to raise exception if cli_inband fails.
* Fix failing tests.
* Add filename detail to pcap.stat clib_error_return for debugging.

Note: this change identifies spurious issues with packet-generator such as:
  CliFailedCommandError: packet-generator capture: pcap file
  '/tmp/vpp-unittest-Test6RD-v09RPA/pg0_out.pcap' does not exist.

These issues resolve themselves on remaining test passes.

Change-Id: Iecbd09daee954d892306d11baff3864a43c5b603
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agodocs: Fix Versions and Titles 94/19694/2
jdenisco [Fri, 17 May 2019 17:43:31 +0000 (17:43 +0000)]
docs: Fix Versions and Titles

Change-Id: I131e33a570bff8b22c767585d03e2eb281dd7184
Signed-off-by: jdenisco <jdenisco@cisco.com>
4 years agoFix punctuation fails in 2x plugins 95/19695/1
Dave Barach [Fri, 17 May 2019 18:48:27 +0000 (14:48 -0400)]
Fix punctuation fails in 2x plugins

More to the point: fix the Python API binding for the plugins.

The http_static and ct6 plugin setup_message_id_table calls didn't
have "_"'s between message names and CRCs. I would have expected this
to originate in the emacs skeleton, but the skeleton is correct.

Punctuation saves lives: "Let's eat Grandma..." != "Let's eat,
Grandma..." More or less.

Change-Id: Icd87813308701d203cf6f147b2bb90d39d51ddeb
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agoLoad vat plugins late in the init sequence 93/19693/2
Dave Barach [Fri, 17 May 2019 17:13:05 +0000 (13:13 -0400)]
Load vat plugins late in the init sequence

After the related data-plane plugins have initialized their message IDs.

Change-Id: I4202a9e46ef6cdb12a5186be0f2370e2f9ccbb78
Signed-off-by: Dave Barach <dave@barachs.net>
4 years ago19.01.2 Release Notes 92/19692/1
Andrew Yourtchenko [Fri, 17 May 2019 14:35:08 +0000 (14:35 +0000)]
19.01.2 Release Notes

Change-Id: Ia68372d397504ede789e40e9f7e1b939d09bc81a
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
4 years agoUDP-Local: fix unregistered ports 84/19684/3
Neale Ranns [Fri, 17 May 2019 13:04:33 +0000 (06:04 -0700)]
UDP-Local: fix unregistered ports

- if the port is unregistered then write ~0 into the sparse vec, this allows the DP to send packets to ICMP
- remove the v6 arcs from the v4 node and vice-versa (since they're never taken)
- i have tests for this in a pending change for the punt socket

Change-Id: Icbd97de2c2fc38490c16afc2e0b414d8436593c4
Signed-off-by: Neale Ranns <nranns@cisco.com>
4 years agoFix 'terminal history off' crasher 88/19688/1
Chris Luke [Fri, 17 May 2019 14:17:16 +0000 (10:17 -0400)]
Fix 'terminal history off' crasher

- 'set terminal history off' or '... limit 0' has an incorrect
  terminal condition and tries to vec_delete one-too-many times
  causing a crash.
- Changing >= to > fixes this.
- In any case, a single vec_delete is more efficient, so do that
  instead.

Change-Id: Ia0db63b6c5c7891d75b302e793b4e4985dd86ebb
Signed-off-by: Chris Luke <chrisy@flirble.org>
4 years agodpdk-ipsec: fix encrypt/decrypt single queue 83/19383/4
Sergio Gonzalez Monroy [Mon, 6 May 2019 20:44:14 +0000 (22:44 +0200)]
dpdk-ipsec: fix encrypt/decrypt single queue

When the same worker thread processes packet for encrypt and decrypt,
ie. single worker with bi-directional traffic, given that the queue is
shared results in packets to be decrypted being dropped as the encrypt
always happens first for each main loop.

With this change, each crypto device queue is logically split into two
queues, each half the real size, avoiding the described problem.

Change-Id: Ifd3f15e316c92fbd6ca05802456b10a7f73f85da
Signed-off-by: Sergio Gonzalez Monroy <sgmonroy@gmail.com>
4 years agogbp: Add unit tests for contracts 41/19041/3
Mohsin Kazmi [Thu, 18 Apr 2019 13:54:58 +0000 (15:54 +0200)]
gbp: Add unit tests for contracts

Change-Id: Ib6615739b1db44b7788f462196cd477b6e23d67e
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
4 years agotests: refactor. Replace literal constant w/ named constant. 75/19575/3
Paul Vinciguerra [Tue, 14 May 2019 17:25:49 +0000 (13:25 -0400)]
tests: refactor. Replace literal constant w/ named constant.

* change literal packet count vlaues from 65 to a named constant of 67.
  (This value was recommended to exercise single, dual, and quad loops)

Change-Id: Ieb1738dddacb8b6ea7fa25883032ac01a98399e1
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoAdd transport_opts to connect_sock bapi 47/19647/3
Nathan Skrzypczak [Thu, 16 May 2019 14:35:40 +0000 (16:35 +0200)]
Add transport_opts to connect_sock bapi

Needed by QUIC to distinguish Q/Ssessions

Change-Id: Idcc9e46f86f54a7d06ce6d870edec1766e95c82d
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
4 years agodocs: Update sphinx, requirements, support markdown tables 46/19546/2
jdenisco [Mon, 13 May 2019 16:40:21 +0000 (12:40 -0400)]
docs: Update sphinx, requirements, support markdown tables

Change-Id: Ie7c546f5720b10fe5423397204e1ab5c22d7a2ba
Signed-off-by: jdenisco <jdenisco@cisco.com>
4 years agoDOC ONLY: document VLIB_INIT_FUNCTION scheme 51/19651/2
Dave Barach [Thu, 16 May 2019 16:16:29 +0000 (12:16 -0400)]
DOC ONLY: document VLIB_INIT_FUNCTION scheme

Change-Id: I15c4256621da6c8d47b1a7c41755ee6587996757
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agoinit / exit function ordering 23/19623/4
Dave Barach [Tue, 14 May 2019 22:01:44 +0000 (18:01 -0400)]
init / exit function ordering

The vlib init function subsystem now supports a mix of procedural and
formally-specified ordering constraints. We should eliminate procedural
knowledge wherever possible.

The following schemes are *roughly* equivalent:

static clib_error_t *init_runs_first (vlib_main_t *vm)
{
   clib_error_t *error;

   ... do some stuff...

   if ((error = vlib_call_init_function (init_runs_next)))
     return error;
   ...
}
VLIB_INIT_FUNCTION (init_runs_first);

and

static clib_error_t *init_runs_first (vlib_main_t *vm)
{
   ... do some stuff...
}
VLIB_INIT_FUNCTION (init_runs_first) =
{
    .runs_before = VLIB_INITS("init_runs_next"),
};

The first form will [most likely] call "init_runs_next" on the
spot. The second form means that "init_runs_first" runs before
"init_runs_next," possibly much earlier in the sequence.

Please DO NOT construct sets of init functions where A before B
actually means A *right before* B. It's not necessary - simply combine
A and B - and it leads to hugely annoying debugging exercises when
trying to switch from ad-hoc procedural ordering constraints to formal
ordering constraints.

Change-Id: I5e4353503bf43b4acb11a45fb33c79a5ade8426c
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agoAdd default value for API Nat flags 20/19320/4
Michal Cmarada [Fri, 3 May 2019 10:58:55 +0000 (12:58 +0200)]
Add default value for API Nat flags

Change-Id: I4f1b83ae1c746b8f67f2d12a02081702b9553b44
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
4 years agoAdd QUIC human readable error logs 69/19569/3
Nathan Skrzypczak [Tue, 14 May 2019 12:21:55 +0000 (14:21 +0200)]
Add QUIC human readable error logs

Change-Id: I01cf5074b5a8b0018de5c3f59c9266d350c22f37
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
4 years agoIPSEC: remove CLI check for unsupported IPv6-AH - it is supported 16/19616/1
Neale Ranns [Wed, 15 May 2019 13:59:04 +0000 (06:59 -0700)]
IPSEC: remove CLI check for unsupported IPv6-AH - it is supported

Change-Id: I72ec95d4a3009a55b0f1fa7e45f9c53f31ef5fc1
Signed-off-by: Neale Ranns <nranns@cisco.com>
4 years agoFix stats documentation with default socket name 78/19578/2
Igor Mikhailov (imichail) [Tue, 14 May 2019 21:58:21 +0000 (14:58 -0700)]
Fix stats documentation with default socket name

Change-Id: Ibcb726c229cc12705764f771c15110852b420c49
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
4 years agovpp_papi: remove dependency on environment var. VPP_API_DIR. 52/18352/4
Paul Vinciguerra [Mon, 18 Mar 2019 00:34:46 +0000 (17:34 -0700)]
vpp_papi: remove dependency on environment var. VPP_API_DIR.

Change-Id: I9e3af8674e8aae27079fd03f6286f165d777814f
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoRemove unused function nat44_ha_resync() and error IN_PROGRESS. 77/19577/2
Jon Loeliger [Tue, 14 May 2019 20:02:39 +0000 (15:02 -0500)]
Remove unused function nat44_ha_resync() and error IN_PROGRESS.

The unused function nat44_ha_resync() was the only function that
used the error message VNET_API_ERROR_IN_PROGRESS.  The error
was the only error code that was positive, and didn't really
play well with the other error codes.

Change-Id: I7d03c2ee915094b635f6efdca7427f71e4d19f2b
Signed-off-by: Jon Loeliger <jdl@netgate.com>
4 years agotests: test_pipe.py. Fix missing import. 76/19576/2
Paul Vinciguerra [Tue, 14 May 2019 17:35:19 +0000 (13:35 -0400)]
tests: test_pipe.py. Fix missing import.

* Fix missing import (does not impact 'make test', fixes issue
  running under 'make test-shell')

Change-Id: I634378a8809df5c5b9671555932e797d04a2abbb
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoQUIC multi thread update 66/19566/2
Aloys Augustin [Tue, 14 May 2019 12:13:51 +0000 (14:13 +0200)]
QUIC multi thread update

* Add support for multiple threads
* Replace quicly buffers with fifos
* Fix cleanup of sessions
* Update quicly release version

Change-Id: I551f936bbec05a15703f043ee85c8e1ba0ab9723
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
4 years agosvm: improve fifo segment prealloc support 24/19524/20
Florin Coras [Sat, 11 May 2019 23:55:53 +0000 (16:55 -0700)]
svm: improve fifo segment prealloc support

- track fifo segment free and chunk freelist memory
- improve fifo alloc. If there are enough chunks to satisfy a fifo
  allocation request but not enough free memory, allocate a multi-chunk
  fifo
- add apis to preallocate chunks and fifo headers
- more tests

Change-Id: If18dba7ab856272c9f565d36ac36365139793e0b
Signed-off-by: Florin Coras <fcoras@cisco.com>
4 years agoIPSEC coverity fixes 68/19568/3
Neale Ranns [Tue, 14 May 2019 06:07:43 +0000 (23:07 -0700)]
IPSEC coverity fixes

Change-Id: I753fbce091c0ba1004690be5ddeb04f463cf95a3
Signed-off-by: Neale Ranns <nranns@cisco.com>
4 years agoIPSEC: remove unecessary pass by reference of sequence number 70/19570/2
Neale Ranns [Tue, 14 May 2019 14:01:01 +0000 (07:01 -0700)]
IPSEC: remove unecessary pass by reference of sequence number

Change-Id: Id406eb8c69a89c57305d8f138e8e6730037aa799
Signed-off-by: Neale Ranns <nranns@cisco.com>
4 years agoVPP-1649: fix coverity warning in api_format.c 65/19565/2
Dave Barach [Tue, 14 May 2019 12:12:36 +0000 (08:12 -0400)]
VPP-1649: fix coverity warning in api_format.c

Change-Id: Idc22377ca705a45300faaf8acbc3cae5f10e1c92
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agoPreallocate mhash key_tmps vector 21/19521/5
Dave Barach [Fri, 10 May 2019 19:25:10 +0000 (15:25 -0400)]
Preallocate mhash key_tmps vector

Fix os_get_nthreads() so that it starts returning the correct answer
as early as possible.

Change-Id: Id5292262f2c3f521b07ffbe6a9f6748dcc4dcb7d
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agoIPsec: increment tunnel intf tx counters 73/19473/3
Matthew Smith [Thu, 9 May 2019 13:55:11 +0000 (08:55 -0500)]
IPsec: increment tunnel intf tx counters

Recent changes removed the function that was incrementing the
tx counters. Increment them in the esp_encrypt functions.

Change-Id: I446333a23ccf66e34893adb2aa49af562cf35507
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
4 years agoBuild packages for generic Arm architecture 78/18278/16
Lijian.Zhang [Wed, 27 Feb 2019 10:17:34 +0000 (18:17 +0800)]
Build packages for generic Arm architecture

The current aarch64 version of VPP package distro in cloud repository
 (https://packagecloud.io/fdio/master/ubuntu), is built on a ThunderX server,
using some arch-specific options, for example, 128Byte cache line size,
 T=arm64-thunderx-linuxapp-gcc, RTE_MACHINE=thunderx

The patch is trying to build package distro with aarch64 generic features,
for both binary type targets, e.g., build/build-release, and package type
targets, e.g., pkg-deb/pkg-rpm, with the generic options, e.g.,
128Byte cache line size, T=arm64-armv8a-linuxapp-gcc, RTE_MACHINE=armv8a

If end users want to build arch specific optimized image,
TARGET_PLATFORM variable could be used, as below example,

$ make build-release/pkg-deb TARGET_PLATFORM=thunderx

Change-Id: If78bca8709fe83db6a95e8c26346f206bf5ea71d
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Sirshak Das <Sirshak.Das@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
4 years agordma: update MAINTAINERS and add doc 64/19364/4
Benoît Ganne [Mon, 6 May 2019 11:15:33 +0000 (13:15 +0200)]
rdma: update MAINTAINERS and add doc

Change-Id: Ida681d299fd57eba66338444b99d2476bdb3c695
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agotests: fix TestMPLSPIC tests in test_mpls.py. 75/19475/4
Paul Vinciguerra [Thu, 9 May 2019 19:53:10 +0000 (15:53 -0400)]
tests: fix TestMPLSPIC tests in test_mpls.py.

* Corrected stray ARP/ND packets in captures interfering with test results.
* Added tests to match counts of recv'd pkts against sent.
* Changes the number of packets to 67 for exercising single,
  dual, and quad-loops.

Change-Id: I9147b8578988607ea4444741d10854e4d8683191
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoCoverity: Fix CID-198494 & CID-198388 51/19551/2
Dave Wallace [Mon, 13 May 2019 23:23:24 +0000 (19:23 -0400)]
Coverity: Fix CID-198494 & CID-198388

Change-Id: I5fa4a3fa512b732fc444e908729582a109db538c
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
4 years agoUnregister UDPC port only when owned 41/19541/2
Nathan Skrzypczak [Mon, 13 May 2019 14:25:50 +0000 (16:25 +0200)]
Unregister UDPC port only when owned

Needed in QUIC, when cleaning up accepted UDP sessions

Change-Id: Ifcb32687175562bed4ca69bdc519cedd4dc3c2bc
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
4 years agomake test: vcl fix OSError exception handling 50/19550/2
Dave Wallace [Mon, 13 May 2019 23:21:24 +0000 (19:21 -0400)]
make test: vcl fix OSError exception handling

Change-Id: I4bf7da6752d85e384a8e8f3110964c4b142edcb5
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
4 years agomake test: Add QUIC external echo transfer test 48/19548/4
Dave Wallace [Mon, 13 May 2019 19:51:52 +0000 (15:51 -0400)]
make test: Add QUIC external echo transfer test

- Add namespace configuration to echo_client
- Add external echo transfer testcase
- Refactor quic test class to reduce unnecessary method args
- Increase default fifo size to 64 and data transfer to 10 mbytes
- Remove sleep() between starting internal server & client apps

Change-Id: Ia9de46a314d58e7809f005f6a5211760e63789bf
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
4 years agoFix typo 47/19547/2
Igor Mikhailov (imichail) [Mon, 13 May 2019 19:04:04 +0000 (12:04 -0700)]
Fix typo

Change-Id: Ibc69195244bcc1e8e82c488fcd50b1eb2fcf81c0
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
4 years agoTrivial Typo's in bier comments/docs. 49/19549/2
Paul Vinciguerra [Mon, 13 May 2019 19:56:41 +0000 (15:56 -0400)]
Trivial Typo's in bier comments/docs.

Change-Id: I3b3e868277d5caf6b1341814003a3bc5726c2df9
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agovnet: remove macro definitions 81/19481/3
Zhiyong Yang [Fri, 10 May 2019 03:59:20 +0000 (23:59 -0400)]
vnet: remove macro definitions

These two macro definitions should be removed as enum
vnet_interface_helper_flags_t has defined them.

Change-Id: I31bd0ea75639d2f9a53f396ac3cf42f9fc5fbdbe
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
4 years agoFix VPP-1528 get the same IP address from DHCP server for two VPP DHCP clients 03/19203/9
jackiechen1985 [Mon, 29 Apr 2019 03:29:04 +0000 (11:29 +0800)]
Fix VPP-1528 get the same IP address from DHCP server for two VPP DHCP clients

Change-Id: I18dfe51000758f44b991d2dd065c9aa2bc5863d5
Signed-off-by: jackiechen1985 <xiaobo.chen@tieto.com>
4 years agoremove dead code in rewrite.c 32/19532/1
Neale Ranns [Mon, 13 May 2019 10:30:03 +0000 (03:30 -0700)]
remove dead code in rewrite.c

Change-Id: Ib34ca76fcc5e85cb3cc646ffc7be208b8e757cba
Signed-off-by: Neale Ranns <nranns@cisco.com>
4 years agocli: Add return value in cli_inband 91/19491/2
Ole Troan [Fri, 10 May 2019 10:01:10 +0000 (12:01 +0200)]
cli: Add return value in cli_inband

Even when a CLI command called through the cli_inband API failed
the API would return 0 (SUCCESS). This patch fixes that,
but since most CLI handlers return error->code == 0,
in most failure cases it will return -1 (UNSPECIFIED ERROR).

Type: fix

Change-Id: Ic83f3b23e8e8954bb8aa211301baba24e8c20ef6
Signed-off-by: Ole Troan <ot@cisco.com>
4 years agoFix stat seg average vector rate computation 05/19505/4
Dave Barach [Fri, 10 May 2019 12:38:25 +0000 (08:38 -0400)]
Fix stat seg average vector rate computation

Add the number of worker threads and per worker thread vector rates to
the stats segment.

Change-Id: I3040108ec9fcdf5fdb6b9a950060dea9b3c88fd1
Signed-off-by: Dave Barach <dbarach@cisco.com>
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agotests: test/vpp_papi_provider.py Specify exception to catch. 76/19476/2
Paul Vinciguerra [Thu, 9 May 2019 20:12:35 +0000 (16:12 -0400)]
tests: test/vpp_papi_provider.py Specify exception to catch.

Change-Id: If936b198bcac7a317d52f958561c3e19d158450a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoUpdate ping cli .short_help. 78/19478/2
Paul Vinciguerra [Thu, 9 May 2019 21:41:23 +0000 (17:41 -0400)]
Update ping cli .short_help.

Change-Id: I5c414a158a8a6b243128127c608ab0fbb5a9405b
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agodocs: Add 1904 99/19299/3
jdenisco [Wed, 1 May 2019 20:30:36 +0000 (16:30 -0400)]
docs: Add 1904

Change-Id: Icf0e01d1dec69d48664ed633205248359b653f4d
Signed-off-by: jdenisco <jdenisco@cisco.com>
4 years agoFix typo in nat44_cli.c:nat_ha_failover_command_fn. 20/19520/3
Paul Vinciguerra [Fri, 10 May 2019 16:13:03 +0000 (12:13 -0400)]
Fix typo in nat44_cli.c:nat_ha_failover_command_fn.

Change-Id: Icdf531b3c688c4da6be732ff178316e3757aebb5
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agozero-pad date string output. 80/19480/2
Paul Vinciguerra [Thu, 9 May 2019 23:12:18 +0000 (19:12 -0400)]
zero-pad date string output.

2019/ 5/ 9 21:18:01:710 notice -> 2019/05/09 21:18:01:710 notice

Change-Id: I8ed932a0d6f5e6ce29ab6428f0f01221d0a6ae34
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agovpp_transport_socket: make connect more resilient 72/19472/5
Vratko Polak [Thu, 9 May 2019 15:04:57 +0000 (17:04 +0200)]
vpp_transport_socket: make connect more resilient

This should make connect() partially retriable,
at least against "No such file or directory on socket",
and when disconnect() is called before retrying connect().

Added TODOs for future improvements.

Change-Id: I5ee727fbc17d66446589b8c781f270055187db68
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
4 years agosession: segment manager fixes 74/19474/4
Florin Coras [Thu, 9 May 2019 19:08:06 +0000 (12:08 -0700)]
session: segment manager fixes

- fix segment size rounding for 4GB segments
- fix initialization of first segment size
- cleanup fifo segment info retrieval

Change-Id: I5ebf20f71ea797087653e7e76fa2e37b2686ec40
Signed-off-by: Florin Coras <fcoras@cisco.com>
4 years agoadd mactime plugin unit / code coverage tests 38/19438/3
Dave Barach [Wed, 8 May 2019 23:18:18 +0000 (19:18 -0400)]
add mactime plugin unit / code coverage tests

The unit and code coverage tests are boring. The rest of the patch
involves test and packet-generator infra cleanups.

Teach the "make test-xxx" family of targets to set the api test plugin
path correctly, to make "binary-api <api-message-name> <args>" debug
CLI commands work correctly in the "make test"
environment. Unfortunately involves both the top-level and test
Makefiles.

Add a minor pg cli feature, a CLI to manually set
s->sw_if_index[VLIB_TX].

Consider the case where one configures an interface with both a
device-input and an output feature. To test the output feature using
the pg, it's necessary to inject packets into the interface output
node with both b->sw_if_index[VLIB_TX] and b->sw_if_index[VLIB_RX] set
correctly. For example:

packet-generator new {
 name tx
 limit 15
 size 128-128
 interface local0  # rx: device input feature not configured on local0
 tx-interface loop0 # tx: output node requires b->sw_if_index[VLIB_TX]
 node loop0-output
 data {
   hex 0x01005e7ffffa000dead0000008000102030405060708090a0b0c0d0e0f0102030405
   }
}

Fix a longstanding bug in the packet generator stream setup.  Remove
kludges which set b->sw_if_index[VLIB_TX] to ~0 [in multiple places]
instead of using the stream value s->sw_if_index[VLIB_TX], and setting
THAT datum correctly.

Change-Id: I1097a18e8db73661ded6b822c1d718f7e5cf36ed
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agodpdk: fix return variable size 84/19384/2
Zhiyong Yang [Tue, 7 May 2019 02:42:55 +0000 (22:42 -0400)]
dpdk: fix return variable size

The function dpdk_ol_flags_extract should return u16
instead of u8.

Change-Id: Id0b08b04c93598818f9a2eee5a88733900320dfa
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
4 years agobapi: separate init shm reply from fd exchange 41/19441/3
Florin Coras [Thu, 9 May 2019 02:57:24 +0000 (19:57 -0700)]
bapi: separate init shm reply from fd exchange

Wait for init shm reply to be consumed before sending fd over the
socket.

Change-Id: I5cd0246d8debcc3c8a163b7e2dd400ca0050a2fb
Signed-off-by: Florin Coras <fcoras@cisco.com>
4 years agovls: relax copy on fork locks 40/19440/3
Florin Coras [Thu, 9 May 2019 02:08:30 +0000 (19:08 -0700)]
vls: relax copy on fork locks

Change-Id: I08cb7180364a5ef8444c9895c6d4f4842661b2a7
Signed-off-by: Florin Coras <fcoras@cisco.com>
4 years agoImprove exceptions in vpp_transport_socket.py 52/19452/3
Vratko Polak [Thu, 9 May 2019 08:04:13 +0000 (10:04 +0200)]
Improve exceptions in vpp_transport_socket.py

Added TODOs for further improvements.

Change-Id: I6724dd8b3de5537518a5c6e0ee9abe72f57b273e
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
4 years agoUpdate API description 37/19437/2
Igor Mikhailov (imichail) [Wed, 8 May 2019 23:01:01 +0000 (16:01 -0700)]
Update API description

Change-Id: I2d616a30e745045789287cb13b26fb12d51d2884
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
4 years agomake test: add quic multistream test case 39/19439/4
Dave Wallace [Thu, 9 May 2019 00:46:33 +0000 (20:46 -0400)]
make test: add quic multistream test case

- Also refactor test_quic.py to prepare for
  external echo tests & ipv6 tests

Change-Id: I7dff60b375ed67d920e73294e0bf491cd3206d56
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
4 years agoNAT: VPP-1665 coverity scan issue fix 39/19339/4
Filip Varga [Fri, 3 May 2019 20:06:16 +0000 (22:06 +0200)]
NAT: VPP-1665 coverity scan issue fix

Change-Id: I092a9f8237a895f907590772f2ea213a86502fb4
Signed-off-by: Filip Varga <fivarga@cisco.com>
4 years agoFix copypaste in vpp_papi/vpp_transport_socket.py 56/19456/1
Vratko Polak [Thu, 9 May 2019 09:06:09 +0000 (11:06 +0200)]
Fix copypaste in vpp_papi/vpp_transport_socket.py

Change-Id: I80e6ccd6f63e3eca2ba723f3b39a47475ae9aed0
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
4 years agoldp: add option to eanble transparent TLS connections 50/19350/13
Yu Ping [Tue, 7 May 2019 16:40:24 +0000 (00:40 +0800)]
ldp: add option to eanble transparent TLS connections

If LDP_TRANSPARENT_TLS is set, LDP transparently converts TCP into TLS
connnection.
Verified in Nginx LD_PRELOAD mode.

Change-Id: I2229be61a0deb723bf5d94a2193ecb792dd997fb
Signed-off-by: Yu Ping <ping.yu@intel.com>
4 years agomake test: introduce COREDUMP_COMPRESS option 82/19382/2
Klement Sekera [Mon, 6 May 2019 17:11:25 +0000 (19:11 +0200)]
make test: introduce COREDUMP_COMPRESS option

setting COREDUMP_COMPRESS=y (or =1) indicates that any core file
is to be compressed by the test framework unless DEBUG=core is set.

Change-Id: Ib0d6d30a7398dbeb6ab5e5dbb411bf5c641b5206
Signed-off-by: Klement Sekera <ksekera@cisco.com>
4 years agosession: send tx events when data is dequeued 28/19428/5
Florin Coras [Tue, 7 May 2019 23:28:16 +0000 (16:28 -0700)]
session: send tx events when data is dequeued

Change-Id: Ib8cb19361c42e38e3f68d7147358378fff161eb1
Signed-off-by: Florin Coras <fcoras@cisco.com>
4 years agoFix $(SUSE_NAME) in Makefile. 17/17917/3
Paul Vinciguerra [Wed, 27 Feb 2019 19:15:04 +0000 (11:15 -0800)]
Fix $(SUSE_NAME) in Makefile.

SUSE_NAME is now lowercase with dashes in place of spaces.

grep '^NAME=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | sed -e 's/ /-/' | awk '{print tolower($0)}'
opensuse-leap

Change-Id: Ie547c2e5684f955529a010d14b9317bbbde4caf6
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoVPP-1508: Fix zip() under python3. 81/17981/4
Paul Vinciguerra [Sat, 2 Mar 2019 18:43:05 +0000 (10:43 -0800)]
VPP-1508: Fix zip() under python3.

Under py3, zip() returns an iterator. Fix so no longer needed in a list contex.

Change-Id: I64b4560d990686cc87fd26d703030f9fb2494f12
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoFix Exception typo in vpp_papi/vpp_transport_socket.py. 26/19426/2
Paul Vinciguerra [Tue, 7 May 2019 19:30:50 +0000 (12:30 -0700)]
Fix Exception typo in vpp_papi/vpp_transport_socket.py.

Change-Id: I80ef74abcb14136984a4c94ba60414a1348015d3
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agobihash: Freeing up working_copy_lengths vector 27/19427/2
Vijayabhaskar Katamreddy [Tue, 7 May 2019 20:27:32 +0000 (13:27 -0700)]
bihash: Freeing up working_copy_lengths vector

1)Freeing up working_copy_lengths vector
2)Passing vebososity level to fmt_fn

Change-Id: I5e3f541e2f8cc0150105cc35835366f84937bb2e
Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
4 years agosvm: decouple fifo and default chunk allocation 45/19345/12
Florin Coras [Sun, 5 May 2019 20:19:57 +0000 (13:19 -0700)]
svm: decouple fifo and default chunk allocation

Default chunk is no longer embedded into the fifo and on free is
returned to its respective chunk list.

Change-Id: Ifc5d214eaa6eca44356eb79dd75650fb8569113f
Signed-off-by: Florin Coras <fcoras@cisco.com>
4 years agoImprove lcov reported code coverage stats 15/19415/4
Dave Barach [Tue, 7 May 2019 14:30:18 +0000 (10:30 -0400)]
Improve lcov reported code coverage stats

Remove unused code from the vppinfra build
Add a bihash test case

Change-Id: Ia930309efa28620dd1c0d69aaec432e2d8bd962c
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agomake test: add python3 compatibility in extend_packet 96/19396/2
Alexandre Poirrier [Tue, 7 May 2019 08:39:57 +0000 (10:39 +0200)]
make test: add python3 compatibility in extend_packet

Change-Id: I342ff8e44e0d1ebd9f2c8cc386372b2f5a731080
Signed-off-by: Alexandre Poirrier <apoirrie@cisco.com>
4 years agoAllow repeated connects on PAPI socket transport 13/19413/2
Vratko Polak [Tue, 7 May 2019 14:16:06 +0000 (16:16 +0200)]
Allow repeated connects on PAPI socket transport

The previous implementation fails with
RuntimeError("cannot set daemon status of active thread")
when a second connect() follows first disconnect().

Change-Id: I671005923eb020130a57b0b484a3386a05d7be33
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
4 years agoAdd bihash statistics hook 33/19333/3
Dave Barach [Fri, 3 May 2019 16:58:01 +0000 (12:58 -0400)]
Add bihash statistics hook

Example / unit-test in .../src/plugins/unittest/bihash_test.c

Change-Id: I23fd0ba742d65291667a755965aee1a3d3477ca2
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agoipsec-mb: fix the "make test" on non-AESNI platforms 90/19290/3
Andrew Yourtchenko [Wed, 1 May 2019 13:39:25 +0000 (15:39 +0200)]
ipsec-mb: fix the "make test" on non-AESNI platforms

"make test" fails with invalid instruction on non-AESNI platform,
so do not register the ipsec-mb crypto backend in this case.

Change-Id: I61887e40ce3d39880e7da534b9dee00fd677d8fd
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
4 years agoFix af_packet issues: 05/19405/1
jackiechen1985 [Tue, 7 May 2019 10:59:13 +0000 (18:59 +0800)]
Fix af_packet issues:

1. Fix af_packet memory leak;
2. Fix close socket twice;
3. Adjust debug log for syscall;
4. Adjust dhcp client output log;

Change-Id: I96bfaef16c4fad80c5da0d9ac602f911fee1670d
Signed-off-by: jackiechen1985 <xiaobo.chen@tieto.com>
4 years agoadd TLS endpoint function 43/19343/3
Yu Ping [Mon, 6 May 2019 18:24:30 +0000 (02:24 +0800)]
add TLS endpoint function

a bit like QUIC, and the added function can get the endpoint info in TLS,
so that the VCL layer can get those info correctly

Change-Id: Ied7aa3077087c1814499364dfa7654a088ad9910
Signed-off-by: Yu Ping <ping.yu@intel.com>
4 years agomake test: Fix truncated core file 76/18776/3
Dave Wallace [Wed, 10 Apr 2019 00:19:51 +0000 (20:19 -0400)]
make test: Fix truncated core file

- Wait for coredump to complete before killing VPP.

Change-Id: Ib7b96b339f796f9ef7e0eadff81d181464b8a03a
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
4 years agogcov / test framework: sigterm not sigkill 79/19379/2
Dave Barach [Mon, 6 May 2019 14:49:41 +0000 (10:49 -0400)]
gcov / test framework: sigterm not sigkill

Otherwise, gcov data vanishes without a trace.

Add a __gcov_flush() call to the unix signal handler, under #ifdef
CLIB_GCOV. Add -DCLIB_GCOV to vpp_gcov_TAG_CFLAGS.

Change-Id: I2726e671b26dfbe7fae88f46a8207bb2b5106884
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agoRemove target option when IPSecMB disabled 75/19275/2
Nathan Skrzypczak [Tue, 30 Apr 2019 16:22:16 +0000 (18:22 +0200)]
Remove target option when IPSecMB disabled

Change-Id: I2313932bdc41a4702585aa338f22df3f6e4e23d7
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
4 years agoip4_load_balance: leverage vlib_get_buffers 42/19342/2
Zhiyong Yang [Sun, 5 May 2019 14:52:43 +0000 (22:52 +0800)]
ip4_load_balance: leverage vlib_get_buffers

vlib_get_buffers can save 1.2 clocks/pkt from 16.1 to 14.9 clocks/pkt
on Skylake.

Change-Id: I79d8b58b192280af5e5a5f73562b6301e1821cec
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
4 years agovirtio: refactor ctrl queue support 89/19289/7
Mohsin Kazmi [Wed, 1 May 2019 12:26:17 +0000 (14:26 +0200)]
virtio: refactor ctrl queue support

Change-Id: Ifb16351f39e5eb2cd154e70a1c96243e4842e80d
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
4 years agoAdd QUIC multistream support 28/19328/3
Nathan Skrzypczak [Fri, 3 May 2019 12:20:27 +0000 (14:20 +0200)]
Add QUIC multistream support

Change-Id: I9dc746b8c62c3e7ee2f65e34a1a1dca243ed4bd9
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
4 years agoppp: simplify code using existing functions 56/19356/2
Zhiyong Yang [Mon, 6 May 2019 08:47:22 +0000 (04:47 -0400)]
ppp: simplify code using existing functions

Change-Id: Ib5289b4d08ca7a8d7f786cc606e6c760735b2a35
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
4 years agoAdd missing init fn dependency to ipsec_init 44/19344/2
Dave Barach [Sun, 5 May 2019 17:34:28 +0000 (13:34 -0400)]
Add missing init fn dependency to ipsec_init

ipsec_init fails if vnet_feature_init hasn't occurred. Can happen if a
particular set of plugins are loaded.

Change-Id: I67b289d640c28d04e248b9a09ebcc8f205834fd2
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agoFix VPP-1487 DHCP client does not support option 6-domain server 04/19204/5
jackiechen1985 [Mon, 29 Apr 2019 04:00:43 +0000 (12:00 +0800)]
Fix VPP-1487 DHCP client does not support option 6-domain server

Change-Id: I36ad1ef2a53af3d3f3a6348bc189b17e9e4e21bd
Signed-off-by: jackiechen1985 <xiaobo.chen@tieto.com>
4 years agoNAT64: Fix port byte order in nat64_free_out_addr_and_port 33/18133/2
Faicker Mo [Fri, 8 Mar 2019 09:22:21 +0000 (17:22 +0800)]
NAT64: Fix port byte order in nat64_free_out_addr_and_port

Change-Id: Idc050e469a5b697ca5587ddd4e87ac2d48d15658
Signed-off-by: Faicker Mo <faicker.mo@ucloud.cn>
4 years agoNAT66:assgin a error value for clib_bihash_kv_48_8_t kv 02/19202/2
lijianpeng [Sun, 28 Apr 2019 05:18:35 +0000 (13:18 +0800)]
NAT66:assgin a error value for clib_bihash_kv_48_8_t kv

Change-Id: Iac0c8218abc8d144d93a955e948a48a732b63107
Signed-off-by: lijianpeng <li.jianpeng@zte.com.cn>
4 years agoNAT: VPP-1646 test case asserts 40/19340/2
Filip Varga [Sat, 4 May 2019 14:02:53 +0000 (16:02 +0200)]
NAT: VPP-1646 test case asserts

Change-Id: I466cea5cbe82a34d4b0b20a76bf5df4d529670e4
Signed-off-by: Filip Varga <fivarga@cisco.com>
5 years agosession/svm: apis for fifo shrinking 37/19337/3
Florin Coras [Fri, 3 May 2019 18:46:55 +0000 (11:46 -0700)]
session/svm: apis for fifo shrinking

Change-Id: Ie519683bb90aae6fb95f2a09e251cded1890ed41
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agosvm: basic support for fifo shrinking 83/19283/21
Florin Coras [Thu, 2 May 2019 19:52:19 +0000 (12:52 -0700)]
svm: basic support for fifo shrinking

As opposed to growing, this is not a bulk operation, instead dependent
on how the producer/consumer advance head and tail, the fifo will shrink
in one or multiple steps.

Only once the fifo's nitems and size are reduced to their appropriate
values, equal or larger to what was requested, can the fifo chunks be
collected by the owner. Chunk collection must be done with the segment
heap pushed.

Change-Id: Iae407ccf48d85320aa3c1e0304df56c5972c88c1
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoAdd callbacks for extended trace functionality, one as content is added with vlib_add... 36/19336/2
Gary Boon [Fri, 3 May 2019 17:30:14 +0000 (13:30 -0400)]
Add callbacks for extended trace functionality, one as content is added with vlib_add_trace, and one to post-process the captured content immediately after trace filtering.

Change-Id: Ieb521686d8c0e7ce1a0ef325f7abdde613e1eb9c
Signed-off-by: Gary Boon <gboon@cisco.com>
5 years agomp_safe SW_INTERFACE_DUMP, SW_INTERFACE_DETAILS, SW_INTERFACE_TAG_ADD_DEL, 12/19312/2
Steven Luong [Thu, 25 Apr 2019 18:19:49 +0000 (11:19 -0700)]
mp_safe SW_INTERFACE_DUMP, SW_INTERFACE_DETAILS, SW_INTERFACE_TAG_ADD_DEL,
BRIDGE_DOMAIN_DUMP, CONTROL_PING, CONTROL_PING_REPLY, and show interface CLI

Change-Id: I2927573b66bb5dd134b37ffb72af0e6676750917
Signed-off-by: Steven Luong <sluong@cisco.com>
(cherry picked from commit 15c31921a628c5500cbed2ebc588d7ddbaa970a3)

5 years agosvm: store normalized head/tail for fifo 09/19309/4
Florin Coras [Thu, 2 May 2019 19:52:19 +0000 (12:52 -0700)]
svm: store normalized head/tail for fifo

If head/tail are stored as "absolute" values that are normalized to [0,
fifo_size] interval, when fifo is shrunk/grown the consumer and producer
have to independently update to the new fifo size and fix head and tail,
respectively.

If the head and tail are stored as normalized values, under the right
conditions, they don't need to be fixed when fifo size changes.

This reverts one of the changes in gerrit 18223.

Change-Id: I55a908828afe90925cf7c20186a940b25e5805f9
Signed-off-by: Florin Coras <fcoras@cisco.com>
5 years agoFix FIB initialization in UDP input 19/19319/2
Nathan Skrzypczak [Fri, 3 May 2019 11:54:44 +0000 (13:54 +0200)]
Fix FIB initialization in UDP input

Change-Id: I7c88ada2af039aa0861fe7c71361a293b999d0c7
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>