13823 Commits

Author SHA1 Message Date
Matus Fabian
7f163b682a misc: replace index() with strchr()
Type: improvement
Change-Id: I471e514ebef0b4c1f86067115b2ebe5a5517c6fb
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-07-22 17:07:02 +00:00
Matus Fabian
7561c45bcc vlib: add "save memory-trace" debug CLI
Save memory traces of the currently traced heap in JSON format to file
which can be used as machine-readable data for memory leak diagnose.

Type: improvement

Change-Id: I277f5be5838510e907c4dd7a8a4e9a883cb67bc3
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-07-22 15:50:22 +00:00
Matus Fabian
ef827b3efc vppinfra: expose raw memory traces
Add clib_mem_trace_dup which return copy of memory traces and
can be used to save memory trace in different formats.

Type: improvement

Change-Id: I731860cdc65e6c5255620a6778ce6c893a493b1d
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-07-22 15:50:22 +00:00
Steven Luong
e87a03f7a6 session: show session rules does not display ip6 entries
1. Adding an ip6 rule entry
session rule add proto tcp ee80::/10 0 ee80::/10 0 action 2

2. show session rules does not display the entry.
show session rules tcp

3. However, show session rules for a specific entry shows the entry
show session rules tcp ee80::/10 0 ee80::/10 0

Type: fix

Change-Id: I65c881665d3698a2a9452a186ed657eee0bf13e0
Signed-off-by: Steven Luong <sluong@cisco.com>
2024-07-19 17:05:29 +00:00
Adrian Villin
09b19fe8a3 hs-test: fix docker log output when logs are empty
- removed "==> /dev/null <==" and "tail: cannot open..." lines
  when docker logs are empty

Type: test

Change-Id: Ia51f7aa41d2c6c04c0adcb82142abfd45fbe2728
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-07-19 14:08:19 +00:00
Fan Zhang
b753554e25 ipsec: fix integer overflow
Type: fix
Coverity issue: 394440

Change-Id: I915a088145ee1317a7c8746b517f4af50323aa11
Signed-off-by: Fan Zhang <fanzhang.oss@gmail.com>
2024-07-19 12:24:22 +00:00
Dave Wallace
6ce5d5bcbb pg: fix pcap packet type when writing pcap file
- fixes incorrect pcap packet type for packet
  generator interfaces configured in ip mode.
- corrects pcap file decode for pg output files
- fixes scapy versions > 2.4.3 which now appear to
  use the packet type in the pcap file header which
  had been ignored in earlier versions

Type: fix

Change-Id: Idb1e3f8fbc7ca938fb5d2aaa72365e333c0ea2e9
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-07-18 14:46:07 +00:00
Dave Wallace
0da0883453 tests: output raw packet data when decoding pcap files
Type: test

Change-Id: I4e945b2bd067466afdaa58a6f07a1ab2c567bc2b
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-07-18 14:45:49 +00:00
Xiaoming Jiang
04da324260 vppinfra: fix cpu freq init error if cpu support aperfmperf
After linux-v4.15, 'cpu MHz' in /proc/cpuinfo is CPU
real frequency on x86 if cpu support aperfmperf flags

more see linux commit: 
7d5905dc14

Type: fix
Change-Id: Ib655a9a1c519104142120b343cd8ddbe0b6e50e6
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
2024-07-18 08:46:14 +00:00
Klement Sekera
357291142b vnet: print Success for API errno 0 instead of UNKNOWN
Type: improvement
Change-Id: I8c5bfc82c1db1213eb43072853f8500ce1d2ee92
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2024-07-18 02:25:41 +00:00
Adrian Villin
2514001377 hs-test: use docker sdk
Type: test

Change-Id: I9d6b15ca6a9aac3343e10f480dec43c4c538f1b7
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-07-17 18:20:54 +02:00
Adrian Villin
b69ee00c34 hs-test: minor cpu pinning suite improvements
- added max cpu check for CI
- added a check for Ip4AddrAllocator: fixes a case where teardown panics
  if a test crashes before allocator gets initialized

Type: test

Change-Id: Ica12366cd79d77801964dfbdc8ee7c9969b4a9ce
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-07-17 16:10:29 +00:00
Adrian Villin
aedfd7ca3d hs-test: exit immediately if docker build fails
Type: test

Change-Id: I299d023ce59b931697352c54e4796ba0af2ab1af
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-07-17 16:07:32 +00:00
Niyaz Murshed
1d3faf0c57 vppinfra: Add macro for targeted prefetching
In Arm platform, targeted prefetching[1] is supported. Adding this in infra
to use it in future optimisation.

[1] https://developer.arm.com/documentation/101458/2404/Optimize/Prefetching-with---builtin-prefetch

Type: improvement
Change-Id: Id3e2a274628289707840a6b2ba4b83c5e4add60b
Signed-off-by: Niyaz Murshed <niyaz.murshed@arm.com>
2024-07-17 14:59:26 +00:00
Steven Luong
99213e0836 session: memory leak on rule tag
Type: fix

Change-Id: If07a6a420d467e6305f166ed250f84befe9f983d
Signed-off-by: Steven Luong <sluong@cisco.com>
2024-07-17 07:29:32 +00:00
Steven Luong
d1aeac5b7f session: memory leaks on rule tag hash tables
Type: fix

Change-Id: Id8542ad74389eca4cc7903cd455f556743a5e0cf
Signed-off-by: Steven Luong <sluong@cisco.com>
2024-07-16 15:35:42 -07:00
Florin Coras
3a2cf84fa5 tls: track app owner of transport session
Allow other apps to own transport sessions for tls.

Type: improvement

Change-Id: Ida04cef1dc49acb7117cbed8657e26890bf43d2a
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-07-16 15:50:30 +00:00
Steven Luong
2da273ace8 session: crash in session_rule_add_del if session is not enable
Invoking the API session_rule_add_del to add a rule causes VPP to crash
if session is not enable.

Type: fix

Change-Id: If8de83f1064bc60d20461e87889b7c3393ad2af1
Signed-off-by: Steven Luong <sluong@cisco.com>
2024-07-15 21:11:00 +00:00
Steven Luong
67bae20b05 session: application namespace may reference a deleted vrf table
lock the vrf table when adding an application namespace and
unlock the vrf table when deleting an application namespace.

Free the session table when no more application namespace
uses it anymore to avoid memory leaks.

Type: fix

Change-Id: I10422c9a3b549bd4403962c925e29dd61a058eb0
Signed-off-by: Steven Luong <sluong@cisco.com>
2024-07-15 20:57:35 +00:00
Klement Sekera
ca2f2e1ec9 tests: more options for decoding pcaps
Introduce "none", "all" and "failed" options for --decode-pcaps
parameter. Keep "failed" as default to be consistent with current
behaviour. Add missing documentation to test/Makefile and passthrough to
Makefile.

Rationale: running tshark binary takes about 100-150ms and if there are
thousands of pcap files, it takes minutes to decode them. This might not
be desirable if rerunning the tests repeatedly during development.

Type: improvement
Change-Id: Ie033521d51d18b9d499b9bc40fe6eff21c94622d
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2024-07-15 18:58:07 +00:00
Alok Mishra
9bff049b84 octeon: fix link down issue
An issue is noticed when the link state of the ethernet interface is
toggled to down and again brought up. The link status shows "up" in the
"show interface", but shows "down" in "show hardware-interface".
This issue does not occur when the link is brought up for the first
time, but only manifests when the interface is brought down and up again.

This happens because the device status and VNET_HW_INTERFACE_FLAG_LINK_UP
aren't correctly updated during the port stop, preventing them from
being updated during the port start.

This patch fixes this issue in the port stop function.

Type: fix
Fixes: 01fe7ab88e

Signed-off-by: Alok Mishra <almishra@marvell.com>
Change-Id: Idbc5a6c31409a3d1c5b19e14a3c9509291175677
2024-07-15 17:13:57 +00:00
Dmitry Valter
34fa0ce8f7 tests: skip more excluded plugin tests
Check and skip VPP_EXCLUDED_PLUGINS tests for most of plugins.

Type: improvement
Signed-off-by: Dmitry Valter <d-valter@yandex-team.com>
Change-Id: I23fd3666729251c639aa8da72a676058e3f5bb4e
2024-07-12 15:43:24 +00:00
Jay Wang
7b7bc045f8 build: overwrite clang-format version on Ubuntu 24.04
clang-format-11 is used by default in checkstyle.sh while it can be
overridden to higher clang-format version. On Ubuntu 24.04, the minimum
version of clang-format is version 14. Set the environment variable
explicitly in Makefile to overwrite the clang-format version.

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

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

Type: fix

Change-Id: Iba3e4739c9376701577b2f37e070d199b195e7d0
Signed-off-by: Jay Wang <jay.wang2@arm.com>
2024-07-12 12:53:56 +00:00
Renato Botelho do Couto
e69ec9c101 build: Fix crossbuilding definitions
CMAKE_C_COMPILER_TARGET doesn't need to be set when it's not cross
compiling, and based on wrong identation of that line I suspect it was
intended to be inside CMAKE_CROSSCOMPILING conditional.

With this line moved inside, it ends up being the only place where
COMPILER_SUFFIX is used, so, move its declaration there as well.

It will not bring any change to currently supported systems but will
make it easier to build VPP on systems running musl libc.

Type: fix

Change-Id: Ia8e16d9e8ad9c987ddf246dd0e3f8636ccad1362
Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
2024-07-12 12:40:15 +00:00
Dave Wallace
d18726eaac build: ubuntu-24.04 install-deps package list
- support for ubuntu-24.04 CI jobs

Type: make

Change-Id: I225d72e22207283de9979cce75d8d208ab99feb5
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-07-12 11:49:10 +00:00
Maxime Peim
6eac5bac60 fib: fix covered_inherit_add
When a FIB entry has multiple sources installed by covering inheritance,
the first walk installs the covering source, which can be worse than the
already used one (hence the source is not activated). If a covering path
is added and a new fib cover walk is done, the deactivated source is
compared to itself. This operation calls for a reactivation of the source which was not activated in the first place.

Type: fix
Change-Id: I2639401bed14eb5a2cb003664c04d6c1f9130de9
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2024-07-12 03:12:58 +00:00
Maxime Peim
0e3fcc0b7e ip6: fix icmp error on check fail
Avoid to do fixup either if TTL or MTU check fails. It rewrites the
icmp header copied in case the ip6-icmp-error ran before.

Type: fix
Change-Id: If043d1cae35c41ebf70ba979883119604bee883d
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2024-07-12 03:11:46 +00:00
Benoît Ganne
23c489660b fib: improve ipv6 fib scaling
VPP IPv6 FIB relies on 2 bihash for all its VRFs: 1 for control plane
and one for data plane. Because of that, control plane VRF walks
time grows with the number of VRFs as it has to go through all the VRFs.
In order to improve control plane performance with large number of VRFs,
the control plane data structure is changed from a global bihash to a
per-VRF hashtable, similarly to IPv4. Contrary to IPv4, there is only 1
hashtable per VRF and not 1 hashtable per prefix-length per VRF, which
is a compromise between memory consumption and single VRF scaling.

Type: improvement

Change-Id: Ib738a44adb88e46c95c4c62c853ee1f1392c7187
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2024-07-12 03:09:58 +00:00
Benoît Ganne
ff570d3d07 fib: make mfib optional
In some cases we do not need multicast support. Making it optional helps
scaling to high number of VRFs, by reducing the control plane operations
and memory consumption.

Type: improvement

Change-Id: Ib34ed3fe2806e2f4624981da4e4a3c49c69f70be
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2024-07-12 03:09:22 +00:00
Benoît Ganne
caaa633223 fib: log an error when destroying non-empty tables
Destroying a non-empty fib table can lead to difficult to diagnose bugs,
like dandling fib entries preventing entries to be inserting to the
mtrie.
Always log an error to help diagnose those issues.

Type: improvement

Change-Id: I2c771a80595035b440931b74cca4429af22161a2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2024-07-12 03:05:02 +00:00
Adrian Villin
63bdb31963 hs-test: quick fix for CpuPinningSuite
Type: test

Change-Id: Iaed08fe23a63562c99012bd469ca3f3271be2564
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-07-10 22:26:39 +00:00
Steven Luong
3f75010dfb session: deleting an application namespace cleaning up the wrong application
We call application_namespace_cleanup to remove the application which
has a reference to the application namespace when deleting an application
namespace. When we find the matching application namespace, we queue
the ns_index instead of app_index to look for the application.
This may lead to a crash.

Type: fix

Change-Id: I89c7f8d1681b4c7c1bcb16641217230a26dbe582
Signed-off-by: Steven Luong <sluong@cisco.com>
2024-07-10 17:39:10 +00:00
Hadi Rayan Al-Sandid
e0e85134ad hs-test: Add CPU pinning test suite
Type: test

Added suite to verify that VPP launches with provided
CPU pinning configurations. CPU configuration is
specified per-test.

Change-Id: Ic283339676d3b24636fc21156a09a192c1a8d8da
Signed-off-by: Hadi Rayan Al-Sandid <halsandi@cisco.com>
2024-07-09 20:14:28 +00:00
Jay Wang
c44fa9355b vppinfra: fix huge page alloc error on 5.19+ kernel
Running VPP on a NUMA system with 5.19+ kernel outputs the following
error messages. 'show physmem' command confirms that VPP falls back to
using normal 4K pages instead of the preallocated 1G huge pages. The
root cause is that VPP uses move_pages()[1] to get the huge page node
information. However, this misbehaves on the 5.19+ kernel due to changes
introduced in its implementation[2].
Our proposed fix is retry obtaining NUMA node info with
get_mempolicy()[3] only if we see -ENOENT returned in status from
move_pages() and huge pages are used. Additionally, we use mincore()[4]
to check if pages are allocated and in memory to avoid the possibility
of get_mempolicy() falsely allocating a new page.

buffer  [warn  ]: numa[1] falling back to non-hugepage backed buffer pool ()

vpp# show physmem
 used-pages 2 reserved-pages 16 default-page-size 1G lookup-page-size 4K
   arena 'buffers-numa-0' pages 1 subpage-size 1G numa-node 0 shared fd 5
   arena 'buffers-numa-1' pages 1 subpage-size 4K numa-node 1 shared fd 6

[1] https://man7.org/linux/man-pages/man2/move_pages.2.html
[2] https://lore.kernel.org/linux-mm/91da2c3b-96f1-bb03-8fff-4c38f31cb9be@huawei.com/
[3] https://man7.org/linux/man-pages/man2/get_mempolicy.2.html
[4] https://man7.org/linux/man-pages/man2/mincore.2.html

Type: fix
Signed-off-by: Jay Wang <jay.wang2@arm.com>
Change-Id: Ia423745423bb080404292333ef95455a4950ce0a
2024-07-09 15:35:52 +00:00
Florin Coras
3fe610a2aa tls: refactor vft functionsn to allow for reuse
Type: refactor

Change-Id: I3d7ff64e2e54b113f8d4b26f2dbf5b9c67b80976
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-07-09 02:04:49 -07:00
Florin Coras
129ff04e3c session: add api to program rx io evts
Type: improvement

Change-Id: I5a4a33604ecb8a29ef6932cc5826835d3bec7f23
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-07-08 21:49:32 +00:00
Dave Wallace
5874dd0365 hs-test: add missing packages to install-deps
Type: test

Change-Id: I2730debc7ea9256bf27208a2662f920edcd6826c
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-07-08 16:30:12 +00:00
Adrian Villin
5d171ebdc2 hs-test: CPU allocation improvements
- Release build runs on numa node0, debug on node1.
  Using the last digit of a build number to reserve 4 cores per test
  mmeans we can run 20 jobs (10 release, 10 debug) on the same machine,
  assuming we have 111 cores available (not counting core 0).
  Can be increased if needed, there are still some cores left.
- Added separate numa aware cpu allocation
- Added CPU0=true|false (useful for users with 4c/8t)

Type: test

Change-Id: Iba8e492a4e01a7f457e49112303887a2a27f6af9
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-07-08 16:27:38 +00:00
Florin Coras
75e8e1e948 session: improve enable and disable handling
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3c79d16f6a19767d990e8a4683c296219b559ccd
2024-07-08 16:27:06 +00:00
Florin Coras
6df9f44227 session: handle multiple attempts to mark mq congested
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iadc6ec58f5fc7fbff62e4fd31d509557b60395cb
2024-07-08 13:44:06 +00:00
Sanjyot Vaidya
e3469369da acl: cli addition to set macip rules
This change is used to add cli command for macip acl rules.
Cli commands added for addition and deletion of rule.

Type: improvement

Change-Id: I28adba0193a904f6c130c81cd19bb6de47f517a9
Signed-off-by: Sanjyot Vaidya <Sanjyot.Vaidya@arm.com>
2024-07-03 14:11:17 +00:00
Andrew Yourtchenko
9987d470a6 tests: disable failing tests on Ubuntu 22.04
Also rework the logic so the skipping of marked Ubuntu 22.04 occurs at framework level

Leave debian11 special cases as-is.

Type: fix
Change-Id: I481eb32cd1a0860935482e9f930ced409da653c9
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2024-07-03 12:43:57 +02:00
Steven Luong
b8a227363c session: session disable crash if not enable
If session is not enable, type in the CLI session disable cause VPP to crash.

Type: fix

Change-Id: Ib55b7430b7ce521a40025d58fa18b765f5129fd5
Signed-off-by: Steven Luong <sluong@cisco.com>
2024-07-02 08:44:07 +00:00
Steven Luong
1b8cef111b unittest: coverity woe
check return value after strstr()

Type: fix

Change-Id: Ib6eb82b6a52c7e08785f6deb73e6cc7a10e7f61b
Signed-off-by: Steven Luong <sluong@cisco.com>
2024-06-29 16:29:15 -07:00
Steven Luong
d2d41bc34e session: memory leaks on various transports when session disable and enable
When toggling session disable and enable, memory leaks found on various
transports.

Don't create the timer wheels on enable when they are already creaded.
Don't create the spin locks when they are already created.
Add session enable disable test in session unit test.

Type: fix

Change-Id: I08988a96bbf2d67a67c743b50b63f5b1e27402a3
Signed-off-by: Steven Luong <sluong@cisco.com>
2024-06-28 15:19:08 -07:00
Adrian Villin
6d44aabe8d hs-test: cat summary file after a failed test run
- as per Florin's request

Type: test

Change-Id: Id76fda0e2dfac7e58b703a8d6f096aa7b5be31c7
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-06-28 05:38:07 +00:00
Andrew Yourtchenko
3e0600bb12 misc: VPP 24.06 Release Notes
Type: docs
Change-Id: Id47dbab5e5661c76e6ff41237bbca5b5b15506c4
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 6e8b350a0154caee6e9f037ae4938b83fb5dcf20)
2024-06-28 01:41:06 +00:00
Renato Botelho do Couto
7f3c21763f vppinfra: Improve code portability
Use standard macros CPU_ISSET_S and CPU_ZERO_S and make code more
portable.

Type: improvement

Change-Id: I8e6a0fd79b90de8c6c33cad8882680eae2ca50ef
Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
2024-06-26 19:25:50 +00:00
Denys Haryachyy
1b794cf1b6 linux-cp: populate mapping vif-sw_if_index only for default-ns
When custom netns is used we don't need to populate the mapping
ifindex->sw_if_index otherwise netlink events in default-ns can apply settings
to wrong interfaces. Most of the lcp functions however wasn't working for such
interfaces and neither it was fixed by this patch.

Type: fix
Change-Id: I74a8a4e332753f9a40fc291d489dfd7fc51cbef3
Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
2024-06-25 18:49:05 +00:00
Damjan Marion
3eb91a5d62 dev: move bus code to bus/
Type: refactor
Change-Id: If3a195f1ea600bfd621717f333af1b1273ab0807
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-06-25 18:16:33 +00:00