vpp.git
3 years agovapi: packed enum type generation 43/26643/4
Neale Ranns [Wed, 22 Apr 2020 16:06:45 +0000 (16:06 +0000)]
vapi: packed enum type generation

Type: fix

if the ,api/.json specifies that a enum should be u8/u16 that the
generated c enum needs to be packed.

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

3 years agomisc: update INFO.yaml 72/26672/5
Dave Barach [Thu, 23 Apr 2020 17:05:49 +0000 (13:05 -0400)]
misc: update INFO.yaml

Add Benoit Ganne to the committer list, remove committers who have
resigned, list committers in alphabetical order.

Type: fix

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

3 years agonat: add/del ed_ext_ports only if the table is instantiated 75/26675/1
Dave Barach [Thu, 23 Apr 2020 20:56:15 +0000 (16:56 -0400)]
nat: add/del ed_ext_ports only if the table is instantiated

Add a suitable ASSERT in the bihash template in case this happens again.

Type: fix

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

3 years agomisc: Markdown cleanups for the 20.01 release 44/24644/3
Andrew Yourtchenko [Mon, 27 Jan 2020 11:09:17 +0000 (11:09 +0000)]
misc: Markdown cleanups for the 20.01 release

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

3 years agosession: fix session_table_get_or_alloc 56/26656/3
Andreas Schultz [Thu, 23 Apr 2020 08:41:50 +0000 (10:41 +0200)]
session: fix session_table_get_or_alloc

Extending the fib_index_to_table_index could leave entries uninitialized,
pointing to the session tables at index 0. That session index exists by
default, but it is a IPv4 session table. That would break all IPv6 on
the unitilized fib indexes.

Type: fix

Change-Id: Ie3f0a87a7f829ceb39f75ec06658b0ad1d3813ae
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
3 years agovppinfra: more bihash optimizatons 61/26661/2
Damjan Marion [Thu, 23 Apr 2020 11:41:47 +0000 (13:41 +0200)]
vppinfra: more bihash optimizatons

* Avoid doing expensive bit extraction for most likely case where bucket
  .log2_page_size == 0 and .linear_search == 0, saves 3-5 cycles for
  lookup, data_prefetch and add operation

* use bextr instruction when available (x86 BMI instruction set)

Type: improvement
Change-Id: I163df36a29287482c5f133be8b21d62a2f7440de
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agoip: Replace Sematics for Interface IP addresses 26/26426/5
Neale Ranns [Wed, 8 Apr 2020 12:19:38 +0000 (12:19 +0000)]
ip: Replace Sematics for Interface IP addresses

Type: feature

 - replace functions for prefixes attached to interfaces
 - add ip_interface.[ch] to consoldate the functions

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

3 years agoip-neighbor: Replace feature for the ip-neighbor data-base 25/26325/5
Neale Ranns [Thu, 2 Apr 2020 17:08:28 +0000 (17:08 +0000)]
ip-neighbor: Replace feature for the ip-neighbor data-base

Type: feature

DB replace is implemented with a mark and sweep algorithm (just the the
FIB)

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

3 years agotcp: avoid bt sample access after possible pool realloc 51/26651/1
Florin Coras [Wed, 22 Apr 2020 22:07:43 +0000 (22:07 +0000)]
tcp: avoid bt sample access after possible pool realloc

Type: fix

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

3 years agoapi: 'api trace' CLI consumes a line of input 46/26646/2
Neale Ranns [Wed, 22 Apr 2020 16:14:52 +0000 (12:14 -0400)]
api: 'api trace' CLI consumes a line of input

Type: improvement

allows the CLI command to be used from a config file

Change-Id: Id9e7ad71b208317a65b1ed4065b0cb8777aee6ec
Signed-off-by: Neale Ranns <nranns@cisco.com>
3 years agovppinfra: move unused code to extras/deprecated/vppinfra 41/26641/3
Dave Barach [Wed, 22 Apr 2020 14:02:31 +0000 (10:02 -0400)]
vppinfra: move unused code to extras/deprecated/vppinfra

Type: improvement

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

3 years agoip: fix format functions for u8 address_family 42/26642/2
Neale Ranns [Wed, 22 Apr 2020 16:02:47 +0000 (16:02 +0000)]
ip: fix format functions for u8 address_family

Type: fix

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

3 years agolisp: switch to new timer wheel code 50/26650/4
Florin Coras [Wed, 22 Apr 2020 18:10:58 +0000 (18:10 +0000)]
lisp: switch to new timer wheel code

Type: improvement

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

3 years agovcl: fix use-after-free 47/26647/3
Benoît Ganne [Wed, 22 Apr 2020 17:14:03 +0000 (19:14 +0200)]
vcl: fix use-after-free

Make sure we disconnect from vlib prior to free-ing the last worker, as
we'll need to access it.

Type: fix

Change-Id: Id5bdd17f0f5efa1ce52021b4270eb4f1e95cc61d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agotcp: fix use-after-free 48/26648/3
Benoît Ganne [Wed, 22 Apr 2020 17:15:49 +0000 (19:15 +0200)]
tcp: fix use-after-free

bts can be freed by the call to bt_fix_overlapped(). Save flags for
later use.

Type: fix

Change-Id: If8b48c96ce39e38f2ed7f4db2815122523eb2e05
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agosession: multiple dgrams per dispatch 14/26614/11
Florin Coras [Mon, 20 Apr 2020 21:07:06 +0000 (21:07 +0000)]
session: multiple dgrams per dispatch

Type: improvement

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

3 years agosvm: asan: fix asan support 37/26637/2
Benoît Ganne [Mon, 20 Apr 2020 07:52:39 +0000 (09:52 +0200)]
svm: asan: fix asan support

 - restrict the unittests SVM address space to what is supported by ASan
 - mark SVM mmap()ed address space accessible for ASan
 - SVM shared memory heap scheme means some allocation can happen
   outside the current process. Lazily mark those accessible for ASan

Type: fix

Change-Id: I7c196c80b2a5297651d0afa54f1a8e478fcf59b1
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agogre: Optimise encap node for tunnel types 48/26448/2
Neale Ranns [Thu, 9 Apr 2020 11:34:08 +0000 (07:34 -0400)]
gre: Optimise encap node for tunnel types

Type: improvement

Change-Id: I6627e22110be94c8127486ae009761494e734c04
Signed-off-by: Neale Ranns <nranns@cisco.com>
3 years agogso: add vxlan tunnel support 41/23041/26
Mohsin Kazmi [Fri, 17 Apr 2020 16:50:56 +0000 (16:50 +0000)]
gso: add vxlan tunnel support

Type: feature

Change-Id: I85f6ec77187a4983c66c5e22fd39fbb2cef82902
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
3 years agomisc: fix coverity warnings 40/26640/2
Dave Barach [Wed, 22 Apr 2020 12:01:52 +0000 (08:01 -0400)]
misc: fix coverity warnings

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

3 years agomisc: asan: mark parsed elf memory as readable for ASan 37/26537/3
Benoît Ganne [Thu, 16 Apr 2020 08:57:41 +0000 (10:57 +0200)]
misc: asan: mark parsed elf memory as readable for ASan

Type: fix

Change-Id: Ic7441a09bab2cabc7632ee502368584ac022f997
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoethernet: leverage vlib_buffer_get_current 77/26477/2
Zhiyong Yang [Sat, 11 Apr 2020 14:36:55 +0000 (14:36 +0000)]
ethernet: leverage vlib_buffer_get_current

Type: improvement

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

3 years agomisc: asan: disable leak sanitizer by default 38/26638/2
Benoît Ganne [Tue, 21 Apr 2020 17:25:14 +0000 (19:25 +0200)]
misc: asan: disable leak sanitizer by default

Leak Sanitizer is not stable yet with VPP. It can always be enabled at
runtime with ASAN_OPTIONS=detect_leaks=1.

Type: fix

Change-Id: Ieff01091e2976e127783ebd331cd0e50a1dbca12
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agoethernet: put vlib_get_buffers together 02/26202/7
Zhiyong Yang [Fri, 27 Mar 2020 17:12:35 +0000 (17:12 +0000)]
ethernet: put vlib_get_buffers together

The patch brings 0.8 clocks saved per pkt in IPv4 l3fwd case on Skylake.

Type: improvement

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

3 years agomisc: asan: do not poison memory after munmap() 39/26639/2
Benoît Ganne [Wed, 22 Apr 2020 07:02:48 +0000 (09:02 +0200)]
misc: asan: do not poison memory after munmap()

It is a bad idea to poison memory after munmap because the address space
can be reused (eg. for global data of dlopen()ed object) and ASan model
allows access by default.
Moreover, access to a stale address space will fault.

Type: fix

Change-Id: I356de422f255447d9d50a3a71fb0c2eaa790d731
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agovppinfra: fix potential race in bihash bucket lock 24/26624/3
Damjan Marion [Tue, 21 Apr 2020 18:14:34 +0000 (20:14 +0200)]
vppinfra: fix potential race in bihash bucket lock

Type: improvement

Change-Id: Ia04bd26ecd689894753e036e52920316de611910
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agovppinfra: improve bihash add/del performance 21/26621/3
Damjan Marion [Tue, 21 Apr 2020 17:42:30 +0000 (19:42 +0200)]
vppinfra: improve bihash add/del performance

Measured improvement is from 439 to 167 clocks for add operation
in 16_8 case...

Type: improvement

Change-Id: I975ff46ff30b983a3ec80a5cde25ccb68d7fa03b
Signed-off-by: Damjan Marion <damarion@cisco.com>
3 years agodpdk: DPDK 20.05 iavf flow director backporting to DPDK 20.02 91/26191/6
Chenmin Sun [Fri, 27 Mar 2020 16:34:19 +0000 (00:34 +0800)]
dpdk: DPDK 20.05 iavf flow director backporting to DPDK 20.02

0001 ~ 0014 patches are for virtual channel and PMD
0015 is the iavf fdir framework
0016 ~ 0017 are for the iavf fidr driver

Type: feature

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

3 years agodevices: Adding ConnectX-6 DX Device ID for validation 27/26627/2
Amir Zeidner [Wed, 22 Apr 2020 07:11:57 +0000 (10:11 +0300)]
devices: Adding ConnectX-6 DX Device ID for validation

Type: fix

Change-Id: I3c7ebbe91e7dffe9fd6851e5334fe920f2187cf0
Signed-off-by: Amir Zeidner <amirzei@mellanox.com>
3 years agovat: fix increment_address(...) 16/26616/2
Dave Barach [Tue, 21 Apr 2020 12:01:16 +0000 (08:01 -0400)]
vat: fix increment_address(...)

vl_api_address_t uses a packed enum for the address family, compare
a->af directly with ADDRESS_IP4 / ADDRESS_IP6 instead of running a->af
through clib_host_to_net_u32(...) before compare.

Indirectly fixes api_ip_route_add_del(...) w/ count > 1.

Type: fix

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

3 years agovlib: queue_hi_thresh fix to avoid deadlock 44/26544/2
Elias Rudberg [Thu, 16 Apr 2020 14:01:52 +0000 (16:01 +0200)]
vlib: queue_hi_thresh fix to avoid deadlock

Adapt queue_hi_thresh value using num_threads to avoid risk of deadlock
between threads which could happen for example when different NAT
threads try to handoff work to each other at the same time when their
frame queues are congested. This change ensures that each thread can
reserve a queue entry without causing problems even in the most extreme
case when all threads attempt to add to the same queue simultaneously
when the queue is nearly full.

Type: fix

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

3 years agonat: dslite ce mode in separate config entry 83/26483/5
Vladimir Ratnikov [Mon, 13 Apr 2020 10:36:19 +0000 (06:36 -0400)]
nat: dslite ce mode in separate config entry

Previously dslite was moved to separate plugin folder
and CE mode was removed. But it still needed.
This patch adds CE option to separate config entry

Type: feature

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: If153ae08fa385ba5a6605cb412e49bbb4d1db46c

3 years agovppinfra: bihash improvements 49/26549/10
Dave Barach [Thu, 16 Apr 2020 16:00:14 +0000 (12:00 -0400)]
vppinfra: bihash improvements

Template instances can allocate BIHASH_KVP_PER_PAGE data records
tangent to the bucket, to remove a dependent read / prefetch.

Template instances can ask for immediate memory allocation, to avoid
several branches in the lookup path.

Clean up l2 fib, gpb plugin codes: use clib_bihash_get_bucket(...)

Use hugepages for bihash allocation arenas

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Signed-off-by: Damjan Marion <damarion@cisco.com>
Change-Id: I92fc11bc58e48d84e2d61f44580916dd1c56361c

3 years agosr: fix non-NULL terminated string overflow 06/26606/2
Benoît Ganne [Fri, 17 Apr 2020 10:11:26 +0000 (12:11 +0200)]
sr: fix non-NULL terminated string overflow

Type: fix

Change-Id: Ia5ae0e893a5358f61353d20f444d88d79953e482
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agosvm: check if fifo free list index is valid on alloc 76/26576/5
Florin Coras [Fri, 17 Apr 2020 20:15:22 +0000 (20:15 +0000)]
svm: check if fifo free list index is valid on alloc

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Change-Id: Ib85c2f01dc7ec9858f2f88b89e209f989d78c5d9

3 years agosession: fix use-after-free in input node 05/26605/3
Benoît Ganne [Fri, 17 Apr 2020 10:09:37 +0000 (12:09 +0200)]
session: fix use-after-free in input node

Type: fix

Change-Id: Ie60b07abe76ad166f048f5885accd7038d8153b2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agosession: avoid rx notifications on accepting sessions 80/26580/2
Florin Coras [Sun, 19 Apr 2020 22:41:55 +0000 (22:41 +0000)]
session: avoid rx notifications on accepting sessions

Type: fix

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

3 years agovcl: ensure sessions are open on select events 81/26581/4
Florin Coras [Sun, 19 Apr 2020 23:12:08 +0000 (23:12 +0000)]
vcl: ensure sessions are open on select events

Type: fix

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

3 years agovcl: expand vcl select maps in ldp if needed 82/26582/3
Florin Coras [Mon, 20 Apr 2020 01:32:38 +0000 (01:32 +0000)]
vcl: expand vcl select maps in ldp if needed

Type: fix

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

3 years agonat: remove unused code 75/26575/3
Klement Sekera [Fri, 17 Apr 2020 18:04:59 +0000 (18:04 +0000)]
nat: remove unused code

Type: improvement

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

3 years agogbp: fix l3-out anonymous test cleanup 46/26546/4
Benoît Ganne [Thu, 16 Apr 2020 14:57:00 +0000 (16:57 +0200)]
gbp: fix l3-out anonymous test cleanup

Type: fix

Change-Id: Ib455b0a57f9b4f9cb82bb295c220270d0c6e5fe5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agotls: fix Picotls tx hang issue 77/26577/2
Simon Zhang [Sun, 19 Apr 2020 13:50:17 +0000 (21:50 +0800)]
tls: fix Picotls tx hang issue

Type: fix

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

3 years agosession: fix half-open cleanup 78/26578/1
Florin Coras [Sun, 19 Apr 2020 19:20:19 +0000 (19:20 +0000)]
session: fix half-open cleanup

Type: fix

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

3 years agolisp: fix use-after-free 39/26539/2
Benoît Ganne [Thu, 16 Apr 2020 10:39:39 +0000 (12:39 +0200)]
lisp: fix use-after-free

Type: fix

Change-Id: I42c3e3514ba50d40e09ee688d083f3e78fa0713a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
3 years agovat: fix static analysis warning 04/26404/3
Andreas Schultz [Tue, 7 Apr 2020 11:40:36 +0000 (13:40 +0200)]
vat: fix static analysis warning

replace hand crafted version with existing vector function

Type: fix

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

3 years agotcp: cubic as default cc algorithm 70/26570/2
Florin Coras [Fri, 17 Apr 2020 16:10:51 +0000 (16:10 +0000)]
tcp: cubic as default cc algorithm

Type: improvement

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

4 years agovirtio: fix to use chained descriptors when missing indirect descriptor 80/25680/7
Mohsin Kazmi [Fri, 10 Apr 2020 14:57:06 +0000 (14:57 +0000)]
virtio: fix to use chained descriptors when missing indirect descriptor

Some vhost-backed missing the VIRTIO_RING_F_INDIRECT_DESC feature.
Previously, vpp doesn't support jumbo frames using chained descriptors.
This patch fixes this issue.

Type: fix

Change-Id: I20487e201e88ea136b556ac84dde058019ab3e78
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
4 years agodpdk: fix udp-encap for esp in transport mode 51/26351/3
Alexander Chernavin [Fri, 3 Apr 2020 14:18:44 +0000 (10:18 -0400)]
dpdk: fix udp-encap for esp in transport mode

Now UDP encapsulation doesn't work in transport mode because:
 - the encrypt node misses filling of UDP header and it gets sent with
   all zeros;
 - the decrypt node misses filling of new IP header and it contains
   garbage data.

With this commit, fill UDP header during encryption and fill IP header
during decryption.

Change-Id: I87a7bd594f0e312b16d3e5eb19e568b4e3164d36
Type: fix
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
4 years agosession tcp: track half open in app wrk 35/26535/9
Florin Coras [Thu, 16 Apr 2020 04:30:22 +0000 (04:30 +0000)]
session tcp: track half open in app wrk

Type: improvement

Do extra checks when establishing an active connect and cleanup pending
connects if application detaches.

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

4 years agovcl: fix app destroy 56/26556/6
Florin Coras [Thu, 16 Apr 2020 18:47:27 +0000 (18:47 +0000)]
vcl: fix app destroy

Type: fix

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

4 years agovppinfra: install missing tw_timer_2t_2w_512sl header file 55/26555/2
Yu Sun [Thu, 16 Apr 2020 17:56:12 +0000 (13:56 -0400)]
vppinfra: install missing tw_timer_2t_2w_512sl header file

Type: improvement

Signed-off-by: Yu Sun <yusun2@cisco.com>
Change-Id: I68aea7c5776c5b31081c98388df4133d2062218a

4 years agotap: add initial support for tun 21/24821/7
Mohsin Kazmi [Mon, 6 Apr 2020 12:19:54 +0000 (14:19 +0200)]
tap: add initial support for tun

Type: feature

Change-Id: I699a01ac925fe5c475a36032edb7018618bb4dd4
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
4 years agofib: fix use-after-free 38/26538/2
Benoît Ganne [Thu, 16 Apr 2020 10:38:48 +0000 (12:38 +0200)]
fib: fix use-after-free

Type: fix

Change-Id: Ie7081d977dd0d3e7d09bc0d1b4d53863288e443b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agoipsec: fix use-after-free 40/26540/2
Benoît Ganne [Thu, 16 Apr 2020 10:40:04 +0000 (12:40 +0200)]
ipsec: fix use-after-free

Type: fix

Change-Id: I1068ff1d03883addb5fe1005a8b608eab17e4168
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agobier: fix vector size confusing ASan 42/26542/2
Benoît Ganne [Thu, 16 Apr 2020 10:40:54 +0000 (12:40 +0200)]
bier: fix vector size confusing ASan

The vector is initialized to 1024 entries which is guaranteed to be
enough, but as its size can shrink between calls, make sure ASan is
aware of the expected size before using it.

Type: fix

Change-Id: I4bcc39867a886b3cb463854d2cda0b32155650e9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agoigmp: fix igmp proxy group merge 43/26543/2
Benoît Ganne [Thu, 16 Apr 2020 10:47:47 +0000 (12:47 +0200)]
igmp: fix igmp proxy group merge

When merging proxy groups in igmp_proxy_device_merge_group(), the call
to igmp_proxy_device_merge_src() can end up removing the current proxy
group via igmp_group_clear(). When that happens, it must returns NULL so
that igmp_proxy_device_merge_config() does not send a IGMPv3 report for
a dead proxy group.
Make igmp_group_clear() reset the group pointer to NULL to fix this bug
and to detect similar bugs more easily.

Type: fix

Change-Id: I229e55b5bfa71734d7844893f5209a66fa3cc8ae
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agoudp: fix buffer trace 45/26545/2
Andreas Schultz [Thu, 16 Apr 2020 14:18:57 +0000 (16:18 +0200)]
udp: fix buffer trace

Type: fix

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

4 years agonat: scavenging functionality removed 82/26382/3
Filip Varga [Mon, 6 Apr 2020 10:52:33 +0000 (12:52 +0200)]
nat: scavenging functionality removed

Type: refactor

Change-Id: I9f743ba2818e1b1c5004c3575925cc7b479948d8
Signed-off-by: Filip Varga <fivarga@cisco.com>
4 years agovppinfra: don't use memcmp to compare keys in cuckoo 33/26533/3
Damjan Marion [Wed, 15 Apr 2020 18:37:54 +0000 (20:37 +0200)]
vppinfra: don't use memcmp to compare keys in cuckoo

Type: improvement
Change-Id: I7e11bf72be5fad5967724c038eb649a261294ca0
Signed-off-by: Damjan Marion <damarion@cisco.com>
4 years agovppinfra: delay bucket2 calc in cuckoo search 31/26531/3
Damjan Marion [Wed, 15 Apr 2020 17:44:17 +0000 (19:44 +0200)]
vppinfra: delay bucket2 calc in cuckoo search

There is no need to calculate bucket2 if there is hit on bucket1

Type: improvement
Change-Id: Id01c37963497668c0160068501294568a181d011
Signed-off-by: Damjan Marion <damarion@cisco.com>
4 years agovppinfra: add clib_cuckoo_search_inline_with_hash function 28/26528/4
Damjan Marion [Wed, 15 Apr 2020 15:45:23 +0000 (17:45 +0200)]
vppinfra: add clib_cuckoo_search_inline_with_hash function

Type: improvement
Change-Id: I547263ae954506f11101666ff768524fbfdb579e
Signed-off-by: Damjan Marion <damarion@cisco.com>
4 years agopg: set vnet buffer flags in pg streams 25/26525/3
Dave Barach [Wed, 15 Apr 2020 13:34:43 +0000 (09:34 -0400)]
pg: set vnet buffer flags in pg streams

See .../extras/pg/checksum_offload.pg for a nontrivial example, which
deliberately sets bogus ip and udp checksums in the generated packets,
then fixes the mess with (software emulated) hardware checksum
offload.

Validated via "pcap dispatch trace on max 1000 buffer-trace pg-input 100".
Packets stuffed into loop1-output have the configured bogus ip and udp
checksums. vnet_calc_checksums_inline(...) fixes the checksums, which
are correct when packets visit loop1-tx.

The packet generator is a dumb robot in this regard. If you ask for a
ridiculous flag combination - example: ip4 and ip6 - your mileage may
vary.

Type: feature

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

4 years agovppinfra: install missing cuckoo hash header files 27/26527/3
Damjan Marion [Wed, 15 Apr 2020 15:44:27 +0000 (17:44 +0200)]
vppinfra: install missing cuckoo hash header files

Type: improvement
Change-Id: Ifb4eec00fd4f1d19e4b0af802d015a35e402e0af
Signed-off-by: Damjan Marion <damarion@cisco.com>
4 years agosession: detach session from app on cleanup 13/26513/3
Florin Coras [Tue, 14 Apr 2020 23:52:12 +0000 (23:52 +0000)]
session: detach session from app on cleanup

Type: fix

Avoids unwanted notifications.

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

4 years agourpf: Allow locally generated packets on TX 20/26520/3
Neale Ranns [Wed, 15 Apr 2020 11:53:36 +0000 (11:53 +0000)]
urpf: Allow locally generated packets on TX

Type: fix

Change-Id: I87d301aec20b9f5b34997b394493c796188fce14
Signed-off-by: Neale Ranns <nranns@cisco.com>
4 years agotcp: allow local port sharing if 5-tuple available 73/26473/4
Florin Coras [Fri, 10 Apr 2020 14:51:46 +0000 (14:51 +0000)]
tcp: allow local port sharing if 5-tuple available

Type: improvement

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

4 years agomisc: refactor calc_checksums 81/26481/5
Dave Barach [Sun, 12 Apr 2020 12:31:39 +0000 (08:31 -0400)]
misc: refactor calc_checksums

Merge two mildly incompatible static inlines, and rename the results
vnet_calc_checksums_inline (...).

The resulting inline has three additional parameters: int is_ip4, int
is_ip6, and int with_gso. All calls manage to pass one or more as
compile-time constants, which causes a certain amount of code to
disappear in each instantiation.

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

4 years agovat: fix socket connection 05/26505/4
Dave Barach [Tue, 14 Apr 2020 13:52:26 +0000 (09:52 -0400)]
vat: fix socket connection

vat_socket_connect(...) needs to set the api main client index. The M2
helper macro needed to allocate a buffer of size sizeof(*mp) + n, not
sizeof(*mp).

Type: fix

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

4 years agosession: avoid all session cleanup on unlisten 89/26489/3
Florin Coras [Mon, 13 Apr 2020 23:35:55 +0000 (23:35 +0000)]
session: avoid all session cleanup on unlisten

Type: improvement

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

4 years agourpf: Unicast reverse Path Forwarding (plugin) 22/26322/7
Neale Ranns [Thu, 2 Apr 2020 15:02:16 +0000 (15:02 +0000)]
urpf: Unicast reverse Path Forwarding (plugin)

Type: feature

 - move the IP4 code to plugin
 - add ip6 support
 - add suport for uRPF on TX
 - add tests

Change-Id: I074c2debc486d3e79c12fad4b8dbd72c41e841a0
Signed-off-by: Neale Ranns <nranns@cisco.com>
4 years agoipsec: validate number of input sas 79/26479/2
Matthew Smith [Sat, 11 Apr 2020 01:27:33 +0000 (20:27 -0500)]
ipsec: validate number of input sas

Type: fix

There is a statically allocated array for inbound SAs which can hold
4 IDs. The input parameter containing the IDs of th inbound SAs is a
vector and Its possible to pass a vector with more than 4 elements
and write the memory past the end of the array. Fail if more than 4
SAs are passed in the vector.

Change-Id: I0c9d321c902d6366b8aff816d04e343dcbd110eb
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
4 years agosession: remove ho with fifos support 85/26485/2
Florin Coras [Mon, 13 Apr 2020 16:48:04 +0000 (16:48 +0000)]
session: remove ho with fifos support

Type: refactor

UDPC (removed) was the only consumer.

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

4 years agobuffers: configurable buffer fault injector 61/26461/3
Dave Barach [Thu, 9 Apr 2020 21:24:07 +0000 (17:24 -0400)]
buffers: configurable buffer fault injector

When configured at compile time via the cmake
VPP_BUFFER_FAULT_INJECTOR option, the buffer allocator will appear to
fail a certain fraction of the time.

By default, the allocator succeeds 80% of the time. Detailed command
line configuration options are available, but only when the image has
been compiled with cmake option described above:

    vlib { buffer-alloc-success-rate [0.0 ... 1.0]
           buffer-alloc-success-seed <nnnn> }

Modify vlib_buffer_pool_create(...) so 0 is always an invalid buffer
index.

Debug images: add checks for bad buffer index enqueues, and also
verify that f->n_vectors doesn't accidentally map one or more
instances of the frame poison pattern 0xfefefefe.

Type: improvement

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

4 years agodhcp: fix unicast pkts, clean up state machine 78/26478/2
Dave Barach [Thu, 9 Apr 2020 22:34:29 +0000 (18:34 -0400)]
dhcp: fix unicast pkts, clean up state machine

Send dhcp unicast packets to ip4-lookup. Otherwise, these packets
won't reach a dhcp server on a different subnet.

Do an immediate client scan after processing wakeup events.

Calculate the next process wakeup time by scanning all
clients.

Increase maximum (idle, no-clients-configured) timeout to 1000
seconds.

Reduce log spew.

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

4 years agosession: cleanup debug code 82/26482/6
Florin Coras [Mon, 13 Apr 2020 01:20:25 +0000 (01:20 +0000)]
session: cleanup debug code

Type: refactor

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

4 years agosession: adding debug events 95/26395/8
Srikanth Akula [Tue, 7 Apr 2020 02:19:49 +0000 (19:19 -0700)]
session: adding debug events

Type: feature

Enhancing the debugging capability of tcp session layer by measing time spent for various events.
This is meant only for debugging purpose

Signed-off-by: Srikanth Akula <srakula@cisco.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9f401881b345bcae5f7d8050338637fd47b3723b
Signed-off-by: Srikanth Akula <srakula@cisco.com>
4 years agotls: make ctx_write function return the length of enqueue 76/26476/3
Simon Zhang [Sat, 11 Apr 2020 11:09:03 +0000 (19:09 +0800)]
tls: make ctx_write function return the length of enqueue

Type: fix

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

4 years agofib: fix accessing empty dpo pool elements 65/26465/5
ShivaShankarK [Fri, 10 Apr 2020 12:50:02 +0000 (18:20 +0530)]
fib: fix accessing empty dpo pool elements

Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: Iee88a2101ce42d7f1cdb65df532c349d14829e4c

4 years agoudp: remove connected udp transport proto 75/26475/1
Florin Coras [Fri, 10 Apr 2020 19:52:04 +0000 (19:52 +0000)]
udp: remove connected udp transport proto

Type: refactor

To reproduce functionality, use udp in combination with
TRANSPORT_CFG_F_CONNECTED transport flag set in connect and listen
parameters.

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

4 years agoquic: fix clean stream close 34/26434/5
Aloys Augustin [Wed, 8 Apr 2020 20:15:25 +0000 (22:15 +0200)]
quic: fix clean stream close

Properly close the stream sending side instead of resetting the entire
stream.

Change-Id: I2daca7e507daa7bf9cd6a27fa8828a9ea7d175f9
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
4 years agoudp: fix local node no port error counter 63/26463/3
Florin Coras [Fri, 10 Apr 2020 02:01:51 +0000 (02:01 +0000)]
udp: fix local node no port error counter

Type: fix

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

4 years agovirtio: fix gso and csum offload errors handling 45/26145/4
Mohsin Kazmi [Thu, 9 Apr 2020 20:11:29 +0000 (22:11 +0200)]
virtio: fix gso and csum offload errors handling

GSO and CSUM offloaded packets are transmitted
even itf doesn't support GSO/CSUM. This patch
fixes it by logging the respective errors and
dropping the packets.

Type: fix

Change-Id: I5ab19d15ce6aa9fda515313c313a5a56c0b96837
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
4 years agogeneve: Fix the byte swapping for the VNI 36/26336/5
Neale Ranns [Fri, 3 Apr 2020 07:46:28 +0000 (07:46 +0000)]
geneve: Fix the byte swapping for the VNI

Type: fix

- swipe away the vomit indent left last time.
- add tests for VNIs > 16bit

Change-Id: I2d1f591bfb9d7a18996c38969365a509168d4193
Signed-off-by: Neale Ranns <nranns@cisco.com>
4 years agofib: fix adjacency cli command issue 57/26457/4
ShivaShankarK [Thu, 9 Apr 2020 15:45:58 +0000 (21:15 +0530)]
fib: fix adjacency cli command issue

Type: fix

Signed-off-by: ShivaShankarK <shivaashankar1204@gmail.com>
Change-Id: I193023705003e664c50487fdfaa42b813604a078

4 years agosession: fix leak on accept fifo alloc failure 59/26459/3
Florin Coras [Thu, 9 Apr 2020 20:59:20 +0000 (20:59 +0000)]
session: fix leak on accept fifo alloc failure

Type: fix

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

4 years agotcp: avoid regrabing error node in input and output 60/26460/2
Florin Coras [Thu, 9 Apr 2020 21:23:01 +0000 (21:23 +0000)]
tcp: avoid regrabing error node in input and output

Type: improvement

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

4 years agotls: adopt picotls engine to new session scheduling mechanism 37/26437/5
Simon Zhang [Thu, 9 Apr 2020 08:35:04 +0000 (16:35 +0800)]
tls: adopt picotls engine to new session scheduling mechanism

Type: fix

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

4 years agosession: update fifo slice on session migration 35/26435/9
Florin Coras [Thu, 9 Apr 2020 01:49:45 +0000 (01:49 +0000)]
session: update fifo slice on session migration

Type: fix

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

4 years agodocs: Fix the Use Cases Index 58/26458/1
John DeNisco [Thu, 9 Apr 2020 18:23:13 +0000 (14:23 -0400)]
docs: Fix the Use Cases Index

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

4 years agovom: Fixes for g++-9 54/26454/3
neale ranns [Thu, 9 Apr 2020 13:03:45 +0000 (13:03 +0000)]
vom: Fixes for g++-9

Type: improvement

Signed-off-by: neale ranns <nranns@cisco.com>
Change-Id: I356251b750fcab05ff91e0295e96a8451e8b2f88

4 years agomisc: add a nerd knob to skip a sysctl during the .deb installation 47/26447/2
Andrew Yourtchenko [Thu, 9 Apr 2020 12:10:29 +0000 (12:10 +0000)]
misc: add a nerd knob to skip a sysctl during the .deb installation

In some cases, e.g. in the container installs, it's beneficial to skip
the sysctl portion of the installation.

This commit allows to do that by setting the environment variable
VPP_INSTALL_SKIP_SYSCTL.

Change-Id: If88468c5c45bf122e927f09e08560e25b73bf1f9
Type: feature
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
4 years agoudp: fix coverity warning 55/26455/2
Florin Coras [Thu, 9 Apr 2020 14:20:52 +0000 (14:20 +0000)]
udp: fix coverity warning

Type: fix

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

4 years agobfd: always start timers with non-zero tick counts 24/26424/2
Dave Barach [Wed, 8 Apr 2020 12:45:27 +0000 (08:45 -0400)]
bfd: always start timers with non-zero tick counts

Otherwise the tw_timer_template code ASSERTs...

Type: fix

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

4 years agosvm: use active fifo count in fifo test 36/26436/4
Florin Coras [Thu, 9 Apr 2020 04:46:14 +0000 (04:46 +0000)]
svm: use active fifo count in fifo test

Type: improvement

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

4 years agompls: fix typo in error path 29/26429/2
Dave Barach [Wed, 8 Apr 2020 14:19:29 +0000 (10:19 -0400)]
mpls: fix typo in error path

if ip4_frag_do_fragment(...) returns an error due to buffer allocation
failure, we end up trying to increment a nonexistent counter, which
causes an ASSERT failure.

The second argument to vlib_error_count is a node index, not a
next index...

Type: fix

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

4 years agomisc: fix error handling in punt_replicate 33/26433/2
Dave Barach [Wed, 8 Apr 2020 18:31:45 +0000 (14:31 -0400)]
misc: fix error handling in punt_replicate

If vlib_buffer_clone (...) fails due to a buffer allocation error, update
*n_dispatched with the actual number of clones, not the requested
number of clones.

Punt_replicate(...) should not set *to_next[0] = bi0. The original
buffer is enqueued separately in punt_dispatch_node(...)

Type: fix

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

4 years agoudp: cleanup input node 16/26416/11
Florin Coras [Wed, 8 Apr 2020 01:55:39 +0000 (01:55 +0000)]
udp: cleanup input node

Type: refactor

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

4 years agoping: fix buffer allocator error handling 31/26431/2
Dave Barach [Wed, 8 Apr 2020 16:03:32 +0000 (12:03 -0400)]
ping: fix buffer allocator error handling

The code sets f->n_vectors = n_to_send, but it can bail out of the
loop if vlib_buffer_copy(...) returns 0.

Need to fix f->n_vectors in the error return path, or we enqueue some
number of 0xfefefefe buffer indices in a debug image or worse in a
production image.

Type: fix

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

4 years agomisc: check return values from vlib_buffer_copy(...) 22/26422/2
Dave Barach [Wed, 8 Apr 2020 12:14:57 +0000 (08:14 -0400)]
misc: check return values from vlib_buffer_copy(...)

vlib_buffer_copy(...) returns NULL if the system is temporarily out of
buffers.

This is NOT correct. Please don't be this person:

   c0 = vlib_buffer_copy (vm, p0);
   ci0 = vlib_get_buffer_index (vm, c0);

Type: fix

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

4 years agogbp: More reliable unit-tests 01/26401/3
Neale Ranns [Tue, 7 Apr 2020 08:44:20 +0000 (08:44 +0000)]
gbp: More reliable unit-tests

Type: fix

the GBP unit tests would peridocially fail. The reason being that there
is dynamic state whose presence nneds to be created, tested and then
timeed out. The failures occurded when the timeout occured before the
state could be tested. the previous timeout was 2 seconds, this has been
doubled, as a result i saw no faliures running continuously for ~16
hours.
bumping the timer increasing the test run time from ~40 to ~53 seconds,
a small price to pay.

in test cases where the state is not timed out i bumped the timer to 60
seconds.

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