8897 Commits

Author SHA1 Message Date
Damjan Marion
599efc67e8 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>
2020-05-08 17:01:32 +00:00
Dave Barach
13f64ce227 ethernet: fix coverity warning
Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I20daa023eed50f8b42e8dc2d17e47a54aa16ae31
2020-05-08 14:35:33 +00:00
Ole Troan
c5c788bfa1 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
2020-05-08 12:47:55 +00:00
Ole Troan
71f62a52a2 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>
2020-05-08 11:23:18 +00:00
Lijian.Zhang
88d6ce2bee 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>
2020-05-08 07:21:30 +00:00
Lijian.Zhang
9ad8a2621b 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>
2020-05-08 13:36:32 +08:00
Steven Luong
ec7012e51e 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
2020-05-07 11:34:50 -07:00
Klement Sekera
def783445f nat: remove duplicate line of code
Type: fix

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I3c914d5c457df40205280ac589a2d353261343d5
2020-05-07 17:07:58 +00:00
Filip Varga
9bb09afb56 nat: fix per thread data vlib_main_t usage
Type: fix

Change-Id: If6784c9eb278f525e05304d10fd1a00641faaaf0
Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-05-07 17:04:00 +00:00
Damjan Marion
5505ee8904 misc: deprecate elftool
Type: make

Change-Id: I34fec1c40ef660177c266517eaf41d60827609f4
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-07 16:47:33 +00:00
Florin Coras
72db664c76 session: catch segment manager alloc failure
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4ac923fda84feee8d2ad76d0c3e3a252f53008ed
2020-05-07 14:43:39 +00:00
Elias Rudberg
92e1b83a39 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
2020-05-07 14:29:21 +02:00
Damjan Marion
a1e03d4da7 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>
2020-05-07 02:23:23 +02:00
Paul Vinciguerra
b5a575b092 docs: clean up make docs job
Type: docs

Change-Id: I9b5e5137eb4c1e89f6e8d7a278cd11a0fd496471
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-05-06 15:13:09 +00:00
Dave Barach
aad5e0c16f vppinfra: add timer wheel section to Sphinx docs
Type: docs

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id0576d98b8e78cf4cd00161968d3eb6dbd58055a
2020-05-06 14:08:33 +00:00
Fan Zhang
f970a75542 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
2020-05-06 10:25:04 +00:00
Dave Barach
c72950e811 misc: fix coverity warnings
Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I51660e4b02f449bd2db12a8cfd395c6c343d2dee
2020-05-06 10:24:21 +00:00
Benoît Ganne
971c5be279 rdma: fix clang build
Type: fix

Change-Id: I9b613f0af484f601dd20a851e2f59ee5e06b5c37
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-05-06 10:23:15 +00:00
Paul Vinciguerra
36686f4717 misc: fts add support for non-ascii author names in yaml
Type: fix

Change-Id: I3f034ca86412b58d3e41a627bd8902157683435a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-05-06 09:46:12 +00:00
Elias Rudberg
8f8212b245 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
2020-05-06 09:28:51 +00:00
Filip Varga
c611f36bbc 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>
2020-05-06 08:46:45 +00:00
Klement Sekera
e4deacc422 nat: fix coverity warning
Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I609fef6f96c6a3fc85a4dc07e75244b0e1ba9239
2020-05-06 08:46:14 +00:00
Paul Vinciguerra
9beabd8afd 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>
2020-05-05 20:50:10 +00:00
Dave Wallace
03ec134bc8 tests: add test description to quic tests
Type: style

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Ief894e940a913a4ccf5368a2fdcf5479917f56cb
2020-05-05 19:45:10 +00:00
Neale Ranns
abc5660c61 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>
2020-05-05 18:36:33 +00:00
Vratko Polak
6fdd7a5f77 session: improve .api comments slightly
Type: style

Change-Id: Iccd2c205059abcdf121093ff03da603fe3dda1f7
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2020-05-05 17:27:46 +00:00
Mohsin Kazmi
1ab8b3c6f9 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
2020-05-05 11:34:40 +00:00
Christian Hopps
f5d38e05ac 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
2020-05-05 11:25:58 +00:00
Filip Tehlar
2fdb41ae41 ikev2: remove sa from main thread
Type: fix

Change-Id: Ib73ce48552cfa9e825a6833f5594650783d82f3b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-05-05 10:44:42 +00:00
Chenmin Sun
ed63a0ff7b 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
2020-05-05 09:50:32 +00:00
Chenmin Sun
350737cd45 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
2020-05-05 09:49:26 +00:00
Mohsin Kazmi
84f91fa9c5 gso: add support for IP-IP
Type: feature

Change-Id: I37752af8496e0042a1da91124f3d94216b39ff11
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-05-05 07:44:12 +00:00
Klement Sekera
5ec6a4ea44 nat: remove unused code
Type: refactor

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I33b2b38961b200dc3297b82124a7107b9ecbd0de
2020-05-05 06:44:40 +00:00
Dave Barach
bdfe5955f5 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>
2020-05-04 21:12:03 +00:00
Andrew Yourtchenko
08ad7804d5 misc: 19.08.2 Release Notes
Change-Id: I78f9edf9c15e9f4a2451be084c04c6318fbb978d
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit ec9ce338f05fb8bc90908ed17b8a0bc9eb8cd9f9)
2020-05-04 19:23:36 +00:00
Pivo
6017ff0dd7 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
2020-05-04 19:03:25 +00:00
Florin Coras
9845c20d77 session: add option to preallocate fifo headers
Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie47546ef36590b90ed481b14cf812afbecf7981c
2020-05-04 18:28:16 +00:00
Filip Tehlar
933c4ca5a0 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>
2020-05-04 18:12:10 +00:00
Paul Vinciguerra
d7a32ebd99 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)
2020-05-04 17:26:28 +00:00
Neale Ranns
4ec36c5535 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>
2020-05-04 17:09:34 +00:00
Florin Coras
b723ccf95f tcp: fix max tx sack blocks upper bound
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I70c63db91c3512fb724bba4762e3ca1e369ca421
2020-05-04 14:14:57 +00:00
Dave Barach
7784140f2b 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
2020-05-04 14:03:21 +00:00
Mohsin Kazmi
d88fc0fced 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>
2020-05-04 13:56:29 +00:00
Filip Varga
6bb080f1e5 nat: per vrf session limits
Type: improvement

Change-Id: I170256ab47978db34fb0ff6808d9cd54ab872410
Signed-off-by: Filip Varga <fivarga@cisco.com>
2020-05-04 12:15:02 +02:00
Paul Vinciguerra
2f1563129a 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>
2020-05-03 15:21:42 -04:00
Paul Vinciguerra
0b0a84c403 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>
2020-05-03 13:52:46 -04:00
Ruslan Babayev
e31820af10 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>
2020-05-02 16:06:16 -07:00
Ruslan Babayev
24b417c481 ip-neighbor: honor walk callback return value
Type: fix

Change-Id: I5e1f7c37d612f4666edf2262b457ae0e13f20791
Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
2020-05-02 13:15:51 +00:00
Ruslan Babayev
7f286f720d 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
2020-05-01 17:06:52 -07:00
Paul Vinciguerra
073d74d0ba 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>
2020-05-01 18:08:45 +00:00