12288 Commits

Author SHA1 Message Date
Zachary Leaf
c7d43a5eb1 perfmon: make less arch dependent
In preparation for enabling perfmon on Arm platforms, move some Intel
/arch specific logic into the /intel directory and update the CMake to
split the common code from arch specific files.

Since the dispatch_wrapper code is very different on Arm/Intel,
each arch can provide their own implementation + conduct any additional
arch specific config e.g. on Intel, all indexes from the mmap pages are
cached. The new method intel_config_dispatch_wrapper conducts this
config and returns a pointer to the dispatch wrapper to use.

Similarly, is_bundle_supported() looks very different on Arm/Intel, so
each implementation is to provide their own arch specific checks.

Two new callbacks/function ptrs are added in PERFMON_REGISTER_SOURCE to
support this - .bundle_support and .config_dispatch_wrapper.

Type: refactor
Signed-off-by: Zachary Leaf <zachary.leaf@arm.com>
Change-Id: Idd121ddcfd1cc80a57c949cecd64eb2db0ac8be3
2022-07-12 15:29:23 +00:00
Artem Glazychev
20ac58e5c5 wireguard: fix coverity warnings
Type: fix

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I62f13ee8cb9b86f8106505fd32a03d66c1a73bce
2022-07-11 13:47:31 +00:00
Matthew Smith
08f39102bf dpdk: add ID for 4xxx QAT VF
Type: improvement

Enable use of 4th gen QAT devices. Will be available on Sapphire Rapids.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I89e7d29e10ecb4c36c700ff5e017796161ec6c5e
2022-07-08 14:16:38 +00:00
Ivan Shvedunov
55050c31c2 gre: fix returning the flags in the API
Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: I5ecfb242e5905c9bd8ce19cd9ab6efd657ee14d4
2022-07-06 01:46:35 +00:00
Sergey Matov
ac199fcd9b vppinfra: fix memory leak in sparse_vec_free()
Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Signed-off-by: Sergey Matov <sergey.matov@travelping.com>
Change-Id: I4ec1a68b7266f05ab7c543cd8207afb29e740743
2022-07-06 01:46:14 +00:00
Andreas Schultz
972dc17634 misc: pass NULL instead of 0 for pointer in variadic functions
0 is not NULL (at least not in all cases), passing 0 into a variadic
function in a place where the consumer reads it as pointer might
leave parts of the pointer uninitilized and hence filled with random
data.

It seems that this used to work with gcc, but clang seems to treat the
0 in those places as a 32bit integer.

Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: I37d975eef5a1ad98fbfb65ebe47d73458aafea00
2022-07-06 03:32:18 +04:00
Jon Loeliger
f8631ce7e8 buffers: protect against bad thread indices
There is a very rare bug in NAT processing that yeilds a thread
index of ~0.  When this happens, vlib_get_frame_queue_elt()
suffers a segfault and VPP quits.  Prevent an outright fault
by dropping the packet instead.

Type: fix
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I48c7a268925bb821ea15e58db5d4bfb211c40c09
2022-07-01 14:11:10 +00:00
Florin Coras
b52bd3a23a vcl: check if listener valid on disconnect cleanup
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie057d0d5a51d3226a1a188cf9d48a5d82dc4a3c7
2022-06-30 18:02:47 +00:00
Andrew Yourtchenko
108abc0320 misc: VPP 22.06 Release Notes
Type: docs
Change-Id: I15971b21fd660b4893218640c0d5e5a5247868f1
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 0d352a97c5e3ad1f5f6eab18a978a14b0b9e06a8)
2022-06-30 18:00:49 +00:00
GaoChX
5b3d543878 vrrp: while delete vr can't delete multi virtual address.
Here is bug example:
vpp# create loopback interface
loop0
vpp# vrrp vr add loop0 vr_id 1 priority 100 192.168.1.1 192.168.1.2
vpp# vrrp vr del loop0 vr_id 1
vpp# vrrp vr add loop0 vr_id 1 priority 100 192.168.1.1 192.168.1.2
vrrp vr add: vrrp_vr_add_del returned -105

Type: fix
Signed-off-by: GaoChX <chiso.gao@gmail.com>
Change-Id: I3e0d086ac8fb52756339cff19b9a83911ec9748b
2022-06-30 17:27:46 +00:00
Ahmed Abdelsalam
d50e661d66 sr: SRv6 Path Tracing Sink node behavior
Type: feature
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
Change-Id: I2d3a0211abfee3501d3d77c80da20e67e1e9e133
2022-06-30 13:27:28 +00:00
Mohammed Hawari
cd758e6af5 vlib: enqueue_to_next_with_aux implementation
Change-Id: I0e1bb39d765ec3efa7b28ca02fb7beeb23607e51
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-06-29 21:25:26 +00:00
Benoît Ganne
b03eec969f classify: use 32 bits hash
classify hash used to be stored as u64 in buffer metadata, use 32 bits
instead:
 - on almost all our supported arch (x86 and arm64) we use crc32c
   intrinsics to compute the final hash: we really get a 32-bits hash
 - the hash itself is used to compute a 32-bits bucket index by masking
   upper bits: we always discard the higher 32-bits
 - this allows to increase the l2 classify buffer metadata padding such
   as it does not overlap with the ip fib_index metadata anymore. This
   overlap is an issue when using the 'set metadata' action in the ip
   ACL node which updates both fields

Type: fix

Change-Id: I5d35bdae97b96c3cae534e859b63950fb500ff50
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-06-29 21:23:38 +00:00
Ahmed Abdelsalam
b0057282d6 sr: code refactor and style fix
Type: refactor
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
Change-Id: Iff5e85952273526d5c9d9e7e73bd2b6c15bcd7f6
2022-06-29 21:20:33 +00:00
Ofer Heifetz
ffa7bac6f5 svm: check svm_msg_q_size_to_alloc success
svm_msg_q_size_to_alloc must return a valid base address, if it fails
pass up the error for handling

Type: fix

Change-Id: I408492f65f646862122acb9a187819b3bbf4f91c
Signed-off-by: Ofer Heifetz <oferh@marvell.com>
2022-06-29 20:21:27 +03:00
Ahmed Abdelsalam
c933bb7e37 sr: Add support for SRv6 Path Tracing Infrastructure
This patch adds support for the infrastructure
required to support SRv6 Path Tracing defined in
https://datatracker.ietf.org/doc/draft-filsfils-spring-path-tracing/

Type: feature

Change-Id: If3b09d6216490a60dd5a816577477b6399abc124
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
2022-06-29 15:28:43 +00:00
Florin Coras
0c3ca59e3f hsa: reduce number of preallocated vcl test server sessions
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7afc6116ca9a609992f26d9e78084732bba1b2ea
2022-06-29 14:15:10 +00:00
Fan Zhang
ab0bf0c0cb ipsec: add fast path python tests
This patch introduces set of python tests for fast path, based on
flow cache tests. There was a bug in calculating of policy mask when
adding to fast path, which has been fixed. Memory size for bihash
tables for both ip4 and ip6 outbound fast path policies
has been increased.

Type: feature
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: Ibeee904ae7179f5dafbd45bb44282436f0b80821
2022-06-29 10:34:22 +00:00
Piotr Bronowski
422544363c tests: add ipsec flow performance unit test
This patch adds performacne and functional tests for ip4
outbound traffic policy matching.
Test setup is configurable in startup.conf and though the test
parameters. Cache, fast path, fast path burst mode can be enabled
and disabled,
and performance for different lookup setup can be measured.

Type: feature
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I1d04d196e412f47f43b7e5cbd46607bf6a9cc40e
2022-06-29 10:33:41 +00:00
Fan Zhang
93bc431df3 ipsec: show fast path flag in cli
This patch updates the "show ipsec spd" cli to display
policies maintained by fast path bihash table.

Type: feature
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I58b9f92f3132dc9809b50786dc912e09c4b84d81
2022-06-29 09:11:41 +00:00
Piotr Bronowski
4da8a63a93 ipsec: add fast path configuration parser
Parser can be configured from the level of startup.conf file:
fast path can be enabled and disabled.

Type: feature
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: Ifab83ddcb75bc44c8165e7fa87a1a56d047732a1
2022-06-29 09:11:12 +00:00
Piotr Bronowski
e1dce37588 ipsec: add spd fast path matching
This patch adds matching functionality for spd fast path
policy matching. Fast path matching has been introduced
for outbound traffic only.

Type: feature
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I03d5edf7d7fbc03bf3e6edbe33cb15bc965f9d4e
2022-06-29 09:10:33 +00:00
Piotr Bronowski
829bff853e ipsec: make match function inline
This patch introduces ipsec_output.h file. Matching implementation is
moved there. The reason behind is the possibility of unit testing
matching mechanism. Therefore we need to have functions that are in
scope of our intrest there and since these are inline their
implementation needs to be moved to the header file as well.

Type: improvement
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: Id7c605375d1f3be146abf96ef70d336a5d156444
2022-06-29 09:09:37 +00:00
Piotr Bronowski
0464310fd3 ipsec: add/delete ipsec fast path policy
This patch introduces functions to add and delete fast path
policies.

Type: feature
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I3f1f1323148080c9dac531fbe9fa33bad4efe814
2022-06-29 09:05:51 +00:00
Florin Coras
fc20c8e50f session: fix connected udp accepts
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0963bae4b56b08c0a9ab4ee1f2738013217e1fb7
2022-06-28 22:52:51 +00:00
Florin Coras
cf5c774b59 session quic: allow custom config of rx mqs seg size
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Idc0fdebfea29c241d8a36128241ccec03eace5fd
2022-06-28 21:34:36 +00:00
Pratikshya Prasai
365fabea1e docs: fix broken links
Type: docs

Signed-off-by: Pratikshya Prasai <pratikshyaprasai2112@gmail.com>
Change-Id: I729de9e18624c63a72ec415a05c55617cb360c47
2022-06-28 20:04:47 +00:00
Piotr Bronowski
d699a347c0 ipsec: introduce spd fast path types
This patch introdcues basic types supporting fast path lookup.
Fast path performs policy matching with use of hash lookup
(particularly bihash tries has been used for that purpose). Fast path
lookup addresses situation where huge number of policies is created
(~100k or more). In such scenario adding/removing a policy
and policy matching is not efficient and poorly scales (for example
adding 500k policies takes a few hours. Also lookup time
increases significantly). With fast path adding and matching up to
1M flows scales up linearly (adding 1M of policies takes about 150s
on the test machine vs many hours in case of original implementation,
also matching time is significantly improved). Fast path will not
deal well with a huge number of policies that are spanning large
ip/port ranges. Large range will be masked out almost entirely leaving
only a few bits for calculating the hash key. Such keys will tend to
 gather much more policies than other keys and hash will match most of
the packets anihilating advantages of hashing. Having said that
we also think that it is not the real life scenario.

Type: feature
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I600dae5111a37768ed4b23aa18426e66bbf7b529
2022-06-28 15:04:08 +00:00
Piotr Bronowski
815c6a4fbc ipsec: change wildcard value for any protocol of spd policy
Currently 0 has been used as the wildcard representing ANY type of
protocol. However 0 is valid value of ip protocol (HOPOPT) and therefore
it should not be used as a wildcard. Instead 255 is used which is
guaranteed by IANA to be reserved and not used as a protocol id.

Type: improvement
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I2320bae6fe380cb999dc5a9187beb68fda2d31eb
2022-06-28 14:53:07 +00:00
fanxb
5b4b4c05ff quic:fix crash rx_fifo full or grow
if when the rx_fifo grows, svm_fifo_enqueue() return -4,
stream_data->app_rx_data_len += rlen type conversion occurs,
Finally,stream->recvstate.data_off calculation is wrong.

Type:fix

Signed-off-by: fanxb <fxb_mail@163.com>
Change-Id: Iae11f0c453f32d836f4148d70e3b121545a53a90
2022-06-17 18:16:57 +08:00
Alexander Chernavin
d6c3b1f1fc stats: fix prometheus exporter crash on large number of FIB entries
Type: fix

Currently, prometheus exporter may crash because of memory exhaustion
when dumps metrics if the FIB contains large number of routes.

With this fix, increase memory size for prometheus exporter to be able
to handle large number of FIB entries.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ia2b9a665368883c87448deee9bcf8d2ac1168357
2022-06-15 14:42:17 +00:00
Dave Wallace
15b13813bc docs: fix spelling errors
- also add docs-spell to checkstyle-all make target

Type: fix
Fixes: 5f6422db9

Change-Id: I8e9d7d17a03ee7b55f4e1785983459c43af267f7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-06-14 12:10:12 -04:00
Vijayabhaskar Katamreddy
ada7e4eeda ip: reassembly - Add node level stats, fix customapp behavior
Type: fix

Added stats for success and failure cases
Fixed Custom app behaviors for the error / drop cases

Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Change-Id: Id6e981c7be5c5b3cee5af2df505666d5558da470
2022-06-14 12:11:11 +00:00
Saima Yunus
bbc99f445c build: update makefile for ubuntu 22.04 docker executors
* apt '—force-yes' is deprecated in the version of apt in Ubuntu 22.04
* several Ubuntu-22.04-specific packages (e.g. python3-virtualenv, libssl-dev, clang clang-format-11)
are needed in the current VPP installation as well

Type: fix

Signed-off-by: Saima Yunus <yunus.saima.99@gmail.com>
Change-Id: I96ead90152f692233da812cdc853792bedb47c3c
2022-06-13 19:46:48 +00:00
Saima Yunus
5f6422db9c docs: cleaning up VPP documents by deleting unnecessary info.
- cleaned up the 'build/run VPP' docs

Type: docs

Signed-off-by: Saima Yunus <yunus.saima.99@gmail.com>
Change-Id: I9dbddbe1932804b8d507cb2f1631cd7116e59072
2022-06-13 18:38:47 +00:00
Benoît Ganne
78f672bbc6 rdma: bump to rdma-core 41.0
Type: improvement

Change-Id: Ifdbb879d3018996c09f0caf55df11038ead173a2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-06-13 11:54:02 +00:00
Xiaoming Jiang
2d7665758e dpdk: add support allow/block scan mode for vmbus dev
Type: improvement
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: Id3f45968cd24f53350dce365b2cc9b3191ec836f
2022-06-13 11:50:07 +00:00
Liangxing Wang
2211277f3a vcl: fix iperf3 server crash issue when it runs over vpp host stack.
Issue:

Let iperf3 server run via ldp and vcl on top of vpp's host stack. If
iperf3 client connects this iperf3 server with tcp MSS setting option,
iperf3 server will always crash.

Root cause:

When MSS option is specified by iperf3 client, iperf3 server will
recreate the listening socket firstly, then call setsockopt() to set MSS
immediately. Iperf3 code can be referred here:
58332f8154/src/iperf_tcp.c (L186).
However, in vcl layer vpp_evt_q of this recreated session is not
allocated yet. So iperf3 server crashes with vpp_evt_q null pointer access.

Fix:

Add session vpp_evt_q null pointer check in vcl_session_transport_attr().
Add a vcl test case for this MSS option scenario.

Type: fix
Signed-off-by: Liangxing Wang <liangxing.wang@arm.com>
Change-Id: I2863bd0cffbe6e60108ab333f97c00530c006ba7
2022-06-10 18:11:58 +00:00
Benoît Ganne
0d5f1a6c54 vppinfra: fix bihash_8_16 entry format function
Type: fix

Change-Id: I1e8655baaf09b455f7f0052452402a372f738d0f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-06-10 09:55:59 +02:00
Florin Coras
c2ab1bdbc7 hsa: allow first segments larger than 4g for proxy
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9c502a491ff56806a2e631f7a4c18903a2e93ab2
2022-06-10 04:31:59 +00:00
Benoît Ganne
c629f90752 ip: improve ip ACL traces
Type: improvement

Change-Id: I85c73cb940d81d0b249eda0d57de135bcd798418
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-06-10 01:09:57 +00:00
Damjan Marion
f4cfa2a8a0 vppinfra: missing __clib_export for clib_pmalloc_alloc_aligned
Type: improvement
Change-Id: I7489327d8b9c5f69b4ceb2159456f00f8a3612df
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-06-09 16:03:44 +00:00
Benoît Ganne
b3559cef77 udp: add cli to dump registered ports
Type: improvement

Change-Id: Ic949e3136a7cf27011d098a50e91920f83226ea9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-06-08 16:28:29 +00:00
Matthew Smith
42928beec9 wireguard: increment interface RX counters
Type: improvement

When packets were received and processed successfully, increment the
byte/packet counters for the tunnel interface.

Change-Id: I42855607ac6916de641be42aac86c9942cc97140
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2022-06-08 15:20:29 +00:00
Nathan Skrzypczak
b376e92f44 classify: fix sesssion details api
We were not allocating space for the
variable length payload in the response
message.

Type: fix

Change-Id: I345102f4555f66c5632ab0882ca1dd178e98eb7b
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-06-07 18:30:44 +02:00
Pim van Pelt
96158834db vlib: fix crash on packet on deleted interface
If ip4_neighbor_probe (or any other) is sending packet to a deleted interface,
ASSERT trips and dataplane crashes. Example:

create loopback interface instance 0
set interface ip address loop0 10.0.0.1/32
set interface state GigabitEthernet3/0/1 up
set interface state loop0 up
set interface state loop0 down
set interface ip address del loop0 10.0.0.1/32
delete loopback interface intfc loop0
set interface state GigabitEthernet3/0/1 down
set interface state GigabitEthernet3/0/1 up
comment { the following crashes VPP }
set interface state GigabitEthernet3/0/1 down

This sequence reliably crashes VPP:

(gdb)p n->name
$4 = (u8 *) 0x7fff82b47578 "interface-3-output-deleted”

If the interface doesn't exist, return ~0 and be tolerant of this in the
two call sites of counter_index()

Type: fix
Signed-off-by: Pim van Pelt <pim@ipng.nl>
Change-Id: I90ec58fc0d14b20c9822703fe914f2ce89acb18d
2022-06-07 14:17:44 +00:00
Ahmed Abdelsalam
9cca694c8f sr: SRv6 TEF behavior support
Adding support for the SRv6 TEF (Timestamp, Encapsulation and Forward) behavior defined in
draft-filsfils-spring-path-tracing (https://datatracker.ietf.org/doc/draft-filsfils-spring-path-tracing/).

Type: feature

Change-Id: I7f38b593147daf8d27af9c983448cf82947e5bed
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
2022-06-07 12:37:25 +00:00
Alexander Chernavin
1477c7262a wireguard: fix crash by not sending arp via wg interface
Type: fix

Currently, neighbor adjacencies on a wg interface are converted into a
midchain only if one of the peers has a matching allowed prefix
configured. If create a route that goes through a wg interface but the
next-hop address does not match any allowed prefixes, an ARP/ND request
will try to be sent via the wg interface to resolve the next-hop address
when matching traffic occurs. And sending an ARP request will cause VPP
to crash while copying hardware address of the wg interface which is
NULL. Sending an ND message will not cause VPP to crash but the error
logged will be unclear (no source address).

With this fix, convert all neighbor adjacencies on a wg interface into a
midchain and update tests to cover the case. If there is no matching
allowed prefix configured, traffic going such routes will be dropped
because of "Peer error". No changes if there is matching allowed prefix
configured.

Also, fix getting peer by adjacency index.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I15bc1e1f83de719e97edf3f7210a5359a35bddbd
2022-06-05 21:14:09 +00:00
Florin Coras
db8dd260d5 hsa: dealloc proxy fifos on right thread
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia66c12e1da126d0d8d101b645e6dc8454c3826d6
2022-06-03 15:21:24 -07:00
Florin Coras
7b8d26c136 hsa: refactor proxy session lookup and cleanup
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic68627bbca676cc78b0be05bc1fa0f386f5d27fa
2022-06-03 14:02:24 -07:00