vpp.git
3 years agovppapigen: api crc checker 81/26881/16
Ole Troan [Tue, 5 May 2020 10:23:47 +0000 (12:23 +0200)]
vppapigen: api crc checker

crcchecker is a tool for enforcement of the binary API.

1. Production APIs should never change.
2. An API can be deprecated across three release cycles.
   Release 1: API is marked as deprecated.
   option deprecated="vyy.mm";
   option replaced_by="new_api_2";
   Release 2: both old and new APIs are supported
   Release 3: the deprecated API is deleted.
3. APIs that are experimental / not released are not checked.
   An API message can be individually marked as in progress, by:
   option status="in_progress";
   In the API definition.

The definition of a "production API" is if the major version in the API file is > 0.

extras/scripts/crcchecker.py --check-patchset # returns -1 if backwards incompatible
extras/scripts/crcchecker.py --dump-manifest
extras/scripts/crcchecker.py --git-revision v20.01 <files>
extras/scripts/crcchecker.py -- diff <oldfile> <newfile>

This patch integrates the tool in "make checkstyle-api".
A future patch is required to integrate the tool in the verify job.
I.e. this patch does not enable enforcement through Jenkins.

Change-Id: I5f13c0976d8a12a58131b3e270f2dc9c00dc7d8c
Type: feature
Signed-off-by: Ole Troan <ot@cisco.com>
3 years agogtpu: fix coverity issue 53/26953/2
Chenmin Sun [Fri, 8 May 2020 19:17:54 +0000 (03:17 +0800)]
gtpu: fix coverity issue

Fix coverity issue #210194 in gtpu-decap

Type: fix

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I5b172c8494527e7117c4e7e7083a8473165aa40f

3 years agobuild: reject merge conflict checkin attempts 56/26956/2
Dave Barach [Fri, 8 May 2020 13:46:17 +0000 (09:46 -0400)]
build: reject merge conflict checkin attempts

Although attempts to build code containing merge conflict markers
USUALLY results in compile errors, this patch adds an explicit check
for the conflict end marker.

If for some unknown reason it's necessary to check in the text
'>>>>>>>', construct it by concatenation: ">>>"">>>>"
or '>>>' + '>>>>' depending on the language involved.

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Iaad2aa8b87a71137a3bb9a09f7f4159909bf79ab

3 years agodocs: fix merge damage in nat.h 58/26958/3
Dave Wallace [Fri, 8 May 2020 15:58:24 +0000 (15:58 +0000)]
docs: fix merge damage in nat.h

Type: fix
Fixes: b5a575b09

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I22d35159a923075243df9760f1a74e2ca74e30e1

3 years agovppinfra: set explicit found in search_free_list loop 54/26954/2
Steven Luong [Fri, 8 May 2020 11:50:05 +0000 (04:50 -0700)]
vppinfra: set explicit found in search_free_list loop

While https://gerrit.fd.io/r/c/vpp/+/26948 fixed avoid using -1 to
index into h->free_lists[b][l] by changing the loop counter, the
check for the value of the loop counter (l < 0) cannot be trusted
to decide whether we've found a large enough object within the bin
or not. When the loop is terminated, the value of the variable l
could be ambiguous if it equals to 0 and it is never less than 0,
ie, when we bail out of the loop, we don't know if it was due to the
breaking out of the condition in
  if ((s = f_size - size) >= 0)
     break;
or
  while (l > 0);

The fix is to explicitly set a variable when we have found a large enough
object inside the loop to be used to test whether the loop was prematurely
terminated (found == 1) or the loop just ran exhausted (found == 0)

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I0161813fbd44dcba8982a767eac2e0930e9d77e3

3 years agomisc: add knob to generate compile_commands.json 60/26960/3
Damjan Marion [Fri, 8 May 2020 17:01:22 +0000 (19:01 +0200)]
misc: add knob to generate compile_commands.json

Used for lanuguage servers like clangd and ccls

Type: improvement
Change-Id: I68d534dfa7b8ba3459fbd919d5ffccaa1fa1171e
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agobuild: various improvements 41/26941/7
Damjan Marion [Thu, 7 May 2020 14:49:45 +0000 (16:49 +0200)]
build: various improvements

- add option to install only host tools
- add option to specify lib and runtime dir

Type: improvement

Change-Id: I6356b52df459120fc9b0127948bae7679fb10e52
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agoethernet: fix coverity warning 55/26955/2
Dave Barach [Fri, 8 May 2020 12:16:06 +0000 (08:16 -0400)]
ethernet: fix coverity warning

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I20daa023eed50f8b42e8dc2d17e47a54aa16ae31

3 years agopapi: use python3 for papi install 52/26952/2
Ole Troan [Fri, 8 May 2020 08:39:30 +0000 (10:39 +0200)]
papi: use python3 for papi install

Breaks on Ubuntu 20.04 otherwise.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I407215a03948d6e49152ee97099539bb625c12ef

4 years agonat: fix per thread data vlib_main_t usage take 2 51/26951/4
Ole Troan [Fri, 8 May 2020 08:02:18 +0000 (10:02 +0200)]
nat: fix per thread data vlib_main_t usage take 2

The original fix access vlib_main before these was initialized.
Removed cached vlib_mains structure.

Type: fix
Fixes: 9bb09afb56b1aa787ca574cc732085272059fd5f
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I686bab9220e27891f66bf60489c1602855786aa8
Signed-off-by: Ole Troan <ot@cisco.com>
4 years agodpdk: fix compiling issue with clang 49/26949/2
Lijian.Zhang [Thu, 30 Apr 2020 06:52:15 +0000 (14:52 +0800)]
dpdk: fix compiling issue with clang

When building vpp image with below command, clang reports warnings/errors
on the unused option '-L', as it's not linking stage, and does not require
linking libraries.

In dpdk.mk, the linking library path should be attached to
DPDK_EXTRA_LDFLAGS, instead of DPDK_EXTRA_CFLAGS

$ make build-release CC=clang V=1

clang -Wp,-MD,./.ark_ddm.o.d.tmp  -fPIE -fPIC -pthread -I/root/origin/build-root/build-vpp-native/external/dpdk-20.02/lib/librte_eal/linux/eal/include  -march=armv8-a+crc -DRTE_MACHINE_CPUFLAG_NEON -DRTE_MACHINE_CPUFLAG_CRC32  -I/root/origin/build-root/build-vpp-native/external/dpdk-20.02/arm64-armv8a-linuxapp-clang/include -DRTE_USE_FUNCTION_VERSIONING -include /root/origin/build-root/build-vpp-native/external/dpdk-20.02/arm64-armv8a-linuxapp-clang/include/rte_config.h
-D_GNU_SOURCE -O3 -I./ -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wdeprecated -Wno-missing-field-initializers -Wno-address-of-packed-member -Werror   -g -mtune=generic -L/root/origin/build-root/install-vpp-native/external/lib -I/root/origin/build-root/install-vpp-native/external/include -o ark_ddm.o -c
/root/origin/build-root/build-vpp-native/external/dpdk-20.02/drivers/net/ark/ark_ddm.c
== Build drivers/vdpa/ifc
clang: warning: argument unused during compilation: '-L/root/origin/build-root/install-vpp-native/external/lib' [-Wunused-command-line-argument]
clang: error: argument unused during compilation: '-L/root/origin/build-root/install-vpp-native/external/lib' [-Werror,-Wunused-command-line-argument]

Type: fix

Change-Id: If8fd9b19d0aff9d3c27d77e78cd3064bb1ad6565
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Jieqiang Wang <Jieqiang.Wang@arm.com>
Reviewed-by: Govindarajan Mohandoss <Govindarajan.Mohandoss@arm.com>
4 years agovppinfra: fix u32x4_byte_swap on Arm 50/26950/1
Lijian.Zhang [Mon, 27 Apr 2020 02:46:06 +0000 (10:46 +0800)]
vppinfra: fix u32x4_byte_swap on Arm

Fix the endianness conversion function u32x4_byte_swap() on Arm. Here's
an example of using this function with and without the fix.

This issue is seen using Mellanox NIC RDMA driver on Arm servers.
The packet length cannot be parsed correctly.

Testing code:
u32x4 s = {0x12345678, 0x23456789, 0x3456789a, 0x456789ab};
u32x4 ss = u32x4_byte_swap (s);

Without the code change:
(gdb) p /x s
$1 = {0x12345678, 0x23456789, 0x3456789a, 0x456789ab}
(gdb) p /x ss
$2 = {0x23456789, 0x12345678, 0x456789ab, 0x3456789a}

With the code change:
(gdb) p /x s
$3 = {0x12345678, 0x23456789, 0x3456789a, 0x456789ab}
(gdb) p /x ss
$4 = {0x78563412, 0x89674523, 0x9a785634, 0xab896745}

Type: fix

Change-Id: Ie5f263e94331783940e7c00397092a64e4fc4279
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Jieqiang Wang <Jieqiang.Wang@arm.com>
Reviewed-by: Govindarajan Mohandoss <Govindarajan.Mohandoss@arm.com>
4 years agovppinfra: loop counter off by 1 in search_free_list() 48/26948/3
Steven Luong [Thu, 7 May 2020 17:47:33 +0000 (10:47 -0700)]
vppinfra: loop counter off by 1 in search_free_list()

In search_free_list(), we have this do while loop.
do
  {
    l--;
    f_index = h->free_lists[b][l];
    f = elt_at (h, f_index);
    f_size = heap_elt_size (v, f);
    if ((s = f_size - size) >= 0)
      break;
  }
while (l >= 0);

When (l == 0), we still go back up to execute l--. Then l become -1. The
next statement is we index h->free_lists[b][-1]. After that, elt_at() would
probably cause a crash in the ASSERT.

Type: fix
Ticket: VPPSUPP-63

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I617d122aa221cfdfe38f8be50f4e0f0e76e11bb5

4 years agonat: remove duplicate line of code 97/26897/2
Klement Sekera [Wed, 6 May 2020 11:21:16 +0000 (11:21 +0000)]
nat: remove duplicate line of code

Type: fix

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I3c914d5c457df40205280ac589a2d353261343d5

4 years agonat: fix per thread data vlib_main_t usage 42/26942/2
Filip Varga [Thu, 7 May 2020 12:28:56 +0000 (14:28 +0200)]
nat: fix per thread data vlib_main_t usage

Type: fix

Change-Id: If6784c9eb278f525e05304d10fd1a00641faaaf0
Signed-off-by: Filip Varga <fivarga@cisco.com>
4 years agomisc: deprecate elftool 36/26936/2
Damjan Marion [Thu, 7 May 2020 07:49:27 +0000 (09:49 +0200)]
misc: deprecate elftool

Type: make

Change-Id: I34fec1c40ef660177c266517eaf41d60827609f4
Signed-off-by: Damjan Marion <damarion@cisco.com>
4 years agosession: catch segment manager alloc failure 14/26514/3
Florin Coras [Wed, 15 Apr 2020 01:30:46 +0000 (01:30 +0000)]
session: catch segment manager alloc failure

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4ac923fda84feee8d2ad76d0c3e3a252f53008ed

4 years agolacp: fix regarding vm arg for vlib_time_now calls 43/26943/1
Elias Rudberg [Thu, 7 May 2020 12:29:21 +0000 (14:29 +0200)]
lacp: fix regarding vm arg for vlib_time_now calls

Use thread-specific vlib_main_t *vm pointers to avoid problems with
different threads accessing the same vlib_main_t data structure.
This avoids assertion failure when vlib_time_now() is called with a vm
corresponding to a different thread.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: I359596ecff86e03d57aa8d2330f77bf9a913485f

4 years agordma: fix alignment issue 34/26934/2
Damjan Marion [Wed, 6 May 2020 21:38:58 +0000 (23:38 +0200)]
rdma: fix alignment issue

Type: fix

Change-Id: I0ff7a6f3354066c2252c1ebd0d43ac59db278bf0
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
4 years agodocs: clean up make docs job 68/23168/7
Paul Vinciguerra [Fri, 1 Nov 2019 17:00:58 +0000 (13:00 -0400)]
docs: clean up make docs job

Type: docs

Change-Id: I9b5e5137eb4c1e89f6e8d7a278cd11a0fd496471
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agovppinfra: add timer wheel section to Sphinx docs 90/26890/2
Dave Barach [Tue, 5 May 2020 21:08:53 +0000 (17:08 -0400)]
vppinfra: add timer wheel section to Sphinx docs

Type: docs

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id0576d98b8e78cf4cd00161968d3eb6dbd58055a

4 years agocrypto: fix coverity issues 19/26819/3
Fan Zhang [Fri, 1 May 2020 12:06:57 +0000 (13:06 +0100)]
crypto: fix coverity issues

Fix coverity issues in crypto framework and cryptodev
engine.

Type: fix

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: Ib261da0163c8182c803600db22c5a6dad5a19999

4 years agomisc: fix coverity warnings 70/26870/2
Dave Barach [Mon, 4 May 2020 18:47:45 +0000 (14:47 -0400)]
misc: fix coverity warnings

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I51660e4b02f449bd2db12a8cfd395c6c343d2dee

4 years agordma: fix clang build 80/26880/3
Benoît Ganne [Tue, 5 May 2020 10:25:13 +0000 (12:25 +0200)]
rdma: fix clang build

Type: fix

Change-Id: I9b613f0af484f601dd20a851e2f59ee5e06b5c37
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agomisc: fts add support for non-ascii author names in yaml 87/26887/2
Paul Vinciguerra [Tue, 5 May 2020 15:46:26 +0000 (11:46 -0400)]
misc: fts add support for non-ascii author names in yaml

Type: fix

Change-Id: I3f034ca86412b58d3e41a627bd8902157683435a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agonat: ipfix logging vlib_mains[thread_index] bugfix 59/26659/2
Elias Rudberg [Thu, 23 Apr 2020 09:17:58 +0000 (11:17 +0200)]
nat: ipfix logging vlib_mains[thread_index] bugfix

Use thread-specific vlib_main_t *vm pointers to avoid problems
with different threads accessing the same vlib_main_t data
structure. This avoids crashing when ipfix logging is enabled
and several threads are used.

Type: fix

Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Change-Id: Ic1d3d335919d7666ead14be1153eb8c8c07b7356

4 years agonat: enable force session cleanup 15/26615/9
Filip Varga [Sun, 19 Apr 2020 17:44:49 +0000 (19:44 +0200)]
nat: enable force session cleanup

Force session cleanup drops NAT db.
Also fixing user specific cli/api calls.

Type: improvement

Change-Id: Ia3e25fcf07fe5fb9a83d55c03fe90aca727b41ac
Signed-off-by: Filip Varga <fivarga@cisco.com>
4 years agonat: fix coverity warning 09/26709/4
Klement Sekera [Mon, 27 Apr 2020 08:19:12 +0000 (08:19 +0000)]
nat: fix coverity warning

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I609fef6f96c6a3fc85a4dc07e75244b0e1ba9239

4 years agotests: clean up logging 16/23716/7
Paul Vinciguerra [Mon, 2 Dec 2019 03:24:28 +0000 (22:24 -0500)]
tests: clean up logging

Tests currently expect the logger to be poked from run_tests.py.
The tests should run without any magic values.  This change sets a default
null logger and removes the hasattr checks for the logger.

For reference, see: https://docs.python-guide.org/writing/logging/

Type: test

Change-Id: I98f953d73d12d00e74b59c94a0fb8c7a625b9c44
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agotests: add test description to quic tests 89/26889/1
Dave Wallace [Tue, 5 May 2020 19:45:10 +0000 (19:45 +0000)]
tests: add test description to quic tests

Type: style

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Ief894e940a913a4ccf5368a2fdcf5479917f56cb

4 years agoipsec: User can choose the UDP source port 76/26276/13
Neale Ranns [Wed, 1 Apr 2020 09:45:23 +0000 (09:45 +0000)]
ipsec: User can choose the UDP source port

Type: feature

thus allowing NAT traversal,

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ie8650ceeb5074f98c68d2d90f6adc2f18afeba08
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agosession: improve .api comments slightly 85/26385/3
Vratko Polak [Mon, 6 Apr 2020 13:01:46 +0000 (15:01 +0200)]
session: improve .api comments slightly

Type: style

Change-Id: Iccd2c205059abcdf121093ff03da603fe3dda1f7
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
4 years agogso: fix the make test for ipip 78/26878/2
Mohsin Kazmi [Tue, 5 May 2020 10:31:17 +0000 (10:31 +0000)]
gso: fix the make test for ipip

Type: test

This commit fixes the make test for GSO/IPIP which are added in
following commit id: 84f91fa9c54f82c54b58ea3bf6e9ba22ff735d3a

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I66a57fe195e626b432ff0acba3a5bdf242a7a46e

4 years agoapi: ip: add IP_ROUTE_LOOKUP API 29/26829/7
Christian Hopps [Mon, 4 May 2020 14:28:03 +0000 (10:28 -0400)]
api: ip: add IP_ROUTE_LOOKUP API

Add an IP_ROUTE_LOOKUP function that does either an exact match or
longest prefix match in a given fib table for a given prefix
returning the match if present.

Add API test.

Type: improvement
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-ID: I67ec5a61079f4acf1349a9c646185f91f5f11806

4 years agoikev2: remove sa from main thread 75/26875/2
Filip Tehlar [Fri, 1 May 2020 06:37:39 +0000 (06:37 +0000)]
ikev2: remove sa from main thread

Type: fix

Change-Id: Ib73ce48552cfa9e825a6833f5594650783d82f3b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
4 years agogtpu: RX offload for IPv6 payload supporting 61/25561/4
Chenmin Sun [Sun, 1 Mar 2020 16:08:20 +0000 (00:08 +0800)]
gtpu: RX offload for IPv6 payload supporting

this patch adds the offloading capability for the IPv4 GTPU
tunnel which the next-node is assigned as IPv6

Type: feature

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ie39cd43058d36514656351dc6e906a19d5de89c0

4 years agoflow: explicitly convert RSS function types in dpdk_plugin 06/26806/3
Chenmin Sun [Thu, 30 Apr 2020 12:00:09 +0000 (20:00 +0800)]
flow: explicitly convert RSS function types in dpdk_plugin

explicitly convert RSS function types from vnet_rss_function_t to
rte_eth_hash_function to avoid these two types go out of sync in the future...

Type: fix

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ic09f6bb7f2cfbcf7cc4d380e51554b7f2b7a3b90

4 years agogso: add support for IP-IP 22/26722/9
Mohsin Kazmi [Thu, 23 Apr 2020 15:59:49 +0000 (17:59 +0200)]
gso: add support for IP-IP

Type: feature

Change-Id: I37752af8496e0042a1da91124f3d94216b39ff11
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
4 years agonat: remove unused code 68/26868/2
Klement Sekera [Mon, 4 May 2020 12:31:24 +0000 (12:31 +0000)]
nat: remove unused code

Type: refactor

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I33b2b38961b200dc3297b82124a7107b9ecbd0de

4 years agoethernet: add sanity checks to p2p_ethernet_add/del 66/26866/3
Dave Barach [Mon, 4 May 2020 16:33:18 +0000 (12:33 -0400)]
ethernet: add sanity checks to p2p_ethernet_add/del

Binary API message handlers need to check sw_if_index
values.

Found in binary api fuzz testing.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I51e717e9260e58a4c36d4d95981fd001be594fed
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agomisc: 19.08.2 Release Notes 40/26840/2
Andrew Yourtchenko [Thu, 30 Apr 2020 18:05:47 +0000 (18:05 +0000)]
misc: 19.08.2 Release Notes

Change-Id: I78f9edf9c15e9f4a2451be084c04c6318fbb978d
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit ec9ce338f05fb8bc90908ed17b8a0bc9eb8cd9f9)

4 years agovcl: allow vcl worker index to be set by applications 64/26864/3
Pivo [Mon, 4 May 2020 15:57:33 +0000 (17:57 +0200)]
vcl: allow vcl worker index to be set by applications

When using vppcom_session* apis to setup TCP sessions in applications build outside of the VPP repository, it is necessary to set the worker_index explicitly when these apis are called from the none-VCL worker threads. An example is when data is to be sent to the TCP session that is originated from a different thread, like the main program thread or from the bin api thread. This change allows the application to set it.

Type: fix

Signed-off-by: IJsbrand Wijnands <ice@cisco.com>
Change-Id: I37f3654a49ea9a8cf3a0d3d0e672583018c12299

4 years agosession: add option to preallocate fifo headers 31/26731/5
Florin Coras [Tue, 28 Apr 2020 01:54:22 +0000 (01:54 +0000)]
session: add option to preallocate fifo headers

Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie47546ef36590b90ed481b14cf812afbecf7981c

4 years agoikev2: fix string in api 65/26865/3
Filip Tehlar [Mon, 4 May 2020 16:30:57 +0000 (16:30 +0000)]
ikev2: fix string in api

Type: fix

key file name should be a string and not array of u8.

Change-Id: I7d280d2397030e73732b374ad9d3146fad0bb19f
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
4 years agovapi: add support for defaults in typedefs 20/26820/5
Paul Vinciguerra [Fri, 1 May 2020 14:09:58 +0000 (10:09 -0400)]
vapi:  add support for defaults in typedefs

  refactored out of Neale's change:
    https://gerrit.fd.io/r/c/vpp/+/26276

Type: refactor

Change-Id: Ibb0c019856dc44640e94d6d80a5d119a6296d95c
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
(cherry picked from commit a751d8d61fe5880f6d447e63b81e2df30561e9f9)

4 years agofib: midchain adjacency optimisations 65/26265/14
Neale Ranns [Tue, 31 Mar 2020 13:21:29 +0000 (09:21 -0400)]
fib: midchain adjacency optimisations

Type: improvement

 - inline some common encap fixup functions into the midchain
   rewrite node so we don't incur the cost of the virtual function call
 - change the copy 'guess' from ethernet_header (which will never happen) to an ip4 header
 - add adj-midchain-tx to multiarch sources
 - don't run adj-midchain-tx as a feature, instead put this node as the
   adj's next and at the end of the feature arc.
 - cache the feature arc config index (to save the cache miss going to fetch it)
 - don't check if features are enabled when taking the arc (since we know they are)

the last two changes will also benefit normal adjacencies taking the arc (i.e. for NAT, ACLs, etc)

for IPSec:
 - don't run esp_encrypt as a feature, instead when required insert this
   node into the adj's next and into the end of the feature arc. this
   implies that encrypt is always 'the last feature' run, which is
   symmetric with decrypt always being the first.
 - esp_encrpyt for tunnels has adj-midchain-tx as next node

Change-Id: Ida0af56a704302cf2d7797ded5f118a781e8acb7
Signed-off-by: Neale Ranns <nranns@cisco.com>
4 years agotcp: fix max tx sack blocks upper bound 28/26828/3
Florin Coras [Sat, 2 May 2020 02:26:56 +0000 (02:26 +0000)]
tcp: fix max tx sack blocks upper bound

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I70c63db91c3512fb724bba4762e3ca1e369ca421

4 years agomisc: binary api fuzz test fixes 02/26802/5
Dave Barach [Wed, 29 Apr 2020 21:04:10 +0000 (17:04 -0400)]
misc: binary api fuzz test fixes

Add a hook to src/vlibapi/api_shared.c to fuzz (screw up) binary API
messages, e.g. by xoring random data into them before processing. We
specifically exempt client connection messages, and inband debug CLI
messages. We step over msg_id, client index, client context, and
sw_if_index. Otherwise, "make test" vectors fail too rapidly to learn
anything.

The goal is to reduce the number of crashes caused to zero. We're
fairly close with this patch.

Add vl_msg_api_max_length(void *mp), which returns the maximum
plausible length for a binary API message.

Use it to hardern vl_api_from_api_to_new_vec(...) which takes an
additional argument - message pointer - so it can verify that
astr->length is sane. If it's not sane, return a u8 *vector of the
form "insane astr->length nnnn\0".

Verify array lengths in vl_api_dhcp6_send_client_message_t_handler(...)
and vl_api_dhcp6_pd_send_client_message_t_handler(...).

Add a fairly effective binary API fuzz hook to the unittest plugin,
and modify the "make test" framework.py to pass "api-fuzz { on|off }"
to enable API fuzzing: "make API_FUZZ=on TEST=xxx test-debug" or similar

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I0157267652a163c01553d5267620f719cc6c3bde

4 years agotap: refactor existing flags 13/26813/6
Mohsin Kazmi [Thu, 30 Apr 2020 17:05:56 +0000 (19:05 +0200)]
tap: refactor existing flags

Type: refactor

This patch refactor the existing flags and also add a new
flag for packet coalescing.

Change-Id: Ic826e4c81313f26d87c475cdf666b06cbed60a3a
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
4 years agonat: per vrf session limits 75/26775/5
Filip Varga [Thu, 16 Apr 2020 11:20:25 +0000 (13:20 +0200)]
nat: per vrf session limits

Type: improvement

Change-Id: I170256ab47978db34fb0ff6808d9cd54ab872410
Signed-off-by: Filip Varga <fivarga@cisco.com>
4 years agotests: vpp_interface remove deprecated packed properties 31/26831/3
Paul Vinciguerra [Sun, 3 May 2020 02:34:40 +0000 (22:34 -0400)]
tests: vpp_interface remove deprecated packed properties

The api no longer requires packed ip addresses.

Type: test

Change-Id: If67365d86b7c3189f871a58234e99f9c8f875371
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agotests: improve vpp_papi_provider exception output 30/26830/1
Paul Vinciguerra [Sat, 2 May 2020 14:40:33 +0000 (10:40 -0400)]
tests: improve vpp_papi_provider exception output

saves time debugging tests by replacing 'API call' with
the actual function signature:

  vpp_papi_provider.UnexpectedApiReturnValueError: API call failed, expected 0 return value instead of -2 in vxlan_add_del_tunnel_reply(_0=247, context=5052, retval=-2, sw_if_index=4294967295)

  vpp_papi_provider.UnexpectedApiReturnValueError: vxlan_add_del_tunnel(is_add=0, src_address=172.16.1.1, dst_address=239.1.1.209, vni=209, sw_if_index=26, mcast_sw_if_index=1, encap_vrf_id=None, instance=None, decap_next_index=None) failed, expected 0 return value instead of -2 in vxlan_add_del_tunnel_reply(_0=247, context=5052, retval=-2, sw_if_index=4294967295)

Type: test

Change-Id: Ie3b6a5fdb4e1d427d60c51f7a7bf815af0bb3de6
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agovlib: add nosyslog unix option 25/26825/7
Ruslan Babayev [Sat, 15 Feb 2020 01:45:02 +0000 (17:45 -0800)]
vlib: add nosyslog unix option

The "nosyslog" option disables syslog just like the "interactive" mode
but can be used together with "nodaemon".

This is useful for when VPP is running under a process supervisor like
runit or daemontools that pipe the stdout/stderr to a dedicated logger
service.

Type: feature

Change-Id: Ic4287338d6836fea9f3eabdcf960dc1f51875dd1
Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
4 years agoip-neighbor: honor walk callback return value 24/26824/2
Ruslan Babayev [Mon, 3 Feb 2020 01:30:31 +0000 (17:30 -0800)]
ip-neighbor: honor walk callback return value

Type: fix

Change-Id: I5e1f7c37d612f4666edf2262b457ae0e13f20791
Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
4 years agoapi: fix include_guard when path contains a plus 26/26826/2
Ruslan Babayev [Thu, 31 Oct 2019 08:37:50 +0000 (01:37 -0700)]
api: fix include_guard when path contains a plus

The path to VPP source might contain a '+' when building it
with Yocto/OpenEmbedded.

Type: fix

Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
Change-Id: I205ac0de7d8726724af0e30f5b199391e05dc615

4 years agotap: implement sw_interface_tap_v2_dump filtering by sw_if_index 08/26708/10
Paul Vinciguerra [Mon, 27 Apr 2020 05:12:48 +0000 (01:12 -0400)]
tap: implement sw_interface_tap_v2_dump filtering by sw_if_index

Type: feature

Change-Id: I6f607f383dc77a71e8712124f7613b38b4ac065a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agomisc: add Matt Smith to the committer list 16/26816/2
Dave Barach [Thu, 30 Apr 2020 19:33:52 +0000 (15:33 -0400)]
misc: add Matt Smith to the committer list

In hopes of restoring his +2 button...

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2600daab5afa4334713695d1074706fbb287832f

4 years agol2: fix coverity warnings in l2_fwd.c 17/26817/3
Dave Barach [Thu, 30 Apr 2020 19:42:44 +0000 (15:42 -0400)]
l2: fix coverity warnings in l2_fwd.c

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ibf468970b56fc6bf8d5fb6ba491dd3e727464fc0

4 years agotcp: fix v6 ll lookup fib 25/26625/3
Florin Coras [Tue, 21 Apr 2020 19:55:39 +0000 (19:55 +0000)]
tcp: fix v6 ll lookup fib

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie4b2bca3b6b0ca6097152aab232991ca7935e442

4 years agosession: cleanup listener segment manager on wrk free 12/26812/6
Florin Coras [Thu, 30 Apr 2020 15:05:24 +0000 (15:05 +0000)]
session: cleanup listener segment manager on wrk free

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1585af9e4f4273f055aed824b133ddc8eddd1df7

4 years agoip-neighbor: Add flush API 58/26658/5
Neale Ranns [Thu, 23 Apr 2020 09:04:59 +0000 (09:04 +0000)]
ip-neighbor: Add flush API

Type: feature

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: I96509c274895b917c3e220204d7959d9270de30d

4 years agohsa: bind af-unix socket only for echo tests 70/26770/4
Florin Coras [Wed, 29 Apr 2020 07:11:05 +0000 (07:11 +0000)]
hsa: bind af-unix socket only for echo tests

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6da8cc7c4577d199e9dc0aa52c73b1230a380018

4 years agoflow: add l2tpv3oip flow 02/26502/5
Chenmin Sun [Tue, 14 Apr 2020 17:55:58 +0000 (01:55 +0800)]
flow: add l2tpv3oip flow

This patch adds the l2tpv3oip type flow support
Have tested on E810 with Intel iAVF driver

Type: feature

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Icb5114b5f70dd7a63f681e7c6ac802fade8b8cf1

4 years agocrypto: introduce async crypto infra 36/18036/54
Fan Zhang [Wed, 29 Apr 2020 13:00:03 +0000 (14:00 +0100)]
crypto: introduce async crypto infra

Type: feature

Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Signed-off-by: Dariusz Kazimierski <dariuszx.kazimierski@intel.com>
Signed-off-by: Piotr Kleski <piotrx.kleski@intel.com>
Change-Id: I4c3fcccf55c36842b7b48aed260fef2802b5c54b

4 years agobuild: rework x86 CPU variants 81/26781/5
Damjan Marion [Wed, 29 Apr 2020 19:28:15 +0000 (21:28 +0200)]
build: rework x86 CPU variants

Type: improvement
Change-Id: Ief243f88e654e578ef9b8060fcf535b364aececb
Signed-off-by: Damjan Marion <damarion@cisco.com>
4 years agovcl: disconnect both flavors of bapi transport on destroy 05/26805/4
Florin Coras [Thu, 30 Apr 2020 02:59:55 +0000 (02:59 +0000)]
vcl: disconnect both flavors of bapi transport on destroy

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6697296b45c5816a31535b0cf44b8e726292b8bb

4 years agobuild: support arch-specific compiling for Neoverse N1 04/26804/3
Lijian.Zhang [Tue, 18 Feb 2020 11:58:19 +0000 (19:58 +0800)]
build: support arch-specific compiling for Neoverse N1

Enable arch-specific compiling and dynamic optimal function selection
for Arm Neoverse-N1.

Support for -march=armv8.2-a+crc+crypto -mtune=neoverse-n1 for
Neoverse-N1 is added starting from gcc-9.2.0

                    without change  with change improvement
[L2 - 1x flows]     11.00 Mpps      11.46 Mpps  4%
[L2 - 10Kx flows]   6.83 Mpps       7.17 Mpps   5%
[L3 - 1x flows]     10.39 Mpps      10.78 Mpps  3.7%
[L3 - 10Kx flows]   6.67 Mpps       7.19 Mpps   7.8%

Type: feature

Change-Id: I5d24d17820b3dd6909b913202e8c31fc7d48650f
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Jieqiang Wang <Jieqiang.Wang@arm.com>
Reviewed-by: Govindarajan Mohandoss <Govindarajan.Mohandoss@arm.com>
4 years agoikev2: use thread local vlib_main in vlib_time_now 08/26808/3
Filip Tehlar [Wed, 29 Apr 2020 23:18:41 +0000 (23:18 +0000)]
ikev2: use thread local vlib_main in vlib_time_now

Type: fix

Change-Id: I8e4a47bd16fa8475ef695c09e3487eabf08faabe
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
4 years agotap: allow deletion of tun interface 80/26780/2
Matthew Smith [Wed, 29 Apr 2020 16:17:08 +0000 (11:17 -0500)]
tap: allow deletion of tun interface

Type: improvement

tap_delete_if() returns early if the interface type is not
VIRTIO_IF_TYPE_TAP. Allow VIRTIO_IF_TYPE_TUN also and take
appropriate action for those interfaces.

Change-Id: I196b6d6f3f5e1543a14d6be76fd879d44c9794fd
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
4 years agobuild: detect GNU Assembler AVX-512 bug and disable AVX-512 variants if needed 78/26778/3
Damjan Marion [Wed, 29 Apr 2020 13:15:45 +0000 (15:15 +0200)]
build: detect GNU Assembler AVX-512 bug and disable AVX-512 variants if needed

Type: fix
Change-Id: I098f6c79be3c2e4db001edc0cf0a229bf6e0b13d
Signed-off-by: Damjan Marion <damarion@cisco.com>
4 years agoip: use thread local vm instead of thread main for vlib_time_now calls 65/26765/5
Tom Seidenberg [Tue, 28 Apr 2020 21:58:12 +0000 (17:58 -0400)]
ip: use thread local vm instead of thread main for vlib_time_now calls

Type: fix
Change-Id: I8d68e7c7392dcb748a2a84e72c7b1ca0c6c0eb07
Signed-off-by: Tom Seidenberg <tseidenb@cisco.com>
4 years agomisc: switch to clang-9 44/26744/6
Damjan Marion [Tue, 28 Apr 2020 11:29:37 +0000 (13:29 +0200)]
misc: switch to clang-9

Type: improvement
Change-Id: Iebf77a63c0c19b130a3fbd26b5293304a9fed4c1
Signed-off-by: Damjan Marion <damarion@cisco.com>
4 years agohsa: cleanup ifdefs in sock tests 66/26766/9
Florin Coras [Wed, 29 Apr 2020 01:11:35 +0000 (01:11 +0000)]
hsa: cleanup ifdefs in sock tests

Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1f03d80c4ee2a555dc6baa262d6df4521c1ae818

4 years agodevices: vhost: simplify string copies for GCC-10 86/26686/2
Benoît Ganne [Fri, 24 Apr 2020 08:33:40 +0000 (10:33 +0200)]
devices: vhost: simplify string copies for GCC-10

GCC-10 increases string truncations warnings. Refactor string copies
confusing it.

Type: refactor

Change-Id: I9720a0539059de00ab212ff2fc73055f04f5af1d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agotap: fix missing "num-rx-queues" from cli help 76/26776/1
Mohsin Kazmi [Wed, 29 Apr 2020 11:10:08 +0000 (13:10 +0200)]
tap: fix missing "num-rx-queues" from cli help

Type: fix

Change-Id: Ib09c7cebb6978b3adc09ac36cb32f7947b143e51
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
4 years agovcl: add separate fcntl64 ldp handler 68/26768/5
Florin Coras [Wed, 29 Apr 2020 02:19:51 +0000 (02:19 +0000)]
vcl: add separate fcntl64 ldp handler

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idb81e2901398dd6ae94931c705a704c7b52bbb36

4 years agointerface: fix interface_types.api enums 63/26763/2
Paul Vinciguerra [Tue, 28 Apr 2020 21:32:23 +0000 (17:32 -0400)]
interface: fix interface_types.api enums

Unspecified c enums start at 0.
Unspecified api enums start at 1.

Type: fix

Change-Id: I431c11302c0ad897a968134ce90496af3db7bb86
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoflow: explicit rss function enum cast 69/26769/2
Florin Coras [Wed, 29 Apr 2020 04:11:04 +0000 (04:11 +0000)]
flow: explicit rss function enum cast

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8c0eb5b5b12ffac1ff5dc89cab10bdb8e4be4322

4 years agovlib: add ASSERT to vlib_time_now(...) 64/26764/2
Dave Barach [Tue, 28 Apr 2020 22:00:21 +0000 (18:00 -0400)]
vlib: add ASSERT to vlib_time_now(...)

Calling vlib_time_now (&vlib_global_main) from a worker thread is a bad
mistake. ASSERT (vm->thread_index == __os_thread_index) will catch it.

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I55af6de84e06143f8f43adc62103b77267a7a441

4 years agosvm: fix fifo alignemnt in batch prealloc 62/26762/3
Florin Coras [Tue, 28 Apr 2020 20:40:57 +0000 (20:40 +0000)]
svm: fix fifo alignemnt in batch prealloc

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5cdf3cff820a0679f78b212a277d1873c2cfb980

4 years agovlib: use flexible array in vlib_buffer for GCC-10 89/26689/2
Benoît Ganne [Fri, 24 Apr 2020 09:48:04 +0000 (11:48 +0200)]
vlib: use flexible array in vlib_buffer for GCC-10

GCC-10 increase overflows-related warnings but gets confused by 0-length
arrays. Use C99 flexible length array instead.

Type: fix

Change-Id: Ie62cfa8faaa408479a598785fd3f06ffd0233c7a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agogomemif: introduce gomemif 02/26302/15
Jakub Grajciar [Thu, 2 Apr 2020 08:02:17 +0000 (10:02 +0200)]
gomemif: introduce gomemif

golang native memif driver

Type: feature

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I693156a44011c80025245d25134f5bf5db6eba82
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
4 years agovppinfra: type prove vec_new and vec_resize 15/26315/4
Andreas Schultz [Thu, 26 Mar 2020 14:18:52 +0000 (14:18 +0000)]
vppinfra: type prove vec_new and vec_resize

Some vector functions (e.g. vec_new) pass the vector pointer through
vec_resize. This turn the pointer from a real type into a void pointer.
Explicitly cast the pointer back to its original type to catch type
mismatches.

Type: improvement

Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: Id13e52d4f038af2cee28e5abf1aca720f8909378

4 years agoflow: add RSS support 21/25721/2
Chenmin Sun [Fri, 28 Feb 2020 14:49:37 +0000 (22:49 +0800)]
flow: add RSS support

This patch enables the RSS configuration through vnet/flow interface
With this RSS feature, users can config the RSS functions for specific flows

Currently, it supports:
  default, toeplitz and symmetric_toeplitz rss function, and
  ipv4-tcp/ipv4-udp/ipv6-tcp/ipv6-ucp flow types

Users can use the following options to combine with above flow
types for more specific hash input set selection:
  l3-src-only, l3-dst-only, l4-src-only, l4-dst-only

Command line:
test flow add dst-ip any proto udp rss function default rss types ipv4-tcp use l3-dst-only
test flow add dst-ip any proto udp rss function toeplitz rss types ipv4-udp use l4-src-only
test flow add dst-ip any proto udp rss function symmetric_toeplitz rss types ipv6-udp use l3-src-only and l3-dst-only

Type: feature

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I213efc76dc8af37f2f63605884f353e05b0f5d2a

4 years agotap: use one tap fd per rx queue 23/25923/14
Aloys Augustin [Mon, 16 Mar 2020 16:29:52 +0000 (17:29 +0100)]
tap: use one tap fd per rx queue

This matches vhost queues to linux netdev queues and avoids random
packet shuffling across vhost queues on rx.

Change-Id: I9901689d361e440fb0b91c9fbaf8124ce525b316
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
4 years agoipsec: fix buffer alloc 17/26417/3
Filip Tehlar [Fri, 3 Apr 2020 12:14:29 +0000 (12:14 +0000)]
ipsec: fix buffer alloc

Type: fix

Change-Id: I0f12c19b79df19b692f18ac13d6c32341853b764
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
4 years agonat: remove unused code 34/26734/2
Klement Sekera [Tue, 28 Apr 2020 09:22:29 +0000 (09:22 +0000)]
nat: remove unused code

Type: refactor

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I0f82d937b4829e5a7f074d4d566fa49319a11716

4 years agovppinfra: improve test coverage 29/26729/4
Dave Barach [Mon, 27 Apr 2020 22:38:36 +0000 (18:38 -0400)]
vppinfra: improve test coverage

Bonus corner-case bugfix in bitmap.h, found during the exercise.
Issue dates from 2001 or thereabouts. Please review this specific
change carefully.

lcov_post: filter system include directories and generated files in
build-root

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Iaa0b63e9dc571dfe3d992197ac49ba4d93403c61

4 years agodocs: add missing spelling dictionary 21/24121/3
Paul Vinciguerra [Tue, 24 Dec 2019 04:07:13 +0000 (23:07 -0500)]
docs: add missing spelling dictionary

Type: docs

Change-Id: I334312f8bfe2000d4613908c2a0ba7e6a39d3825
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agotests: fix update_path_flags for multicast in vpp_ip_route 50/26750/2
Paul Vinciguerra [Tue, 28 Apr 2020 15:23:31 +0000 (11:23 -0400)]
tests: fix update_path_flags for multicast in vpp_ip_route

  add support for the case where the first path doesn't
  match the searched interface.

Type: test

Change-Id: I29bd724cfe275ec5489d32c37ef2af12d6d1102a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agotests: implement ipaddress convenience methods 32/26732/4
Paul Vinciguerra [Tue, 28 Apr 2020 04:27:38 +0000 (00:27 -0400)]
tests: implement ipaddress convenience methods

  Add vpp specific properties to ip addresses for use in the api.
  .vapi_af  -- returns [ADDRESS_IP4, ADDRESS_IP6]
  .vapi_af_name -- returns the string ['ip4', 'ip6']

  Update tests to demonstrate usage.

Type: feature

Change-Id: I43447a1522769d99f89debdc714c51700068d771
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agolisp: API cleanup 63/24663/8
Jakub Grajciar [Thu, 30 Jan 2020 12:26:43 +0000 (13:26 +0100)]
lisp: API cleanup

Use consistent API types.

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ib7f73a0b6de188982a09040f7739dc46be3cb1de
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
4 years agovlib: startup multi-arch variant configuration 98/25798/11
Ray Kinsella [Tue, 10 Mar 2020 14:35:32 +0000 (14:35 +0000)]
vlib: startup multi-arch variant configuration

Support for startup node multi-arch variant selection through startup.conf.
This is to facilitate unit, functional testing and benchmarking of non-default
multi-arch variant node code path. Also added parameters to make test, to
specific using multi-arch variants in unit testing.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I94fd332bb629683b7a7dd770ee9f615a9a424060

4 years agostats: add apis to delete simple/combined counters 20/26620/3
Ole Troan [Tue, 21 Apr 2020 15:54:41 +0000 (17:54 +0200)]
stats: add apis to delete simple/combined counters

vlib_free_simple_counter()
vlib_free_combined_counter()

Frees the name and two dimensional vector from the stats segment.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: If1becf7d09520ba41a3d59e2df94958ecfcf6948

4 years agotests: move defaults from defaultmapping to .api files 33/26733/1
Paul Vinciguerra [Tue, 28 Apr 2020 05:12:04 +0000 (01:12 -0400)]
tests: move defaults from defaultmapping to .api files

facilitates use of papi beyond the tests.

Type: improvement

Change-Id: I3d502d9130b81a7fb65ee69bb06fe55802b28a27
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agotcp: remove sack reneging verbose logging 30/26730/4
Florin Coras [Mon, 27 Apr 2020 23:20:41 +0000 (23:20 +0000)]
tcp: remove sack reneging verbose logging

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4dbbf8456d0ed2350459fcdc0664bbae024072fc

4 years agosvm: null instead of panic if fifo hdr alloc fails 28/26728/4
Florin Coras [Mon, 27 Apr 2020 22:41:39 +0000 (22:41 +0000)]
svm: null instead of panic if fifo hdr alloc fails

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2c5c9e3e7eff8481e48a940e8420d236a16e7649

4 years agotls: fix wrong usage of session close function issue 29/26629/4
Simon Zhang [Wed, 22 Apr 2020 14:58:57 +0000 (22:58 +0800)]
tls: fix wrong usage of session close function issue

Type: fix

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: I5a73e45e5b8a6a97c068e1ca108d8f8a2c1c0f90

4 years agovirtio: support virtio 1.1 packed ring in vhost 86/26086/15
Steven Luong [Mon, 23 Mar 2020 16:34:59 +0000 (09:34 -0700)]
virtio: support virtio 1.1 packed ring in vhost

virtio 1.1 defines a number of new features. Packed ring is among the most
notable and important one. It combines used, available, and descripptor rings
into one.

This patch provides experimental support for packed ring. To avoid
regression, when packed ring is configured for the interface, it is branched
to a separate RX and TX driver. Non packed ring should continue to perform
as it was before.

Packed ring is tested using qemu4.2 and ubuntu focal fossa (kernel 5.4.0-12)
on the guess VM which supports packed ring.

To configure VPP with packed ring, just add the optional keyword "packed"
when creating the vhost interface. To bring up the guest VM with packed ring,
add "packed=on" in the qemu launch command.

To facilitate troubleshooting, also added "verbose" option in
show vhost desc CLI to include displaying the indirect descriptors.

Known qemu reconnect issue -
If VPP is restarted, guest VMs also need to be restarted. The problem
is kernel virtio-net-pci keeps track of the previous available and used
indices. For virtio 1.0, these indices are in shared memory and qemu can
easily copy them to pass to the backend for reconnect. For virio 1.1, these
indices are no longer in shared memory. Qemu needs a new mechanism to retrieve
them and it is not currently implemented. So when the protocol reconnects,
qemu does not have the correct available and used indices to pass to the
backend. As a result, after the reconnect, virtio-net-pci is reading the TX
ring from the wrong position in the ring, not the same position which the
backend is writing. Similar problem exists also in the RX.

Type: feature

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I5afc50b0bafab5a1de7a6dd10f399db3fafd144c

4 years agol2: merge two clib_memcpy_fast into one 57/26657/4
Zhiyong Yang [Thu, 23 Apr 2020 15:21:30 +0000 (15:21 +0000)]
l2: merge two clib_memcpy_fast into one

Merge two memcpy into one by swapping src and dst address in
l2fwd_trace_t.

Type: improvement

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Change-Id: I71c5ecad0b453a434b1cb292ef03d88a760255c8