vpp.git
4 years agotap: implement sw_interface_tap_v2_dump filtering by sw_if_index 08/26708/10
Paul Vinciguerra [Mon, 27 Apr 2020 05:12:48 +0000 (01:12 -0400)]
tap: implement sw_interface_tap_v2_dump filtering by sw_if_index

Type: feature

Change-Id: I6f607f383dc77a71e8712124f7613b38b4ac065a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
4 years agomisc: add Matt Smith to the committer list 16/26816/2
Dave Barach [Thu, 30 Apr 2020 19:33:52 +0000 (15:33 -0400)]
misc: add Matt Smith to the committer list

In hopes of restoring his +2 button...

Type: fix

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

4 years agol2: fix coverity warnings in l2_fwd.c 17/26817/3
Dave Barach [Thu, 30 Apr 2020 19:42:44 +0000 (15:42 -0400)]
l2: fix coverity warnings in l2_fwd.c

Type: fix
Ticket: VPP-1837

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

4 years agotcp: fix v6 ll lookup fib 25/26625/3
Florin Coras [Tue, 21 Apr 2020 19:55:39 +0000 (19:55 +0000)]
tcp: fix v6 ll lookup fib

Type: fix

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

4 years agosession: cleanup listener segment manager on wrk free 12/26812/6
Florin Coras [Thu, 30 Apr 2020 15:05:24 +0000 (15:05 +0000)]
session: cleanup listener segment manager on wrk free

Type: fix

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

4 years agoip-neighbor: Add flush API 58/26658/5
Neale Ranns [Thu, 23 Apr 2020 09:04:59 +0000 (09:04 +0000)]
ip-neighbor: Add flush API

Type: feature

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

4 years agohsa: bind af-unix socket only for echo tests 70/26770/4
Florin Coras [Wed, 29 Apr 2020 07:11:05 +0000 (07:11 +0000)]
hsa: bind af-unix socket only for echo tests

Type: improvement

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

4 years agoflow: add l2tpv3oip flow 02/26502/5
Chenmin Sun [Tue, 14 Apr 2020 17:55:58 +0000 (01:55 +0800)]
flow: add l2tpv3oip flow

This patch adds the l2tpv3oip type flow support
Have tested on E810 with Intel iAVF driver

Type: feature

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

4 years agocrypto: introduce async crypto infra 36/18036/54
Fan Zhang [Wed, 29 Apr 2020 13:00:03 +0000 (14:00 +0100)]
crypto: introduce async crypto infra

Type: feature

Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Signed-off-by: Dariusz Kazimierski <dariuszx.kazimierski@intel.com>
Signed-off-by: Piotr Kleski <piotrx.kleski@intel.com>
Change-Id: I4c3fcccf55c36842b7b48aed260fef2802b5c54b

4 years agobuild: rework x86 CPU variants 81/26781/5
Damjan Marion [Wed, 29 Apr 2020 19:28:15 +0000 (21:28 +0200)]
build: rework x86 CPU variants

Type: improvement
Change-Id: Ief243f88e654e578ef9b8060fcf535b364aececb
Signed-off-by: Damjan Marion <damarion@cisco.com>
4 years agovcl: disconnect both flavors of bapi transport on destroy 05/26805/4
Florin Coras [Thu, 30 Apr 2020 02:59:55 +0000 (02:59 +0000)]
vcl: disconnect both flavors of bapi transport on destroy

Type: fix

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

4 years agobuild: support arch-specific compiling for Neoverse N1 04/26804/3
Lijian.Zhang [Tue, 18 Feb 2020 11:58:19 +0000 (19:58 +0800)]
build: support arch-specific compiling for Neoverse N1

Enable arch-specific compiling and dynamic optimal function selection
for Arm Neoverse-N1.

Support for -march=armv8.2-a+crc+crypto -mtune=neoverse-n1 for
Neoverse-N1 is added starting from gcc-9.2.0

                    without change  with change improvement
[L2 - 1x flows]     11.00 Mpps      11.46 Mpps  4%
[L2 - 10Kx flows]   6.83 Mpps       7.17 Mpps   5%
[L3 - 1x flows]     10.39 Mpps      10.78 Mpps  3.7%
[L3 - 10Kx flows]   6.67 Mpps       7.19 Mpps   7.8%

Type: feature

Change-Id: I5d24d17820b3dd6909b913202e8c31fc7d48650f
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Jieqiang Wang <Jieqiang.Wang@arm.com>
Reviewed-by: Govindarajan Mohandoss <Govindarajan.Mohandoss@arm.com>
4 years agoikev2: use thread local vlib_main in vlib_time_now 08/26808/3
Filip Tehlar [Wed, 29 Apr 2020 23:18:41 +0000 (23:18 +0000)]
ikev2: use thread local vlib_main in vlib_time_now

Type: fix

Change-Id: I8e4a47bd16fa8475ef695c09e3487eabf08faabe
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
4 years agotap: allow deletion of tun interface 80/26780/2
Matthew Smith [Wed, 29 Apr 2020 16:17:08 +0000 (11:17 -0500)]
tap: allow deletion of tun interface

Type: improvement

tap_delete_if() returns early if the interface type is not
VIRTIO_IF_TYPE_TAP. Allow VIRTIO_IF_TYPE_TUN also and take
appropriate action for those interfaces.

Change-Id: I196b6d6f3f5e1543a14d6be76fd879d44c9794fd
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
4 years agobuild: detect GNU Assembler AVX-512 bug and disable AVX-512 variants if needed 78/26778/3
Damjan Marion [Wed, 29 Apr 2020 13:15:45 +0000 (15:15 +0200)]
build: detect GNU Assembler AVX-512 bug and disable AVX-512 variants if needed

Type: fix
Change-Id: I098f6c79be3c2e4db001edc0cf0a229bf6e0b13d
Signed-off-by: Damjan Marion <damarion@cisco.com>
4 years agoip: use thread local vm instead of thread main for vlib_time_now calls 65/26765/5
Tom Seidenberg [Tue, 28 Apr 2020 21:58:12 +0000 (17:58 -0400)]
ip: use thread local vm instead of thread main for vlib_time_now calls

Type: fix
Change-Id: I8d68e7c7392dcb748a2a84e72c7b1ca0c6c0eb07
Signed-off-by: Tom Seidenberg <tseidenb@cisco.com>
4 years agomisc: switch to clang-9 44/26744/6
Damjan Marion [Tue, 28 Apr 2020 11:29:37 +0000 (13:29 +0200)]
misc: switch to clang-9

Type: improvement
Change-Id: Iebf77a63c0c19b130a3fbd26b5293304a9fed4c1
Signed-off-by: Damjan Marion <damarion@cisco.com>
4 years agohsa: cleanup ifdefs in sock tests 66/26766/9
Florin Coras [Wed, 29 Apr 2020 01:11:35 +0000 (01:11 +0000)]
hsa: cleanup ifdefs in sock tests

Type: refactor

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

4 years agodevices: vhost: simplify string copies for GCC-10 86/26686/2
Benoît Ganne [Fri, 24 Apr 2020 08:33:40 +0000 (10:33 +0200)]
devices: vhost: simplify string copies for GCC-10

GCC-10 increases string truncations warnings. Refactor string copies
confusing it.

Type: refactor

Change-Id: I9720a0539059de00ab212ff2fc73055f04f5af1d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
4 years agotap: fix missing "num-rx-queues" from cli help 76/26776/1
Mohsin Kazmi [Wed, 29 Apr 2020 11:10:08 +0000 (13:10 +0200)]
tap: fix missing "num-rx-queues" from cli help

Type: fix

Change-Id: Ib09c7cebb6978b3adc09ac36cb32f7947b143e51
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
4 years agovcl: add separate fcntl64 ldp handler 68/26768/5
Florin Coras [Wed, 29 Apr 2020 02:19:51 +0000 (02:19 +0000)]
vcl: add separate fcntl64 ldp handler

Type: fix

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

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