vpp.git
4 years agointerface: fix interface_types.api enums 63/26763/2
Paul Vinciguerra [Tue, 28 Apr 2020 21:32:23 +0000 (17:32 -0400)]
interface: fix interface_types.api enums

Unspecified c enums start at 0.
Unspecified api enums start at 1.

Type: fix

Change-Id: I431c11302c0ad897a968134ce90496af3db7bb86
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agoflow: explicit rss function enum cast 69/26769/2
Florin Coras [Wed, 29 Apr 2020 04:11:04 +0000 (04:11 +0000)]
flow: explicit rss function enum cast

Type: fix

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

4 years agovlib: add ASSERT to vlib_time_now(...) 64/26764/2
Dave Barach [Tue, 28 Apr 2020 22:00:21 +0000 (18:00 -0400)]
vlib: add ASSERT to vlib_time_now(...)

Calling vlib_time_now (&vlib_global_main) from a worker thread is a bad
mistake. ASSERT (vm->thread_index == __os_thread_index) will catch it.

Type: improvement

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

4 years agosvm: fix fifo alignemnt in batch prealloc 62/26762/3
Florin Coras [Tue, 28 Apr 2020 20:40:57 +0000 (20:40 +0000)]
svm: fix fifo alignemnt in batch prealloc

Type: fix

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

4 years agovlib: use flexible array in vlib_buffer for GCC-10 89/26689/2
Benoît Ganne [Fri, 24 Apr 2020 09:48:04 +0000 (11:48 +0200)]
vlib: use flexible array in vlib_buffer for GCC-10

GCC-10 increase overflows-related warnings but gets confused by 0-length
arrays. Use C99 flexible length array instead.

Type: fix

Change-Id: Ie62cfa8faaa408479a598785fd3f06ffd0233c7a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agogomemif: introduce gomemif 02/26302/15
Jakub Grajciar [Thu, 2 Apr 2020 08:02:17 +0000 (10:02 +0200)]
gomemif: introduce gomemif

golang native memif driver

Type: feature

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I693156a44011c80025245d25134f5bf5db6eba82
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
4 years agovppinfra: type prove vec_new and vec_resize 15/26315/4
Andreas Schultz [Thu, 26 Mar 2020 14:18:52 +0000 (14:18 +0000)]
vppinfra: type prove vec_new and vec_resize

Some vector functions (e.g. vec_new) pass the vector pointer through
vec_resize. This turn the pointer from a real type into a void pointer.
Explicitly cast the pointer back to its original type to catch type
mismatches.

Type: improvement

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

4 years agoflow: add RSS support 21/25721/2
Chenmin Sun [Fri, 28 Feb 2020 14:49:37 +0000 (22:49 +0800)]
flow: add RSS support

This patch enables the RSS configuration through vnet/flow interface
With this RSS feature, users can config the RSS functions for specific flows

Currently, it supports:
  default, toeplitz and symmetric_toeplitz rss function, and
  ipv4-tcp/ipv4-udp/ipv6-tcp/ipv6-ucp flow types

Users can use the following options to combine with above flow
types for more specific hash input set selection:
  l3-src-only, l3-dst-only, l4-src-only, l4-dst-only

Command line:
test flow add dst-ip any proto udp rss function default rss types ipv4-tcp use l3-dst-only
test flow add dst-ip any proto udp rss function toeplitz rss types ipv4-udp use l4-src-only
test flow add dst-ip any proto udp rss function symmetric_toeplitz rss types ipv6-udp use l3-src-only and l3-dst-only

Type: feature

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

4 years agotap: use one tap fd per rx queue 23/25923/14
Aloys Augustin [Mon, 16 Mar 2020 16:29:52 +0000 (17:29 +0100)]
tap: use one tap fd per rx queue

This matches vhost queues to linux netdev queues and avoids random
packet shuffling across vhost queues on rx.

Change-Id: I9901689d361e440fb0b91c9fbaf8124ce525b316
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
4 years agoipsec: fix buffer alloc 17/26417/3
Filip Tehlar [Fri, 3 Apr 2020 12:14:29 +0000 (12:14 +0000)]
ipsec: fix buffer alloc

Type: fix

Change-Id: I0f12c19b79df19b692f18ac13d6c32341853b764
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
4 years agonat: remove unused code 34/26734/2
Klement Sekera [Tue, 28 Apr 2020 09:22:29 +0000 (09:22 +0000)]
nat: remove unused code

Type: refactor

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

4 years agovppinfra: improve test coverage 29/26729/4
Dave Barach [Mon, 27 Apr 2020 22:38:36 +0000 (18:38 -0400)]
vppinfra: improve test coverage

Bonus corner-case bugfix in bitmap.h, found during the exercise.
Issue dates from 2001 or thereabouts. Please review this specific
change carefully.

lcov_post: filter system include directories and generated files in
build-root

Type: improvement

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

4 years agodocs: add missing spelling dictionary 21/24121/3
Paul Vinciguerra [Tue, 24 Dec 2019 04:07:13 +0000 (23:07 -0500)]
docs: add missing spelling dictionary

Type: docs

Change-Id: I334312f8bfe2000d4613908c2a0ba7e6a39d3825
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agotests: fix update_path_flags for multicast in vpp_ip_route 50/26750/2
Paul Vinciguerra [Tue, 28 Apr 2020 15:23:31 +0000 (11:23 -0400)]
tests: fix update_path_flags for multicast in vpp_ip_route

  add support for the case where the first path doesn't
  match the searched interface.

Type: test

Change-Id: I29bd724cfe275ec5489d32c37ef2af12d6d1102a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agotests: implement ipaddress convenience methods 32/26732/4
Paul Vinciguerra [Tue, 28 Apr 2020 04:27:38 +0000 (00:27 -0400)]
tests: implement ipaddress convenience methods

  Add vpp specific properties to ip addresses for use in the api.
  .vapi_af  -- returns [ADDRESS_IP4, ADDRESS_IP6]
  .vapi_af_name -- returns the string ['ip4', 'ip6']

  Update tests to demonstrate usage.

Type: feature

Change-Id: I43447a1522769d99f89debdc714c51700068d771
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agolisp: API cleanup 63/24663/8
Jakub Grajciar [Thu, 30 Jan 2020 12:26:43 +0000 (13:26 +0100)]
lisp: API cleanup

Use consistent API types.

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ib7f73a0b6de188982a09040f7739dc46be3cb1de
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
4 years agovlib: startup multi-arch variant configuration 98/25798/11
Ray Kinsella [Tue, 10 Mar 2020 14:35:32 +0000 (14:35 +0000)]
vlib: startup multi-arch variant configuration

Support for startup node multi-arch variant selection through startup.conf.
This is to facilitate unit, functional testing and benchmarking of non-default
multi-arch variant node code path. Also added parameters to make test, to
specific using multi-arch variants in unit testing.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I94fd332bb629683b7a7dd770ee9f615a9a424060

4 years agostats: add apis to delete simple/combined counters 20/26620/3
Ole Troan [Tue, 21 Apr 2020 15:54:41 +0000 (17:54 +0200)]
stats: add apis to delete simple/combined counters

vlib_free_simple_counter()
vlib_free_combined_counter()

Frees the name and two dimensional vector from the stats segment.

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

4 years agotests: move defaults from defaultmapping to .api files 33/26733/1
Paul Vinciguerra [Tue, 28 Apr 2020 05:12:04 +0000 (01:12 -0400)]
tests: move defaults from defaultmapping to .api files

facilitates use of papi beyond the tests.

Type: improvement

Change-Id: I3d502d9130b81a7fb65ee69bb06fe55802b28a27
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agotcp: remove sack reneging verbose logging 30/26730/4
Florin Coras [Mon, 27 Apr 2020 23:20:41 +0000 (23:20 +0000)]
tcp: remove sack reneging verbose logging

Type: improvement

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

4 years agosvm: null instead of panic if fifo hdr alloc fails 28/26728/4
Florin Coras [Mon, 27 Apr 2020 22:41:39 +0000 (22:41 +0000)]
svm: null instead of panic if fifo hdr alloc fails

Type: fix

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

4 years agotls: fix wrong usage of session close function issue 29/26629/4
Simon Zhang [Wed, 22 Apr 2020 14:58:57 +0000 (22:58 +0800)]
tls: fix wrong usage of session close function issue

Type: fix

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

4 years agovirtio: support virtio 1.1 packed ring in vhost 86/26086/15
Steven Luong [Mon, 23 Mar 2020 16:34:59 +0000 (09:34 -0700)]
virtio: support virtio 1.1 packed ring in vhost

virtio 1.1 defines a number of new features. Packed ring is among the most
notable and important one. It combines used, available, and descripptor rings
into one.

This patch provides experimental support for packed ring. To avoid
regression, when packed ring is configured for the interface, it is branched
to a separate RX and TX driver. Non packed ring should continue to perform
as it was before.

Packed ring is tested using qemu4.2 and ubuntu focal fossa (kernel 5.4.0-12)
on the guess VM which supports packed ring.

To configure VPP with packed ring, just add the optional keyword "packed"
when creating the vhost interface. To bring up the guest VM with packed ring,
add "packed=on" in the qemu launch command.

To facilitate troubleshooting, also added "verbose" option in
show vhost desc CLI to include displaying the indirect descriptors.

Known qemu reconnect issue -
If VPP is restarted, guest VMs also need to be restarted. The problem
is kernel virtio-net-pci keeps track of the previous available and used
indices. For virtio 1.0, these indices are in shared memory and qemu can
easily copy them to pass to the backend for reconnect. For virio 1.1, these
indices are no longer in shared memory. Qemu needs a new mechanism to retrieve
them and it is not currently implemented. So when the protocol reconnects,
qemu does not have the correct available and used indices to pass to the
backend. As a result, after the reconnect, virtio-net-pci is reading the TX
ring from the wrong position in the ring, not the same position which the
backend is writing. Similar problem exists also in the RX.

Type: feature

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

4 years agol2: merge two clib_memcpy_fast into one 57/26657/4
Zhiyong Yang [Thu, 23 Apr 2020 15:21:30 +0000 (15:21 +0000)]
l2: merge two clib_memcpy_fast into one

Merge two memcpy into one by swapping src and dst address in
l2fwd_trace_t.

Type: improvement

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

4 years agovlib: pcap rx/tx/dispatch trace test 19/26719/2
Dave Barach [Mon, 27 Apr 2020 13:11:19 +0000 (09:11 -0400)]
vlib: pcap rx/tx/dispatch trace test

Mainly intended to improve code coverage, but since the test only runs
for 0.3 seconds we might as well run it all the time.

Type: test

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

4 years agovlib: deprecate i2c and cj 21/26721/2
Dave Barach [Mon, 27 Apr 2020 13:59:04 +0000 (09:59 -0400)]
vlib: deprecate i2c and cj

i2c follows its only use case - the original 82599 driver - into
extras/deprecated.

cj is/was an emergency debug tool unused in several years. Move to
extras/deprecated/vlib

Type: refactor

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

4 years agoioam: do not reuse existing vnet symbol 84/26684/2
Benoît Ganne [Fri, 24 Apr 2020 07:20:13 +0000 (09:20 +0200)]
ioam: do not reuse existing vnet symbol

vxlan_gpe_init() is already defined in libvnet. When loading ioam plugin
we end up having 2 different objects using the same symbol.
ASan in GCC-10 started to enforce the One-Definition-Rule and it seems
like good hygiene anyway.

Type: fix

Change-Id: I2ea9af1821bca6482a290742e9a109fc25692f37
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agovppinfra: selectively disable false-positive GCC-10 warnings 87/26687/3
Benoît Ganne [Fri, 24 Apr 2020 08:44:40 +0000 (10:44 +0200)]
vppinfra: selectively disable false-positive GCC-10 warnings

GCC-10 increase overflows-related warnings but is confused by SIMD
operations.

Type: fix

Change-Id: Iafde754c2fbec60e2d0a328f295b1f5c156d8234
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agoip: reassembly: fix one possible use-after-free 01/26701/5
Gao Feng [Sun, 26 Apr 2020 01:57:18 +0000 (09:57 +0800)]
ip: reassembly: fix one possible use-after-free

When use the kv->v.memory_owner_thread_index as the index to get the
reass in pool, maybe this element is freed by the owner thread because
of timeout, too many fragments, and so on.

So we should check if do_handoff with kv->v.memory_owner_thread_index
before get the reass from pool.

Type: fix

Signed-off-by: Gao Feng <davidfgao@tencent.com>
Change-Id: Ie0f1dc368f86d0fd65292ca0c5e1908348015e09

4 years agovppinfra: selectively disable false-positive GCC-10 warnings 88/26688/3
Benoît Ganne [Fri, 24 Apr 2020 09:32:13 +0000 (11:32 +0200)]
vppinfra: selectively disable false-positive GCC-10 warnings

GCC-10 increase overflows-related warnings but failed to infer that
b->n_cached_bytes is always < sizeof(uword).

Type: fix

Change-Id: I956ae609abc9e39d4a932e5801510999d7d27b79
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agobuild: add vppinfra/warnings.h to exported headers list 91/26691/2
Benoît Ganne [Fri, 24 Apr 2020 12:37:10 +0000 (14:37 +0200)]
build: add vppinfra/warnings.h to exported headers list

To allow the use of WARN_ON/OFF macros to selectively disable build
warnings.

Type: fix

Change-Id: Iceb9d28b2b80c373afb51900880c23041be836db
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agordma: tx: interleave prefetches 94/26694/2
Benoît Ganne [Fri, 24 Apr 2020 13:52:24 +0000 (15:52 +0200)]
rdma: tx: interleave prefetches

Type: improvement

Change-Id: Ic2d9b17cf5e524f3ad2a3c5343fe1230aa360e73
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agodevices: allow link state down with netlink 98/26698/2
Matthew Smith [Fri, 24 Apr 2020 18:43:12 +0000 (13:43 -0500)]
devices: allow link state down with netlink

Type: fix

Use the up parameter in vnet_netlink_set_link_state(). It was
ignoring the parameter and always setting IFF_UP on an interface.

Change-Id: I0d44406d982afbdc43bc6b26d0f22c0bdd47abdc
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
4 years agonat: improve perf - long read after short write 03/26603/11
Klement Sekera [Fri, 17 Apr 2020 18:42:28 +0000 (18:42 +0000)]
nat: improve perf - long read after short write

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

4 years agodhcp: fix dhcp proxy behavior for qinq and dot1q subinterfaces 62/26662/5
Stanislav Zaikin [Thu, 23 Apr 2020 12:14:30 +0000 (12:14 +0000)]
dhcp: fix dhcp proxy behavior for qinq and dot1q subinterfaces

Previous behavior worked only when subinterface ID matches with dot1q tag and doesn't work at all in QinQ case.
In this patch I'm checking how subinterface is configured.

Type: fix

Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
Change-Id: I7a662a0442fdc8e68aba5d6f469f3b1139a4bc2d

4 years agotls: improve cli state reporting 96/26696/3
Florin Coras [Fri, 24 Apr 2020 16:59:49 +0000 (16:59 +0000)]
tls: improve cli state reporting

Type: improvement

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

4 years agosession vcl: propagate transport cleanup notifications 00/26700/5
Florin Coras [Fri, 24 Apr 2020 23:00:11 +0000 (23:00 +0000)]
session vcl: propagate transport cleanup notifications

Type: improvement

Can be used to force app to close a connection on which it still waits
for data.

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

4 years agovcl: generate select events on read/write errors 97/26697/3
Florin Coras [Fri, 24 Apr 2020 17:09:25 +0000 (17:09 +0000)]
vcl: generate select events on read/write errors

Type: fix

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

4 years agovppinfra: finish deprecating qsort.c 99/26699/2
Dave Barach [Fri, 24 Apr 2020 20:07:37 +0000 (16:07 -0400)]
vppinfra: finish deprecating qsort.c

Minor change to vec_sort_with_function(...): don't depend on the qsort
implementation to deal with null, zero-long, or 1-long vectors

Type: fix

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

4 years agoacl: ACL creation CLI parsing fix 70/26670/3
Neale Ranns [Thu, 23 Apr 2020 16:01:20 +0000 (16:01 +0000)]
acl: ACL creation CLI parsing fix

Type: fix

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

4 years agonat: ignore user hash in ED NAT 74/26574/11
Klement Sekera [Wed, 15 Apr 2020 13:37:18 +0000 (15:37 +0200)]
nat: ignore user hash in ED NAT

With port overloading, port is no longer a scarce resource and there
is no need to limit connections per internal IP. This saves one hash
insert in slow path.

Type: improvement

Change-Id: I8a7a9713ac855fa99fa1617ec684f757cf6e09ae
Signed-off-by: Klement Sekera <ksekera@cisco.com>
4 years agonat: make usage of vnet_buffer2 transparent 90/26690/3
Klement Sekera [Fri, 24 Apr 2020 12:24:41 +0000 (12:24 +0000)]
nat: make usage of vnet_buffer2 transparent

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

4 years agotests: test vnet_calc_checksums_inline(...) 92/26692/3
Dave Barach [Fri, 24 Apr 2020 13:43:14 +0000 (09:43 -0400)]
tests: test vnet_calc_checksums_inline(...)

Use a hand-crafted packet generator script to inject packets with
deliberately broken ip4 and udp checksums - and the appropriate
checksum offload flags - into src/vnet/interface_output.c
vnet_interface_output_node_inline(...), and make sure that the
resulting checksums are correct.

Use the packet tracer to catch one of the packets. Parse through the
packet trace, and make sure that the checksums have been correctly
computed.

Type: test

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

4 years agonat: ED: reduce number of hash tables used 11/26511/11
Klement Sekera [Thu, 9 Apr 2020 11:31:27 +0000 (13:31 +0200)]
nat: ED: reduce number of hash tables used

Use out2in_ed hash table for port overloading tracking instead of
global table. This reduces number of hash insertions in slowpath.

Type: improvement

Change-Id: Iad4e897d52033beb7f6d76a7ddb596eef586c6cb
Signed-off-by: Klement Sekera <ksekera@cisco.com>
4 years agonat: fix extended unit tests 67/26667/4
Klement Sekera [Thu, 23 Apr 2020 13:42:19 +0000 (13:42 +0000)]
nat: fix extended unit tests

Type: fix
Fixes: b86437b79b82493c2e9728929df417f55b153824

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

4 years agoip: reassembly: improve type safety 47/24047/5
Klement Sekera [Wed, 18 Dec 2019 12:17:06 +0000 (12:17 +0000)]
ip: reassembly: improve type safety

Type: refactor

Change-Id: Ib2d4a11ffa0e1e56ca05705ba8cdf84e6cc66427
Signed-off-by: Klement Sekera <ksekera@cisco.com>
4 years agoip: Setting the Link-Local address from the API enables IPv6 on the 54/26654/4
Neale Ranns [Thu, 23 Apr 2020 07:36:12 +0000 (07:36 +0000)]
ip: Setting the Link-Local address from the API enables IPv6 on the
interface

Type: fix

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

4 years agovirtio: vhost checksum problem for ipv6 65/26365/4
Steven Luong [Sun, 5 Apr 2020 23:09:17 +0000 (16:09 -0700)]
virtio: vhost checksum problem for ipv6

When checksum is enable for IPv6, it erroneously set the flag
VNET_BUFFER_F_OFFLOAD_IP_CKSUM. That flag is meant for ip4 packets only.

Type: fix
Ticket: VPP-1857

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

4 years agoipsec: add input node bypass/discard functionality 00/26500/5
ShivaShankarK [Tue, 14 Apr 2020 08:31:03 +0000 (14:01 +0530)]
ipsec: add input node bypass/discard functionality

add bypass/discard functionality to ipsec4-input-feature node

Type: feature

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

4 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

4 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

4 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

4 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)

4 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>
4 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>
4 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

4 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

4 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

4 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>
4 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

4 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

4 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

4 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>
4 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>
4 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

4 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>
4 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>
4 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>
4 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

4 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>
4 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

4 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>
4 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

4 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>
4 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>
4 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>
4 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

4 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>
4 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

4 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

4 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

4 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

4 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>
4 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

4 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>
4 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

4 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

4 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

4 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

4 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>
4 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

4 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

4 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>
4 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

4 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