13396 Commits

Author SHA1 Message Date
Samvel Vartapetov
7f5f21ebc4 udp: fix ipv6 udp punt show
Type: fix
Signed-off-by: Samvel Vartapetov <svartapetov@yandex-team.ru>
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I57cba1e724f851419c7dfdee896568fc7416feaf
2024-03-03 01:12:14 +05:00
Florin Coras
4f3da9c1f7 session: add api cb for listen and unlisten
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I28ccebf4d2f0728dd174ab3ee77a0d7ad4b90951
2024-03-01 22:22:53 +00:00
Damjan Marion
242fe13c62 crypto-native: fix AES-CBC encrypt loop
Type: fix
Change-Id: I11cc52ff3867277e6591efb061f96cadfcc70c88
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-01 15:33:53 +00:00
Tom Jones
46bddc3b4a dhcp: Compare DIUD_LL as a network short
The existing comparision triggers the following clang assertion:

    error: result of comparison of constant 50331648 with expression of type
    'u16' (aka 'unsigned short') is always true

Section 9.1 of RFC3315 describes the DUID type field as:
    "A DUID consists of a two-octet type code represented in network byte"

correctly convert the local type to a network short for the comparison.

Type: fix
Change-Id: I7cb048035bd5e06372e29471ae6004ee1b2191b9
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-29 14:57:45 +00:00
Monendra Singh Kushwaha
3d1459b142 octeon: add flow offload infra
Type: feature

Change-Id: I3485e1627eafc5125255985003573247e7562db2
Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
2024-02-28 15:35:52 +01:00
Niyaz Murshed
7f050d9749 crypto: CLI to change dispatch mode
This change aims to affect crypto_sw_scheduler behavior,
but all the edits end up in vnet/crypto.

After 9a9604b introduced adaptive mode for crypto dispatch,
the performance of async mode at lower rate got worse.

A work around for CSIT test is done by changing dispatch mode via explicit API call
in 139aba2047

In this change, the CLI is brought back to allow user to fix the
dispatch mode.

set crypto async dispatch mode <polling|interrupt|adaptive>

Type: improvement
Change-Id: I029e98aa25889eddcf62e75a6c78926cdee862ef
Signed-off-by: Niyaz Murshed <niyaz.murshed@arm.com>
2024-02-28 13:40:03 +00:00
Florin Coras
ea158d64a0 tls: pass reset ntf to engines
Type: improvement

Change-Id: Ie042605e50656229874b7a93638f0f04c894410f
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-02-27 18:49:20 +00:00
Florin Coras
7c90be5e29 session: fix transport closed and disconnect race
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie7ff4bac22e9dbb449610072b52d1ec4e46fe757
2024-02-27 18:49:06 +00:00
Monendra Singh Kushwaha
4af3fdfdd0 dev: add per-port vnet flow
Type: feature

Change-Id: If63f39211288ab2eba8bc1ab50a2a4c7755abc66
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
2024-02-27 15:37:20 +00:00
Florin Coras
4e32bc6b6d tcp: fix fin retransmit when out of buffers
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I787825dea7f82748537cc4372104cc6647cf2132
2024-02-26 18:43:48 +00:00
Tom Jones
5bce60353c hsa: Undef libepoll-shims close on FreeBSD
libepoll-shim has some hacks to enable functionality, one of these
redefines close as a macro. This conflicts with a close call back. On
FreeBSD undefine this macro at point of use.

Type: improvement
Change-Id: I7b4f7cd874f3451d76c580cf999369426d9e89c2
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-26 18:04:11 +00:00
Mohsin Kazmi
84847c4762 virtio: fix the packed ring support
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: If27702d2a9755e0e0a6eaeab4cf26b4974444b44
2024-02-26 16:15:48 +00:00
Tom Jones
4e16e782ad memif: don't include prctl.h
Type: improvement
Change-Id: I3ab8df625524b5ff85e62760f5e29daf0d650773
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-26 09:23:15 +00:00
Florin Coras
60732dff6d tls: initialize app session app wrk
Type: fix

Change-Id: I8832839738b96495bd775a778dd736bb25e1236c
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-02-23 18:06:36 -08:00
Tom Jones
eceef16b5c svm: Use ftruncate to expand svm on FreeBSD
Linux doesn't support the Linux idiom of using lseek and a write to set
the size of a file, instead use ftruncate to accomplish the same effect.

This change is taken from the Nanoteq VPP port commit:
04a1b19b37

Type: improvement
Change-Id: Ie0b83e751b8b8f20b6814e5c9f760035747dfad9
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-23 18:48:29 +00:00
Tom Jones
b613d411a4 vcl: Use FreeBSD specific errno value for bad fd
Type: improvement
Change-Id: I7693f2647f65f662c9b20f77bbf7e1a530b58259
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-23 10:51:40 +00:00
Tom Jones
5ed27ef8b6 build: Discover libepoll-shim on FreeBSD
FreeBSD doesn't offer epoll, but an implementation which uses kqueue is
available as an external library. On FreeBSD in subsystems which require
epoll have cmake look for libepoll-shim.

Type: improvement
Change-Id: Iafd5406a9e2ebaa53fd94034489ffbbf87a7d040
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-23 10:07:49 +00:00
Tom Jones
72cb9f7e44 vlib: Use platform specific headers for sched.h
FreeBSD only defines posix scheduling policies, remove the others from
the for each look to allow build.

Type: improvement
Change-Id: Ifdb9414417e8b6ffdf216fd001708b347c496b97
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-23 10:02:34 +00:00
Tom Jones
532a1ce98a build: Add support to add_vpp_library for platform specific sources
Add support for adding Linux and FreeBSD specific sources to
add_vpp_library and support for installing Linux specific headers. Don't
add support for FreeBSD specific headers until we have some to install.

Type:	improvement
Change-Id: I38549cf4d71999b71b3298e529323956e54ddc36
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-23 10:01:47 +00:00
Benoît Ganne
89c7b545dd ip6: ECMP hash support for ipv6 fragments
Type: improvement

Change-Id: I41f70e5977fedbf0050205ebe52126ef373ebc06
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2024-02-22 08:24:02 +00:00
Florin Coras
8074fc6209 tls: fix transport endpoint get
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idb8cc576168ce0ffa8f06be1acef4be4b3b29433
2024-02-20 11:27:03 -08:00
Maxime Peim
7217dcdb54 pg: fix stream pg interface
When an other interface is specified to generate packets from, we should
bind its sw_if_index to the pg interface to use.
Fix if_index_by_sw_if_index variable name, and force to specify a pg
interface to source traffic from.

Type: fix
Change-Id: Ib3e6dca92774b307def82926fc09945b7998267d
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2024-02-20 17:20:43 +00:00
Kaj Niemi
088d1a0168 build: Enable building on AlmaLinux 9
AlmaLinux is identical to Rocky and can be made to work with
the same build dependencies

Type: feature

Change-Id: I24bb8781a02c15f887c9c26cc98621e6256f4115
Signed-off-by: Kaj Niemi <kajtzu@a51.org>
2024-02-19 18:19:24 +00:00
Tom Jones
078affa92c vnet: include platform specific un.h
On FreeBSD define UNIX_PATH_MAX so it is available in punt.c. FreeBSD's
max path is 4 bytes shorter than Linux's.

Type: improvement
Change-Id: I2c4b7aa11246213575b557fab44669706885e6b7
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-19 18:12:06 +00:00
Tom Jones
ac80b8be8b vppinfra: Stub out get_current_cpu and get_current_numa on FreeBSD
FreeBSD has its own set of syscalls for getting current CPU and NUMA
domain information. Stub out these calls and return CPU 0 and NUMA domain
0 as placeholders until we bring in FreeBSD specific calls.

Type: improvement
Change-Id: Id61df0273b0bcc6acf4844ee626e4f246f9f217b
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-19 18:11:34 +00:00
Monendra Singh Kushwaha
03b7ac929e dev: fix type for uint32 arg value
Type: fix

Change-Id: Ib09d6a0dfc95d82ecfd2ff123be9004cb038d0d4
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
2024-02-19 18:10:38 +00:00
Monendra Singh Kushwaha
3e594d6d7d build: bump octeon-roc version to 0.3
This patch updates cache line size in octeon-roc library.

Type: fix

Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
Change-Id: Ifbb6e7d2a5436a88ef10d22c414112edc23e0b35
2024-02-19 18:10:07 +00:00
Lijian Zhang
97c9f5e7c7 crypto-openssl: refactor openssl API usage
For the openssl crypto engine based cipher encrypt/decrypt and HMAC IPSec
use cases, the openssl API calls of doing ctx init and key expansion are
moved to initialization stage.

In current implementation , the ctx is initialized with "key" and "iv" in
EVP_EncryptInit_ex (ctx, 0, 0, key->data, op->iv)
in data plane, while the ctx can be initialized with 'key' and 'iv' separately,
which means there could be two API calls:
 1. EVP_EncryptInit_ex (ctx, 0, 0, key->data, 0)
 2. EVP_EncryptInit_ex (ctx, 0, 0, 0, op->iv)

As the 'key' for certain IPSec SA is fixed and known, so call #1 can
be placed in IPSec SA initialization stage.
While call #2 should be kept in data plane for each packet, as the "iv"
is random for each packet.

Type: feature
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Change-Id: Ided4462c1d4a38addc3078b03d618209e040a07a
2024-02-19 15:37:19 +00:00
Lijian Zhang
6f8252e83c wireguard: notify key changes to crypto engine
This is a prerequisite patch for the following openssl API optimization
patch, which tries to offload openssl ctx init and key expansion work to
the initialization stage.

Wireguard adds crypto keys via vnet_crypto_key_add (), and whenever it
modifies the keys, the underneath openssl crypto engine shoud be informed
of the changes to update the openssl ctx.

Type: feature
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Change-Id: I3e8f033f3f77eebcecfbd06e8e3bbbfdc95a50e2
2024-02-19 15:36:36 +00:00
Matthew Smith
ff71939c30 ipsec: check each packet for no algs in esp-encrypt
In esp_encrypt_inline(), if two or more consecutive packets are
associated with the same SA which has no crypto or integrity algorithms
set, only the first one gets dropped. Subsequent packets either get sent
(synchronous crypto) or cause a segv (asynchronous crypto).

The current SA's index and pool entry are cached before it can be
determined whether the packet should be dropped due to no algorithms
being set. The check for no algorithms is only performed when the cached
SA index is different than the SA index for the current packet. So
packets after the first one associated with the "none" alg SA aren't
handled properly.

This was broken by my previous commit ("ipsec: keep esp encrypt pointer
and index synced") which fixed a segv that occurred under a different
set of circumstances.

Check whether each packet should be dropped instead of only checking
when a new SA is encountered.

Update unit tests:
- Add a test for no algs on tunnel interface which enables
  asynchronous crypto.
- Send more than one packet in the tests for no algs.

Type: fix
Fixes: dac9e566cd16fc375fff14280b37cb5135584fc6

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I69e951f22044051eb8557da187cb58f5535b54bf
2024-02-19 15:35:54 +00:00
Florin Coras
37127f7bcc udp: use transport port refcnt on accept
Use udp transport refcnt instead of local port refcnt when accepting new
connections.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibc34677b1138682497f98e96b6fddb5b96094ff9
2024-02-18 18:54:55 +00:00
Tom Jones
9a97fb8ad7 svm: Only include sys/user on Linux
Type: improvement
Change-Id: Idb318eb386617013015c43153bf0bd92fa28b9b6
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:08:21 +00:00
Tom Jones
9447adc429 vnet: Add required header for pthread_np
Type: improvement
Change-Id: Ia9295b79340a18de6eb5fe80877dcf4ce97b35eb
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:08:04 +00:00
Tom Jones
67e7f016d2 vppinfra: Place hugepage MMAP call behind linux specific ifdef
Type: improvement
Change-Id: I3a48ec4fd4a4063b6e3792b87def7bb796fc947c
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:06:31 +00:00
Tom Jones
9bf4f8fb58 vnet: Use platform specific netlink headers on FreeBSD
Type: improvement
Change-Id: Ifbd84a45edc82c79ac2850dd70ecdd2f9f1289ae
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:05:33 +00:00
Tom Jones
0f7830023a vnet: Disable tuntap build on not Linux
tuntap requires porting on FreeBSD, only build on Linux for now.

Type: improvement
Change-Id: I448c462b31f3bc06f291a95d0ff5df9d6f8f24b8
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:03:01 +00:00
Tom Jones
aaa2a89a3d vlib: Only init vfio on Linux
Type: improvement
Change-Id: Id1c72928324b85bc67860e600722bf8baeff45b2
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:02:27 +00:00
Tom Jones
646e5d2ad4 vpp: Add required socket headers on FreeBSD
Type: improvement
Change-Id: I948e447082233187d9ca794ca56a62fad4592e13
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:01:57 +00:00
Tom Jones
e12f69f773 vppinfra: Provide FreeBSD implementation of clib_mem functions
Working from the implementation in linux/mem.c add FreeBSD specific
functionality. This duplicates parts of the Linux implementation and a
depuplication job could be run in the future.

Stub out some parts of the API for now, they are either use unavailable
features on FreeBSD or require further implementation than this initial
implementation.

Type: improvement
Change-Id: I1e443e32304d19776a9a4d5e34adfa16ec919427
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:00:09 +00:00
Tom Jones
2cbbbb6d15 build: Add FreeBSD as a supported platform for cmake
Allow FreeBSD as a platform in the main CMakeLists file. This requires a
correct target for the compiler and an explicit name in the system
check.

The included subdirs require further changes to build, but the compiler
needs to find them before it can complain.

Type: improvement
Change-Id: Ic56fe68290519ef5d3ed61082e7fb0ba0528a3fc
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 15:59:11 +00:00
Tom Jones
61b4efc4da vnet: Provide platform specific if_tap headers
Type: improvement
Change-Id: Ia5cec0afc7f929491e495bb337493e64f752d75f
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 15:58:01 +00:00
Tom Jones
6ce1e930e8 vnet: Only build tap on Linux
tap requires some porting on FreeBSD, while we wait for those changes
only build tap on Linux.

Type: improvement
Change-Id: I4361bf43764fdb046c2138d4a2ee5d7efa31bd5a
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 15:57:17 +00:00
Tom Jones
393bfa786c vpp: Add platform specific headers for socket and inet
Type: improvement
Change-Id: Idcedc14089a49483d83c28a82ecb79d1b856f225
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 15:53:09 +00:00
Florin Coras
d1e17a8738 tcp: retransmit fins in last-ack
Fix instances where timers are reset after programming fin.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib80e3a401d585f388a97c7f2bb62e68ee774d50d
2024-02-17 02:25:07 +00:00
Florin Coras
81a6ffced1 udp: unregister ports on all cleanups
UDP transport port refcount is incremented even if port is shared. So
decrement it, by unregistering, whener udp connections are cleaned up.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id0a2c60c5faf4dea8b2cd9ded0334934ad9e918c
2024-02-16 18:18:56 +00:00
Denys Haryachyy
d5d510f795 vppapitrace: Fixed trace dump API result issue.
Set last thread id and last packet position in TRACE_DUMP_REPLY.
To enable collection of traces from multiple workers using iterator.

Type: fix

Change-Id: I69872af4f6981d50cd050fa3d16de2a3c0d6b496
Signed-off-by: Denys Haryachyy <garyachy@gmail.com>
2024-02-16 15:29:07 +00:00
adrianvillin
fbf5f2b030 hs-test: shortened interface names to avoid character limit
Type: test

Change-Id: I09df597ccb8a3c4af47b8a36010afb81df533236
Signed-off-by: adrianvillin <avillin@cisco.com>
2024-02-15 18:35:34 +00:00
Florin Coras
0ded4890be tls: mark ho done atomically after ctx init
Make sure ctx is initialized before ho is marked as done.

Type: fix

Change-Id: If0525a9890a56e289e2ab006c669a9d64dc6505d
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-02-15 17:52:51 +00:00
Florin Coras
e439b1e70e session: postpone ct cleanup if rx evt pending
Type: fix

Change-Id: I8cfaa62abd38d5356263b0ffd428638d1a027617
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-02-15 17:20:41 +00:00
Benoît Ganne
a421d564cd build: add fib configuring option
Allow to select 8-8-8-8 or 16-8-8 mtrie FIB implementation.

Type: improvement

Change-Id: I2f4aec8bfec987d3f3d9f9cc5a16fabf4b6cc2ac
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2024-02-15 08:34:58 +00:00