12036 Commits

Author SHA1 Message Date
Dave Wallace
4a332319cc build: remove clang-format-10
- No longer used now that ubuntu-18.04 is deprecated.
- Change default to clang-format-11 in checkstyle.sh

Type: make

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I202244563738417bf4ae5b22fc8e2804bff2d25f
2022-03-22 14:28:37 +00:00
Mohsin Kazmi
b495e34b00 memif: fix the maxmimum number of txqs
Type: fix

With multi-txq in VPP, user should be able to create
more txqs than vpp threads. MEMIF_MAX_M2S_RING should
be defined to 256 instead of number of vpp threads.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I337c3a5ea691470815653ff2dbfa862bb324b240
2022-03-22 14:12:37 +00:00
Vladislav Grishenko
15732f5d05 fib: refetech the adj after the walk in case the pool realloc'd
Follow e3aeb38fa82b77ae84643f5140d9674056b6b5ca

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I743911cacc026af5da392d26eaf47ab83ea1de99
2022-03-22 09:02:30 +00:00
Klement Sekera
b9ff03c805 build: fix clang-format-diff[.py] detection
Fix clang-format-diff autodetection error in case of non-standard
clang-format-diff path. Also allow finding clang-format-diff.py in
non-standard location.

Type: improvement
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I3cb76aa152a8245e62db62f5fe2ba96b1ff86428
2022-03-22 01:34:57 +00:00
Klement Sekera
b3fc65817e tests: fix DEBUG=attach functionality
Make make test-start-vpp-in-gdb work again.
Fix incorrect temp directory when using DEBUG=attach.

Type: fix
Fixes: b23ffd7ef216463c35b75c831e6a27e58971f4ec
Change-Id: Ie98b637acbbe0221606ccdc7b54f63885e5951a4
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2022-03-22 00:50:23 +00:00
Damjan Marion
f0574da2b7 stats: fix vlib_stats_validate_will_expand_internal
Type: fix
Change-Id: If4c0b23aaa4fc57c0783efcbe349aba5e5885b30
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-21 21:13:31 +00:00
Florin Coras
e09bd48e35 session: linked list of events to be handled by main
Minimize amount of rpcs from first worker to main

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3794ff028a17d18b7bff69ede2b62e1e2d45ae77
2022-03-21 12:53:15 -07:00
Francesco Lombardo
38659d8f2c sr: fix srv6 definition of behavior associated to a LocalSID
The behavior associateted to a LocalSID accordig to the definition should be u8 instead of u16;

Type: fix

Signed-off-by: Francesco Lombardo <franclombardo@gmail.com>
Change-Id: I6dd60d5facc1c3f20900cb393619349e82eef38c
Signed-off-by: Francesco Lombardo <franclombardo@gmail.com>
2022-03-21 18:18:00 +00:00
Damjan Marion
8a96c6d0e7 vppinfra: use clib_mem_alloc
Type: refactor
Change-Id: I26a2a410f8f4070d10696f796d5887842cad3916
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-21 17:46:23 +00:00
Jon Loeliger
d23c55fa56 wireguard: dont stacksmash bad peer base64 keys
Just like commit 252647482b24bb3474e8f13bc86100718176832f
did for Wireguard interface keys, prevent stack smashing
the peer keys.

Integer math on 32 bytes of base64 data might yield 33 bytes
of data in some poorly formed user input of private key values.
Rather than smashing the stack (detected) and aborting, simply
allow for the possible yet irrelevant 33-rd byte of data.

Type: fix
Fixes: edca1325cf296bd0f5ff422fc12de2ce7a7bad88
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I9f77b3faaaa01d3123b356c958db60c87238db9c
2022-03-21 16:25:21 +00:00
Jon Loeliger
f479179598 wireguard: improve peer dump details
- Add peer_index, table_id, and keep-alive.
- Fix some lingering cut-n-paste issues in the API file.

Type: improvement
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I6fc0729ba0268bbcda0248f680979c44e68b6b0c
2022-03-21 15:56:36 +00:00
Nathan Skrzypczak
17ecd853e9 vppinfra: add new bihash exports
This adds two new exported functions
for the clib_bihash

* clib_bihash_add_with_overwrite_cb allowing
to pass a callback to be called on overwriting
a key with bucket lock held.
* clib_bihash_add_del_with_hash doing an add_del
with a precomputed hash.

Type: feature

Change-Id: I1590c933fa7cf21e6a8ada89b3456a60c4988244
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-21 11:27:29 +00:00
Filip Tehlar
d0d4b43374 hsa: add support for SAPI in vpp_echo
Type: feature

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: If24a43b7f79e05092306562c192de03994dec550
2022-03-21 06:04:34 +00:00
Damjan Marion
3cfd529bd0 vppinfra: deprecate vec numa macros
More generic vector heap code coming in another patch...

Type: refactor
Change-Id: I2327128fb3aba9d5d330f46a35afec32e1e3942e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-18 22:17:45 +00:00
Andrew Yourtchenko
f56b007356 tests: fix the RND_SEED parsing
The random seed is not an integer, so the current code does not allow reproducing a test run by running e.g.

RND_SEED=1647595144.0940742 make test

Solution: make the random seed a positive float.

Also, add the missing positiveness check to the positive_integer function.

Type: fix

Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I858bab0a9b828b99c20a2252aeecb9e2dda4ee21
2022-03-18 20:11:26 +00:00
Florin Coras
53d8d4fd62 session: add infra for safe pool reallocs
This is not to be used lightly.

The idea is to forces pool reallocs to be done only on main thread with
a barrier to make sure pools are always reallocated without
peekers/readers. If rpcs are delayed and the pool runs out of elements,
workers will block waiting for barrier and force the realloc.

Consumers of this api should be session layer and transports.

Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I533272a29534338935a3fcf7027c0e7af2ca948c
2022-03-18 20:05:42 +00:00
Florin Coras
c8e4110cd1 udp: avoid grabbing vlib main if not needed
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I88a747cac70cb88755f50c7b337207f4ba256530
2022-03-18 20:05:00 +00:00
Ed Warnicke
1aa6afb3cf misc: Auto close PRs to GitHub mirror
Introduce a GitHub Action to auto close PRs submitted via GitHub
Will add a helpful comment to point folks towards gerrit.

Type: feature

Signed-off-by: Ed Warnicke <hagbard@gmail.com>
Change-Id: I3c4a2590d4e38edd1061e65e800cfdb124c43866
2022-03-18 12:26:04 -05:00
Damjan Marion
66d4cb5a21 vppinfra: refactor *_will_expand() functions
Type: refactor
Change-Id: I3625eacf9e04542ca8778df5d46075a8654642c7
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-18 13:16:36 +00:00
Damjan Marion
05563c9a90 vppinfra: deprecate vec_free_h()
vec_free() does the work

Type: refactor
Change-Id: I8a97607c3b2f58d116863642b32b55525dc15d88
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-18 13:16:30 +00:00
Damjan Marion
a4a28f04cb vppinfra: use stored vec header size to find header
Type: refactor
Change-Id: Iaa1e43c87c5725ab33ea8489bff2a7bda18b9c79
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-18 13:16:24 +00:00
Damjan Marion
86bbdf926c vppinfra: fixed pool from heap
Immediate benefit is ability to use hugepage backed memory.

Type: improvement
Change-Id: Ibcae961aa09ea92d3e931a40bedbc6346a4b2039
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-18 14:15:29 +01:00
Nathan Skrzypczak
762cfd408b cnat: Fix conflicting rsession
When dNAT-ing to a VIP, it can happen
that the return session conflicts with
another forward session than the one
we own.

This patchs adds a rsession_flags
CNAT_SESSION_RETRY_SNAT that makes cnat_session_create
search for a free src port to use for the
resulting return session.

It also makes forward & return session
share their fate in the session scanner.

Type: fix

Change-Id: Id0edf59abf8e5bc0c0d8941ba289c4563c77dee0
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-18 11:33:51 +00:00
Nathan Skrzypczak
6798e9ec34 memif: fix rx/txqueue RC on connected
Type: fix

Calling vnet_hw_if_register_tx_queue should
be done with the worker barrier held, as
virtio-pre-input might be grabbing a queue
while a memif connect event is triggered.

Change-Id: Ie1272cdfd2477faf7a4e10f30778279872f04916
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-18 10:10:22 +00:00
Aloys Augustin
0b77e31282 ip: fix assert in ip4_ttl_inc
There is no need to verify the checksum for packets that have the IP
checksum offload flag set. This uses the same logic as
ip4_ttl_and_checksum_check.

Type: fix

Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Change-Id: I177b07212a992362a4c965c074dcecf1e504c593
2022-03-18 08:25:11 +00:00
Klement Sekera
19658c990b bfd: remove source IP check from session add
Checking for existence of source address on interface prevents creating
session before assigning address to said interface. Removing this check
allows more flexibility when configuring BFD feature.

Type: improvement
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: Ia57960e29b5dbdb758a7a64193c28f21482f229e
2022-03-18 08:13:21 +00:00
Florin Coras
f540d1e11d vlib: fix vlib_mains vector alignment
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib3d1ac6c82bc0c00e445b15d4102e4fd755f8e2d
2022-03-17 23:22:10 +00:00
Filip Tehlar
eeb31ec723 vcl: fix invalid socket read
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ic8cc12788d9062f30faa992afaecc0c64078c4d7
2022-03-17 23:08:22 +00:00
Damjan Marion
5c45d1cf1b vppinfra: vec_max_len, vec_mem_size use stored header size
Type: improvement
Change-Id: I17778e89674da0e8204713302e2293377bdabcbc
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-17 20:31:14 +00:00
Damjan Marion
1da361f9ea vppinfra: store vector header size and alignment into header
On the forst vector alloc values are stored into header.
Later, when vector grows values from header are used istead of provided
ones.

In the debug image code will assert if same values are not provided.

Type: improvement
Change-Id: I8fdcfa495e9c1df0f6392c90f634e8c74b73b328
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-17 20:31:14 +00:00
Damjan Marion
2b702da86c vppinfra: move hash bitmap out of vec header
Type: refactor
Change-Id: Ibd29a717eaf12d795b3bceb31835d6fc655268b1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-17 20:22:36 +00:00
Nathan Skrzypczak
d591b82cc8 misc: Improve go bindings gen
Type: improvement

Change-Id: Id705dab895602a60b053296b560ca3db5b0cd344
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-17 13:05:48 +00:00
Klement Sekera
c2feb65f42 nat: fix ICMP error translation
Add missing translation of ICMP inner IP layer.
Change responsible test so that it actually tests something.

Type: fix
Fixes: 4881cb4c6f
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: Id3a6f12a7308d81b1cdf9815f857221fab2f24d9
2022-03-17 11:17:49 +00:00
Damjan Marion
541de587a9 vpp: binary-api CLI weak linking workaround
For some unknown reason sometimes calling exec() ends up on weak
exec() defined in src/vat/api_format.c which return -1 instead of using
one few lines above.

Another proof that use of weak symbols is bad idea.

Luckily this can be easily workarounded.

Type: fix
Change-Id: Ic84e8525bff75c1b8186c233cd524aac4d95c8b5
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-16 16:43:26 +01:00
Florin Coras
e8d67719fd tcp: update error counters in listen node
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib2e1d847607c9c7d928b174b87e5c21d53153ebe
2022-03-15 21:46:34 -07:00
Florin Coras
c6a2f1f76f tcp: update persist timer if data acked
Update persist timer if data sent during snd_wnd < snd_mss was acked.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5c75ff8ddc0e49750b2088237d32afa4eda99e7f
2022-03-15 16:27:02 +00:00
Ting Xu
3a36682017 flow: add generic flow pattern for 5G flow enhancement
In order to support the requirement of RSS and packet steering of new
protocols, such as GTPU PDU-type and QFI, for 5G UPF, a generic pattern
is introduced in vnet flow. The generic flow pattern is based on DDP
(Dynamic Device Personalization) function and Parser Library module in
DPDK. Using generic flow pattern, we do not need to create new packet
and field type and offset in API parser for every new protocols. We can
create flows for any protocol immediately as long as supported by DDP.
The generic flow can be used to support 5G related protocols in
different scenarios.

The input of this generic pattern are two binary strings for spec and
mask. Spec is the binary presentation of the target packet type, and
mask is used to mark the target fields.

In this patch DPDK plugins is enabled for POC. Next step we will enable
generic flow in native IAVF, which is the main target.

Here is an example. If we want to create a flow for GTPU QFI,
spec is:
00000000000100000000000208004500003C00000000001100000101010102020202000
008680028000034FF001C00000000000000850100010045000014000000000000000001
01010102020202
mask is:
00000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000007F0000000000000000000000000000
00000000000000

A naming API POC is created via VAPI to help create the rule with
the target packet format similar to Scapy. It is based on a function
module called PacketForge. In this way, the user no need to create
binary string spec and mask by themselves.

Type: feature

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Id3444f95c158bdcdfeeee19d795cd9ecbeeec07c
2022-03-15 16:15:19 +00:00
Damjan Marion
218e4ec530 vlib: add vlib_frame_bitmap_and
Type: improvement
Change-Id: I531115f32c484e4c4794173d24e15f3b5b8f547b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-15 16:17:31 +01:00
Mauro Sardara
b0f0f8c8dd memif: fix memif_process_desc indexing
The index i was incremented in the wrong place, and the check on the
presence of a next buffer in the chain was actually done for the
next desc_status rather than the current one.

Type: fix

Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: I74a64a34fea497900b7969cd96e1aeeb570a1bba
2022-03-15 08:15:21 +00:00
Florin Coras
41a1bbffc6 vppinfra: fix vec capacity
Rename vec_capacity to vec_mem_size  as it returned the size of the
underlying memory allocation not the number of bytes that can be used
for vector elements.

Add new vec_max_elts macro that returns number of elements that can fit
into generic vector.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2e53a2bfa6e56a89af62d6ddc073ead58b8c49bb
2022-03-14 22:03:37 +00:00
Damjan Marion
58fd481d73 stats: refactor vlib counters
Change-Id: I09d2da73eff42c52ba1373acc99ff28f283a6725
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-14 20:30:06 +00:00
Matthew Smith
92991e5c69 dpdk: add patch to support i226v
Type: improvement

Add a patch to the DPDK 21.11 build to enable the PCI device ID for the
I226-V.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I82ff4b70e6b6e0ba0803519943190a564e85d2ac
2022-03-14 20:04:40 +00:00
Govindarajan
ebfd2b6ac8 crypto: Enabling IOMMU DMA translation table update for QAT card
With DPDK plugin, VPP does the DMA page map in IOMMU, only when
DPDK supported ethernet devices are present. As a result, Mellanox NIC
and QAT combo doesn't work. As part of this fix, DPDK supported
crypto device check is added to do the DMA page map.

Type: fix
Signed-off-by: mgovind <govindarajan.mohandoss@arm.com>
Change-Id: I02de4588c5b021e0c9c62612137f28ed8784bea6
2022-03-14 19:58:03 +00:00
Damjan Marion
d1bd9af16e stats: support recursive locking
Type: improvement
Change-Id: I85dd3d34bcb175dd68dda34a58cd454848a0fc2b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-14 18:33:32 +00:00
Filip Tehlar
85a9c101bf hsa: fix error message
Fixes a minor issue that causes printing an error message when there is no error.

Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I59f5c6af7c5aeae3e812b4cf0c75a47894bb8bbd
2022-03-14 18:04:21 +00:00
Damjan Marion
eb63caea2a vppinfra: don't account vec_header_t size twice in the pool header
Type: fix
Change-Id: I298d2a5067f7949002e6c010f892553f1eb9f477
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-14 17:55:19 +00:00
Fan Zhang
a9fe20f4b8 dpdk: improve rx burst count per loop
Type: improvement

This patch improves the per dpdk-input loop number of packets
received from the port. The change mimics how packets rx happened
before VPP 22.02/DPDK 21.11: instead of trying to rx huge number
of packets (256) in one go, rx more times with up to 32 packets
max each time.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: I804dce6d9121ab21b02e53dd0328dc52ac49d80f
2022-03-14 16:58:16 +00:00
Benoît Ganne
e41fa7790f map: fix memory leak
Thanks to Ben McKeegan <ben@netservers.co.uk> for the report.

Type: fix

Change-Id: I8170dda572c326b6b1823fd330dbd5e961fdad74
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-11 21:46:00 +00:00
Renato Botelho do Couto
dcd08b278f build: Restrict tag names when discovering version
Type: improvement

When `make install-ext-deps` is called, it creates a debian changelog
file and use `git describe` to fill project version.  On downstream
consumers it's possible to have different tags that makes it to end up
using an invalid version on changelog and breaking the installation
process.

Restrict tags to be considered by git-describe to match 'v[0-9]*'
pattern to get it fixed.

Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
Change-Id: Ieabd7b42ac33735ec4d484bed9039ff20c9872f2
2022-03-11 19:13:04 +00:00
Florin Coras
91a46cb1ff tls: remove pkg dependencies on mbedtls
The tlsmbedtls plugin should only be built if mbedtls libraries are
present.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I24364177d24ea744f24f808f492be08adff3690b
2022-03-11 19:04:46 +00:00