vpp.git
3 years agotap: add function to set speed 84/28684/3
Alexander Chernavin [Fri, 4 Sep 2020 13:24:20 +0000 (09:24 -0400)]
tap: add function to set speed

A plugin can set the speed on a host interface making it possible for
host applications to be aware of the actual interface speed, not the
one that the driver reports by default.

With this change, add a function to set speed on a host interface.

Type: feature
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I259a52b736022bdd805e8d92dcd1bfd5c58f6f96

3 years agoipsec: fix unformat types 99/29799/2
Benoît Ganne [Fri, 6 Nov 2020 09:51:47 +0000 (10:51 +0100)]
ipsec: fix unformat types

ipsec_{crypto,integ}_alg_t are packed and smaller than u32. Callers are
using those enums so unformat functions should too instead of u32 to
not overflow the stack.

Type: fix

Change-Id: Ifc86366f1928ca6352f06f390a88ac64668289d5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoipsec: fix outer table id lookup in ipsec tun script 00/29800/2
Benoît Ganne [Fri, 6 Nov 2020 09:55:22 +0000 (10:55 +0100)]
ipsec: fix outer table id lookup in ipsec tun script

Type: fix

Change-Id: I195949b610dca1b860baca18a059d39949627961
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoipsec: add support for tx-table-id in cli + example 01/29801/2
Benoît Ganne [Fri, 6 Nov 2020 13:14:23 +0000 (14:14 +0100)]
ipsec: add support for tx-table-id in cli + example

Type: improvement

Change-Id: I840741dfe040718b682935cdbcb0ba958d45a591
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agotcp: avoid consuming trailing bytes 88/29788/2
Florin Coras [Thu, 5 Nov 2020 21:39:48 +0000 (13:39 -0800)]
tcp: avoid consuming trailing bytes

Thanks to Shaligram Prakash <Shaligram.Prakash@enea.com> for reporting.

Type: fix

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

3 years agonat: fix hairpinning trace 31/29531/4
Klement Sekera [Mon, 19 Oct 2020 13:42:41 +0000 (13:42 +0000)]
nat: fix hairpinning trace

Type: fix
Fixes: 17a8ab6857f023bc1436d84808acc58dd614203e
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I597d08d1d2457116e6856fa40cd65987e13a28d4

3 years agovppinfra: mspace_get_aligned should respect MALLOC_ALIGNMENT 83/29783/2
Damjan Marion [Thu, 5 Nov 2020 13:54:08 +0000 (14:54 +0100)]
vppinfra: mspace_get_aligned should respect MALLOC_ALIGNMENT

While underlying mspace_malloc() respects MALLOC_ALIGNMENT (16)
mspace_get_aligned moves start of data for 4 bytes making final result
not aligned to MALLOC_ALIGNED.

Type: fix
Change-Id: Ib1584f315e3658b3b748ebf4886fb7389ce640fe
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agobuild: link time optimization for release builds 97/29597/10
Damjan Marion [Thu, 22 Oct 2020 12:23:47 +0000 (14:23 +0200)]
build: link time optimization for release builds

Type: improvement
Change-Id: I0e24f1d2ad5c7a11a8bd40125428f86aca867bec
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agobuild: run garbage collection while linking plugins 85/29785/2
Damjan Marion [Thu, 5 Nov 2020 16:55:53 +0000 (17:55 +0100)]
build: run garbage collection while linking plugins

Ask linker to remove symbols which are not referenced or exported.

Type: improvement
Change-Id: Iec01fda7ec5b14bab8f36d25c2652bd6fe619961
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agonat: remove unnecessary code 01/29701/2
Klement Sekera [Fri, 30 Oct 2020 16:17:00 +0000 (16:17 +0000)]
nat: remove unnecessary code

Type: improvement

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

3 years agotap: allow change of carrier state on host 45/28645/4
Matthew Smith [Fri, 24 Jul 2020 18:38:03 +0000 (13:38 -0500)]
tap: allow change of carrier state on host

Type: feature

Add a function to adjust the link state of the host side of a tap
interface. If an application (e.g. route protocol daemons) running on
the host uses netlink to monitor interface state, a plugin
could use this function to communicate a loss of connectivity
to the application by making the interface appear to go down.

Requires a somewhat recent kernel. E.g. it does not have any effect
on CentOS 7 but it works on CentOS 8.

Change-Id: I677ee7889d2eb142e2395bea98f0b4d7e7e7f810
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
3 years agovirtio: misc optimizations 06/29706/4
Damjan Marion [Sat, 31 Oct 2020 22:40:51 +0000 (23:40 +0100)]
virtio: misc optimizations

Type: improvement
Change-Id: Iaf98a60e37dd28828feca365b8fdc5d2f7ae6935
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agoip: fix doxygen doc for address add/del command 54/29554/2
Benoît Ganne [Tue, 20 Oct 2020 12:36:55 +0000 (14:36 +0200)]
ip: fix doxygen doc for address add/del command

Type: docs

Change-Id: I96d5cdb41bd938f06d2d72f2625bf1b3d2c5b1b4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agocnat: reduce compile time 24/29724/3
Nathan Skrzypczak [Mon, 2 Nov 2020 16:29:52 +0000 (17:29 +0100)]
cnat: reduce compile time

Compile time reduced from ~30s to 2s for
cnat_node_vip.c & cnat_node_snat.c This doesn't
impact performance for now as ts update rwlock
is the main bottleneck.

Type: improvement

Change-Id: Ic92df300ae0dfddc5235c350bd021e73e7c850d9
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
3 years agonat: fix byte order of vrf_id in logging 77/29777/2
Alexander Chernavin [Thu, 5 Nov 2020 07:53:57 +0000 (02:53 -0500)]
nat: fix byte order of vrf_id in logging

Type: fix
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I9930a2a90caa78e848fe657ab2da863467be41ea

3 years agovirtio: move retry logic to outer function 05/29705/4
Damjan Marion [Sat, 31 Oct 2020 21:47:01 +0000 (22:47 +0100)]
virtio: move retry logic to outer function

Improves compile time....

Type: improvement
Change-Id: I310a2e55e5e488a953d65fd065f7795a43d2e9a7
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agofeature: reset interface feature arc on interface deletion 51/29751/3
Benoît Ganne [Wed, 4 Nov 2020 09:02:03 +0000 (10:02 +0100)]
feature: reset interface feature arc on interface deletion

When removing an interface we must reset all per-interface per-feature
arc data to ensure we do not get wrong feature arc config data when the
sw_if_index is recycled.

Type: fix

Change-Id: I8c9d850d7c62b7b77193da4258ab5fb9bdda85a6
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agonat: remove unused code 50/29750/2
Klement Sekera [Wed, 4 Nov 2020 17:40:53 +0000 (17:40 +0000)]
nat: remove unused code

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

3 years agosession: fix ct server session thread index 55/29755/3
Florin Coras [Wed, 4 Nov 2020 21:08:35 +0000 (13:08 -0800)]
session: fix ct server session thread index

Type: fix

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

3 years agobuild: better detection of libbpf dependencies 09/29309/4
Benoît Ganne [Thu, 8 Oct 2020 12:08:47 +0000 (14:08 +0200)]
build: better detection of libbpf dependencies

Type: fix

Change-Id: Ib496e6eb0a76e6268aea09d5f4495f3ecd921ec2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agovlib: add postmortem pcap dispatch trace 34/29734/2
Dave Barach [Tue, 3 Nov 2020 14:59:06 +0000 (09:59 -0500)]
vlib: add postmortem pcap dispatch trace

Inspired by a real-life conundrum: scenario X involves a vpp crash in
ip4-load-balance because vnet_buffer(b)->ip.adj_index[VLIB_TX] is
(still) set to ~0.

The problem takes most of a day to occur, and we need to see the
broken packet's graph trajectory, metadata, etc. to understand the
problem.

Fix a signed/unsigned ASSERT bug in vlib_get_trace_count().

Rename elog_post_mortem_dump() -> vlib_post_mortem_dump(), add
dispatch trace post-mortem dump.

Add FILTER_FLAG_POST_MORTEM so we can (putatively) capture a ludicrous
number of buffer traces, without actually using more than one dispatch
cycle's worth of memory.

Type: improvement

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

3 years agordma: various fixes for chained buffers tx 32/29732/5
Mohammed Hawari [Mon, 2 Nov 2020 13:05:03 +0000 (14:05 +0100)]
rdma: various fixes for chained buffers tx

Type: fix
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Change-Id: I428c87e581db335362fef30e274db8947a896416

3 years agoikev2: add option to disable NAT traversal 15/29715/5
Filip Tehlar [Fri, 30 Oct 2020 04:47:44 +0000 (04:47 +0000)]
ikev2: add option to disable NAT traversal

Type: feature
Ticket: VPP-1935

Change-Id: I705f84047b112279377590157a1c7b4a34f693d2
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agoikev2: fix reply during rekey 20/29720/3
Filip Tehlar [Fri, 30 Oct 2020 05:28:11 +0000 (05:28 +0000)]
ikev2: fix reply during rekey

Type: fix

Change-Id: If87f4b8ae92508215fe91178958fe2ddb91e5a35
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agoikev2: increase tick interval in process node 19/29719/4
Filip Tehlar [Fri, 30 Oct 2020 05:59:55 +0000 (05:59 +0000)]
ikev2: increase tick interval in process node

This helps to resolve sporadic failures in unit tests.

Type: fix

Change-Id: I3abd77ed74310f9729a841e8569eafe6d7758dcb
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agotls: fix picotls engine crypto multi-thread issue 29/29729/2
Simon Zhang [Tue, 3 Nov 2020 15:48:03 +0000 (23:48 +0800)]
tls: fix picotls engine crypto multi-thread issue

Type: fix

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

3 years agosession: reduce max session node frame size 28/29728/3
Florin Coras [Tue, 3 Nov 2020 03:00:10 +0000 (19:00 -0800)]
session: reduce max session node frame size

Type: improvement

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

3 years agonat: bihash: fix buckets calc and remove mem param 38/29638/4
Klement Sekera [Mon, 26 Oct 2020 13:42:41 +0000 (13:42 +0000)]
nat: bihash: fix buckets calc and remove mem param

Calculate bihash buckets as n_elts / 2.5 rounded to closest pow2
per Damjan's recommendation. Remove memory configuration parameters
because bihash init ignores them anyway as it resides in main heap now.

Type: improvement
Change-Id: I189f463f3c4640106cce4f12d3c5a62969276a82
Signed-off-by: Klement Sekera <ksekera@cisco.com>
3 years agoikev2: cli for disabling dead peer detection 18/29718/3
Filip Tehlar [Fri, 30 Oct 2020 05:52:19 +0000 (05:52 +0000)]
ikev2: cli for disabling dead peer detection

Type: feature

Change-Id: I0db0a9b2f872753fa64d27335838cb34645a9ee8
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agonat: fix nat64 disable 48/29548/3
Benoît Ganne [Tue, 20 Oct 2020 12:07:55 +0000 (14:07 +0200)]
nat: fix nat64 disable

 - we should not copy and iterate over the pool underlying vector, as
   slots can be freed (ie in the freelist).
 - delete interface instead of adding them again
 - fix the log message

Type: fix

Change-Id: If0a7a2f475b4f40793eb29ea80a9d29fe5d1bcb9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoikev2: fix memory leak 16/29716/2
Filip Tehlar [Fri, 30 Oct 2020 05:00:18 +0000 (05:00 +0000)]
ikev2: fix memory leak

Type: fix

Change-Id: I33c38c791cc9a28898de402ae831c4862073eb2d
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agoipsec: Tunnel SA DSCP behaviour 48/24148/12
Neale Ranns [Thu, 2 Jan 2020 04:06:10 +0000 (04:06 +0000)]
ipsec: Tunnel SA DSCP behaviour

Type: feature

 - use tunnel_encap_decap_flags to control the copying of DSCP/ECN/etc
during IPSEC tunnel mode encap.
 - use DSCP value to have fixed encap value.

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

3 years agovcl: support fifo segments with ct sessions 56/29656/4
Florin Coras [Thu, 29 Oct 2020 04:22:04 +0000 (21:22 -0700)]
vcl: support fifo segments with ct sessions

Type: improvement

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

3 years agosession: fix ct cleanup before full establishement 55/29655/5
Florin Coras [Wed, 28 Oct 2020 23:41:26 +0000 (16:41 -0700)]
session: fix ct cleanup before full establishement

Type: fix

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

3 years agovcl session: minimize ct io events 44/29644/7
Florin Coras [Wed, 28 Oct 2020 07:37:15 +0000 (00:37 -0700)]
vcl session: minimize ct io events

Type: improvement

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

3 years agotap: fix the segv 49/29649/3
Mohsin Kazmi [Wed, 28 Oct 2020 18:35:53 +0000 (19:35 +0100)]
tap: fix the segv

Type: fix

Change-Id: I53cb96950f8658d7159fb0bd8ecfa50b6977e5af
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agovcl: fix epoll fd cleanup 53/29653/3
Florin Coras [Wed, 28 Oct 2020 19:51:10 +0000 (12:51 -0700)]
vcl: fix epoll fd cleanup

Type: fix

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

3 years agobuild: explicitly stop vpp in vpp.preinst 52/29652/1
Dave Barach [Wed, 28 Oct 2020 18:56:12 +0000 (14:56 -0400)]
build: explicitly stop vpp in vpp.preinst

Otherwise, "dpkg -i <vpp-debian-packages>" hangs. This is a new
behavior.

Type: improvement

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

3 years agomisc: Break the big IP header files to improve compile time 34/29634/4
Neale Ranns [Mon, 26 Oct 2020 13:00:06 +0000 (13:00 +0000)]
misc: Break the big IP header files to improve compile time

Type: refactor

Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Change-Id: Id1801519638a9b97175847d7ed58824fb83433d6

3 years agovirtio: fix the buffer array index 46/29646/1
Mohsin Kazmi [Wed, 28 Oct 2020 09:42:32 +0000 (10:42 +0100)]
virtio: fix the buffer array index

Type: fix

Fixes: 2e6f624f1f82ae0351dd05ad5d930d6876105519

Change-Id: I24a9822d1968a134c7e41221f48296cc8a67dd91
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agovcl: postpone unhandled ctrl events if needed 36/29636/8
Florin Coras [Mon, 26 Oct 2020 22:35:40 +0000 (15:35 -0700)]
vcl: postpone unhandled ctrl events if needed

Unhandled control events, i.e., events delivered outside of epoll/select
loops, that need to be propagated to apps should be postponed such that
epoll and select can later deliver them.

Type: fix

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

3 years agosession: per worker state for ct sessions 18/29618/7
Florin Coras [Fri, 23 Oct 2020 23:31:40 +0000 (16:31 -0700)]
session: per worker state for ct sessions

Type: feature

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

3 years agovppinfra: clib_mem_vm_{un}map thread safe 27/29627/2
Damjan Marion [Mon, 26 Oct 2020 09:39:30 +0000 (10:39 +0100)]
vppinfra: clib_mem_vm_{un}map thread safe

Type: improvement
Change-Id: I1ab1b100000b4d7212c58e10312e16e7527bd333
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agomemif: handle unexpected EPOLLOUT for RX queue 81/29581/4
Steven Luong [Wed, 21 Oct 2020 19:54:29 +0000 (12:54 -0700)]
memif: handle unexpected EPOLLOUT for RX queue

Getting an unexpected EPOLLOUT for RX queue and crashing due to missing
callback function on write_function to handle EPOLLOUT.

(gdb) f 5
f 5
    node=<optimized out>, vm=0x7f948bbe4540 <vlib_global_main>) at /vpp/src/vlib/unix/input.c:325
325       errors[n_errors] = f->write_function (f);
(gdb) p *e
p *e
$21 = {events = 4, data = {ptr = 0x23, fd = 35, u32 = 35, u64 = 35}}
(gdb) p file_main.file_pool[e->data.fd]
p file_main.file_pool[e->data.fd]
$22 = {file_descriptor = 37, flags = 1, polling_thread_index = 0, private_data = 65536,
  read_function = 0x7f944a87b140 <memif_int_fd_read_ready>, write_function = 0x0,
  error_function = 0x0, description = 0x7f944be22400 "memif0/1 rx 0 int", read_events = 0,
  write_events = 1, error_events = 0}
(gdb)

File descriptors are recycled. It is likely that the EPOLLOUT is meant
for the previous owner of the same file descriptor number which memif
recycled and memif RX did not expect to receive an EPOLLOUT. For
defensive play, we create a dummy callback function to ignore the
EPOLLOUT instead of crashing.

Type: fix

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

3 years agovirtio: improve the compile time 31/29631/3
Mohsin Kazmi [Mon, 26 Oct 2020 11:41:41 +0000 (12:41 +0100)]
virtio: improve the compile time

Type: improvement

packet buffering is common code to tun/tap/virtio.

Change-Id: I59a339f268a28a0c32756e52d10d1ed6b207db42
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agodpdk: allow offline build by caching build-deps 96/29596/3
Mohammed Hawari [Thu, 22 Oct 2020 12:14:04 +0000 (14:14 +0200)]
dpdk: allow offline build by caching build-deps

Change-Id: I40262c640be24f4ca48a2e1461fbc2eb2b0c4c96
Type: fix
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
3 years agovirtio: reduce the compile time for device.c 15/29615/4
Mohsin Kazmi [Fri, 23 Oct 2020 09:23:52 +0000 (11:23 +0200)]
virtio: reduce the compile time for device.c

Type: improvement

GRO is common to tap/tun/virtio devices. Hence move to
common place.

Change-Id: Ibb099f3a80f493ddb934df6bb7640f7c9c370fd5
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agotls: separate init from enable 20/29620/3
Florin Coras [Sun, 25 Oct 2020 21:01:37 +0000 (14:01 -0700)]
tls: separate init from enable

Type: improvement

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

3 years agosession: fix feature disable 19/29619/5
Florin Coras [Sun, 25 Oct 2020 21:00:29 +0000 (14:00 -0700)]
session: fix feature disable

Type: fix

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

3 years agosession: fix ct local listener session index 22/29622/3
Florin Coras [Mon, 26 Oct 2020 02:06:57 +0000 (19:06 -0700)]
session: fix ct local listener session index

Type: fix

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

3 years agovcl: avoid epoll cleanup before app close 24/29624/3
Florin Coras [Mon, 26 Oct 2020 03:28:23 +0000 (20:28 -0700)]
vcl: avoid epoll cleanup before app close

Type: fix

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

3 years agotcp: byte tracker fix 23/29623/3
Ryujiro Shibuya [Fri, 23 Oct 2020 07:35:53 +0000 (07:35 +0000)]
tcp: byte tracker fix

Type: fix

Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Change-Id: If7e22978a6b65f5b68ccb2bd97b5e0fba167b3bf

3 years agoavf: use atomic store instead of barrier 28/29628/2
Damjan Marion [Mon, 26 Oct 2020 10:27:13 +0000 (11:27 +0100)]
avf: use atomic store instead of barrier

Type: improvement
Change-Id: Ifea5f0c2fecb99fd320a2e1141f4b4f0d6a793ca
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agordma: fix clang-11 build 26/29626/2
Damjan Marion [Mon, 26 Oct 2020 09:05:29 +0000 (10:05 +0100)]
rdma: fix clang-11 build

/vpp/src/plugins/rdma/rdma.h:203:17: error: field 'buffer_template' with variable sized type 'vlib_buffer_t' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
  vlib_buffer_t buffer_template;

Type: fix
Change-Id: I4661839f262e01fe274a2ee7b3cb70f9bc6b7c62
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agonat: nat44 cli command fix 32/29632/3
Filip Varga [Mon, 26 Oct 2020 12:05:19 +0000 (13:05 +0100)]
nat: nat44 cli command fix

Type: fix
Change-Id: I4aa0dac544582703316cbcfabe67bcb7dc24d4f7
Signed-off-by: Filip Varga <fivarga@cisco.com>
3 years agofib: API to extract any resolving interface rather than the one from the 29/29629/2
Neale Ranns [Mon, 26 Oct 2020 10:44:54 +0000 (10:44 +0000)]
fib: API to extract any resolving interface rather than the one from the
best source

Type: improvement

Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Change-Id: Iaa91cbc7eba94f4ffbdc249ecdb49770bd2ae916

3 years agovlib: add VLIB_REGISTER_LOG_CLASS macro 17/29617/2
Damjan Marion [Fri, 23 Oct 2020 19:52:50 +0000 (21:52 +0200)]
vlib: add VLIB_REGISTER_LOG_CLASS macro

Type: improvement
Change-Id: Iafcaeb88fa3569e042fb9cb270cf062b145416e2
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agopppoe: make pppoe plugin work with dot1q subinterfaces 64/26964/10
zstas [Sat, 9 May 2020 16:57:23 +0000 (16:57 +0000)]
pppoe: make pppoe plugin work with dot1q subinterfaces

- Enabling arc "device-input" with the next node "pppoe-input" on the pppoe cp interface: to get rid of L3_MAC_MISMATCH error
- Parsing in the "pppoe-input" node fixed to parse all headers from the scratch
- Getting mac address directly from encap interface when filling up DPO adjacency. Anyway, in the case of the dot1q subinterface, we need to get vlan tags to fill the DPO adjacency.

Type: improvement

Change-Id: I5405931b0f58bef7b852c079a7e66e0da8b5de0f
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
3 years agovmxnet3: vmxnet3_dump is broken 36/29536/2
Steven Luong [Tue, 20 Oct 2020 00:21:10 +0000 (17:21 -0700)]
vmxnet3: vmxnet3_dump is broken

control ping id was not set

Fixes: gerrit 22396 / I009e806997461ad790f125d6359993862e1c5e5d
Type: fix

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

3 years agoaf_xdp: add option to claim all available rx queues 49/28849/2
Benoît Ganne [Tue, 15 Sep 2020 13:25:43 +0000 (15:25 +0200)]
af_xdp: add option to claim all available rx queues

Type: feature

Change-Id: I97176c2c90ea664a68078b3a7b7d44eb237a7f13
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoipsec: remove pending node 28/29528/3
Fan Zhang [Mon, 19 Oct 2020 12:08:34 +0000 (13:08 +0100)]
ipsec: remove pending node

This patch removes esp-encrypt-pending and esp-decrypt-pending
graph nodes from ipsec data-path.

Type: improvement

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

3 years agovrrp: asynchronous events on VR state change 15/29315/3
Matthew Smith [Thu, 8 Oct 2020 16:11:27 +0000 (11:11 -0500)]
vrrp: asynchronous events on VR state change

Type: feature

Add API message for an API client to subscribe/unsubscribe to receive
an event when a VRRP VR changes state. Add code to build and send the
events.

Change-Id: Ie92cadd4850d4352c1aaa79c4b0a7daa0f3b04e7
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
3 years agordma: implement striding rq for multiseg rx 75/29575/3
Mohammed Hawari [Wed, 21 Oct 2020 12:48:38 +0000 (14:48 +0200)]
rdma: implement striding rq for multiseg rx

This change leverages the striding RQ feature of
ConnectX-5 adapters to support chained buffers on
the RX path. In Striding RQ mode, WQE are SG lists
of data segments, each mapped to a vlib_buffer.
When a packet is received, it can consume one or
multiple data segments belonging to the WQE,
without wasting the whole WQE.

Change-Id: I74eba5b2c2c66538e75e046335058ba011cb27fd
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
3 years agordma: add RSS support for IPv6 and TCP 85/29485/2
Benoît Ganne [Fri, 16 Oct 2020 15:12:41 +0000 (17:12 +0200)]
rdma: add RSS support for IPv6 and TCP

Type: feature

Change-Id: I8b0d918e6f13325954b29bf34e4ef224c1315c51
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agobuild: add compile_commands.json cleanup script 14/29614/3
Damjan Marion [Fri, 23 Oct 2020 15:20:32 +0000 (17:20 +0200)]
build: add compile_commands.json cleanup script

Type: make
Change-Id: I8d6a5018bddf029e106df3cb8b8eded4fa28067d
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agocnat: coverity fix 13/29613/2
Nathan Skrzypczak [Fri, 23 Oct 2020 15:03:14 +0000 (17:03 +0200)]
cnat: coverity fix

Type: fix

Change-Id: Ie1153a0e0f1e9770bf3e0de9291131db91724b2e
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
3 years agolb: Loadbalancer plugin, correctly rewrite checksum in L3DSR, non-TCP cases 73/28673/6
Hiroki Narukawa [Fri, 4 Sep 2020 06:41:40 +0000 (15:41 +0900)]
lb: Loadbalancer plugin, correctly rewrite checksum in L3DSR, non-TCP cases

Current loadbalancer seems to rewrite the 17th and 18th octet of L4 header regardless of which kind of L4 protocol is used in case of L3DSR.

In case UDP, it rewrites 9th and 10th octet of payload (because UDP header is 8 octets long). If UDP payload is less than 8 octets, UDP checksum becomes invalid.

In other protocols similar problems is likely to occue.

This patch checks which L4 protocol is used, and rewrite packet regarding the L4 protocol.

Signed-off-by: Hiroki Narukawa <nhirokinet@nhiroki.net>
Change-Id: I84390ff58a33f05efac0421856beea89014adc72
Type: fix

3 years agovmxnet3: add sw_if_index filter to vmxnet3 interface dump 85/29585/3
Steven Luong [Wed, 21 Oct 2020 23:55:49 +0000 (16:55 -0700)]
vmxnet3: add sw_if_index filter to vmxnet3 interface dump

Introduce a replacement API for vmxnet3_dump which supports interface
filter.

Type: improvement

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

3 years agovlib: log: fix non-null terminated strings 89/29589/3
jiangxiaoming [Thu, 22 Oct 2020 02:08:36 +0000 (10:08 +0800)]
vlib: log: fix non-null terminated strings

Type: fix
Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: Id61966048875ca56a416caa520125c8c2366bf7b

3 years agotcp: remove snd_una_max 16/29616/3
Florin Coras [Fri, 23 Oct 2020 17:45:48 +0000 (10:45 -0700)]
tcp: remove snd_una_max

Type: improvement

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

3 years agotcp: remove force retransmit timer update 00/29600/7
Florin Coras [Thu, 22 Oct 2020 18:22:22 +0000 (11:22 -0700)]
tcp: remove force retransmit timer update

Also simplify condition for detecting unintended timer pops.

Type: improvement

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

3 years agobuild: fix typo in dpdk-20.08 patch #0003 08/29508/1
Dave Wallace [Fri, 23 Oct 2020 13:35:12 +0000 (09:35 -0400)]
build: fix typo in dpdk-20.08 patch #0003

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Id0b3264e723f1df161a606e4dbdcd70c36d448a4
(cherry picked from commit ee3ea114961610476bac544a979fdee8278d2b9e)

3 years agotcp: remove delack time config 03/29603/2
Florin Coras [Thu, 22 Oct 2020 22:49:05 +0000 (15:49 -0700)]
tcp: remove delack time config

Type: refactor

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

3 years agonat: nat44 enable/disable dynamic config 63/29463/5
Filip Varga [Wed, 30 Sep 2020 20:24:47 +0000 (22:24 +0200)]
nat: nat44 enable/disable dynamic config

This patch changes initialization and configuration of NAT
plugin. Instead of allocating data structures at vpp plugin
initialization phase allocation and configuration happens
after calling enable API or CLI call. This reduces base VPP
memory footprint and also enables dynamic reconfiguration
of the NAT plugin.

Type: improvement
Change-Id: I42c069ee19a0311d043ac1f3f230d87bc8d2680f
Signed-off-by: Filip Varga <fivarga@cisco.com>
3 years agovppinfra: add bihash_8/24_16 to headers list 87/29587/2
jiangxiaoming [Thu, 22 Oct 2020 01:08:04 +0000 (09:08 +0800)]
vppinfra: add bihash_8/24_16 to headers list

Type: improvement
Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: Ic67977995dbcba97240009373a4b9e9b57c63706

3 years agovirtio: checksum error reported for ip6 traffic with GSO enable 99/29399/2
Steven Luong [Mon, 12 Oct 2020 17:43:28 +0000 (10:43 -0700)]
virtio: checksum error reported for ip6 traffic with GSO enable

When GSO is enabled, vhost clears the checksum field prior to transmitting
the packet. Some newer kernel version does not like that and complains
about checksum error. This was seen with ip6 traffic.

Type: fix

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

3 years agosvm: support large memfd segments 01/29601/3
Florin Coras [Thu, 22 Oct 2020 18:59:55 +0000 (11:59 -0700)]
svm: support large memfd segments

Type: fix

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

3 years agotcp: no send space in timer recovery 91/29591/3
Florin Coras [Thu, 22 Oct 2020 06:24:53 +0000 (23:24 -0700)]
tcp: no send space in timer recovery

Type: fix

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

3 years agovppinfra: missing __clib_export va_unformat 95/29595/2
Juraj Linkeš [Thu, 22 Oct 2020 11:29:28 +0000 (13:29 +0200)]
vppinfra: missing __clib_export va_unformat

Fix an issue observed on aarch64 systems when running with dpdk plugin:
dpdk_plugin.so: undefined symbol: va_unformat

Type: fix
Fixes: dae1c7ed38e9f7a86e66f3674de62778cc981331

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Change-Id: I22b7ee842dc606f96effdeb7aa4e161496986aed

3 years agopci: set PCI memory enable before mapping PCI BAR 77/29577/5
Mohammed Hawari [Wed, 21 Oct 2020 14:41:30 +0000 (16:41 +0200)]
pci: set PCI memory enable before mapping PCI BAR

This change mitigates software faults issued by some versions of the
linux kernel vfio-pci driver when VF PCI BARs are used without setting
the memory enable bit in the PCI configuration. This problem is
mentionned in https://lkml.org/lkml/2020/6/25/628

Change-Id: Idc177be4a5adb6ee467b4dd8f055f133ff267fe1
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
3 years agobuild: add -E to sudo invocation in top-level Makefile 82/29582/3
Damjan Marion [Wed, 21 Oct 2020 21:55:08 +0000 (23:55 +0200)]
build: add -E to sudo invocation in top-level Makefile

Type: make
Change-Id: I447c6082bfe4aa549e6a7ebc156b657419fc608c
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agotap: fix the api for use of vec_len 78/29578/2
Mohsin Kazmi [Wed, 21 Oct 2020 16:32:59 +0000 (18:32 +0200)]
tap: fix the api for use of vec_len

Type: fix

Fixes: 03b76a20c569b8275beb8783691300a7d66b54a4

Change-Id: Ife788974cb7b2c35f40a017dd195dc2f7ee797b4
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agotcp: updating time constans as timer tick changed 90/29590/3
Ryujiro Shibuya [Thu, 22 Oct 2020 05:26:32 +0000 (05:26 +0000)]
tcp: updating time constans as timer tick changed

Type: fix
Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Change-Id: Ibe305b96f04ffdc95ddb07d144dc00119ae69a07

3 years agovlib: per-class logging configuration in startup.conf 80/29580/3
Damjan Marion [Wed, 21 Oct 2020 17:43:36 +0000 (19:43 +0200)]
vlib: per-class logging configuration in startup.conf

logging {
  class avf {
    rate-limit 200
    level debug
    syslog-level debug
  }

  class dpdk/cryptodev {
    rate-limit 200
    level disabled
    syslog-level disabled
  }
}

Type: improvement
Change-Id: Iebe49b3ed4dfbfd589e80fcd2f9a63a8fe66b83b
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agostats: missing dimension in stat_set_simple_counter 69/29569/3
Ole Troan [Wed, 21 Oct 2020 09:55:28 +0000 (11:55 +0200)]
stats: missing dimension in stat_set_simple_counter

A simple counter is a two dimensional array by threads and
counter index. 28017 introduced an error missing the first
dimension.

If a vector is updated at the same time as a client reads,
an invalid pointer my result. This will be caught by the
optimistic locking after copying out the data, but if
following a pointer outside of the stat segment then
the stat client would crash. Add suitable boundary checks
for access to stat memory segment.

Fixes: 7d29e320fb2855a1ddb7a6af09078b8ed636de01
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I94f124ec71d98218c4eda5d124ac5594743d93d6

3 years agovppinfra: missing __clib_export 79/29579/2
Nathan Skrzypczak [Wed, 21 Oct 2020 17:30:48 +0000 (19:30 +0200)]
vppinfra: missing __clib_export

Type: fix

Change-Id: I2dbd435d04a09f632286e5d669edc5fafd384f94
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
3 years agovlib: print logs to stderr if interactive or nosyslog set 71/29571/5
Damjan Marion [Wed, 21 Oct 2020 10:43:40 +0000 (12:43 +0200)]
vlib: print logs to stderr if interactive or nosyslog set

If VPP is started in interactive mode, instead of sending logs to syslog
server we print them directly to stderr.
Output is colorized, but that can be turned off with unix { nocolor }

Type: improvement
Change-Id: I9a0f0803e4cba2849a6efa0b6a86b9614ed33ced
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agobuild: fix broken debian dependencies on ubuntu-18.04 & debian-9 34/29534/5
Dave Wallace [Mon, 19 Oct 2020 18:57:55 +0000 (14:57 -0400)]
build: fix broken debian dependencies on ubuntu-18.04 & debian-9

- Installation vpp-plugin-core from packagecloud.io/master
  & packagecloud.io/2009 breaks due to invalid dependencies
  on newer versions of libmbedtls & libmbedcrypto

Type: fix
Fixes: 641467406

Change-Id: If736dabcc4a91a04b46515620dd87662b7b14260
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
3 years agoikev2: support sending requests from responder 47/29547/3
Filip Tehlar [Sat, 10 Oct 2020 04:39:11 +0000 (04:39 +0000)]
ikev2: support sending requests from responder

Type: improvement
Ticket: VPP-1894

Change-Id: I5a24a48416bca2ffbd346cdaa813fb25801e6c9b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agoipsec: support for multipoint on ipsec interfaces 27/29527/2
Neale Ranns [Mon, 19 Oct 2020 09:59:41 +0000 (09:59 +0000)]
ipsec: support for multipoint on ipsec interfaces

Type: feature

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

3 years agoip: convert u32 entry_flags to vl_api_mfib_entry_flags_t on mroute API 42/29542/3
Neale Ranns [Tue, 20 Oct 2020 07:20:17 +0000 (07:20 +0000)]
ip: convert u32 entry_flags to vl_api_mfib_entry_flags_t on mroute API

Type: fix

This is not an API change, it's the same values, just a different named
type.
also use VppEnum values in tests

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

3 years agoikev2: fix setting responder/initiator addresses 91/29391/3
Filip Tehlar [Wed, 7 Oct 2020 23:52:37 +0000 (23:52 +0000)]
ikev2: fix setting responder/initiator addresses

Type: fix

Change-Id: Ic406aa914d92e802a5fb0f27c2ffa1b98db012b0
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agoikev2: prevent crash after no IP address 27/28527/12
Filip Tehlar [Wed, 7 Oct 2020 19:17:00 +0000 (19:17 +0000)]
ikev2: prevent crash after no IP address

Type: fix
Ticket: VPP-1900

This fixes a crash when initiating IKE connection using interface
without any IP address.
It also ensures that the IKE connection is automatically retried once the
interface obtains an address.

Signed-off-by: jan_cavojsky <Jan.Cavojsky@pantheon.tech>
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ia1919c349e64b3a0a4198365e075e177e3ba3de5

3 years agocnat: allow max_u16 translation backends 40/29440/5
Nathan Skrzypczak [Tue, 13 Oct 2020 15:26:47 +0000 (17:26 +0200)]
cnat: allow max_u16 translation backends

Type: fix

Allow for 65536 backends for a translation.
- use u32 instead of u8
- filter out back_walk with more than
FIB_PATH_LIST_POPULAR backends
- we're still limited by u16 lb_n_buckets
in src/vnet/dpo/load_balance.h

Change-Id: Ib37b958e59b25ef5ef9f92b82008d626860faddd
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
3 years agovirtio: run process to send interrupts to input nodes 89/29389/4
Mohsin Kazmi [Mon, 12 Oct 2020 11:01:24 +0000 (13:01 +0200)]
virtio: run process to send interrupts to input nodes

Type: improvement

virtio interfaces support packet coalescing and buffering which
depends on timer expiry to flush the stored packets periodically.

virtio input node checks timer expiry and schedules tx queue
accordingly. In poll mode, timer expiry is handled naturally,
as input node runs periodically. In interrupt mode, virtio
input node depends on the interrupts send from backend.
Stored packets could starve, if there would not be interrupts
to input node.

This patch implements a process node which periodically
sends interrupt to virtio input node given coalescing or buffering
feature is enabled on an interface.

Change-Id: Ic38f749f74b001073d4d0579dca149d0a4cea039
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agoipsec: Add to the SA info directly in the bihash 30/29530/4
Neale Ranns [Mon, 19 Oct 2020 13:23:33 +0000 (13:23 +0000)]
ipsec: Add to the SA info directly in the bihash

Type: improvement

this save the cache miss on the protect structure.

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

3 years agovcl: wait for sendto to connect if needed 62/29562/2
Florin Coras [Wed, 21 Oct 2020 01:44:41 +0000 (18:44 -0700)]
vcl: wait for sendto to connect if needed

Type: fix

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

3 years agomisc: fix tracedump graph api initialization overflow 70/29570/2
Benoît Ganne [Wed, 21 Oct 2020 10:18:58 +0000 (12:18 +0200)]
misc: fix tracedump graph api initialization overflow

vppapigen does not create config entries for services stream messages.
It is not needed anyway as the api handler does not rely on VPPAPI
macros.

Type: fix

Change-Id: Iba188b0fc6388c478d7e4d0c7ee2c05ed672e23f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoaf_xdp: fix NUMA node parsing 22/29522/3
Benoît Ganne [Mon, 19 Oct 2020 07:49:09 +0000 (09:49 +0200)]
af_xdp: fix NUMA node parsing

Non-NUMA systems might report -1 as NUMA node.

Type: fix

Change-Id: I092c817ea670009d6f530cc70ad13d45e15fd363
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agostn: remove dependency on tcp and udp headers 59/29559/3
Florin Coras [Tue, 20 Oct 2020 20:40:17 +0000 (13:40 -0700)]
stn: remove dependency on tcp and udp headers

Type: improvement

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