vpp.git
3 years agomisc: add tracedump API plugin 11/27811/8
Dave Barach [Tue, 7 Jul 2020 21:33:38 +0000 (17:33 -0400)]
misc: add tracedump API plugin

Type: feature

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

3 years agoadl: move allow/deny list function to plugin 16/27916/9
Dave Barach [Tue, 14 Jul 2020 22:30:05 +0000 (18:30 -0400)]
adl: move allow/deny list function to plugin

Provide binary API compatibility support for the "cop" APIs until vpp
21.01.

Change the deprecation date in map.api to vpp 21.01.

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

3 years agoip: optimize ip4_header_checksum, take 2 51/27951/2
Damjan Marion [Thu, 16 Jul 2020 14:22:48 +0000 (16:22 +0200)]
ip: optimize ip4_header_checksum, take 2

- add 64-bit version
- remove byte swaps, as they are actually not needed

Type: improvement
Change-Id: Ia1efe54ee80b4ae7633b9ab36b3154c3357006d7
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agoikev2: fix race condition in child_sa update 16/27816/3
Benoît Ganne [Wed, 8 Jul 2020 15:51:23 +0000 (17:51 +0200)]
ikev2: fix race condition in child_sa update

Type: fix

Change-Id: I864d49a641b45337c0a45a0af7d996cad75f6629
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agovppinfra: enable STATIC_ASSERT with clang 10/27810/2
Benoît Ganne [Tue, 7 Jul 2020 14:32:22 +0000 (16:32 +0200)]
vppinfra: enable STATIC_ASSERT with clang

For some reason clang does not support &((struct foo*)0)->field in
static assertion contrary to gcc.
Use offsetof() macro implementation provided by both compilers instead.

Type: fix

Change-Id: I3311cdd29c5861e45dc0ef92f2bbd66242ca73b8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoip: optimize ip4_header_checksum 20/27920/2
Damjan Marion [Wed, 15 Jul 2020 22:48:55 +0000 (00:48 +0200)]
ip: optimize ip4_header_checksum

Type: improvement
Change-Id: I67bacb90a3dd8a9bd7beb4975ad0fe344675b65f
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agogre: fix outer ip6 length 21/27921/3
Aloys Augustin [Thu, 16 Jul 2020 09:01:01 +0000 (11:01 +0200)]
gre: fix outer ip6 length

This updates the computation of the outer ip6 header payload_length
field in order to take into account the GRE header length.

Change-Id: Ie9f982521aeaef7279a9e329a33272d6fae0a428
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
3 years agovppinfra: more vector inlines 19/27919/1
Damjan Marion [Wed, 15 Jul 2020 18:18:39 +0000 (20:18 +0200)]
vppinfra: more vector inlines

Type: improvement
Change-Id: Ie0de374b89ec3a17befecf3f08e94951597609ec
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agonat: add prefetching to in2out_ed/out2in_ed 77/27877/3
Klement Sekera [Mon, 13 Jul 2020 13:59:33 +0000 (13:59 +0000)]
nat: add prefetching to in2out_ed/out2in_ed

This saves about 20 clocks/packet in both code paths.

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

3 years agoikev2: add support for AES-GCM cipher in IKE 08/27908/3
Filip Tehlar [Wed, 8 Jul 2020 13:25:34 +0000 (13:25 +0000)]
ikev2: add support for AES-GCM cipher in IKE

Type: feature
Ticket: VPP-1920

Change-Id: I6e30f3594cb30553f3ca5a35e0a4f679325aacec
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agovirtio: fix the msix for multiqueue 44/27844/7
Mohsin Kazmi [Wed, 15 Jul 2020 11:54:10 +0000 (11:54 +0000)]
virtio: fix the msix for multiqueue

Type: fix

Change-Id: Ie0cff37b474f8d85a3ae376e0f547a347fb1ad8a
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agoikev2: API downgrade due to lack of ikev2 tests 98/27598/4
Filip Tehlar [Thu, 18 Jun 2020 04:18:15 +0000 (04:18 +0000)]
ikev2: API downgrade due to lack of ikev2 tests

Type: refactor

Change-Id: Ic7ddad20088e069887f81721cceb21f4902e8907
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agoip: fix format_ip6_address_and_mask() bug 63/27863/2
Chenmin Sun [Sun, 12 Jul 2020 00:08:36 +0000 (08:08 +0800)]
ip: fix format_ip6_address_and_mask() bug

Previously there's a format_ip4_address in format_ip6...
This patch fixes this typo

Type: fix

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

3 years agohsa: set connected mode for echo_server app in udp mode. 27/27627/9
jiangxiaoming [Mon, 22 Jun 2020 01:18:04 +0000 (09:18 +0800)]
hsa: set connected mode for echo_server app in udp mode.

Type: fix

Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I85a53ee049a9af371d929364400fe166cf71d53f

3 years agosession: fix application_lookup_name fail due to app_by_name default hash type wrong 68/27868/5
jiangxiaoming [Mon, 13 Jul 2020 08:21:33 +0000 (16:21 +0800)]
session: fix application_lookup_name fail due to app_by_name default hash type wrong

Type: fix

Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I539c431d991234c6cebc0961588f5dfbc9caa3c2

3 years agosession: reduce verbosity on fifo alloc failure 78/27878/2
Florin Coras [Mon, 13 Jul 2020 15:52:53 +0000 (08:52 -0700)]
session: reduce verbosity on fifo alloc failure

Also fix session test app name registrations

Type: improvement

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

3 years agodpdk: add txq struct and fix dpdk tx lock 07/27807/3
Benoît Ganne [Tue, 7 Jul 2020 11:29:16 +0000 (13:29 +0200)]
dpdk: add txq struct and fix dpdk tx lock

This introduces a txq structure mirroring the rxq structure.
This fixes the case when #txq > #rxq, because lock must be per txq.

Type: fix
Fixes: dfb19cabe20ccf1cbd1aa714f493ccd322839b91

Change-Id: Ic1bce64d2b08b9a98c8242a1ba1bfcdbda322bec
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agosession: fix ct listener cleanup 12/27812/1
Florin Coras [Wed, 8 Jul 2020 00:57:28 +0000 (17:57 -0700)]
session: fix ct listener cleanup

Type: fix

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

3 years agotcp: round down rcv wnd even if avoiding retraction 99/27799/4
Florin Coras [Mon, 6 Jul 2020 15:06:54 +0000 (08:06 -0700)]
tcp: round down rcv wnd even if avoiding retraction

Type: improvement

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

3 years agotap: fix the tun sndbuf value for kernel 4.20 and later 03/27803/3
Mohsin Kazmi [Mon, 6 Jul 2020 18:03:41 +0000 (18:03 +0000)]
tap: fix the tun sndbuf value for kernel 4.20 and later

Type: fix

From kernel 4.20, xdp support has been added in tun_sendmsg.
If sndbuf == INT_MAX, kernel executes xdp data path
for tun driver which assumes packets are ethernet frames.
This patch is avoiding the xdp data path in kernel by setting
the sendbuf value < INT_MAX.

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

3 years agoikev2: per thread usage of openssl context 00/27800/2
Filip Tehlar [Mon, 6 Jul 2020 14:52:25 +0000 (14:52 +0000)]
ikev2: per thread usage of openssl context

Type: refactor

Change-Id: I04af90b4d86c00092ce1732aeb3c0517af1808e0
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agodocs: Reflect the fact that the DPDK is now a plugin 02/27802/1
John DeNisco [Mon, 6 Jul 2020 16:27:58 +0000 (12:27 -0400)]
docs: Reflect the fact that the DPDK is now a plugin

Type: Improvement

Signed-off-by: John DeNisco <jdenisco@cisco.com>
Change-Id: Ic1253f601ee515392902a21b92e1dfd3962cc0a4

3 years agoikev2: add profile dump API 21/27721/9
Jan Cavojsky [Fri, 26 Jun 2020 13:05:10 +0000 (15:05 +0200)]
ikev2: add profile dump API

Type: feature
Signed-off-by: Jan Cavojsky <Jan.Cavojsky@pantheon.tech>
Change-Id: I84776a50b520134e8a3ca6ae41b4cc29009e6319

3 years agoikev2: add more ikev2 tests 97/27797/2
Filip Tehlar [Wed, 1 Jul 2020 08:56:59 +0000 (08:56 +0000)]
ikev2: add more ikev2 tests

Tests for AES-GCM and AES-CBC with different key lengths

Type: test

Change-Id: Ie7eeebb0f7e8331a717866475cb4ee00042857ce
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agoip: set ip4 mask for ip_copy and ip_set when dealing with ip4 type 26/27626/5
jiangxiaoming [Mon, 22 Jun 2020 01:06:16 +0000 (09:06 +0800)]
ip: set ip4 mask for ip_copy and ip_set when dealing with ip4 type

Type: fix

Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I3ace7dfe3ddacb4f7fa7a974a2ffe2b3cf902ff9

3 years agofib: fix debug preprocessor directives 88/27788/2
Matthew Smith [Thu, 2 Jul 2020 22:24:17 +0000 (17:24 -0500)]
fib: fix debug preprocessor directives

Type: fix

Some debugging declarations were wrapped in an 'ifdef CLIB_DEBUG'.
This seems to always evaluate true because clib.h defines CLIB_DEBUG
to 0 if its not defined.

The result is that if a route table is added and a route is added to
it and then the table is deleted, VPP exits because the debug function
fib_table_assert_empty() gets called whether VPP was started using a
debug build or a release build.

Change the ifdef to 'if CLIB_DEBUG > 0'.

Change-Id: I357dc2c299e81b95244f2f7efaadb8e0de27627a
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
3 years agotcp: fix coverity warning 87/27787/1
Florin Coras [Thu, 2 Jul 2020 21:52:34 +0000 (14:52 -0700)]
tcp: fix coverity warning

Type: fix

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

3 years agotcp: cli to dump half-open connections 85/27785/5
Florin Coras [Thu, 2 Jul 2020 16:44:21 +0000 (09:44 -0700)]
tcp: cli to dump half-open connections

Type: improvement

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

3 years agovrrp: fix feature declaration for v6 accept-mode 83/27783/2
Matthew Smith [Mon, 29 Jun 2020 17:13:21 +0000 (12:13 -0500)]
vrrp: fix feature declaration for v6 accept-mode

Type: fix

The v6 accept mode input feature was being declared with
the node added to ip4-multicast instead of ip6-multicast. Add to
the correct arc.

Change-Id: I08f6e5e7dde84a37687fa0af750a7a16fe537ea6
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
3 years agoikev2: use remote proposals when installing tunnel 84/27784/2
Filip Tehlar [Tue, 30 Jun 2020 10:38:26 +0000 (10:38 +0000)]
ikev2: use remote proposals when installing tunnel

Change-Id: Ib9c5dff6c825f495400a73869d429b9c2df670fc
Type: fix
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agotap: fix dump for TUN interfaces 36/27736/2
Mohsin Kazmi [Tue, 30 Jun 2020 13:28:01 +0000 (15:28 +0200)]
tap: fix dump for TUN interfaces

Type: fix

Change-Id: I3bcc8ff1cf0a828ce3ba112694d38e3287d38d8d
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agomisc: 20.05 Release Notes 51/27751/2
Andrew Yourtchenko [Mon, 18 May 2020 15:04:47 +0000 (15:04 +0000)]
misc: 20.05 Release Notes

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

3 years agonat: nat66 to plugin 53/27753/7
Ole Troan [Wed, 1 Jul 2020 11:16:16 +0000 (13:16 +0200)]
nat: nat66 to plugin

Type: refactor
Change-Id: I8c1f0c02a4522c1f9e461ddadd59938579ec00c6
Signed-off-by: Ole Troan <ot@cisco.com>
3 years agoip: fix the order in ip4 punt redirect 60/27760/1
Mohsin Kazmi [Thu, 2 Jul 2020 08:56:57 +0000 (10:56 +0200)]
ip: fix the order in ip4 punt redirect

Type: fix
Fixes: a84cb715f5a4366dd2f32de18ad92bec566924da

Change-Id: Id448d6ae9cfdd3122e8187121c509412835117c5
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agovlib: wake up workers if interrupts are posted 43/27743/4
Benoît Ganne [Tue, 30 Jun 2020 16:17:06 +0000 (18:17 +0200)]
vlib: wake up workers if interrupts are posted

Type: fix

Change-Id: If8dbbcb46193fd057fe8d704058609a3a8787d6c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoclassify: fix debug CLI 34/27734/1
Dave Barach [Tue, 30 Jun 2020 12:28:06 +0000 (08:28 -0400)]
classify: fix debug CLI

unformat_ip6_mask wasn't accounting for customized field names
when deciding if it managed to parse at least one field.

Type: fix

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

3 years agotests: ikev2: add nat traversal & cert based auth test 63/27663/4
Filip Tehlar [Tue, 23 Jun 2020 20:35:58 +0000 (20:35 +0000)]
tests: ikev2: add nat traversal & cert based auth test

Type: test

Change-Id: I3e8e451c5deaf04f519a471369370c383d9cda3b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agotcp: avoid rcv wnd more than RX fifo can enqueue 54/27654/4
Ryujiro Shibuya [Wed, 24 Jun 2020 07:36:14 +0000 (08:36 +0100)]
tcp: avoid rcv wnd more than RX fifo can enqueue

Type: fix

Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie358b731f8ecb1fcaebd6e79f5ce5c10802c2814

3 years agogso: fix the l2 path 65/27665/2
Mohsin Kazmi [Wed, 24 Jun 2020 14:20:54 +0000 (16:20 +0200)]
gso: fix the l2 path

Type: fix

Change-Id: I4f91175444dec9800d651aa5a5e0472359de63d1
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agoudp: align udp_encap_t_ to 2 cachelines 25/27525/3
Vadym Martsynovskyy [Fri, 12 Jun 2020 16:50:50 +0000 (09:50 -0700)]
udp: align udp_encap_t_ to 2 cachelines

Based on the comments in the struct, udp_encap_t_ is meant to span 2
cachelines. Due to the 64 bit alignment of dpo_id_t, the struct spanned
3 cachelines. This caused fetching ue_ip_proto to trigger an additional
cache miss. This patch rearranges the ordering of the struct fields
so that udp_encap_t_ only spans 2 cachelines as intended.

before:
(gdb) print (int)&((struct udp_encap_t_*)0)->cacheline1
$8 = 128

after:
(gdb) print (int)&((struct udp_encap_t_*)0)->cacheline1
$1 = 64

Type: fix
Signed-off-by: Vadym Martsynovskyy <vmartsyn@fb.com>
Change-Id: I066c08654d4a8ef3e2d3954e957d4c5d382b209f

3 years agosr: fix for SID index across segment lists within a sr policy 56/27656/2
Chinmaya Agarwal [Tue, 23 Jun 2020 12:38:23 +0000 (12:38 +0000)]
sr: fix for SID index across segment lists within a sr policy

Type: fix
Signed-off-by: Chinmaya Agarwal <chinmaya.agarwal@hsc.com>
Change-Id: I9aa5456bf94356e8702fbfd39b14db4c2e74d3e6

3 years agol2: performance enhancement in l2input 91/27191/9
Zhiyong Yang [Fri, 15 May 2020 14:32:34 +0000 (22:32 +0800)]
l2: performance enhancement in l2input

Short Load/Stores combined with prefetching in the beginning of the loop
place too much pressure on AGUs and memory accesses.
The patch interleaves load/store operations with computational operations
to alleviate the pain point.

vlib_get_buffers is also leveraged.

Redefine u8 dst_and_src[12] instead of dst[6] and src[6] in struct
l2input_trace_t in order to merge two copys into one.

Type: improvement

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

3 years agovrrp: backup processes priority 255 advertisement 63/27563/3
Matthew Smith [Mon, 15 Jun 2020 15:58:23 +0000 (10:58 -0500)]
vrrp: backup processes priority 255 advertisement

Type: fix

When accept mode is enabled, a backup VR will configure the VR virtual
addresses locally and respond to packets sent to those addresses. This
did not work when the primary VR is the address owner and sends
advertisements using the virtual address as the source address. It
also did not work when NAT was configured on the interface with the
virtual address as the NAT pool address. In both cases, advertisements
from other VRs would arrive and be dropped because they appeared to
be spoofed - the source address would be an address that is
configured as an interface address on the instance receiving it.

When accept mode is enabled for a VR and the VR enters the master state,
add an input feature on ip[46]-multicast for the interface which looks
for VRRP advertisements, figures out whether they are for a VR which
is configured with accept mode and is in the master state  and kicks
them straight to the VRRP nodes to avoid dropping them.

Change-Id: I240ba1ee0b3fd6d693de729698c1181dc71bb08b
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
3 years agolacp: add unit test 05/27105/7
Steven Luong [Fri, 15 May 2020 19:21:50 +0000 (12:21 -0700)]
lacp: add unit test

add test_lacp.py to cover basic lacp unit test

Type: fix

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

3 years agonat: replace speculative buffer enqueue model 96/27596/6
Klement Sekera [Wed, 17 Jun 2020 13:46:41 +0000 (13:46 +0000)]
nat: replace speculative buffer enqueue model

Replace speculative buffer enqueue coding model with
vlib_get_buffers(...)/vlib_buffer_enqueue_to_next(...).

Type: improvement
Change-Id: I7dbfac2234a7bd754c599857eb1d5b601da5bc7c
Signed-off-by: Klement Sekera <ksekera@cisco.com>
3 years agoikev2: add FEATURE.yaml 67/27667/3
Benoît Ganne [Wed, 24 Jun 2020 16:03:09 +0000 (18:03 +0200)]
ikev2: add FEATURE.yaml

Type: docs

Change-Id: Ie7836543e52bee08d12c565fbb6238d3e82ea3ce
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoflow: add IPSec ESP/AH flow 28/27628/4
Chenmin Sun [Mon, 22 Jun 2020 10:21:31 +0000 (18:21 +0800)]
flow: add IPSec ESP/AH flow

This patch adds the IPSec ESP/AH type flow support
Have tested on E810 with Intel iAVF driver

Type: feature

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

3 years agovirtio: add tx trace 10/27710/2
Mohsin Kazmi [Fri, 26 Jun 2020 13:48:26 +0000 (13:48 +0000)]
virtio: add tx trace

Type: improvement

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

3 years agotap: remove the bridge configurations for TUN interface 09/27709/2
Mohsin Kazmi [Fri, 26 Jun 2020 13:47:21 +0000 (13:47 +0000)]
tap: remove the bridge configurations for TUN interface

Type: fix

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

3 years agoikev2: remove unused field 07/27707/2
Filip Tehlar [Wed, 24 Jun 2020 20:18:50 +0000 (20:18 +0000)]
ikev2: remove unused field

Type: improvement

Change-Id: I0893d7cd8b8ab9958f585ac564bd0638bc60e78a
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agoip: fix the punt redirect for ip4 75/27675/2
Mohsin Kazmi [Thu, 25 Jun 2020 11:43:52 +0000 (13:43 +0200)]
ip: fix the punt redirect for ip4

Type: fix

Change-Id: I39341f201209931392f315ead5adfddd8b567caf
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agomisc: add gdb macros 52/27652/3
Dave Barach [Tue, 23 Jun 2020 21:36:12 +0000 (17:36 -0400)]
misc: add gdb macros

These gdb macros should prove very helpul when poking around in core files.

Pifi (pool_is_free_index) is not straighforward. Best to work it out
once.

Others:
 bitmap_get = clib_bitmap_get
 vl = vec_len
 pe = pool_elts
 node_name_from_index, as described
 vnet_buffer_opaque, prints the primary buffer opaque
 vnet_buffer_opaque2, prints the secondary buffer opaque

Fix vppinfra unit-test compile error

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

3 years agonat: avoid division by zero 61/27661/2
Klement Sekera [Wed, 24 Jun 2020 13:13:46 +0000 (13:13 +0000)]
nat: avoid division by zero

Return error instead of dividing by zero.

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

3 years agotests: fix deps pinning / patching 57/27657/3
Aloys Augustin [Wed, 24 Jun 2020 09:33:20 +0000 (11:33 +0200)]
tests: fix deps pinning / patching

This ensures we don't recompute the requirements-{2,3}.txt on each make
test run, and skips patching scapy if it is already patched instead of
failing.

Change-Id: I3da57182ae49f3dd04db139d96734a5d145fedff
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
3 years agovirtio: fix the vlib buffer flags 64/27664/1
Mohsin Kazmi [Wed, 24 Jun 2020 14:19:19 +0000 (16:19 +0200)]
virtio: fix the vlib buffer flags

Type: fix

Change-Id: I92e8e30e4175229e24dd92471016e9095b5cc83e
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agonat: deterministic: disallow invalid config 48/27648/3
Klement Sekera [Tue, 23 Jun 2020 13:12:33 +0000 (13:12 +0000)]
nat: deterministic: disallow invalid config

Prevent overflow if input network prefix is too small and crash on
packet #1 due to vector not being allocated/initialized.

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

3 years agoudp: jump over ip4 options 51/27651/3
Florin Coras [Tue, 23 Jun 2020 21:11:01 +0000 (14:11 -0700)]
udp: jump over ip4 options

Type: improvement

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

3 years agovppinfra: fix u32x4_gather definition 50/27650/1
Damjan Marion [Tue, 23 Jun 2020 17:01:56 +0000 (19:01 +0200)]
vppinfra: fix u32x4_gather definition

Type: fix
Change-Id: I3df8d3f277bfadee95bfc329e8ce8b929a986af6
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agovlib: debug CLI macro expander, part deux 40/27640/2
Dave Barach [Mon, 22 Jun 2020 14:02:25 +0000 (10:02 -0400)]
vlib: debug CLI macro expander, part deux

Deal with circular macro definitions instead of crashing due to stack
overflow.

Separate macro tables, per CLI session

Add documentation to the Sphinx docs

Type: improvement

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

3 years agonat: fix broken test 39/27639/2
Klement Sekera [Mon, 22 Jun 2020 13:15:41 +0000 (13:15 +0000)]
nat: fix broken test

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

3 years agoip6-nd: punt neighbor advertisements 99/27499/2
Alexander Chernavin [Thu, 11 Jun 2020 13:57:33 +0000 (09:57 -0400)]
ip6-nd: punt neighbor advertisements

With this change, punt received neighbor advertisements instead of drop
in order to give other elements of the system an opportunity to handle
them.

Type: improvement
Change-Id: Ie6cde9eebc83e42029967141cb32ebc459fd3680
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
3 years agonat: set buf error if can't create user 38/27638/1
Klement Sekera [Mon, 22 Jun 2020 12:52:29 +0000 (12:52 +0000)]
nat: set buf error if can't create user

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

3 years agoikev2: use both local and remote ID for profile lookup 85/27085/3
Filip Tehlar [Sun, 10 May 2020 05:18:37 +0000 (05:18 +0000)]
ikev2: use both local and remote ID for profile lookup

Type: fix
Ticket: VPP-1890

Change-Id: I9441d5afc38df7dabf6cccaead69dd32646d2a9e
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agovpp_config: Updates for 20.05 23/27623/3
John DeNisco [Fri, 19 Jun 2020 19:28:48 +0000 (15:28 -0400)]
vpp_config: Updates for 20.05

Added external dependancies package. Updated the startup.conf template.

Fix extras/scripts/check_commit_msg so it accepts '_' characters in
feature names.

Type: fix

Signed-off-by: John DeNisco <jdenisco@cisco.com>
Change-Id: I69c33a24b30d31e5b8081021030bff88cbaeace9
Signed-off-by: Dave Barach <dave@barachs.net>
3 years agotests: improve lcov stats for memory_api.c 68/27568/2
Dave Barach [Mon, 15 Jun 2020 21:38:12 +0000 (17:38 -0400)]
tests: improve lcov stats for memory_api.c

Cover vl_mem_api_dead_client_scan(...), which is not so simple.  Spin
up vpp_api_test using pexpect.spawn, make it bootstrap a private
memory segment, kill vpp_api_test, and wait for the dead client
scanner to run a few times so that it declares the client dead.

The test only runs if GCOV_TESTS=yes is set in the environment.

Type: test

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

3 years agotests: add ikev2 test framework with basic test case 36/27536/5
Filip Tehlar [Sun, 26 Apr 2020 18:05:05 +0000 (18:05 +0000)]
tests: add ikev2 test framework with basic test case

Ticket: VPP-1905
Type: test

Change-Id: Ie66fbd8e37eb5e69bd61b701ed3449366bee8c84
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agobuild: add cmake dependency from test plugin to api 88/27588/2
Tom Seidenberg [Wed, 17 Jun 2020 21:31:44 +0000 (17:31 -0400)]
build: add cmake dependency from test plugin to api

Type: fix

Signed-off-by: Tom Seidenberg <tseidenb@cisco.com>
Change-Id: I00fa22733bd293e56eb6b81346fdf2d75ad9d88f

3 years agovlib: add recursive macro expander to debug cli 97/27597/2
Dave Barach [Thu, 18 Jun 2020 21:04:18 +0000 (17:04 -0400)]
vlib: add recursive macro expander to debug cli

All of the pieces have been sitting around for years.

Added several debug CLI commands:

"define <variable-name> <value>"
"undefine <variable-name>"
"show macro [noeval]"
"echo <whatever>"

Macros may refer to other macros. To defer evaluation:
"define foo \$(bar)" or some such.

The macro evaluator is not smart about "define foo \$(foo)" or more
complicated circular definitions, so don't do that.

Environment variables are available, simply use $<name-of-environment-vbl>

The macro expander has a table of (overrideable) builtin names, which
are evaluated by calling functions.

Simple example:

echo $USER
define ip1 192.168.1.1/24
define ip2 192.168.2.1/24

loop create
loop create
set int ip address loop0 $ip1
set int ip address loop1 $ip2
show int addr
show macro
undefine ip1
undefine ip2

Type: feature

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

3 years agonat: remove unused code 93/27593/3
Klement Sekera [Thu, 18 Jun 2020 12:48:42 +0000 (12:48 +0000)]
nat: remove unused code

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

3 years agodocs: add more FEATURE.yaml documentation 87/27587/1
Dave Barach [Wed, 17 Jun 2020 20:31:34 +0000 (16:31 -0400)]
docs: add more FEATURE.yaml documentation

For src/tools/g2, src/vlibapi, and src/vlibmemory

Type: docs

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

3 years agodocs: add more FEATURE.yaml documentation 84/27584/2
Dave Barach [Wed, 17 Jun 2020 12:41:22 +0000 (08:41 -0400)]
docs: add more FEATURE.yaml documentation

This patch documents the DNS plugin, vlib packet tracing, vnet feature
arcs, and the vppinfra library.

Type: docs

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

3 years agonat: print hash table parameters in CLI 83/27583/2
Klement Sekera [Thu, 11 Jun 2020 14:00:52 +0000 (14:00 +0000)]
nat: print hash table parameters in CLI

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

3 years agobuild: multiple yaml file support 82/27582/1
Dave Barach [Wed, 17 Jun 2020 12:05:37 +0000 (08:05 -0400)]
build: multiple yaml file support

Change the yaml file matching pattern from FEATURE.yaml to
FEATURE*.yaml, so we can document multiple features in one directory.

Type: improvement

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

3 years agonat: add more trex test scripts 76/27576/2
Klement Sekera [Tue, 16 Jun 2020 13:28:09 +0000 (13:28 +0000)]
nat: add more trex test scripts

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

3 years agobuild: cmake cross-compilation fixes 77/27577/2
Damjan Marion [Tue, 16 Jun 2020 14:05:12 +0000 (16:05 +0200)]
build: cmake cross-compilation fixes

Type: fix
Change-Id: I40337c208375b74b4dc3c35102c5e66a6e4568e8
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agoip-neighbor: fix MLD hash key using stack pointer 74/27574/2
Benoît Ganne [Tue, 16 Jun 2020 10:07:09 +0000 (12:07 +0200)]
ip-neighbor: fix MLD hash key using stack pointer

Use pointed value (ipv6 address) as hash key instead of pointer value
(pointer to ipv6 address on the stack).

Type: fix

Change-Id: I74a8b6d4bb552b5b344bcb50c8e830700c4ce739
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agomisc: fix sonarclound warnings 75/27575/4
Dave Barach [Tue, 16 Jun 2020 12:40:53 +0000 (08:40 -0400)]
misc: fix sonarclound warnings

Type: fix
Ticket: VPP-1888
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I9c2fb926a5e010658088a74051c8c3462ff61734

3 years agovlib: address sanitizer support for stack switch, enable clang 99/27199/4
Damjan Marion [Thu, 21 May 2020 14:47:05 +0000 (16:47 +0200)]
vlib: address sanitizer support for stack switch, enable clang

Type: improvement
Change-Id: I81df4b61d1f0b8c1df77c1ee9bebcb491e155b69
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agobuild: fix address sanitizer default args 73/27573/2
Benoît Ganne [Tue, 16 Jun 2020 10:05:07 +0000 (12:05 +0200)]
build: fix address sanitizer default args

Type: fix
Fixes: ec3a3f16e4cd3b33e2a409fb01b8d8826e05f9fa

Change-Id: Iea3acd93a96b4bfc9f335e37ec04c00e8fa5ff27
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agointerface: add minimal vpp pkt trace for error-drop 88/27488/2
Dave Barach [Wed, 10 Jun 2020 21:07:32 +0000 (17:07 -0400)]
interface: add minimal vpp pkt trace for error-drop

Provide a minimal trace [ip4/ip6 src/dst address] for dropped pkts
when the user specifies "trace add error-drop XXXX", but does not
trace pkts from the original input node.

This is a wireshark dissector problem. Packets thrown at error-drop
may be well-formed, or not. VPP must not crash, no matter what.

The minimal trace capture and decode could be enhanced. Anyone
interested in doing that must consider all of the corner-cases
involved. This version should be at least somewhat useful.

Note that "pcap trace drop ..." - and the packet generator - seem like
the right tools to use when researching more complex issues.

Type: improvement

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

3 years agonat: improve outside port selection & perf 64/27464/7
Klement Sekera [Mon, 8 Jun 2020 11:10:55 +0000 (11:10 +0000)]
nat: improve outside port selection & perf

Prefer using source port form packet as outside port if possible.

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

3 years agogtpu: support separate rx-decap and encap-tx teid values 89/27489/3
John Lo [Thu, 11 Jun 2020 04:20:45 +0000 (00:20 -0400)]
gtpu: support separate rx-decap and encap-tx teid values

Support separate local and remote TEIDs, with local (or RX) one used
for GTPU tunnel RX/decap and remote (or TX) one used encap/TX.
Updated current gtpu API to support seperate RX/TX TEIDs and added new
gtpu_tunnel_update_tteid API to allow changing TX-TEID of an existing
GTPU tunnel.  The current tunnel field "teid" is used for RX-TEID and
a new field "tteid" is used for TX-TEID.

Type: improvement

Signed-off-by: John Lo <loj@cisco.com>
Change-Id: I549d79750a34bb965036da298c0ca894d15c2c20

3 years agovirtio: add vhost sw_if_index filter for sw_interface_vhost_user_dump 30/27130/3
Steven Luong [Tue, 19 May 2020 00:12:56 +0000 (17:12 -0700)]
virtio: add vhost sw_if_index filter for sw_interface_vhost_user_dump

The filter sw_if_index was in the API sw_interface_vhost_user_dump. But
it was never implemented in the backend. This patch is to add the backend,
vat, and custom dump support for the filter.

Type: feature

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

3 years agogso: fix the udp checksum in test 83/27483/4
Mohsin Kazmi [Wed, 10 Jun 2020 10:35:05 +0000 (12:35 +0200)]
gso: fix the udp checksum in test

Type: fix

Change-Id: I7005e4763e73f3679c40f94bdab26d439cd23188
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agoapi: check id is valid for bounce checking 71/24471/4
Benoît Ganne [Tue, 21 Jan 2020 17:33:14 +0000 (18:33 +0100)]
api: check id is valid for bounce checking

If the id is invalid we cannot check whether we must free the message or
not, free it anyway.

Type: fix

Change-Id: Ie4426f601390d1e5e14c739f670e8c1e6e3aaf1e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agobuild: remove un-needed script 65/27565/2
Simon Chatterjee [Mon, 15 Jun 2020 17:17:18 +0000 (17:17 +0000)]
build: remove un-needed script

The move to cmake obviates the need for this build script (and its terminology).

Type: make

Signed-off-by: Simon Chatterjee <code@chatts.net>
Change-Id: Ie17429bfdf5a4b02ce2b70ba3568a7445c162d38

3 years agovcl: move helper functions out of header file 37/27537/2
Florin Coras [Mon, 15 Jun 2020 14:59:40 +0000 (07:59 -0700)]
vcl: move helper functions out of header file

Type: improvement

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

3 years agobuild: fix the build on centos8 69/27469/2
Yichen Wang [Tue, 9 Jun 2020 00:13:01 +0000 (17:13 -0700)]
build: fix the build on centos8

Add missing dependencies and correct the building to support CentOS8

Type: make

Change-Id: Ie15b9b1174fa9b6d5ae02bace36ebc77e17d770c
Signed-off-by: Yichen Wang <yicwang@cisco.com>
3 years agovxlan: remove judgement with always true 77/27477/2
Zhiyong Yang [Wed, 10 Jun 2020 13:23:50 +0000 (13:23 +0000)]
vxlan: remove judgement with always true

if ((A | B) == false)  it means both A and B are false, so for
the following code

if (PREDICT_FALSE (!good_udp1))
      {
        if ((flags1 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
          {
              ...
          }
      }
if ((flags1 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0) is always
true if the code run it. Remove it.

Type: improvement

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

3 years agobuffers: fix non-default sized buffers initialization 31/27531/2
Benoît Ganne [Mon, 15 Jun 2020 10:24:36 +0000 (12:24 +0200)]
buffers: fix non-default sized buffers initialization

Type: fix

Change-Id: I4a93e1d9936414c514cb237a22624986b3ef5b3d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agodpdk: cryptodev: fix non-null terminated strings 12/27412/2
Benoît Ganne [Tue, 2 Jun 2020 14:33:26 +0000 (16:33 +0200)]
dpdk: cryptodev: fix non-null terminated strings

Type: fix

Change-Id: Ib6f423e24f1a8d8439cd7e8893e4605e10984d48
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoikev2: announce both 'ESN' and 'No ESN' 23/27523/2
Filip Tehlar [Sat, 6 Jun 2020 18:45:15 +0000 (18:45 +0000)]
ikev2: announce both 'ESN' and 'No ESN'

Type: fix

Change-Id: If73b88b9478b9314df6d9163c3a13724d4253c80
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agovlib: node recyling and node deletion missing triggering graph node sync 91/27491/6
Steven Luong [Thu, 11 Jun 2020 06:38:41 +0000 (23:38 -0700)]
vlib: node recyling and node deletion missing triggering graph node sync

When recycling a graph node vnet_register_interface, it is missing an
explicit call to vlib_worker_thread_node_runtime_update(). However,
there is an implicit call to vlib_worker_thread_node_runtime_update()
via vnet_sw_interface_set_flags_helper() if it enables a new feature on
the interface for the first time. But that implicit call is not
guaranteed. For example, if an interface is created, deleted, and
created, then it may skip the implicit call to
vlib_worker_thread_node_runtime_update(). When that happens, the graph
nodes on thread 0 are not sync'ed to the worker threads. So the worker
thread's graph nodes are out of sync momentarily with the main thread's
graph nodes until some other event happens which calls for a sync is
needed. During this window, the worker thread's graph node is
vulnerable and may experience a crash.

When deleting a graph node, we never trigger a sync to the worker
thread. A patch was committed 3 years ago via
https://gerrit.fd.io/r/c/vpp/+/7523 to fix a show run crash. In
hindsight, the approach taken by 7523 is not orthogonal. While at it,
let's fix it right for both issues with a call to
vlib_worker_thread_node_runtime_update() in the appropriate place and
remove 7523.

Type: fix
Ticket: VPPSUPP-86
Fixes: gerrit 7523 / 19e9d954bd9eb4f04d48640d6540198e84ef65d7

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

3 years agovirtio: interface type based improvements 83/25383/11
Mohsin Kazmi [Wed, 3 Jun 2020 16:20:17 +0000 (18:20 +0200)]
virtio: interface type based improvements

Type: improvement

Change-Id: I220ea6ab609e3c1628f5210be441d0d5e825a32c
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agoip: allocate ip4 mtrie pages in htlb memory 98/27498/2
Dave Barach [Thu, 11 Jun 2020 12:57:52 +0000 (08:57 -0400)]
ip: allocate ip4 mtrie pages in htlb memory

No change in default behavior. To use htlb pages for the ip4 mtrie,
use the "ip" command-line option "mtrie-hugetlb".

Type: improvement

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

3 years agoikev2: don't add DH group in ESP transform proposals 92/27492/4
Filip Tehlar [Sat, 6 Jun 2020 01:19:31 +0000 (01:19 +0000)]
ikev2: don't add DH group in ESP transform proposals

Type: fix

Anouncing DH group in esp transform proposals will enable PFS which is
not suppored now. This fixes issue during rekey when using strongswan as
responder.

Change-Id: Ib9f586113ae0ab9dc67e6ceadff43f8aac463820
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
3 years agonat: properly scale out2in-ed hash on init 96/27496/1
Klement Sekera [Thu, 11 Jun 2020 10:35:52 +0000 (10:35 +0000)]
nat: properly scale out2in-ed hash on init

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

3 years agonat: simplify bihash buckets/mem config 44/27444/9
Klement Sekera [Fri, 27 Mar 2020 10:54:53 +0000 (11:54 +0100)]
nat: simplify bihash buckets/mem config

Derive reasonable values from max translations/max users.

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

3 years agovapi: memset allocated messages to zero 72/27472/3
Klement Sekera [Tue, 9 Jun 2020 14:17:45 +0000 (14:17 +0000)]
vapi: memset allocated messages to zero

This avoids using dirty data from shared memory by client.

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

3 years agoip: reassembly: LRU algorithm should eliminate the longest unused nodes 09/27209/5
zhengdelun [Fri, 22 May 2020 07:42:28 +0000 (15:42 +0800)]
ip: reassembly: LRU algorithm should eliminate the longest unused nodes

Type: fix

Signed-off-by: zhengdelun <xszhengdelun@gmail.com>
Change-Id: I3f6240b4c0798f85960acc55a193a0cbf0c67ea4