vpp.git
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

4 years agonat: use correct data types for memory sizes 56/26256/8
Klement Sekera [Tue, 31 Mar 2020 07:48:02 +0000 (09:48 +0200)]
nat: use correct data types for memory sizes

Type: fix

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

4 years agovirtio: fix the tcp/udp checksum offloads 06/26406/2
Mohsin Kazmi [Tue, 7 Apr 2020 14:42:57 +0000 (16:42 +0200)]
virtio: fix the tcp/udp checksum offloads

Some vhost-backend calculates the wrong checksum in
case of tcp/udp offload when driver resets tcp/udp
checksum field to '0'.

Type: fix

Change-Id: I1d2a9b95b3d5cc1decac38027104a04df2af4680
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
4 years agoip: do not clear the locally-originated flag 28/26428/1
Neale Ranns [Wed, 8 Apr 2020 12:28:06 +0000 (08:28 -0400)]
ip: do not clear the locally-originated flag

Type: fix

 - doing so in MTU dec, means mtu_inc is broken
 - there's no need to. if a packet encounters ipX-rewrite a second time then it went through a tunnel the first time and is still locally originated.

Change-Id: I0f279c2837b608c1677485fe93f63398ab2737b3
Signed-off-by: Neale Ranns <nranns@cisco.com>
4 years agoacl: fix unresolved symbol for format_fib_prefix in vat plugin 75/26375/4
Neale Ranns [Mon, 6 Apr 2020 07:37:47 +0000 (07:37 +0000)]
acl: fix unresolved symbol for format_fib_prefix in vat plugin

Type: fix

Change-Id: I5bf8d6043a49985b9241df8ff24774892678b557
Signed-off-by: Neale Ranns <nranns@cisco.com>
4 years agonat: ED: global session LRU list 79/26379/8
Klement Sekera [Sun, 5 Apr 2020 08:22:47 +0000 (10:22 +0200)]
nat: ED: global session LRU list

Maintain a global session LRU allowing reuse of expired session instead
of relying on a scavenging mechanism to periodically walk sessions.
Whenever a new session is being allocated in slow path, also attempt to
free an expired session from global LRU list.

Type: improvement

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

4 years agonat: preallocate pools 78/26378/5
Klement Sekera [Wed, 1 Apr 2020 18:58:15 +0000 (20:58 +0200)]
nat: preallocate pools

Type: improvement

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

4 years agosr: Fix the coverity issue 11/26411/2
Tetsuya Murakami [Tue, 7 Apr 2020 20:59:26 +0000 (13:59 -0700)]
sr: Fix the coverity issue

Fix the coverity issue on srv/vnet/srv6/sr_localsid.c

Type: fix

Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
Change-Id: I4aeef31cfd67cc1801ab57b94bf4f5ff3d13fd49

4 years agosession: alloc exact number of bufs for multi-seg deqs 55/26255/6
Simon Zhang [Tue, 31 Mar 2020 12:56:22 +0000 (20:56 +0800)]
session: alloc exact number of bufs for multi-seg deqs

Type: refactor

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I11cf806e22158e021a9a405eb4487a9ed6fdbccf

4 years agosession: add more session errors 13/26413/3
Florin Coras [Tue, 7 Apr 2020 22:31:06 +0000 (22:31 +0000)]
session: add more session errors

Type: improvement

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

4 years agol2: handle complete clone fail in l2_flood 07/26407/5
Dave Barach [Tue, 7 Apr 2020 14:52:43 +0000 (10:52 -0400)]
l2: handle complete clone fail in l2_flood

vlib_buffer_clone(...) may not manage to produce any buffer clones at
all.

vlib_buffer_clone_256 should not smash the original buffer reference
count if no clones are produced.

Type: fix

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

4 years agonat: ED: port re-use algorithm 53/25353/27
Klement Sekera [Thu, 20 Feb 2020 11:40:50 +0000 (11:40 +0000)]
nat: ED: port re-use algorithm

Type: fix

Change-Id: I11440c855eb35d2a6095dfe135e4ab5090f11ff3
Signed-off-by: Klement Sekera <ksekera@cisco.com>
4 years agovat: fix vat strncpy stringop-overflow 08/26408/5
Ray Kinsella [Tue, 7 Apr 2020 15:35:22 +0000 (16:35 +0100)]
vat: fix vat strncpy stringop-overflow

Fix GCC 9.0 barf on vat strncpy.

Type: fix

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I5e41225d6ac9673a9d953046720df55e7b69c479
Signed-off-by: Dave Barach <dave@barachs.net>
4 years agonat: don't drop packet for expired session 62/26362/7
Klement Sekera [Sun, 5 Apr 2020 15:07:32 +0000 (17:07 +0200)]
nat: don't drop packet for expired session

If session is expired, the packet which we just received might be a one,
which legitimely creates a new session, process it in slow path instead
to decide the outcome.

Type: fix

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

4 years agoudp: move cli to separate file 10/26410/3
Florin Coras [Tue, 7 Apr 2020 17:30:13 +0000 (17:30 +0000)]
udp: move cli to separate file

Type: refactor

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

4 years agotests: pin sphinx and sphinx-rtd-theme 05/26405/2
Aloys Augustin [Tue, 7 Apr 2020 13:43:33 +0000 (15:43 +0200)]
tests: pin sphinx and sphinx-rtd-theme

Add these two packages to requirements.txt so that their version and
the version of their dependencies are pinned to limit the risk of
unexpected breakage.

Change-Id: If330404f2e840af3d2628f997ce406cd14e7e128
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
4 years agotcp: fix conf mtu parsing 97/26397/2
Florin Coras [Tue, 7 Apr 2020 04:14:45 +0000 (04:14 +0000)]
tcp: fix conf mtu parsing

Type: fix

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

4 years agoudp session: allow dgram ip fragmentation 96/26396/3
Florin Coras [Tue, 7 Apr 2020 03:46:07 +0000 (03:46 +0000)]
udp session: allow dgram ip fragmentation

Type: improvement

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

4 years agoudp session: jumbo frames and configurable mtu 93/26393/6
Florin Coras [Mon, 6 Apr 2020 21:28:59 +0000 (21:28 +0000)]
udp session: jumbo frames and configurable mtu

Type: improvement

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

4 years agoikev2: make liveness params configurable 64/26264/6
Filip Tehlar [Tue, 31 Mar 2020 05:59:41 +0000 (05:59 +0000)]
ikev2: make liveness params configurable

Introduce new cli for setting liveness check period and max retries for
a peer to consider its partner dead.

  ikev2 set liveness <period-in-seconds> <max-retires>

Type: improvement

Change-Id: Iadae1de245d34fe3ee85e09b570f9df8c401772b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
4 years agosr: fix byte-order in steering API 90/26390/3
Ignas Bacius [Mon, 6 Apr 2020 13:31:27 +0000 (16:31 +0300)]
sr: fix byte-order in steering API

Type: fix
Change-Id: Ib25e5324e4ba360cd91b92abc78c994f86148148
Signed-off-by: Ignas Bacius <ignas@noia.network>
4 years agosr: Support uSID function. 91/26091/14
Tetsuya Murakami [Mon, 23 Mar 2020 23:10:28 +0000 (16:10 -0700)]
sr: Support uSID function.

1. Add uSID function in VNET SRv6
2. Add test case for uSID

Type: feature

Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
Change-Id: I354fc687192ed713ceb81fccc9f7b69b6777f6f6
Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
4 years agovat: fix static analysis warning 89/26389/3
Dave Barach [Mon, 6 Apr 2020 14:19:18 +0000 (10:19 -0400)]
vat: fix static analysis warning

Type: fix
Ticket: VPP-1837

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

4 years agovcl session: enforce full dgram reads/writes 63/26363/13
Florin Coras [Sun, 5 Apr 2020 19:25:44 +0000 (19:25 +0000)]
vcl session: enforce full dgram reads/writes

Type: improvement

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

4 years agosession udp: shared local endpoints 61/26361/9
Florin Coras [Sat, 4 Apr 2020 22:45:34 +0000 (22:45 +0000)]
session udp: shared local endpoints

Type: improvement

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

4 years agodocs: pin down sphinx to avoid crash with Sphinx 3.0.0 88/26388/2
Andrew Yourtchenko [Mon, 6 Apr 2020 13:36:50 +0000 (13:36 +0000)]
docs: pin down sphinx to avoid crash with Sphinx 3.0.0

The vpp-make-test-docs-verify jobs started to fail. The last successful run of it shows:

reating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/vpp_vxlan_gbp_tunnel.rst.
Creating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/vpp_vxlan_tunnel.rst.
Creating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/vrf.rst.
Creating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/modules.rst.
sphinx-build -b html -d /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/.sphinx-cache  /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api -c /w/workspace/vpp-make-test-docs-verify-master/test/doc /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/html
Running Sphinx v2.4.4
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 161 source files that are out of date
updating environment: [new config] 161 added, 0 changed, 0 removed
reading sources... [  0%] bfd
reading sources... [  1%] debug
reading sources... [  1%] debug_internal
reading sources... [  2%] discover_tests

The failing jobs show:

Creating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/vpp_vxlan_tunnel.rst.
Creating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/vrf.rst.
Creating file /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api/modules.rst.
sphinx-build -b html -d /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/.sphinx-cache  /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/api -c /w/workspace/vpp-make-test-docs-verify-master/test/doc /w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc/html
Running Sphinx v3.0.0
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 161 source files that are out of date
updating environment: [new config] 161 added, 0 changed, 0 removed
reading sources... [  0%] bfd

Exception occurred:
  File "/usr/lib/python3.6/inspect.py", line 516, in unwrap
    raise ValueError('wrapper loop when unwrapping {!r}'.format(f))
ValueError: wrapper loop when unwrapping scapy.fields.BitEnumField
The full traceback has been saved in /tmp/sphinx-err-n84dadfq.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
Makefile:39: recipe for target 'html' failed
make[2]: *** [html] Error 2
make[2]: Leaving directory '/w/workspace/vpp-make-test-docs-verify-master/test/doc'
Makefile:274: recipe for target '/w/workspace/vpp-make-test-docs-verify-master/build-root/build-test/doc' failed

Type: fix

Change-Id: Id98c0f94104e455ea819aacec62f605e53db13ce
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
4 years agobonding: Add GSO support 86/24686/3
Steven Luong [Mon, 6 Jan 2020 23:14:46 +0000 (15:14 -0800)]
bonding: Add GSO support

Add GSO support, configurable from the CLI.

Type: feature
Ticket: VPP-1820

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I65885a071b24c74437e6cfe5eff237b01bc1744b
(cherry picked from commit a06f68556e506a6ff7f31a617a036614c84f71c0)

4 years agomisc: fix python sonarcloud BLOCKER level issues 53/26353/3
Paul Vinciguerra [Fri, 3 Apr 2020 16:18:40 +0000 (12:18 -0400)]
misc:  fix python sonarcloud BLOCKER level issues

  Fix of the top 11 python issues flagged as BLOCKER.

Ticket: VPP-1856
Type: fix

Change-Id: Icf4691e62f4a69d6ee196b6d6e2ab52d961b5c76
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoikev2: fix wrong index computation 75/26275/2
Filip Tehlar [Tue, 31 Mar 2020 17:54:49 +0000 (17:54 +0000)]
ikev2: fix wrong index computation

Type: fix

Change-Id: Ia7b07b4ec9e5681946f3f5c01c230c1f814e2cf6
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
4 years agoip: reassembly: don't set error if no error 47/26247/3
Klement Sekera [Mon, 30 Mar 2020 14:59:38 +0000 (16:59 +0200)]
ip: reassembly: don't set error if no error

Type: fix

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

4 years agomisc: strcpy be gone 60/26360/1
Dave Barach [Sat, 4 Apr 2020 22:34:41 +0000 (18:34 -0400)]
misc: strcpy be gone

Causes static analysis "vulnerability" warnings

Type: fix
Ticket: VPP-1837

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

4 years agosession tls: support tls descheduling 83/26083/9
Florin Coras [Mon, 23 Mar 2020 15:34:22 +0000 (15:34 +0000)]
session tls: support tls descheduling

Type: improvement

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

4 years agosession tls: improve app transports tx scheduling 85/25485/8
Florin Coras [Thu, 27 Feb 2020 04:32:51 +0000 (04:32 +0000)]
session tls: improve app transports tx scheduling

Type: improvement

- allow apps to request rescheduling of tx events via
SESSION_F_CUSTOM_TX flag
- limit max burst per session custom tx dispatch

In tls
- use the new infra to reschedule tx events
- use max burst bytes as upper limit to number of bytes to be encrypted

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

4 years agomisc: sprintf be gone 57/26357/1
Dave Barach [Sat, 4 Apr 2020 14:05:48 +0000 (10:05 -0400)]
misc: sprintf be gone

Along with related static analysis warnings...

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

4 years agovcl: fix vcl_test.py sonarcloud issue 56/26356/3
Dave Wallace [Fri, 3 Apr 2020 23:48:48 +0000 (19:48 -0400)]
vcl: fix vcl_test.py sonarcloud issue

- Updated comment to indicate the original
  intermittent test failure still occurs when
  running make test with TEST_JOBS > 1.
- The original workaround has been retained
  until the root cause can be determined to
  avoid test failures in the LF CI infra
  with patches containing non-vcl code changes.

Type: test

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

4 years agosession: improve error reporting 95/22895/18
Florin Coras [Mon, 21 Oct 2019 23:07:46 +0000 (16:07 -0700)]
session: improve error reporting

Type: improvement

Change-Id: I9dd850a1ce85b0adb5136233f176117e0ee38817
Signed-off-by: Florin Coras <fcoras@cisco.com>
4 years agomisc: fix sonarcloud html issue 55/26355/2
Dave Wallace [Fri, 3 Apr 2020 17:50:57 +0000 (17:50 +0000)]
misc: fix sonarcloud html issue

Type: fix

Change-Id: I3691c310fa6336bf2c103c42bccd94c27aab4878
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
4 years agosession: init port_proto_type asap 54/26354/2
Florin Coras [Fri, 3 Apr 2020 17:23:42 +0000 (17:23 +0000)]
session: init port_proto_type asap

Type: fix

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

4 years agosession udp: fix transport flags and migration 28/26328/2
Florin Coras [Fri, 3 Apr 2020 00:58:48 +0000 (00:58 +0000)]
session udp: fix transport flags and migration

Type: fix

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

4 years agosession: remove obsolete apis 27/26327/7
Florin Coras [Thu, 2 Apr 2020 23:00:13 +0000 (23:00 +0000)]
session: remove obsolete apis

Type: refactor

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

4 years agodocs: 80-vpp.conf fix transposition error in comments 31/26331/2
Paul Vinciguerra [Fri, 3 Apr 2020 05:30:15 +0000 (01:30 -0400)]
docs: 80-vpp.conf fix transposition error in comments

Type: docs

Change-Id: I0d75c7673d85c5bd8ae10f48e7189ee28a31240e
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoip: remove vl_api_address_family_t byte order swap 77/26277/3
Jakub Grajciar [Wed, 1 Apr 2020 13:42:06 +0000 (15:42 +0200)]
ip: remove vl_api_address_family_t byte order swap

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I8074db3623ee4b37ac70ce8ea0d1912b97e5c059

4 years agodpdk: VM VHOST tests with rxq>1 failing 01/26301/3
Steven Luong [Thu, 2 Apr 2020 04:50:10 +0000 (21:50 -0700)]
dpdk: VM VHOST tests with rxq>1 failing

DPDK recently added a check in the virtio driver to make sure that
rxmode->mq_mode == ETH_MQ_RX_NONE. We were passing ETH_MQ_RX_RSS
and the device initialization was not accepted.

The reason for the change in DPDK was that there is no controls
(algorithm, redirection table, hash function). So they thought ETH_MQ_RX_NONE
was the best choice for the value of mq_mode.

Type: fix
Ticket: VPP-1853

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

4 years agotcp: explicit use of timer wheel in timer apis 99/25999/16
Florin Coras [Wed, 18 Mar 2020 21:26:41 +0000 (21:26 +0000)]
tcp: explicit use of timer wheel in timer apis

Type: refactor

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

4 years agoipsec: provide stat index in sa details 24/26324/2
Matthew Smith [Thu, 2 Apr 2020 12:45:49 +0000 (07:45 -0500)]
ipsec: provide stat index in sa details

Type: improvement

When IPsec SAs are dumped, include the index that can be used to
find byte & packet counters for the SA in the stat segment.

Removed the field total_data_size from the details since it was not
being populated and put the stat index field in its place.

Change-Id: If73efc230542a11944551b6e710b57b575450da3
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
4 years agomisc: fix static analysis warnings 21/26321/3
Dave Barach [Thu, 2 Apr 2020 14:44:09 +0000 (10:44 -0400)]
misc: fix static analysis warnings

One actual bugfix.

Type: fix
Ticket: VPP-1837

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

4 years agotcp: move features to separate files 98/25998/16
Florin Coras [Wed, 18 Mar 2020 20:31:34 +0000 (20:31 +0000)]
tcp: move features to separate files

Type: refactor

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

4 years agodocs: Fix venv under python3 09/25809/5
Paul Vinciguerra [Wed, 11 Mar 2020 17:28:27 +0000 (13:28 -0400)]
docs: Fix venv under python3

See ticket for output under containers for each distro.

Ticket: VPP-1851
Type: docs

Change-Id: I0d80dabeb30d92d09edffa503b05d5eef08313dc
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoudp session vcl: add udp iperf test 95/26295/8
Florin Coras [Wed, 1 Apr 2020 23:16:11 +0000 (23:16 +0000)]
udp session vcl: add udp iperf test

Type: improvement

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

4 years agotcp: count zero wnd enqueue attempts 55/26155/4
Florin Coras [Thu, 26 Mar 2020 02:45:39 +0000 (02:45 +0000)]
tcp: count zero wnd enqueue attempts

Type: improvement

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

4 years agodocs: add a timebase precision section 94/26294/2
Dave Barach [Wed, 1 Apr 2020 22:04:32 +0000 (18:04 -0400)]
docs: add a timebase precision section

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

4 years agovppinfra: fix vppinfra test code build 93/26293/2
Dave Barach [Wed, 1 Apr 2020 20:54:00 +0000 (16:54 -0400)]
vppinfra: fix vppinfra test code build

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