13294 Commits

Author SHA1 Message Date
Mohsin Kazmi
c60266d1ea memif: use VPP cacheline size for memif when compiling within VPP
Type: make

memif.h file is independent code which can be used outside of
VPP. Hence it uses its own cacheline size MACRO. This patch
sets the value of MEMIF_CACHELINE_SIZE in the cmake file for
memif plugin to VPP_CACHE_LINE_SIZE.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I8185e78897f4571f1a0430dd7e758816e127444c
2024-01-19 12:32:55 +00:00
Tom Jones
c3b416c492 build: Explicitly use bash for shell scripts
VPP requires bash for all shell scripts. Align shebang lines in build
and test scripts to look up the location of bash rather than hard coding
'/bin/bash'.

Look up the location of bash for makefiles.

Type: improvement
Change-Id: I23b705d81d60389fa8af61c680cf0abd74f0ea24
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-01-19 12:30:01 +00:00
nucleo
ca75cd83b5 af_xdp: Backport xdp-tools fix transposed calloc() arguments
Fixes compilation error with GCC 14

'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument

Type: fix

Change-Id: Ie328ecc711976547df2cffe17325b786bc7a8849
Signed-off-by: nucleo <alekcejk@googlemail.com>
2024-01-19 08:39:46 +00:00
Maxime Peim
77caeb1b19 tests: preload api files
When sanity test is not done, API files are not loaded until the
first test case is run. Hence, it is not possible to use enums, etc.
outside of a test class.
By preloading API files before running any tests, it prevents its
issue.

Type: fix
Change-Id: I8730150374e6c5f8d6933ec037811372ac2a8da0
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2024-01-18 20:14:54 +00:00
Filip Tehlar
87241fefd9 hs-test: use specific port for http3 test
curl sometimes uses 2 different source ports during the test.

Type: test

Change-Id: Ib27e9d22a9cc951f4729f4bd0ae99d80bf8d938b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2024-01-18 17:06:00 +00:00
Damjan Marion
01fe7ab88e octeon: native driver for Marvell Octeon SoC
Type: feature
Change-Id: I6898625c4e8854f777407dac3159e4c639a54860
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-01-17 20:44:10 +01:00
Georgy Borodin
dc26d50426 vppinfra: change fchmod to umask for unix socket
Setting g+w permission for unix sockets didn't work. There were
two problems:
1. new flag local_only wasn't set for all AF_UNIX sockets;
2. fchmod is not a good choice for sockets.

fchmod was replaced with couple of umasks, and local_only with
socket type check.

Type: fix
Fixes: 085757bb4930511928daa97f972cdca021e7a813
Change-Id: I8dc0fceb110a36bfa234f552bbdf182e09e55e27
Signed-off-by: Georgy Borodin <bor1-go@yandex-team.ru>
2024-01-17 19:10:13 +00:00
Artem Glazychev
8beddaf5b4 af_packet: set next0 for AF_PACKET_IF_MODE_ETHERNET mode
Normally af_packet sets next0 = next_index on each cycle. It works for the most cases.
But if vlib_validate_buffer_enqueue_x1() changes the next_index (from NEXT_ETHERNET to NEXT_DROP for example)
then the following next0 will have the wrong value, and the correct packet will be dropped.

AF_PACKET_IF_MODE_IP handles this case, but AF_PACKET_IF_MODE_ETHERNET doesn't.

Type: fix

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: Ic742043e8b10a2abe56b314bb584277151a9c5eb
2024-01-17 14:13:47 +00:00
Guillaume Solignac
de04e023cb build: add vapi scripts to VPP_HOST_TOOLS_ONLY
vapi generators were missing from the VPP_HOST_TOOLS_ONLY, which
prevents building an out-of-tree plugin with API files. We now
install them.

Type: improvement
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: Ie613c8f64034e933124325242f2f8b3ac3955878
2024-01-16 22:34:43 +00:00
Georgy Borodin
c018204aaf vnet: fix log_debug message format
debug+asan build will fail on initialisation when loglevel==debug

Type: fix
Fixes: 1cd0e5dd533f4209dde453eaa43215e52cd42985
Change-Id: I2005ebf9b95ec3b753c4e6d29337be460c77ffed
Signed-off-by: Georgy Borodin <bor1-go@yandex-team.ru>
2024-01-16 22:07:46 +00:00
Dmitry Valter
0bef4cf39c vppinfra: fix memcpy test buffer size
Fix dst buffer size in memcpy_x86_64 test.

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.com>
Change-Id: I2b4502a62d9346d729b83522f4ea01c98a5b961c
2024-01-16 22:04:38 +00:00
Kai Ji
ebe2371e6a dpdk: add ID for QAT 4xxx series VF support
Type: feature

Enable use of 4th gen QAT series devices.

Change-Id: I890c1f1d305ff9b996322c29e9510cfe89d88d97
Signed-off-by: Kai Ji <kai.ji@intel.com>
2024-01-16 22:03:43 +00:00
Georgy Borodin
dbe9937b72 dpdk: fix log_debug message format
debug+asan build will fail on initialisation when log level==debug

Type: fix
Fixes: 549838c81bd0d995f2b8569955afc33132582c77
Change-Id: Ic64b376727d49f89790fb29bd03a0a2520625cdc
Signed-off-by: Georgy Borodin <bor1-go@yandex-team.ru>
2024-01-16 22:02:58 +00:00
Damjan Marion
1cfac4e6e4 vlib: remove unused code
Type: improvement
Change-Id: I2c54cb3eb41ed35f114eca75fb6e2be3eb3f4ca1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-01-16 17:40:56 +00:00
Damjan Marion
7e9513b8fc vppinfra: enable AES tests on ARM
Type: improvement
Change-Id: I30f3b2924ab219a8bace87f358b1b823e8bc83bb
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-01-16 17:40:40 +00:00
Pim van Pelt
4a515d35a8 build: Provide clang-14 for Debian12
checkstyle.sh assumes clang-format-11 but allows it to be overridden.
Debian12 ships with a minimal version of clang-14, so set the correct
version for checkstyle.

Before:
$ make checkstyle
extras/scripts/checkstyle.sh: line 41: --version: command not found
make: *** [Makefile:720: checkstyle] Error 127

After:
$ make checkstyle
Debian clang-format version 14.0.6
*******************************************************************
* CHECKSTYLE SUCCESSFULLY COMPLETED
*******************************************************************

Type: make
Fixes: 712fc0308981c61444e593d6bcc2ad62102c726d
Change-Id: I0c58456477011397115810dab825865b5850d10d
Signed-off-by: pim@ipng.nl
2024-01-16 17:39:17 +00:00
Pim van Pelt
276cd73b75 stats: Add optional labels to prometheus metrics
* Refactor the existing prometheus exporter to function print_metric_v1()
* Add a 'v2' flag which instead uses metric names with labels, example:
  nodes_clocks{node="ip4-lookup",index="0",thread="4"} 30198798628761
  nodes_vectors{node="ip4-lookup",index="0",thread="4"} 298176625181
  nodes_calls{node="ip4-lookup",index="0",thread="4"} 119789874274
  nodes_suspends{node="ip4-lookup",index="0",thread="4"} 0

  interfaces_rx_packets{interface="tap0",index="0",thread="1"} 79582338270
  interfaces_rx_bytes{interface="tap0",index="0",thread="1"} 16265349667188
* For stat names that we don't know, print their v1 equivalent, which
  keeps backwards compatibility.

Details in https://ipng.ch/s/articles/2023/04/09/vpp-stats.html

Type: improvement
Signed-off-by: pim@ipng.nl
Change-Id: I53ed3ede8cc7853eb46c354834d89eb788ece3b1
2024-01-16 10:05:55 +00:00
Florin Coras
66abf32283 session: avoid spurious disconnect and reset ntfs
Type: fix

Change-Id: Icdc9d1c8b7b29827ce17920dae64a365bb8a4e40
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-01-15 13:11:24 +00:00
Mohsin Kazmi
159ee88ff5 devices: add support to check host interface offload capabilities
Type: improvement

This patch implements support to check the host interface offload
capabilities.

NOTE: this check is only done once when interface is being created.
Any changes to the cap of host interface after that will not reflect
changes to af_packet interface in VPP.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ibc9953131f64f3fb3e601d34036b9f453913692a
2024-01-15 10:01:37 +00:00
Pim van Pelt
712fc03089 build: Add Debian12 environment
Add clang-14 and libffi8 which ship with Debian Bookworm. The project
compiles cleanly with these versions.

Type: make
Change-Id: I17350aae30cec72987792d54d88231b3221b56b9
Signed-off-by: pim@ipng.nl
2024-01-14 21:10:33 +01:00
Florin Coras
ed4e612e60 session: fix app wrk free leak
Type: fix

Change-Id: I9c48b163f174b824df1a76e75c272dc985386bf2
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-01-12 18:23:53 +00:00
Damjan Marion
da3771c25b crypto-native: add AES-CTR
Type: feature
Change-Id: Iab84226043d8042a99a507767b75e9d4a89cc5c6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-01-12 17:37:42 +00:00
Damjan Marion
9caef2a351 vppinfra: native AES-CTR implementation
Type: feature
Change-Id: I7ef3277edaeb266fbd3c8c9355d4443002ed2311
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-01-12 17:37:28 +00:00
Filip Tehlar
bf40da413f http: fix memory leak
Type: fix

Change-Id: I36905132a42d23e719bf0e82eeafa48f60f4887a
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2024-01-12 11:25:16 +01:00
Tianyu Li
d7c96324c0 libmemif: fix segfault and buffer overflow in examples
- Fix buffer overflow caused by strncpy(dst, src, strlen(src)),
use sized buffer to ensure overflow safe.

- Fix test_app getopt usage

 When use example/icmp_responder in slave mode
- Fix segfault when buffer size is not specified
- Fix wrong packet send out.

Type: fix
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I5ed47fd8e630420d7ae0203a2605d2b9abd33d2a
2024-01-12 03:22:56 +00:00
mbly
00e9fe6ca7 libmemif: fix for memif_init_queues slot math
Increase slot variable to u32 to address combinations of num-queues and queue-size that cause slot variable to wrap when declared as u16, e.g. num-queues > 8 && queue-size is 2^12

Type: fix
Change-Id: I5bd6198d60395156a06f1a280ea2594824ceaa9d
Signed-off-by: mbly <mbly@ciena.com>
2024-01-12 03:22:30 +00:00
mbly
a908779820 libmemif: Fix for memif_buffer_alloc rewind logic
Rewind logic was not supporting count = 1, where size was > memif_buffer_size and a rewind is required.
Fixed slot-->next_buf bug for !master as well.

Type: fix
Change-Id: I65cf0d3d0c105f37125412a613e5ff8c5da9a3a2
Signed-off-by: mbly <mbly@ciena.com>
2024-01-12 03:22:06 +00:00
Daniel Béreš
9853342194 libmemif: added tests
This patch provides unit tests for libmemif written in Unity

Type: test

Signed-off-by: Daniel Béreš <dberes@cisco.com>
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I19116def6e6d28efd5f460c93911245474a11321
2024-01-12 03:21:41 +00:00
Filip Tehlar
56e17cf7a2 hs-test: add more asserts
Type: test

Change-Id: Ia285ff39d9b19464ea086ec847ceaf52c6c0195c
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2024-01-11 19:45:06 +00:00
Ranjan Raj
ba39d86eec crypto: align host and VPP IPsec-mb lib
Ensure alignment between the Intel IPsec-mb library on the
host and VPP targets.If the version of Intel ipsec-mb on the
host is misaligned with the targets,terminate the compilation
process to prevent potential library linkage issues.

Type: fix

Change-Id: I38864115d59ae09fb5556ad4a29e884ebace8155
Signed-off-by: Ranjan Raj <ranjanx.raj@intel.com>
2024-01-11 13:19:57 +00:00
Filip Tehlar
3336eefaa8 hs-test: add tls proxy test
Type: test

Change-Id: I8f3f4c464907356bb1990ea53f0f46befc057acf
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2024-01-11 10:35:54 +00:00
Filip Tehlar
4fa0ba6ac0 hs-test: retry command on test setup failure
Type: test

Change-Id: Iad744c4b3f79820e8bd0dd2ef9f18e4f7718e845
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2024-01-11 10:27:09 +00:00
Alexander Skorichenko
afefe22e5d linux-cp: fix route prefix construction
Prevent comparison ops for uninitialized IPv6 prefix bytes.

Type: fix

Change-Id: I440fea7f0725769406ad348eb3402a98c593dc3c
Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
2024-01-10 16:16:35 +00:00
Pim van Pelt
2c9b128e1b linux-cp: Fix looping netlink messages
Signal when consuming a batch of netlink messages, in order to inhibit
lcp_sync from generating new netlink messages. This avoids link up/down
state changess from triggering an infinite loop.
Do this in the regular case of nl_route_process_msgs()
and in the special case of re-synchronizing in lcp_nl_recv_dump_replies().
Type: fix
Change-Id: I419d3f9aa350c119b3778b644c65165cb4cc1bef
Signed-off-by: Pim van Pelt <pim@ipng.nl>
2024-01-10 14:49:25 +00:00
Pim van Pelt
2fa69effc8 urpf: add interface dump to API
Add an urpf_interface_dump() API call, with optional sw_if_index.
If either a mode or a table is specified in any given interface
address family and direction, return it in a list, otherwise omit
it.

TESTED:
create loopback interface instance 0
create loopback interface instance 1
create loopback interface instance 2
create loopback interface instance 3
ip6 table add 8298
set urpf ip4 rx loose loop1
set urpf ip6 tx off loop2 table 8298

API call urpf_interface_dump(sw_if_index=~1) returns:
[
urpf_interface_details(_0=658, context=2, sw_if_index=2, is_rx=True, mode=<vl_api_urpf_mode_t.URPF_API_MODE_LOOSE: 1>, af=<vl_api_address_family_t.ADDRESS_IP4: 0>, table_id=0),
urpf_interface_details(_0=658, context=2, sw_if_index=3, is_rx=False, mode=<vl_api_urpf_mode_t.URPF_API_MODE_OFF: 0>, af=<vl_api_address_family_t.ADDRESS_IP6: 1>, table_id=8298)
]

Type: improvement
Change-Id: I1ded5c445dc07dab73ea41b817b5827b72ca79d4
Signed-off-by: pim@ipng.nl
2024-01-10 00:28:06 +00:00
Florin Coras
97fef28a0b session: make app listener pool global
One less pointer chase when accepting sessions.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I20dbb21d15d4a703f76e3b12f04a6f5b5d2a3cd8
2024-01-09 17:07:54 +00:00
Florin Coras
7428eaa4a1 session: support for cl port reuse
Adds support for connectionless listener port reuse. Until now, cl
listeners had fifos allocated to them and therefore only one app worker
could ever listen, i.e., a session cannot have multiple fifos.

To circumvent the limitation, this separates the fifos from the listener
by allocating new cl sessions for each app worker that reuses the app
listener. Flows are hashed to app worker cl sessions but, for now, this
is not a consistent/fixed hash.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic6533cd47f2765903669f88c288bd592fb17a19e
2024-01-09 17:07:54 +00:00
Florin Coras
5afc13d594 session: avoid spurious closed notifications
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia98556e7ae61547cf153c78ec085cd4248bee74a
2024-01-09 17:07:26 +00:00
Mohsin Kazmi
2b5bc3bce6 libmemif: add name to maintainer file
Type: docs

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I994d843a035e6afc4b72d06745d2be74cd81cd3a
2024-01-08 13:45:52 +00:00
Alexander Chernavin
5d13416f38 flowprobe: fix calling vlib_time_now() from worker threads
Currently, when flowprobe_export_send() calls vlib_time_now(), a pointer
to the main thread's vlib_main_t is always passed (the one cached in
flow_report_main). However, that code can also be executed from a worker
thread. And passing a pointer to the main thread's vlib_main_t to
vlib_time_now() from a worker thread may cause time synchronization
issues. Also, running a debug binary will cause an assertion failure in
vlib_time_now() in this case.

With this fix, flowprobe_export_send() passes the pointer to the current
thread's vlib_main_t to vlib_time_how().

This doesn't allow to remove @tag_fixme_vpp_workers from the unit tests
yet as they will be failing for other multi-worker related problems.

Type: fix
Change-Id: Ia35e3a4176777b88cf8ca8af8af7c42c495cbc6a
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2024-01-02 23:08:59 +00:00
Filip Tehlar
b1ea30e563 http: unify client/server state machines
Type: improvement

Change-Id: I57a816fbed8b681dec201edc8d5950a34a555a2b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2024-01-02 12:07:04 +00:00
Dave Barach
b7e66f4a30 docs: minor updates to the lxc container test writeup
Fix minor differences between Ubuntu 18.04 LTS and Ubuntu 22.04 LTS when
using the scheme to test new code.

Type: docs

Change-Id: I5810b6f3d76d8d98fa764b61828b1ca32507bd91
Signed-off-by: Dave Barach <dave@barachs.net>
2023-12-29 11:19:37 -05:00
Florin Coras
44d9cbc49c session: add flag to track cless sessions
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0bb6aba26f1cd974d6bb3b5fe6234aacfee0d30c
2023-12-22 22:30:09 -05:00
Florin Coras
98d24a5fea hs-test: more proxy vars for docker builds
Type: improvement

Change-Id: Ica9d87abde7a1dc0b4007911a7e0abab46dfb75d
Signed-off-by: Florin Coras <fcoras@cisco.com>
2023-12-23 01:01:09 +00:00
adrianvillin
a77d4ca32a tests: Temporarily skip an unstable test
Type: test

Change-Id: Idd608511ed350a8e13afff393e558e20d52627a0
Signed-off-by: adrianvillin <avillin@cisco.com>
2023-12-22 17:32:10 +00:00
Florin Coras
f26bbeac4b hs-test: use prebuilt curl with http3 support
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4d17ae3f7736dc10c68ca6e304699ea39d012f6c
2023-12-22 17:19:11 +00:00
Filip Tehlar
7e452ba15c quic: seed random generator during init
Quic does not seed random value, so if the plugin is loaded
separately RAND_bytes will fail.

Type: fix

Change-Id: If600cbde1fef30afb6316fc1a355261b008c3191
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-12-22 16:49:57 +00:00
emmanuel
b1454f89b5 session: unset fifo evt to enqueue ack evt on tcp timewait
Incase the ack for the fin is lost twice or want to dup ack
packets with incorrect ack/seq # at different times and
session state is already closed, this fifo event is set for
the first ack that went out and prevents queuing of further events.

Type: fix
Change-Id: I102019fca26918a51e055a751db7209011bd43ad
Signed-off-by: emmanuel <emmanuelscaria11@gmail.com>
2023-12-22 16:27:48 +00:00
Alexander Skorichenko
e1489260ca vlib: lowercase vmbus device names
Use lowercased hex in uuid in sysfs/vmbus names

Type: fix

Change-Id: Ic4b7b995441723dc1b29ff8a75346cc8ba7f85f1
Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
2023-12-22 15:46:51 +00:00
hsandid
832342e3a4 vlib: add error checks to thread pinning
Type: fix

Added error checks around pthread_setaffinity_np
calls to stop vpp launch if pinning fails.

Change-Id: Iec391c485d1832b6c2ff20fbf789608f6bcf7b57
Signed-off-by: hsandid <halsandi@cisco.com>
2023-12-22 15:45:07 +00:00