8822 Commits

Author SHA1 Message Date
Jakub Grajciar
07363a45fe 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>
2020-04-28 21:18:37 +00:00
Andreas Schultz
c458c49366 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
2020-04-28 21:16:58 +00:00
Chenmin Sun
24e2c50bf3 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
2020-04-28 21:13:50 +00:00
Aloys Augustin
2857e7850c 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>
2020-04-28 21:10:36 +00:00
Filip Tehlar
beee60d2c3 ipsec: fix buffer alloc
Type: fix

Change-Id: I0f12c19b79df19b692f18ac13d6c32341853b764
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2020-04-28 21:09:14 +00:00
Klement Sekera
ca6307ccb9 nat: remove unused code
Type: refactor

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I0f82d937b4829e5a7f074d4d566fa49319a11716
2020-04-28 21:06:32 +00:00
Dave Barach
37b445468e 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
2020-04-28 20:55:20 +00:00
Paul Vinciguerra
bfb377ce79 docs: add missing spelling dictionary
Type: docs

Change-Id: I334312f8bfe2000d4613908c2a0ba7e6a39d3825
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-04-28 17:43:44 +00:00
Paul Vinciguerra
6230b9d123 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>
2020-04-28 16:42:36 +00:00
Paul Vinciguerra
e64e5fff4d 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>
2020-04-28 15:43:28 +00:00
Jakub Grajciar
58db6e16cf 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>
2020-04-28 11:54:00 +00:00
Ray Kinsella
4830e4f78f 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
2020-04-28 11:10:50 +00:00
Ole Troan
a568a19b29 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
2020-04-28 09:39:47 +00:00
Paul Vinciguerra
c0e9441e79 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>
2020-04-28 01:12:04 -04:00
Florin Coras
f5445bf36f tcp: remove sack reneging verbose logging
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4dbbf8456d0ed2350459fcdc0664bbae024072fc
2020-04-28 00:56:39 +00:00
Florin Coras
5226d26d11 svm: null instead of panic if fifo hdr alloc fails
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2c5c9e3e7eff8481e48a940e8420d236a16e7649
2020-04-28 00:56:19 +00:00
Simon Zhang
3ff8e23d7d tls: fix wrong usage of session close function issue
Type: fix

Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Change-Id: I5a73e45e5b8a6a97c068e1ca108d8f8a2c1c0f90
2020-04-28 00:20:08 +00:00
Steven Luong
bc0d9ff672 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
2020-04-27 09:25:32 -07:00
Zhiyong Yang
ba6deb96e9 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
2020-04-27 15:31:48 +00:00
Dave Barach
6d6711b5f0 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
2020-04-27 15:07:59 +00:00
Dave Barach
ce32770251 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
2020-04-27 15:07:42 +00:00
Benoît Ganne
83ceffcd98 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>
2020-04-27 15:04:37 +00:00
Benoît Ganne
a66971f980 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>
2020-04-27 14:20:52 +00:00
Gao Feng
9165e0365c 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
2020-04-27 13:35:17 +00:00
Benoît Ganne
ffbcf61788 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>
2020-04-27 12:22:30 +00:00
Benoît Ganne
be7dbbbfdd 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>
2020-04-27 12:22:30 +00:00
Benoît Ganne
2d25467d13 rdma: tx: interleave prefetches
Type: improvement

Change-Id: Ic2d9b17cf5e524f3ad2a3c5343fe1230aa360e73
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-27 12:19:39 +00:00
Matthew Smith
81284163a2 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>
2020-04-27 10:54:13 +00:00
Klement Sekera
770178e365 nat: improve perf - long read after short write
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Idbbad246161d28f595c25e10d7282c8b33fa9876
2020-04-27 08:21:53 +00:00
Stanislav Zaikin
e65eea360c 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
2020-04-26 13:18:54 +00:00
Florin Coras
681ea6dd28 tls: improve cli state reporting
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I02d60134d6069764da75dc6d206b376a0d46998e
2020-04-25 11:40:43 +00:00
Florin Coras
36d49391aa 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
2020-04-25 11:40:25 +00:00
Florin Coras
5e6222a033 vcl: generate select events on read/write errors
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3429f9d0406b6d710846fc82d77400f26f77fdf4
2020-04-25 11:39:59 +00:00
Dave Barach
f593b57920 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
2020-04-24 16:52:55 -04:00
Neale Ranns
bf883bb086 acl: ACL creation CLI parsing fix
Type: fix

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: I026f0d8385b538e543bae0c1f7e56e49e4713ba1
2020-04-24 17:22:41 +00:00
Klement Sekera
d9e18aac39 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>
2020-04-24 15:22:24 +00:00
Klement Sekera
5581de6d6d nat: make usage of vnet_buffer2 transparent
Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I50df248afb3f6b46c49e6695b3f124cfd584f016
2020-04-24 15:21:44 +00:00
Dave Barach
82192ca4dc 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
2020-04-24 15:01:29 +00:00
Klement Sekera
69de9fadbf 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>
2020-04-24 13:51:38 +00:00
Klement Sekera
e7f4201776 nat: fix extended unit tests
Type: fix
Fixes: b86437b79b82493c2e9728929df417f55b153824

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I2c833928dcdceb4d23dfc161bcc3358272076980
2020-04-24 13:51:19 +00:00
Klement Sekera
c99c0250a5 ip: reassembly: improve type safety
Type: refactor

Change-Id: Ib2d4a11ffa0e1e56ca05705ba8cdf84e6cc66427
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2020-04-24 09:54:47 +00:00
Neale Ranns
ec40a7d2bc 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
2020-04-24 09:24:43 +00:00
Steven Luong
82b62bbf58 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)
2020-04-24 09:11:33 +00:00
ShivaShankarK
0546483ce0 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
2020-04-24 07:37:20 +00:00
Neale Ranns
b5c0d35f94 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
2020-04-24 07:22:32 +00:00
Dave Barach
0e2751cc1d 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
2020-04-23 23:40:23 +00:00
Dave Barach
a90ba644b2 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
2020-04-23 16:56:51 -04:00
Andrew Yourtchenko
843ea7c3e3 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)
2020-04-23 18:18:22 +00:00
Andreas Schultz
30a28c187b 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>
2020-04-23 15:34:18 +00:00
Damjan Marion
68e5fd5206 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>
2020-04-23 13:45:25 +02:00