vpp.git
2 years agolinux-cp: A V2 variant of pair create API that returns the host 11/32411/2
Neale Ranns [Fri, 21 May 2021 09:47:08 +0000 (09:47 +0000)]
linux-cp: A V2 variant of pair create API that returns the host
interface created

Type: improvement

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I31a83cd50513078895078bae3ae11372d351ddcd

2 years agonat: report correct EI per-user session limit 01/32301/5
Matthew Smith [Thu, 13 May 2021 16:11:33 +0000 (11:11 -0500)]
nat: report correct EI per-user session limit

Type: fix

When enabling the endpoint independent NAT44 plugin, user_sessions
determines the maximum number of translations that can be active for
a single inside address. If 0 is passed in, a default value is used
but 0 is still stored in the field that is used to populate reply
messages to nat44_ei_show_running_config,

At the time of enabling the plugin, if user_sessions is 0, update the
field which is used by nat44_ei_show_running_config to contain the
default per-user limit which gets used by the EI nodes.

Change-Id: I6b060d85bcd42d91db879b95a8b07c6844bcd2a5
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2 years agodpdk: disable DPDK iAVF interrupt support 22/32422/2
Mohammed Hawari [Mon, 24 May 2021 13:14:02 +0000 (15:14 +0200)]
dpdk: disable DPDK iAVF interrupt support

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

2 years agointerface: show if tx queue is shared 18/32418/2
Damjan Marion [Sat, 22 May 2021 10:13:48 +0000 (12:13 +0200)]
interface: show if tx queue is shared

Type: improvement
Change-Id: Idb48f835730db6c652c4b0e6ef310c7f36599a72
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agotests: skip hoststack iperf3 cut thru test on aarch64 26/32426/2
Dave Wallace [Mon, 24 May 2021 15:30:49 +0000 (11:30 -0400)]
tests: skip hoststack iperf3 cut thru test on aarch64

- Temporary fix for intermittent unrelated test failure
  on AARCH64 CI verify/merge jobs.  To be reverted
  when the root cause is fixed.

Type: test

Change-Id: Ie28e5a7b9fa9a20469ac7e91766f4c226e44d244
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2 years agotls: prealloc chunks for dtls dgram enq 17/32417/4
Florin Coras [Sat, 22 May 2021 01:26:30 +0000 (18:26 -0700)]
tls: prealloc chunks for dtls dgram enq

Type: fix

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

2 years agosession: improve main thread connects rpc 16/32416/3
Florin Coras [Fri, 21 May 2021 22:48:18 +0000 (15:48 -0700)]
session: improve main thread connects rpc

Avoid grabbing the worker barrier if there's no work to be done.

Type: improvement

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

2 years agostats: catch stat segment overrun in retry loop 13/32313/6
Ole Troan [Fri, 14 May 2021 12:00:50 +0000 (14:00 +0200)]
stats: catch stat segment overrun in retry loop

Raise IOError so that the blocking code retries not only on
optimistic locking failures but also on data segment illegal reads.

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

2 years agoaf_xdp: use desc offset on rx 84/32384/6
Benoît Ganne [Wed, 19 May 2021 14:41:03 +0000 (16:41 +0200)]
af_xdp: use desc offset on rx

Instead of pre-programming the data offset on rx, use offset passed in
the descriptor. This is more robust and future-proof.

Type: fix

Change-Id: I2bd910d92b8b03d17be5be85a24108be711dc7b9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agoaf_xdp: refill rx rings when interface goes up 78/32278/7
Benoît Ganne [Tue, 11 May 2021 11:19:56 +0000 (13:19 +0200)]
af_xdp: refill rx rings when interface goes up

If interrupt mode is configured through startup.conf exec script, the
input function will not be polled and the rx ring will never be filled.
Always refill the ring when interface goes up so it is ready to receive
packets.

Type: fix

Change-Id: I4cf22c8ae00638679f2e8650303a6fe916c1319b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agobfd: use vnet crypto 93/32193/13
Klement Sekera [Tue, 20 Apr 2021 17:21:36 +0000 (19:21 +0200)]
bfd: use vnet crypto

Type: improvement

Change-Id: I873a99c1258a97ed5ed195b9756e8302f865e7f0
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2 years agoaf_xdp: workaround kernel race between poll() and sendmsg() 77/32277/6
Benoît Ganne [Thu, 29 Apr 2021 16:24:24 +0000 (18:24 +0200)]
af_xdp: workaround kernel race between poll() and sendmsg()

Prior to Linux 5.6 there is a race condition between poll() and
sendmsg() in the kernel. This patch protects the syscalls with a lock
to prevent it, unless the NO_SYSCALL_LOCK flag is set at create time.
See
https://lore.kernel.org/bpf/BYAPR11MB365382C5DB1E5FCC53242609C1549@BYAPR11MB3653.namprd11.prod.outlook.com/

Type: fix

Change-Id: Ie7d4f5cb41f697b11a09b6046e54d190430d76df
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agonat: add maximum configured sessions to stat segment 61/32361/3
Ole Troan [Tue, 18 May 2021 13:05:23 +0000 (15:05 +0200)]
nat: add maximum configured sessions to stat segment

Add /nat44-ed/max-cfg-sessions gauge.
Reflects the configured value for configured sessions (per thread).

Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I618c8aa0daab0981399cfe9273d191fa1990ef60
Signed-off-by: Ole Troan <ot@cisco.com>
2 years agodoxygen: fix doxygen tags 06/32306/4
Dave Wallace [Thu, 13 May 2021 22:00:23 +0000 (18:00 -0400)]
doxygen: fix doxygen tags

- Missing tags mess up doxygen TOC heirarchy

Type: docs

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

2 years agotests: add role to VCLAppWorker 04/32404/2
Dave Wallace [Thu, 20 May 2021 18:01:51 +0000 (14:01 -0400)]
tests: add role to VCLAppWorker

- Improve readability of log output with respect
  to worker role

Type: test

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

2 years agolinux-cp: Add delegate to adjacencies 55/32255/2
Matthew Smith [Thu, 6 May 2021 18:16:42 +0000 (13:16 -0500)]
linux-cp: Add delegate to adjacencies

Type: improvement

When an adjacency is created, add the linux-cp delegate on the new
adjacency so we can later deal with modifications & deletions in our
cache of adjacency data.

Add a pool of hash keys and associate the pool index for a particular
key with the adj_delegate_t. If the rewrite on an adjacency is changed,
this will allow us to delete the old hash table entry and it will not
become orphaned.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I072b960c02cf377d66f7d18b8c0e9e05824a0ca3

2 years agoquic: add extended vcl test 57/32357/5
Florin Coras [Tue, 18 May 2021 07:35:50 +0000 (00:35 -0700)]
quic: add extended vcl test

Only works with release binaries.

Type: test

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

2 years agoquic: fix timer update 08/32408/2
Florin Coras [Thu, 20 May 2021 21:01:11 +0000 (14:01 -0700)]
quic: fix timer update

Use ctx timer wheel not current thread since connects are done on main
but the ctx is allocated on first worker.

Type: fix

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

2 years agoquic: init crypto context on streams 07/32407/2
Florin Coras [Thu, 20 May 2021 20:56:29 +0000 (13:56 -0700)]
quic: init crypto context on streams

Type: fix

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

2 years agoquic: make sure aead crypto context matches quicly 06/32406/3
Florin Coras [Thu, 20 May 2021 20:48:33 +0000 (13:48 -0700)]
quic: make sure aead crypto context matches quicly

Type: fix

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

2 years agoipsec: Default the IPSec interface MTU to 9000 01/32401/2
Neale Ranns [Thu, 20 May 2021 16:03:59 +0000 (16:03 +0000)]
ipsec: Default the IPSec interface MTU to 9000

Type: fix

The same value is used for other tunnel types.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I6593001918993d65f127cc9f716c95e932239842

2 years agomemif: fix gcc-10 build error on arm platform 66/32366/4
Tianyu Li [Tue, 18 May 2021 14:19:26 +0000 (22:19 +0800)]
memif: fix gcc-10 build error on arm platform

In function ‘memcpy’,
 inlined from ‘memif_device_input_zc_inline’
 at src/plugins/memif/node.c:850:7,
 string_fortified.h:34:10: error:
   writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=]
 34 |   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
    |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/plugins/memif/node.c: In function ‘memif_input_node_fn_neoversen1’:
src/plugins/memif/memif.h:175:16: note:
  at offset 0 to object ‘desc’ with size 0 declared here
  175 |   memif_desc_t desc[0];
      |                ^~~~

Using C99 way empty brackets for flexible array members

Type: fix
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I7a6ad89f95e1b5e3f9aac36546a2559dbda9bd6c

2 years agomemif: fix input node buffer prefetch 67/32367/2
Tianyu Li [Wed, 19 May 2021 06:45:58 +0000 (14:45 +0800)]
memif: fix input node buffer prefetch

Prefetch should be the next group of buffers instead of current buffers

Type: fix
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: If13967e27f74c10856ae48892420d7ade6f0c92c

2 years agotests: don't buffer worker stdin/stdout 63/32363/4
Dave Wallace [Tue, 18 May 2021 21:12:16 +0000 (17:12 -0400)]
tests: don't buffer worker stdin/stdout

- Required to get VCLAppWorker stdin / stdout data
  into log.txt when a test fails.

Type: test

Change-Id: I4db467986940f701750aec6d842a4d9aee22b4e6
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2 years agobash: add set-quicly-ws function 88/32388/3
Dave Wallace [Thu, 20 May 2021 01:47:00 +0000 (21:47 -0400)]
bash: add set-quicly-ws function

- Set up vpp workspace to build/test/debug with
  quicly source code downloaded from github.

Type: improvement

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

2 years agobuild: add .clang-tidy 98/32398/1
Damjan Marion [Thu, 20 May 2021 13:23:50 +0000 (15:23 +0200)]
build: add .clang-tidy

Initial version

Type: make
Change-Id: Id26827e7812f794da3f17b91f78d2550e4800083
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agogre: Walk IPv6 adjacencies during restack 42/32342/2
Matthew Smith [Fri, 14 May 2021 22:00:15 +0000 (17:00 -0500)]
gre: Walk IPv6 adjacencies during restack

Type: fix

If a GRE tunnel is created and the peer is not resolved yet and an
IPv6 route is added which points to the tunnel, packets matching the
route will be dropped. When the tunnel peer is resolved, adjacencies
on the tunnel interface should be restacked and packets matching the
route can be encapsulated and sent..

There is a loop that is intended to do this for both IPv4 and IPv6.
The call to walk adjacencies is invoked in a "return" statement though.
So the loop is exited and the function returns before IPv6 adjacencies
are walked.

Remove the return so the loop finishes.

Change-Id: Ia4f695681713020209ea490ae4142857cea49c41
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2 years agohsa: test server incremental stats 64/32364/7
Florin Coras [Wed, 19 May 2021 02:33:00 +0000 (19:33 -0700)]
hsa: test server incremental stats

Type: improvement

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

2 years agotls svm: prealloc tcp fifo chunks before ssl write 89/32389/3
Florin Coras [Thu, 20 May 2021 02:28:40 +0000 (19:28 -0700)]
tls svm: prealloc tcp fifo chunks before ssl write

Type: improvement

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

2 years agosession: fix transport half-open cleanup call 90/32390/3
Florin Coras [Thu, 20 May 2021 02:33:19 +0000 (19:33 -0700)]
session: fix transport half-open cleanup call

Type: fix

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

2 years agotls: fix signed unsigned comparison 87/32387/1
Florin Coras [Thu, 20 May 2021 01:33:04 +0000 (18:33 -0700)]
tls: fix signed unsigned comparison

On error, the signed value is cast to unsigned.

Type: fix

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

2 years agobash: fix vpp-make-test -g option 85/32385/2
Dave Wallace [Wed, 19 May 2021 21:01:55 +0000 (17:01 -0400)]
bash: fix vpp-make-test -g option

- Don't pollute shell with local variables
  which also fixes a bug with -g option
- If WS_ROOT is not set and vpp-make-test is
  invoked in the vpp root dir, then export
  WS_ROOT env var

Type: fix

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

2 years agoquic: fix memory leak & crash on connection delete 86/32386/1
Dave Wallace [Wed, 19 May 2021 20:37:58 +0000 (16:37 -0400)]
quic: fix memory leak & crash on connection delete

- quicly conn struct leaked on connection delete
- Occasionally connection delete is called twice
  before connection is closed which caused a crash.

Type: fix

Change-Id: Ifaaaeda55f71d58c97fa4d6652bda60a3efd4b69
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2 years agosession: cleanup event llist usage 54/32354/5
Florin Coras [Tue, 18 May 2021 02:09:33 +0000 (19:09 -0700)]
session: cleanup event llist usage

Type: refactor

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

2 years agomemif: remove dead code 39/32339/6
Damjan Marion [Fri, 14 May 2021 16:05:13 +0000 (18:05 +0200)]
memif: remove dead code

Type: fix
Change-Id: I6fce8c1f91fc5080271c1832bf40a9fb6bbcb7e3
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoavf: improve elogs 98/29398/5
Damjan Marion [Mon, 17 Jun 2019 18:25:54 +0000 (20:25 +0200)]
avf: improve elogs

Change-Id: I6221e1a5924223865b3caf53590d3668965b564c
Type: fix
Fixes: b4ff07a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovppinfra: add more llist macros 53/32353/9
Florin Coras [Tue, 18 May 2021 01:16:44 +0000 (18:16 -0700)]
vppinfra: add more llist macros

Type: improvement

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

2 years agosession: fix session queue node access on disable 75/32375/2
Florin Coras [Wed, 19 May 2021 14:58:49 +0000 (07:58 -0700)]
session: fix session queue node access on disable

Type: fix

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

2 years agobuild: fix crypto_native compile flags check 73/32373/2
Damjan Marion [Wed, 19 May 2021 13:13:40 +0000 (15:13 +0200)]
build: fix crypto_native compile flags check

Type: fix
Change-Id: I338036a3cac74fd5f9772bcf7685ee6970653ddb
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agointerface: shared tx queue support 72/32372/2
Damjan Marion [Wed, 19 May 2021 09:18:20 +0000 (11:18 +0200)]
interface: shared tx queue support

Type: improvement
Change-Id: I6bb7b6d6bd63b044952ab981be5b0673144c9834
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoavf: tx queue sharing fixes and improvements 71/32371/2
Damjan Marion [Wed, 19 May 2021 09:00:00 +0000 (11:00 +0200)]
avf: tx queue sharing fixes and improvements

Type: fix
Change-Id: I16b6720174efd98c19751e0fff36df58968484d2
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoavf: print stats in separate log class 69/32369/1
Damjan Marion [Wed, 19 May 2021 08:35:10 +0000 (10:35 +0200)]
avf: print stats in separate log class

Type: improvement
Change-Id: Ia1a4b1b1acad989cbd47a805b900160ba0071071
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agotls: fix dtls with no workers 56/32356/4
Florin Coras [Tue, 18 May 2021 07:28:59 +0000 (00:28 -0700)]
tls: fix dtls with no workers

Type: fix

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

2 years agosession: poll main thread if pending connects 47/32347/12
Florin Coras [Sun, 16 May 2021 17:58:53 +0000 (10:58 -0700)]
session: poll main thread if pending connects

Type: improvement

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

2 years agonat: refactor multiple vrf tests 49/32349/3
Klement Sekera [Mon, 17 May 2021 11:17:56 +0000 (13:17 +0200)]
nat: refactor multiple vrf tests

Replace VRF test testing multiple scenarios into more simpler tests to
improve readability and ease of debugging.

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

2 years agosession: only handle old ctrl events per dispatch 52/32352/4
Florin Coras [Mon, 17 May 2021 23:05:41 +0000 (16:05 -0700)]
session: only handle old ctrl events per dispatch

Avoids dispatching ctrl events generated while handling the
current pending list.

Type: improvement

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

2 years agosession: move tx-buffers to tx ctx 55/32355/2
Florin Coras [Tue, 18 May 2021 06:44:53 +0000 (23:44 -0700)]
session: move tx-buffers to tx ctx

Type: refactor

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

2 years agomemif: remove unused code 51/32351/2
Damjan Marion [Mon, 17 May 2021 16:36:54 +0000 (18:36 +0200)]
memif: remove unused code

Type: refactor
Change-Id: I127b8c7131fd993a5fe605c7c36cc1d0b6672984
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agobuild: fix the "show version" output in the centos release builds 93/31893/3
Andrew Yourtchenko [Mon, 17 May 2021 16:16:28 +0000 (16:16 +0000)]
build: fix the "show version" output in the centos release builds

A couple of releases ago I made a change that slightly changes
the naming of artifacts, in order to make the version sorting better.
However, that change broke the "show version" output of the VPP
in the RPM - that build copies the entire source tree into
a new location and builds there, supplying the version
information in .version file rather than using git describe.

Updating only the version script and not the .version file content
resulted in the VPP release builds within the RPM installs have
the "count of commits since tagging" being zero and the commit ID,
rather than having XX.YY-release format.

A couple of releases - 20.09 and 21.01, saw a more haphazard solution,
but it is proper to fix the content of the .version file so it
is all consistent.

This commit fixes the contents of this file made for the RPM build, so that
the versioning script does not see unexpected input, thus addressing
the issue of "show version" in the release build.

Change-Id: I0af68e69b1e40fc49ade759bb2f0ed9f47614217
Type: fix
Fixes: 1060332e62d1216bf33c697d0a54ba35d4903eb3
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2 years agomemif: remove duplicate code in tx 44/32344/2
Damjan Marion [Fri, 14 May 2021 23:38:18 +0000 (01:38 +0200)]
memif: remove duplicate code in tx

Type: refactor
Change-Id: Idb82e28ee2e370ae8fc1becc2f8b92a548bc6b1b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agomemif: optimize zero-copy rx ring refill 40/32340/2
Damjan Marion [Fri, 14 May 2021 15:22:03 +0000 (17:22 +0200)]
memif: optimize zero-copy rx ring refill

Type: improvement
Change-Id: I8169da230eb5f74651810a8e2490895620c38269
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agomemif: fix "remove barriers" commit 50/32350/1
Damjan Marion [Mon, 17 May 2021 14:49:07 +0000 (16:49 +0200)]
memif: fix "remove barriers" commit

Type: fix
Change-Id: I60bb0261c05bf7e25ca01c72780f1cd77fde7a9a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agomemif: remove barriers 38/32338/3
Damjan Marion [Fri, 14 May 2021 12:36:23 +0000 (14:36 +0200)]
memif: remove barriers

Type: improvement
Change-Id: Idef30aee80b654ce424b6f1f1f730574ca68874c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovirtio: add the checks for descriptors chain len 20/32220/5
Mohsin Kazmi [Wed, 12 May 2021 12:51:29 +0000 (14:51 +0200)]
virtio: add the checks for descriptors chain len

Type: fix

virtio uses indirect descriptors for chain buffers.
indirect descriptor chain is mapped on a vlib_buffer_t.
Single descriptor is 16 bytes and vlib_buffer_t has
2048 bytes space. So maximum long chain can have
128 (=2048/16) indirect descriptors.

This patch adds check to make sure descriptors chain
len should not exceed 128.

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

2 years agosession: rpc for connects to main 24/32224/13
Florin Coras [Wed, 5 May 2021 16:54:00 +0000 (09:54 -0700)]
session: rpc for connects to main

Type: improvement

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

2 years agolacp: coverity fix on null pointer dereference 43/32343/2
Steven Luong [Fri, 14 May 2021 22:33:01 +0000 (15:33 -0700)]
lacp: coverity fix on null pointer dereference

Coverity complains on null pointer dereference. It is not likely to
happen.

Type: fix

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

2 years agosession: fix coverity warning 45/32345/5
Florin Coras [Sat, 15 May 2021 03:11:14 +0000 (20:11 -0700)]
session: fix coverity warning

Type: fix

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

2 years agotcp: remove ho lock 41/32341/5
Florin Coras [Fri, 14 May 2021 16:22:20 +0000 (09:22 -0700)]
tcp: remove ho lock

Half-open sessions are allocated by main thread and cleaned up on main
with timers.

Type: improvement

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

2 years agovlib: remove unused code 15/32315/4
Damjan Marion [Fri, 14 May 2021 13:00:05 +0000 (15:00 +0200)]
vlib: remove unused code

Type: refactor
Change-Id: Ia5f670541dd43a4f6d731dda84b2d898195643fc
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovlib: pass node runtime to vlib_buffer_enqueue_to_thread() 14/32314/3
Damjan Marion [Fri, 14 May 2021 12:50:01 +0000 (14:50 +0200)]
vlib: pass node runtime to vlib_buffer_enqueue_to_thread()

Mechanical change for patch following this one...

Type: improvement
Change-Id: Iee12f3a8851f35569e6c039494a94fc36e83d20f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoavf: free spinlock on txq removal 36/32336/3
Damjan Marion [Fri, 14 May 2021 13:26:53 +0000 (15:26 +0200)]
avf: free spinlock on txq removal

Type: fix
Change-Id: I8e9a907a227f82b870a945b94731dc3204c23ee1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agointerface: fix converity in update_runtime_data 79/32279/5
Mohammed Hawari [Tue, 11 May 2021 15:28:44 +0000 (17:28 +0200)]
interface: fix converity in update_runtime_data

Change-Id: I59eb41516b5e052109428ae70660ed49126c25bb
Type: fix
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2 years agointerface: update tx queue runtime if vector size changes 37/32337/2
Damjan Marion [Fri, 14 May 2021 13:48:52 +0000 (15:48 +0200)]
interface: update tx queue runtime if vector size changes

Fixes issue which causes crash in case when VPP only runs with main thread.

Type: fix
Change-Id: Ia0ca973bb7e7ff81f15b37764ae248e2502bdcec
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovcl: fix lookup listener assert 07/32307/5
liuyacan [Fri, 14 May 2021 02:11:03 +0000 (02:11 +0000)]
vcl: fix lookup listener assert

The following timing may happen:

1. vpp accept new connection, send ACCEPTED to vcl, but vcl has
   not handle it
2. vcl unbind the listener, go into DISCONNECT state
3. vcl handle the ACCEPTED event

Type: fix

Signed-off-by: liuyacan <liuyacan@corp.netease.com>
Change-Id: If9a96a153af38763db062df133c2fdcc04ceba9b

2 years agosession: switch ct to vc and track half-opens 03/32303/13
Florin Coras [Thu, 13 May 2021 18:37:43 +0000 (11:37 -0700)]
session: switch ct to vc and track half-opens

Type: improvement

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

2 years agotls: switch dtls to vc and track half-opens 97/32297/10
Florin Coras [Thu, 13 May 2021 15:36:56 +0000 (08:36 -0700)]
tls: switch dtls to vc and track half-opens

Also adds support for half-open support transport migration.

Type: improvement

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

2 years agolacp: Prohibiting bonding with remote having different key than 1st member 92/32292/4
Steven Luong [Wed, 12 May 2021 21:38:22 +0000 (14:38 -0700)]
lacp: Prohibiting bonding with remote having different key than 1st member

After forming the bonding with 1st remote member, Subsequent member must
have the same key in order to join the same bonding group.

Type: fix

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

2 years agointerface: fix tx queue runtime update 96/32296/2
Damjan Marion [Thu, 13 May 2021 12:19:33 +0000 (14:19 +0200)]
interface: fix tx queue runtime update

Type: fix
Change-Id: I5ce7e57ae277de26af602fe786048bf21b8612f8
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agotests: move test source to vpp/test 93/32293/2
Dave Wallace [Thu, 13 May 2021 01:43:59 +0000 (21:43 -0400)]
tests: move test source to vpp/test

- Generate copyright year and version
  instead of using hard-coded data

Type: refactor

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

2 years agoquic: remove cmake --target 89/32289/2
Nathan Skrzypczak [Wed, 12 May 2021 16:47:12 +0000 (18:47 +0200)]
quic: remove cmake --target

Type: fix

This isnt needed as we pass
CMAKE_SKIP_INSTALL_ALL_DEPENDENCY

Change-Id: I1406d84192efb9baedf7df680aca0b96bb0eef01
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agomisc: change VFIO group ownership and permissions in vfctl script 86/32286/3
Damjan Marion [Wed, 12 May 2021 09:51:08 +0000 (11:51 +0200)]
misc: change VFIO group ownership and permissions in vfctl script

This is missing step to allow runing VPP unpriviledged
with AVF driver.

Type: improvement
Change-Id: I37dfad9236691c1a8e2837a5811536170c65d7bc
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoavf: avoid eating our own tail 88/32288/1
Damjan Marion [Wed, 12 May 2021 12:43:21 +0000 (14:43 +0200)]
avf: avoid eating our own tail

This happens in case we are not able to refill ring with new buffers.

Type: fix
Change-Id: I727e55c5b8482d9b8aeb4a9933a9a755fe21e55f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoflow: fix vxlan vni convert bug 62/32262/3
Chenmin Sun [Mon, 10 May 2021 12:11:49 +0000 (20:11 +0800)]
flow: fix vxlan vni convert bug

This patch fixes a vxlan vni field conversion bug in flow api layer

Type: fix

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

2 years agotls: switch to vc service and track half-open sessions 75/32275/12
Florin Coras [Tue, 11 May 2021 04:12:27 +0000 (21:12 -0700)]
tls: switch to vc service and track half-open sessions

Half-open tls sessions are now tracked by the app worker and are cleaned
up only when tcp cleans up its half-open session, i.e., independent of
when the established tls context is allocated.

Type: improvement

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

2 years agosession: return connect session handle to app 83/32283/7
Florin Coras [Tue, 11 May 2021 18:55:07 +0000 (11:55 -0700)]
session: return connect session handle to app

App transports not supported for now. Will have to be updated
individually.

Type: improvement

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

2 years agocrypto: add chacha20-poly1305 support to ipsecmb 38/32238/10
Fan Zhang [Tue, 11 May 2021 11:53:15 +0000 (12:53 +0100)]
crypto: add chacha20-poly1305 support to ipsecmb

Type: feature

This patch adds chacha20-poly1305 single and chained algorithm
support to ipsecmb crypto engine.

Signed-off-by: DariuszX Kazimierski <dariuszx.kazimierski@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: If04ee0c8f985b07fd31dad1ce29000ec6f1733c5

2 years agosession: support half-close connection 61/32261/4
liuyacan [Sun, 9 May 2021 03:50:40 +0000 (03:50 +0000)]
session: support half-close connection

Some app(e.g. Envoy) may call shutdown() instead of close() when
draining connection.

Type: improvement

Signed-off-by: liuyacan <liuyacan@corp.netease.com>
Change-Id: I9543b9ca3caa87b10b134fd1fc4019124e41e4d2

2 years agoip: ensure ttl doesn't decrease to 0 when punting 69/31969/7
Aloys Augustin [Tue, 13 Apr 2021 19:14:55 +0000 (21:14 +0200)]
ip: ensure ttl doesn't decrease to 0 when punting

Change-Id: I248ef12fd34ea2a1c383fbcc530a8ffeb31ba92b
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2 years agointerface: tx queue infra 04/32004/17
Damjan Marion [Thu, 15 Apr 2021 11:12:51 +0000 (13:12 +0200)]
interface: tx queue infra

Type: improvement
Change-Id: I415b2f980de10ca3154d2c8677c24792453eccd0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agobuild: compiler flags handling cleanup 70/32270/6
Damjan Marion [Mon, 10 May 2021 12:51:44 +0000 (14:51 +0200)]
build: compiler flags handling cleanup

Type: make
Change-Id: I51f30edb91e09525ba116fe3941f2e43f9718da7
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoquic: alloc ctx on udp thread 74/32274/4
Florin Coras [Tue, 11 May 2021 00:21:06 +0000 (17:21 -0700)]
quic: alloc ctx on udp thread

UDP sessions are allocated on first worker because main does not poll.
Consequently, quic should also allocate connection on first, to avoid
multiple migration events.

Type: improvement

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

2 years agovppinfra: Add missing %o 72/32272/3
Nathan Skrzypczak [Fri, 7 May 2021 17:39:51 +0000 (19:39 +0200)]
vppinfra: Add missing %o

This is used in vppinfra/socket.c:495

Type: feature

Change-Id: I89b409ae7abb01723108ae3e6c55bb1675db50ee
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agovlib: exec cmd handle scripts with blank lines 73/32273/2
Dave Barach [Mon, 10 May 2021 23:01:42 +0000 (19:01 -0400)]
vlib: exec cmd handle scripts with blank lines

Type: fix
Fixes: 2f96e7648b9b7d501088eddff7e4a761973e71f4

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

2 years agomisc: fix crash in lawful intercept CLI 49/32149/5
hemant_mnkcg [Tue, 27 Apr 2021 22:02:13 +0000 (18:02 -0400)]
misc: fix crash in lawful intercept CLI

Type: fix

Signed-off-by: hemant_mnkcg <hemant@mnkcg.com>
Change-Id: I097815617053dac09de7ad3092b3d3071770114f

2 years agosession: use half-open sessions for vc establishment 58/32258/14
Florin Coras [Sat, 8 May 2021 02:39:43 +0000 (19:39 -0700)]
session: use half-open sessions for vc establishment

Use half-open sessions to track virtual circuit connection
establishment. These sesssions can only be allocated and freed by the
thread that allocates half-open connections (main). Consequently, they
can only be freed on half-open cleanup notifications from transports.

Goal is to simplify state tracking within the session layer but it's
also a first step towards allowing builtin apps to track and cleanup
outstanding connects.

Type: improvement

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

2 years agodpdk: do not crash when failing to bring interface up 67/32267/2
Benoît Ganne [Mon, 10 May 2021 12:10:19 +0000 (14:10 +0200)]
dpdk: do not crash when failing to bring interface up

If dpdk device starts failed for some reason, we should not try to get
stats and the interface must remain down.

Type: fix

Change-Id: I0079f89d3b43a9b47553991347da8ed4ce6ede8d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agordma: bump to rdma-core v35.0 66/32266/3
Benoît Ganne [Mon, 10 May 2021 12:07:49 +0000 (14:07 +0200)]
rdma: bump to rdma-core v35.0

Type: improvement

Change-Id: I5f7ff309aacbfd7a5a8a973bcc7ba04ba44923c5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agosvm: try chunk alloc only if enough space available 60/32260/3
Florin Coras [Sat, 8 May 2021 22:29:50 +0000 (15:29 -0700)]
svm: try chunk alloc only if enough space available

Type: fix

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

2 years agogso: fix the gro coalesced chain len 23/32223/3
Mohsin Kazmi [Wed, 5 May 2021 16:25:39 +0000 (16:25 +0000)]
gso: fix the gro coalesced chain len

Type: fix

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

2 years agoapi: fix crash in vl_msg_api_free 59/32259/3
wanghanlin [Sat, 8 May 2021 03:39:53 +0000 (11:39 +0800)]
api: fix crash in vl_msg_api_free

VPP crash when ASSERT in clib_mem_free.

Type: fix

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: Id06d833caab3385446528d62a6ed3bde38d57db0

2 years agovhost: low performance in interrupt mode in some cases 40/32240/3
Steven Luong [Thu, 6 May 2021 17:00:30 +0000 (10:00 -0700)]
vhost: low performance in interrupt mode in some cases

When vhost and another interface, say tap, are configured for interrupt
mode, performance number may be very low from vhost.

Further analysis discovers that when vhost posts an interrupt to the
RX infra, there is a 10 msec delay in waking up its input routine.
The delay is due to vhost posts the interrupt from the main thread
which tries to wake up the worker thread.

The fix is for vhost to move the posting interrupt call to the
corresponding input worker thread by calling
vnet_hw_if_set_rx_queue_file_index() to set it up.

While at it, streamline the function vhost_user_kickfd_read_ready()
since it will be called from the worker thread.

Type: fix

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

2 years agomemif: Fix delete on error 54/32254/2
Nathan Skrzypczak [Fri, 7 May 2021 16:16:58 +0000 (18:16 +0200)]
memif: Fix delete on error

Type: fix

Change-Id: I3cc09630cae999cc194a0eedb4d2cfee7a826b76
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agoavf: fix coverity 53/32253/3
Mohammed Hawari [Fri, 7 May 2021 15:27:51 +0000 (17:27 +0200)]
avf: fix coverity

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

2 years agotests: fix another race condition in punt tests 57/32257/2
Dave Wallace [Sat, 8 May 2021 01:40:54 +0000 (21:40 -0400)]
tests: fix another race condition in punt tests

- Don't close the socket and don't stop receiving
  until after draining the existing data in the
  socket.

Type: fix

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

2 years agodpdk: fix cryptodev session handler 51/32251/2
Fan Zhang [Fri, 7 May 2021 11:50:18 +0000 (12:50 +0100)]
dpdk: fix cryptodev session handler

Type: fix

This patch fixes the possible segmentation fault in DPDK
cryptodev when deleting session.

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

2 years agobuild: bump ipsecmb version to 1.0 47/32247/2
Damjan Marion [Fri, 7 May 2021 07:20:54 +0000 (09:20 +0200)]
build: bump ipsecmb version to 1.0

Type: improvement
Change-Id: If2c0db46805c0a8c995a76938f049568f57f7560
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agosession: connects seg manager is always first 46/32246/10
Florin Coras [Thu, 6 May 2021 22:32:14 +0000 (15:32 -0700)]
session: connects seg manager is always first

By convention, connects segment manager will be first. Therefore it will
be the one with the first segment wherein lies the app's message queue.

Saves us the trouble of allocating it on first connect, if app started
by listening, and we no longer need to track if it's assignable to a
listener or if it can be removed.

Type: improvement

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

2 years agoavf: Fix cksum offload / ipsec 05/32205/3
Nathan Skrzypczak [Tue, 4 May 2021 13:46:33 +0000 (15:46 +0200)]
avf: Fix cksum offload / ipsec

VNET_BUFFER_F_OFFLOAD means 'check 2nd cacheline'
but we can still have TCP_CKSUM=0 & UDP_CKSUM=0

Type: fix

Change-Id: I42b5974f6d34b777aa959c06c67619a5c83c5805
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agovppinfra: add universal array mask_compare and compress funcs 39/32239/8
Damjan Marion [Thu, 6 May 2021 15:34:49 +0000 (17:34 +0200)]
vppinfra: add universal array mask_compare and compress funcs

Type: improvement
Change-Id: I6d812339f626ea630ad9354632d2f9506122d379
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovcl: add dtls test 44/32244/4
Florin Coras [Thu, 6 May 2021 19:46:04 +0000 (12:46 -0700)]
vcl: add dtls test

Type: test

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