vpp.git
7 months agovlib: reset stop_timer_handle on expired processes 60/38660/2 stable/2302
Matthew Smith [Tue, 4 Apr 2023 19:27:55 +0000 (19:27 +0000)]
vlib: reset stop_timer_handle on expired processes

Type: fix

The main loop populates a vector of suspended process nodes to dispatch
by calling TW (tw_timer_expire_timers_vec), which identifies expired
timers and appends the user handle for each one to the vector.

Subsequently, the vector is iterated and the process node corresponding
to each handle is dispatched. The vast majority of the time, the process
node will end up suspending itself again to wait for a new timer or
event.

Given a process node A whose timer has expired, between the point when
the timer expired and the point when A is dispatched and suspends itself
again, its stop_timer_handle contains a stale value.

If another process node B is dispatched before A is dispatched, it may
end up using the timer ID that A formerly used. If another process node
C is dispatched after B and before A and calls
vlib_process_signal_event() to signal A, the timer started by B can be
deleted by vlib_process_signal_event_helper().

After getting the vector of process node IDs for expired timers, reset
the stop_timer_handle on each of those nodes.

Change-Id: I266da438e76e1fc356016da0b9b4941efac1c28a
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 9aa4ac55b0a205e333e567f87c3cc9379af2363c)

7 months agovlib:process node scheduling use timing_wheel have problem. 59/38659/2
jinsh [Tue, 7 Mar 2023 06:32:06 +0000 (14:32 +0800)]
vlib:process node scheduling use timing_wheel have problem.

The time wheel should not be started in the loop while processing expired events.
can be set  p->stop_timer_handle = ~0 to solve.

Type: fix

Signed-off-by: jinsh <jinsh11@chinatelecom.cn>
Change-Id: Ie9a4293f39f981f50d280b39a5d958d319ee2300
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit b7756b26a9cc6e04a969dec3914ad7e148086e91)

11 months agovcl: fix crash issue when connect an IP that VPP can't resolve 21/38921/2
qinyang [Mon, 29 May 2023 09:12:19 +0000 (02:12 -0700)]
vcl: fix crash issue when connect an IP that VPP can't resolve

Type: fix

Change-Id: Id0e56906da7cee7be955e87935b073fdd04c78e7
Signed-off-by: qinyang <qiny@yusur.tech>
13 months agonat: fix nat44 vrf handlers 23/38423/2
Daniel Béreš [Fri, 10 Mar 2023 10:35:24 +0000 (02:35 -0800)]
nat: fix nat44 vrf handlers

Change of enums used in REPLY_MACRO() to appropriate one
for handlers:
-vl_api_nat44_ed_add_del_vrf_table_t_handler
-vl_api_nat44_ed_add_del_vrf_route_t_handler

Type: fix

Change-Id: I58e97817b1678da7c025c0d03a8b938a4e0f7b6c
Signed-off-by: Daniel Béreš <daniel.beres@pantheon.tech>
(cherry picked from commit 2c03879ce45c6568da015c01d85300eef147ece7)

14 months agoavf: fix bit calculation function fls_u32 91/38191/2
Ting Xu [Mon, 6 Feb 2023 03:01:10 +0000 (03:01 +0000)]
avf: fix bit calculation function fls_u32

In avf the function fls_u32 is used to calculate the power of 2.
Fix the expression of this function.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I27160de8588a5efb3f24306597a5a240deb3ab74
(cherry picked from commit dc95634a237419433b8189bf41b3968640b1f97e)

14 months agoavf: fix checksum offload configuration 90/38190/2
Ting Xu [Thu, 2 Feb 2023 02:06:12 +0000 (02:06 +0000)]
avf: fix checksum offload configuration

Fix some configurations of avf checksum offload to get the correct
udp and tcp checksum. Change Tx checksum offload capability since
avf supports ipv4, tcp and udp offload all. Remove the operation to
swap bit of checksum.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I55a916cc9ee6bef5b2074b5b6bb5f517fc2c178d
(cherry picked from commit 26d841870f5ad5d14883ec1b69c381f4b73cb279)

14 months agoavf dpdk: fix incorrect handling of IPv6 src address in flow 88/38188/2
Ting Xu [Tue, 13 Dec 2022 03:10:54 +0000 (03:10 +0000)]
avf dpdk: fix incorrect handling of IPv6 src address in flow

In current flow creating process in native avf and dpdk-plugins, when
parsing the input arguments, it does not copy IPv6 src address correctly,
so that IPv6 src address will not be configured in any flow rule, and
any packet with the same address will not be matched.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Ic957c57e3e1488b74e6281f4ed1df7fd491af35c
(cherry picked from commit 11d9d02459ee3ac6ae402dd565aabbdfeea2c4fb)

14 months agoavf: fix incorrect flag for flow director 89/38189/2
Ting Xu [Tue, 17 Jan 2023 02:34:37 +0000 (02:34 +0000)]
avf: fix incorrect flag for flow director

When parsing flow action type in avf, there is an incorrect flag for
flow director, which makes flow director rule created unexpectedly.

Type: fix
Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Id9fed5db8ccacd5cc6c2f4833183364d763188c1
(cherry picked from commit 25ab42e33b03d9d9a0e3478c3ee346891cf65aef)

14 months agomisc: VPP 23.02 Release Notes 08/38308/2 v23.02
Andrew Yourtchenko [Tue, 21 Feb 2023 12:27:15 +0000 (12:27 +0000)]
misc: VPP 23.02 Release Notes

Type: docs
Change-Id: I88ae8452ed1b39a4c6d82b790f63f31deae4c2fa
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
14 months agomisc: VPP 22.10.1 Release Notes 57/38257/1
Dave Wallace [Sat, 11 Feb 2023 00:20:28 +0000 (19:20 -0500)]
misc: VPP 22.10.1 Release Notes

Type: docs
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I70374ea376c895d92d5789debf4b437113e3d884
(cherry picked from commit 57302fe52f141c19b5448997774271d2eedf5cb1)

14 months agomisc: VPP 22.06.1 Release Notes 35/38235/2
Dave Wallace [Fri, 10 Feb 2023 18:28:46 +0000 (13:28 -0500)]
misc: VPP 22.06.1 Release Notes

Type: docs
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I8770a35c801126ffd2de8f58d79e6616642709a9
(cherry picked from commit 1513b381d8879d9d437bbbc9a270b4ff5f4b19ba)

14 months agopacketforge: fix lack of edge for ipv6 after gtppsc 81/38181/2 v23.02-rc2
Ting Xu [Mon, 30 Jan 2023 03:42:20 +0000 (03:42 +0000)]
packetforge: fix lack of edge for ipv6 after gtppsc

Add one new edge for ipv6 after gtppsc so that packetforge can parse
this protocol combination.

Type: fix
Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I1bae1ec617c4867de2e0b3de27eda77b89e5580c
(cherry picked from commit 656a550f1feda3ddfa96f8e1fc510e8eebd3ce7a)

14 months agopacketforge: fix order of dst/src address of mac 82/38182/2
Ting Xu [Wed, 18 Jan 2023 04:22:00 +0000 (04:22 +0000)]
packetforge: fix order of dst/src address of mac

In the defination of mac node, the order of dst and src address is
reversed. Swap their order in this patch.

Type: fix
Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I039accc0a881eef12f13c75c5becf8b7df97d525
(cherry picked from commit 02bdd3f5cb0f2ff4988f972f31fb44da89fd786e)

14 months agovcl: drop lock on segment attach failure 80/38180/2
Florin Coras [Tue, 7 Feb 2023 17:01:59 +0000 (09:01 -0800)]
vcl: drop lock on segment attach failure

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3bc2c7986f492b7b7dfbc84e4893202354223790
(cherry picked from commit aaad4f977cd7337b37cc6f00019f601f07abdced)

14 months agovcl: add ldp implementation for recvmmsg 79/38179/2
Florin Coras [Fri, 3 Feb 2023 06:56:03 +0000 (22:56 -0800)]
vcl: add ldp implementation for recvmmsg

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7322abc3d3b0aa81399667bf02b03786fc62c958
(cherry picked from commit f1a232fd863e0e081a8edf8b1859a9417debb7c7)

14 months agovcl: better handlig of ldp apis that rely on gnu source 78/38178/2
Florin Coras [Thu, 2 Feb 2023 20:56:16 +0000 (12:56 -0800)]
vcl: better handlig of ldp apis that rely on gnu source

Control use of apis that rely on _GNU_SOURCE being defined with compile
time macro.

Also fixes sendmmsg and recvmmsg which were not probably wrapped.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I207de23210d4b9dc960bb4289159502760c5614d
(cherry picked from commit 3684794336602435b91b91a1dc5bd9401a974432)

14 months agoipsec: fix AES CBC IV generation (CVE-2022-46397) 50/38150/2
Benoît Ganne [Tue, 18 Jan 2022 14:56:41 +0000 (15:56 +0100)]
ipsec: fix AES CBC IV generation (CVE-2022-46397)

For AES-CBC, the IV must be unpredictable (see NIST SP800-38a Appendix
C). Chaining IVs like is done by ipsecmb and native backends for the
VNET_CRYPTO_OP_FLAG_INIT_IV is fully predictable.
Encrypt a counter as part of the message, making the (predictable)
counter-generated IV unpredictable.

Fixes: VPP-2037
Type: fix

Change-Id: If4f192d62bf97dda553e7573331c75efa11822ae
Signed-off-by: Benoît Ganne <bganne@cisco.com>
14 months agosession: fix out of bounds event memcpy 11/38111/1
Florin Coras [Fri, 3 Feb 2023 04:07:19 +0000 (20:07 -0800)]
session: fix out of bounds event memcpy

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If5300653edd2dad470985f4591959d00cad2a43b
(cherry picked from commit af2e88d964ff8bd8eca30c182ab00e178213c1d4)

14 months agovppapigen: fix incorrect comments in json 10/38110/2
Ondrej Fabry [Fri, 3 Feb 2023 10:33:39 +0000 (11:33 +0100)]
vppapigen: fix incorrect comments in json

Type: fix

Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I241cefbbce98cf6fef83f36bd87ae2c1f4b067f0
(cherry picked from commit a4f994f31e566cc5e6512d3aebf627a6e3ce2cc7)

14 months agotls: openssl: fix SSL_read partial read scenario 06/38106/1
Ofer Heifetz [Thu, 2 Feb 2023 14:57:26 +0000 (06:57 -0800)]
tls: openssl: fix SSL_read partial read scenario

When application performs SSL_read from the app rx-fifo, it can
pre-allocate multiple segments, but there is an issue if the OpenSSL
manages to partially fill in the first segment, in this case, since
data is assumed to be copied over by OpenSSL to the pre-allocated
segments(s), vpp uses svm_fifo_enqueue_nocopy API which performs
zero copy by passing the pre-allocated segment to SSL_read.

If the decrypted data size is smaller than the pre-allocated fifo
segment buffer size, application will fetch buffers including zero
in the area not filled in by SSL_read.

Type: fix

Signed-off-by: Ofer Heifetz <oferh@marvell.com>
Change-Id: I941a89b17d567d86e5bd2c35785f1df043c33f38
(cherry picked from commit 905ec8797790380e134714e15ff3341eeeabb05e)

15 months agomisc: Initial changes for stable/2302 branch 46/37946/1 v23.02-rc1
Andrew Yourtchenko [Wed, 18 Jan 2023 13:08:39 +0000 (13:08 +0000)]
misc: Initial changes for stable/2302 branch

Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Icea0f6987e3fd240167cab4d2304cd3962997a41

15 months agolb: add source ip based sticky load balancing 68/37268/7
Nobuhiro MIKI [Wed, 28 Sep 2022 06:53:17 +0000 (15:53 +0900)]
lb: add source ip based sticky load balancing

This patch adds source ip based sticky session, which is already
implemented in many hardware LBs and software LBs. Note that sticky
sessions may be reset if the hash is recalculated as ASs are added
or deleted.

Since this feature is unrelated to the other existing options, the
lb_add_del_vip API version has been upgraded to v2 and a new option
"src_ip_sticky" has been added.

Type: feature
Signed-off-by: Nobuhiro MIKI <nmiki@yahoo-corp.jp>
Change-Id: I3eb3680a28defbc701f28c873933ec2fb54544ab

15 months agobuild: use CMAKE_C_COMPILER_LAUNCHER for ccache 93/37893/4
Guillaume Solignac [Wed, 11 Jan 2023 10:56:29 +0000 (11:56 +0100)]
build: use CMAKE_C_COMPILER_LAUNCHER for ccache

In some situations, CMake will find ccache in /usr/bin but /usr/bin
might not present in PATH. The former fix for this was to place the
ccache configuration logic before the project() declaration, but since
CMake 3.4 there is a new variable to be used which handles this case.

For the original problem, see also
https://crascit.com/2016/04/09/using-ccache-with-cmake/

Type: fix
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: Ie026e02b2b06e2dca2d62da5fea7b1a104bcc7c3

15 months agovppapigen: include comments in json 27/32227/4
Ole Troan [Wed, 5 May 2021 21:00:58 +0000 (23:00 +0200)]
vppapigen: include comments in json

Type: feature
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Ibd796adea734b64d9209c5e18c5b9800cbaf62c6
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
15 months agohs-test: zero timeout on docker stop 40/37940/2
Florin Coras [Tue, 17 Jan 2023 21:02:51 +0000 (13:02 -0800)]
hs-test: zero timeout on docker stop

Should drop execution time for all tests by about 80%.

Type: test

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib6b4ef9fb4e7745a61b40c0b34e53e4046ccdbcc

15 months agopppoe: fix memcpy out of bounds with gcc-11 on arm 79/37779/2
Tianyu Li [Thu, 8 Dec 2022 02:08:32 +0000 (02:08 +0000)]
pppoe: fix memcpy out of bounds with gcc-11 on arm

In function ‘memcpy’,
    inlined from ‘clib_memcpy_fast’ at /home/vpp/src/vppinfra/string.h:86:10,
    inlined from ‘memcpy_s_inline’ at /home/vpp/src/vppinfra/string.h:157:7,
    inlined from ‘vnet_pppoe_add_del_session’ at /home/vpp/src/plugins/pppoe/pppoe.c:356:7:
 error: ‘__builtin_memcpy’ offset [0, 5] is out of the bounds [0, 0] [-Werror=array-bounds]
   34 |   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cc1: all warnings being treated as errors

Hardware address is zero length vector for PPP, use vec_len instead.

Type: fix
Fixes: 62f9cdd82c52 ("Add PPPoE Plugin")
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: If9fb409cfbbac77c15559d103987f0130bf30255

15 months agovppinfra:fix pcap write large file(> 0x80000000) error. 98/37498/4
aihua2013 [Fri, 21 Oct 2022 02:32:08 +0000 (02:32 +0000)]
vppinfra:fix pcap write large file(> 0x80000000) error.

Type: improvement

Signed-off-by: aihua2013 <51931196@qq.com>
Change-Id: I22670f49abfb5d1fd728686fc7d65fb40ea6bda2

15 months agotests: improve packet checksum functions 54/37654/2
Klement Sekera [Mon, 14 Nov 2022 10:26:18 +0000 (11:26 +0100)]
tests: improve packet checksum functions

Fool-proof assert_checksum_valid so that one does not verify checksum on
wrong layer (because of how scapy internally works).

Make assert_packet_checksums_valid start checksum checking at inner
layers and outwards to make it more obvious where the error is. With old
behaviour, if one received an ICMP packet carrying a truncated TCP
packet, an error would be raised for ICMP checksum, as that one would be
the first to be wrong after recalculating all packet checksums, while
the real issue is TCP header being truncated and thus unsuitable for use
with this function.

Type: improvement
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I39a2b50ec5610f969cfde9796416ee3a50ae0ba3

15 months agopci: fix musl crash 41/37841/3
Benoît Ganne [Mon, 19 Dec 2022 17:23:03 +0000 (18:23 +0100)]
pci: fix musl crash

The musl libc does not support closedir(0) resulting in a crash. Only
call closedir() if we successfully opened it.

Type: fix

Change-Id: I3198454f44735501047afc42b94b2fea273212f4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
15 months agohs-test: add http proxy env to container builds 33/37933/2
Florin Coras [Mon, 16 Jan 2023 21:21:35 +0000 (13:21 -0800)]
hs-test: add http proxy env to container builds

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8c116efb41d561e30fd0db1388cdba903e2edffe

15 months agohs-test: autodetect ubuntu version during build 36/37936/2
Maros Ondrejicka [Tue, 17 Jan 2023 09:52:20 +0000 (10:52 +0100)]
hs-test: autodetect ubuntu version during build

Since VPP binaries are being compiled on host system,
it makes sense to autodetect Ubuntu version when building test images
so that containers would be running version equal to host system.

Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I0e13d9ba1ddcd3ad5835bce1b8cccfc048e5e528

15 months agoacl: CLI allow replace, allow deletion 24/37924/2
Pim van Pelt [Sun, 15 Jan 2023 19:04:56 +0000 (19:04 +0000)]
acl: CLI allow replace, allow deletion

Allow the CLI caller to specify an optional [index <idx>] index,
which will remove the ACL at that index. This mimicks the API behavior,

Add a 'delete acl-plugin acl index <idx>' to mimick the API acl_del
call, which will refuse to delete a non-existent index, as well as
an index that is referenced by an interface.

Type: improvement
Signed-off-by: pim@ipng.nl
Change-Id: I5f240f7a4e3bca14e8122917e8a5186d80094de2

15 months agovlib: install dma.h to fix out-of-tree plugins 37/37937/1
Mohammed Hawari [Tue, 17 Jan 2023 11:18:15 +0000 (12:18 +0100)]
vlib: install dma.h to fix out-of-tree plugins

Change-Id: I7888ab58abced93859ce15d0dbd1c3d7c94a02f5
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: fix
Fixes: 0654242d1ef51566f0d58445a16053cf376e5a6e

15 months agohs-test: better directory structure 25/37925/2
Filip Tehlar [Mon, 16 Jan 2023 09:21:29 +0000 (10:21 +0100)]
hs-test: better directory structure

Move config files to resources and docker files to separate directory

Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I24dd0705c4a463c06de525f28cb54d882527320a

15 months agohs-test: restrict concurrency on envoy 23/37923/3
Filip Tehlar [Fri, 13 Jan 2023 20:33:43 +0000 (21:33 +0100)]
hs-test: restrict concurrency on envoy

Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I8b06f4554a6ee5b13de829e47eaa82431a76c332

15 months agowireguard: add local variable 63/37763/4
Gabriel Oginski [Thu, 10 Nov 2022 09:22:17 +0000 (09:22 +0000)]
wireguard: add local variable

The current implementation of wireguard use dereference value from
pointer, but between get and dereference the value from pointer can be
occur change in pool memory, which means that this pointer can be
invalid. Since current implementation doesn't handle with invalid
pointers, segfault can occur.

The fix add a local variable to keep index of peer from pool and also
handle with null pointers from get pointer from pool.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Ic161ab08266e584493338c682d827ea1fd754b98

15 months agoipsec: fix transpose local ip range position with remote ip range in fast path implem... 04/37504/4
Piotr Bronowski [Fri, 21 Oct 2022 15:48:55 +0000 (15:48 +0000)]
ipsec: fix transpose local ip range position with remote ip range in fast path implementation

In fast path implementation of spd policy lookup  opposite convention to
the original implementation has been applied and local ip range has been
interchanged with the remote ip range. This fix addresses this issue.

Type: fix
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I0b6cccc80bf52b34524e98cfd1f1d542008bb7d0

15 months agovlib: add const to char* params of several funcs 22/37922/5
Sergey Nikiforov [Fri, 13 Jan 2023 19:15:13 +0000 (00:15 +0500)]
vlib: add const to char* params of several funcs

These functions do not need modifiable strings.
It helps with linker sections as well as C++ compatibility.
It is a good style to use const where approriate.

Type: refactor
Signed-off-by: void234@gmail.com
Change-Id: Ib437a01663aa61860c6a938d869ed1111da71ec7

15 months agovppinfra: add const to char* params of several funcs 21/37921/4
Sergey Nikiforov [Fri, 13 Jan 2023 19:12:05 +0000 (00:12 +0500)]
vppinfra: add const to char* params of several funcs

These functions do not need modifiable strings.
It helps with linker sections as well as C++ compatibility.
It is a good style to use const where approriate.

Type: refactor
Signed-off-by: void234@gmail.com
Change-Id: I8d1e922197b3594122296e8c1af57e0a8ec0bf3d

15 months agovcl: set deq notify flag on epoll connected sessions 20/37920/4
Florin Coras [Fri, 13 Jan 2023 17:44:14 +0000 (09:44 -0800)]
vcl: set deq notify flag on epoll connected sessions

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I021f8e8bba247b0050d390a37dbc75900dc6a598

15 months agohs-test: use equal ubuntu versions in test images 15/37915/6
Maros Ondrejicka [Fri, 13 Jan 2023 09:09:14 +0000 (10:09 +0100)]
hs-test: use equal ubuntu versions in test images

Official nginx image is based on Debian with older libc version,
that causes a runtime fail when VPP libraries are compiled in Ubuntu
which has newer libc.
Using equal version of Ubuntu in VPP image and in nginx image
ensures that running nginx won't fail due to different libc versions.

Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I48f3b23be30a9d9d9144351437ce163d64a4bb6b

15 months agovppinfra: fix else if check in _vec_set_len() 11/37911/2
Liangxing Wang [Fri, 13 Jan 2023 03:48:37 +0000 (03:48 +0000)]
vppinfra: fix else if check in _vec_set_len()

Type: fix

Signed-off-by: Liangxing Wang <liangxing.wang@arm.com>
Change-Id: I1f757abccd228b9e73f25c96754738c8e6bff259

15 months agobuild: cmake NAMELINK_COMPONENT in vpp libraries 25/37825/2
Nick Brown [Tue, 13 Dec 2022 14:20:35 +0000 (14:20 +0000)]
build: cmake NAMELINK_COMPONENT in vpp libraries

Installs the unversioned .so symlink in the -dev component.
This prevent debian lintian error:
link-to-shared-library-in-wrong-package

NAMELINK_COMPONENT was added in cmake 3.12

Type: make
Change-Id: I9d743218fa1f6b677659d745525e399ff66e73f4
Signed-off-by: Nick Brown <nickbroon@gmail.com>
15 months agoaf_xdp: update af_xdp driver plugin to depend on libxdp 69/37869/6
Yulong Pei [Thu, 5 Jan 2023 02:26:32 +0000 (02:26 +0000)]
af_xdp: update af_xdp driver plugin to depend on libxdp

AF_XDP support is deprecated in libbpf since v0.7.0 [1], the libxdp library
now provides the functionality which once was in libbpf, this commit updates
af_xdp plugin to depend on libxdp, libbpf still remains a dependency even if
libxdp is present, as it need use libbpf APIs for program loading.

libxdp is distributed within xdp-tool [2], xdp-tools package also
include libbpf in it as dependency, so here installed libxdp v1.2.9 and
libbpf v0.8.0, both from xdp-tool-1.2.9 package.

More information about libxdp compatibility can be found in the libxdp
README [3].

In libbpf v0.8.0, The bpf_prog_load function was deprecated and changed to
bpf_object__open_file and bpf_object__next_program and bpf_object__load,
The bpf_get_link_xdp_id and bpf_set_link_xdp_fd functions were deprecated
and changed to bpf_xdp_attach and bpf_xdp_detach, The bpf_object__unload
function was deprecated and changed to bpf_object__close.

[1] https://github.com/libbpf/libbpf/commit/277846bc6c15
[2] https://github.com/xdp-project/xdp-tools/releases/tag/v1.2.9
[3] https://github.com/xdp-project/xdp-tools/blob/master/lib/libxdp/README.org

Type: improvement

Change-Id: Ifbf6e3aa38bc6e0b77561f26311fd11c15ddb47e
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
15 months agovppinfra: fix longstanding corner case bug in serialize_get() 10/37910/2
Dave Barach [Thu, 12 Jan 2023 21:07:26 +0000 (16:07 -0500)]
vppinfra: fix longstanding corner case bug in serialize_get()

serialize_get() -> serialize_write_not_inline(...) was losing track of
the current buffer index when it managed to empty the overflow vector
but had to turn around and use it again.

Test-case added to test_serialize.c.

This issue dates from 2010.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I024a03f7a50fd6df543ddbc7c45d85def4f1981d

15 months agohs-test: fix tests using wget 06/37906/1
Filip Tehlar [Thu, 12 Jan 2023 15:21:55 +0000 (16:21 +0100)]
hs-test: fix tests using wget

This fixes an issue on systems with http proxy set.

Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ic84fcd0b8a7698ef101b369d46be858cbe85fc73

15 months agomisc: use right include for fctnl.h and poll.h 90/37890/3
Guillaume Solignac [Tue, 10 Jan 2023 14:37:18 +0000 (15:37 +0100)]
misc: use right include for fctnl.h and poll.h

Musl is stricter than glibc and has a warning that including fctnl.h and
poll.h should be prefered rather than their sys/ counterparts, which
breaks -Wall setups.

Type: fix
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: Id101e999371951b0927cc8c4109f8f1536de1bc2

15 months agoabf: exclude networks with deny rules 76/37876/6
Josh Dorsey [Wed, 4 Jan 2023 21:28:07 +0000 (21:28 +0000)]
abf: exclude networks with deny rules

Type: improvement

Signed-off-by: Josh Dorsey <jdorsey@netgate.com>
Change-Id: Iee43ca9278922fc7396764b88cff1a87bcb28349

15 months agohs-test: optimize size of docker image 95/37895/2
Filip Tehlar [Wed, 11 Jan 2023 09:58:58 +0000 (10:58 +0100)]
hs-test: optimize size of docker image

Copy necessary only plugins in docker image

Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I5f60a8a1ccbbe099ac60774562dc5901f3b4fbed

15 months agohs-test: use anchors in yaml config files 45/37845/4
Maros Ondrejicka [Tue, 20 Dec 2022 14:10:50 +0000 (15:10 +0100)]
hs-test: use anchors in yaml config files

Volumes can be referenced with anchors to reduce text duplication
and to explicitly show which containers share a volume.

Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: Id408a78262573b3faf2257c32bfa569eca2e2049

15 months agovirtio: add option to bind interface to uio driver 16/37416/9
Benoît Ganne [Thu, 13 Oct 2022 12:01:03 +0000 (14:01 +0200)]
virtio: add option to bind interface to uio driver

Type: improvement

Change-Id: I30e66370c927afeb62ba3a2b3334bdc2a31d4561
Signed-off-by: Benoît Ganne <bganne@cisco.com>
15 months agopci: add option to force uio binding 17/37417/7
Benoît Ganne [Thu, 13 Oct 2022 15:22:26 +0000 (17:22 +0200)]
pci: add option to force uio binding

Type: improvement

Change-Id: Ifea4badd58f7e2b5e792d7506f6747851a08587f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
15 months agolinux-cp: Fix endianness in lcp response 94/37894/2
Pim van Pelt [Wed, 11 Jan 2023 11:31:41 +0000 (11:31 +0000)]
linux-cp: Fix endianness in lcp response

Creation of LCP will return garbled host_sw_if_index of the newly
created TAP interface.

Example PAPI code:
```
lcp_add = vpp.api.lcp_itf_pair_add_del_v2(is_add=True, sw_if_index=17,
          host_if_type=VppEnum.vl_api_lcp_itf_host_type_t.LCP_API_ITF_HOST_TAP,
          host_if_name="loop0", netns="dataplane")
print(lcp_add)

lcp_ret = vpp.api.lcp_itf_pair_get()
print(lcp_ret)
```

Before, the returned host_sw_if_index has the wrong endianness:
VPP version is 23.02-rc0~212-gf06a518f8
lcp_itf_pair_add_del_v2_reply(_0=103, context=2, retval=0, host_sw_if_index=301989888)
(lcp_itf_pair_get_reply(_0=105, context=3, retval=0, cursor=4294967295),[lcp_itf_pair_details(_0=106, context=3, phy_sw_if_index=17, host_sw_if_index=18, vif_index=594, host_if_name='loop0', host_if_type=<vl_api_lcp_itf_host_type_t.LCP_API_ITF_HOST_TAP: 0>, netns='dataplane')])

After, it is correctly showing idx 18:
VPP version is 23.02-rc0~212-gf06a518f8
lcp_itf_pair_add_del_v2_reply(_0=103, context=2, retval=0, host_sw_if_index=18)
(lcp_itf_pair_get_reply(_0=105, context=3, retval=0, cursor=4294967295), [lcp_itf_pair_details(_0=106, context=3, phy_sw_if_index=17, host_sw_if_index=18, vif_index=595, host_if_name='loop0', host_if_type=<vl_api_lcp_itf_host_type_t.LCP_API_ITF_HOST_TAP: 0>, netns='dataplane')])

Type: fix
Signed-off-by: pim@ipng.nl
Change-Id: I9085bac0c4a9ad64356c67f9b85f4910131e349e

15 months agosr: remove stale runs_after 37/37837/2
Nathan Skrzypczak [Mon, 19 Dec 2022 08:38:02 +0000 (09:38 +0100)]
sr: remove stale runs_after

This patch removes a
.runs_after = VNET_FEATURES ("ip6-lookup"),
On the 'pt' node, as 'ip6-lookup' does not belong to the 'ip6-output' arc.

Type: fix

Change-Id: Ie34aaf7351593f08c61e3b02aaf9f72a4de1a437
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
15 months agonat: do not use nat session object after deletion 42/37742/4
Benoît Ganne [Thu, 22 Dec 2022 14:01:21 +0000 (15:01 +0100)]
nat: do not use nat session object after deletion

Type: fix

Change-Id: Ifc709b6e7217a893d13aee6d3019e699637366ef
Signed-off-by: Benoît Ganne <bganne@cisco.com>
15 months agosr: fix compilation errors 74/37874/3
Guillaume Solignac [Fri, 6 Jan 2023 12:55:04 +0000 (13:55 +0100)]
sr: fix compilation errors

Uses VPP's clib_host_to_net functions, and initializes a potentially
uninitialized variable.

Type: fix
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: Ie6b035c698f57ff39aeb955b35db8ec40f383b7a

15 months agotests: update install-deps to support interface test runs in the CI 46/37846/2
Naveen Joy [Tue, 20 Dec 2022 16:39:06 +0000 (08:39 -0800)]
tests: update install-deps to support interface test runs in the CI

Change-Id: I704c35644b3caf6567be4b43dc4e550d1394e438
Type: improvement
Signed-off-by: Naveen Joy <najoy@cisco.com>
15 months agobuild: do not link with libssl if not needed 67/37867/2
Benoît Ganne [Wed, 4 Jan 2023 16:56:58 +0000 (17:56 +0100)]
build: do not link with libssl if not needed

In most cases we only need OpenSSL libcrypto (crypto primitives) but
not libssl (tls).

Type: improvement

Change-Id: I9dce27d23d65bf46aea2d0f8aaf417240701efcc
Signed-off-by: Benoît Ganne <bganne@cisco.com>
15 months agoudp: avoid listener cleanups with active opens 83/37883/6
Florin Coras [Mon, 9 Jan 2023 20:46:07 +0000 (12:46 -0800)]
udp: avoid listener cleanups with active opens

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibff9f32e4fcaf0344207d8e43f3547180cbd4eef

15 months agocrypto-ipsecmb: fix perf scaling in ipsecmb v1.3 85/37885/2
Marcel Cornu [Mon, 9 Jan 2023 23:15:11 +0000 (23:15 +0000)]
crypto-ipsecmb: fix perf scaling in ipsecmb v1.3

Type: fix

This patch adds a fix for an issue in the ipsecmb library resulting in
lower than expected performance in multi-threaded scenarios. This is
due to multiple threads writing the same global variable simultaneously.

Signed-off-by: marcel.d.cornu@intel.com
Change-Id: Ibcac321aa40da4b1709198dec3e18226e3891138

15 months agovrrp: fix update virtual addr make mistake 79/37879/5
gaochx [Mon, 9 Jan 2023 09:56:09 +0000 (17:56 +0800)]
vrrp: fix update virtual addr make mistake

When use update api delete a virtual address, no matter which IP want to delete, always delete the last one.

Type: fix

Signed-off-by: GaoChX <chiso.gao@gmail.com>
Change-Id: Ia67c06dd53a442740794e1884d1a4aaa06965398

15 months agosession: avoid trying to send incomplete dgram 86/37886/3
Florin Coras [Tue, 10 Jan 2023 00:00:10 +0000 (16:00 -0800)]
session: avoid trying to send incomplete dgram

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ibebe9e4ab7331c3ae66c9502e910368acaba51ec

15 months agoudp: initialize gso_size on dgram enqueue 84/37884/4
Florin Coras [Mon, 9 Jan 2023 22:00:33 +0000 (14:00 -0800)]
udp: initialize gso_size on dgram enqueue

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I1b5a35b9d53cc56d4d8050de70f40b95e92f1011

15 months agohs-test: remove exec flags from source files 81/37881/1
Filip Tehlar [Mon, 9 Jan 2023 14:48:40 +0000 (15:48 +0100)]
hs-test: remove exec flags from source files

Type: style

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ia87b28e81b6fd06c8c3681bf3cb1dd6ce8c84f41

15 months agohs-test: fix code style 80/37880/1
Filip Tehlar [Mon, 9 Jan 2023 11:07:09 +0000 (12:07 +0100)]
hs-test: fix code style

This will add a new target (fixstyle) to Makefile that runs gofmt tool.

Type: style

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Icba60633f82aa8bbc75749f080e00f0375b55a18

15 months agohs-test: add nginx test 49/37849/2
Filip Tehlar [Wed, 21 Dec 2022 07:59:16 +0000 (08:59 +0100)]
hs-test: add nginx test

Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Idd5352f254df0d1f36c1270e73440c9287247b81

15 months agosession: avoid dgram dequeues with no transport 75/37875/2
Florin Coras [Fri, 6 Jan 2023 19:38:49 +0000 (11:38 -0800)]
session: avoid dgram dequeues with no transport

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1a3393b579caeb5dc25b60bc1b4a71706fb07051

15 months agobfd: fix ip address cli parsing 72/37872/2
Benoît Ganne [Fri, 6 Jan 2023 08:58:53 +0000 (09:58 +0100)]
bfd: fix ip address cli parsing

unformat_ip46_address() requires the address type as 2nd parameter.

Type: fix

Change-Id: Iaa1aebaebd1a947dab6c936c3b931854c0a3facc
Signed-off-by: Benoît Ganne <bganne@cisco.com>
15 months agovapi: add vapi_stop_rx_thread() 57/37857/2
Matthew Smith [Thu, 15 Dec 2022 22:18:08 +0000 (22:18 +0000)]
vapi: add vapi_stop_rx_thread()

Type: improvement

Allow vapi to signal to an application's RX thread that it should wake
up and exit.

Before disconnecting from VPP's API, libvlibmemoryclient inserts an
rx_thread_exit message into the client's own input queue to cause its
RX thread to wake up from its blocking dequeue and exit cleanly. Add a
function to vapi's API which will allow libvapi client applications
which have an RX thread waiting for incoming messages using vapi_wait()
to do the same thing.

The existing libvlibmemoryclient code which does this was moved to a
separate function and made available for vapi_stop_rx_thread() to call.

Also fixed some inconsistencies in indentation of function prototypes in
vapi.h to make checkstyle.sh happy.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I7bbb73470807123cc63ef313cfb91d1fd31b34e5

16 months agovppinfra: fix function prototypes 62/37862/1
Dave Barach [Mon, 26 Dec 2022 19:01:36 +0000 (14:01 -0500)]
vppinfra: fix function prototypes

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Idbdfdf2d3fdbb64366f50d5a7458c4073a4f2746

16 months agodocs: update home-gateway use-case 59/37859/1
Dave Barach [Sun, 25 Dec 2022 13:47:47 +0000 (08:47 -0500)]
docs: update home-gateway use-case

Type: fix
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I720b1395ee8714de2e2386b31a0f2c041272042a

16 months agohsa: fix echo client workers initialization 55/37855/3
Benoît Ganne [Thu, 22 Dec 2022 14:01:32 +0000 (15:01 +0100)]
hsa: fix echo client workers initialization

We were creating an additional worker not backed by any VPP threads,
leading off-by-1 access in the session main workers vector.
Also uses vec_elt_at_index() when accessing session main workers vector
elements to catch those errors more easily.

Type: fix

Change-Id: I6059116b7b64ae6b26ad83c1fcf55df8522868ad
Signed-off-by: Benoît Ganne <bganne@cisco.com>
16 months agomisc: fix crash using tracedump plugin with socket API clients 56/37856/1
Arthur de Kerhor [Thu, 22 Dec 2022 18:48:05 +0000 (19:48 +0100)]
misc: fix crash using tracedump plugin with socket API clients

Type: fix
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
Change-Id: I208724a515c9a38c4032f101bdf73aa87b1c13be

16 months agodpdk: link DPDK with MLX4/MLX5 libraries again 38/37838/2
Vladimir Ratnikov [Mon, 19 Dec 2022 08:45:35 +0000 (08:45 +0000)]
dpdk: link DPDK with MLX4/MLX5 libraries again

 Previously it was linked and worker properly. While rdma build
was simplified, link was lost so all encrypted data won't pass
via Mellanox interfaces(ipsec, ipip, ssh etc) and NetVSC taps
won't created the right way.

 Errors:
mlx5_common: Verbs device not found: 21a5:00:02.0
mlx5_common: Failed to initialize device context.
EAL: Requested device 21a5:00:02.0 cannot be used
 Tested on Azure. Same errors appears on physical machine with
Mellanox connect adapter

Type: fix

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: Ib68976282e0ed91c016a7318db6b5eddf5510c47

16 months agoaf_packet: move to plugin 30/37830/3
Mohsin Kazmi [Wed, 14 Dec 2022 13:10:29 +0000 (13:10 +0000)]
af_packet: move to plugin

Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I3ec857adb3a9e8a778072a202a4d23f4101e83b2

16 months agohs-test: small improvements 50/37850/2
Filip Tehlar [Wed, 21 Dec 2022 13:40:35 +0000 (14:40 +0100)]
hs-test: small improvements

Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ifa56da632b139acd5e743c3076c24b5b55388924

16 months agoquic: fix quic plugin with openssl 3.x 47/37847/3
Dave Wallace [Tue, 20 Dec 2022 22:41:43 +0000 (17:41 -0500)]
quic: fix quic plugin with openssl 3.x

- load openssl legacy providers during quic init
  when building with openssl 3.0 or greater
- re-enable quic 'make test' testcases on
  ubuntu-22.04

Type: fix

Change-Id: Icfd429b6bc1bddf9f9937baa44cc47cd535ac5f2
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
16 months agoudp: fix tx handling of non-connected sessions 42/37842/5
Florin Coras [Mon, 19 Dec 2022 18:55:18 +0000 (10:55 -0800)]
udp: fix tx handling of non-connected sessions

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I659b9914fcfa4619a68e9807ef241f88c96b3bd0

16 months agohs-test: add runtime options 43/37843/3
Maros Ondrejicka [Mon, 19 Dec 2022 19:35:27 +0000 (20:35 +0100)]
hs-test: add runtime options

Options
 "-p" to not remove topology elements after the test finishes
 "-v" from now on extra output from tests is hidden by default,
      this will show it again

Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I626188561c883534e9004d5130ee2a972d12b4e2

16 months agovapi: use the correct my_context_id when disconnecting API clients 17/37817/8
Mauro Sardara [Mon, 12 Dec 2022 14:04:09 +0000 (14:04 +0000)]
vapi: use the correct my_context_id when disconnecting API clients

While before the my_client_index variable was stored as global variable
in api_main_t, after commit 2ca88ff97884ec9ed20a853b13cee6d86f9c9d0f
the my_client_index becomes part of vapi_ctx_t.

Each API client (internal/external) connected to VPP stores its
client index in vapi_ctx_t.

The issue is in the client disconnection. The vapi_disconnect is
untouched in patch 2ca88ff97884ec9ed20a853b13cee6d86f9c9d0f,
so it keeps the behavior of using the my_client_index stored
in api_main_t.

Ticket: VPP-2069
Type: fix
Fixes: 2ca88ff97884ec9ed20a853b13cee6d86f9c9d0f

Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: Idf8c1d1056cbd631cc3057cf7acc486216fa8303

16 months agohs-test: abstract away topology from test cases 32/37832/7
Maros Ondrejicka [Wed, 14 Dec 2022 15:30:04 +0000 (16:30 +0100)]
hs-test: abstract away topology from test cases

Definition of shared volumes and containers has been moved
to yaml files to be together with network topology.
Containers are automatically run at the beginning of each test case
and stopped afterward.

Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I264cbb4f1355f8bd7aade221e9609fb5b9bd693e

16 months agonat: fix incorrect using about sw_if_index in nat44-ed static mapping v2 api. 45/37745/3
Huawei LI [Sat, 3 Dec 2022 03:30:49 +0000 (11:30 +0800)]
nat: fix incorrect using about sw_if_index in nat44-ed static mapping v2 api.

Type: fix

Signed-off-by: Huawei LI <lihuawei_zzu@163.com>
Change-Id: I2a96ab0dafe4db796704341c325c43a6960be312

16 months agonat: fix memory leak and refactor nat44-ed db init/free. 83/37683/5
Huawei LI [Mon, 21 Nov 2022 13:54:50 +0000 (21:54 +0800)]
nat: fix memory leak and refactor nat44-ed db init/free.

fix memory leak and refactor nat44-ed db init/free through.
how to reproduce memory leak: input "set nat44 session limit
50000 vrf 1" repeatedly.

Program received signal SIGABRT, Aborted.
0x00007ff4b3cc5337 in raise () from /lib64/libc.so.6
(gdb) bt
0  0x00007ff4b3cc5337 in raise () from /lib64/libc.so.6
1  0x00007ff4b3cc6a28 in abort () from /lib64/libc.so.6
2  0x00000000004079db in os_panic () at /usr/src/debug/vpp-23.02/src/vpp/vnet/main.c:417
3  0x00007ff4b43e784f in os_out_of_memory ()
   at /usr/src/debug/vpp-23.02/src/vppinfra/unix-misc.c:221
4  0x00007ff4b43a71aa in clib_mem_heap_alloc_inline (heap=0x0, size=27263040, align=64,
   os_out_of_memory_on_failure=1) at /usr/src/debug/vpp-23.02/src/vppinfra/mem_dlmalloc.c:613
5  0x00007ff4b43a7256 in clib_mem_alloc_aligned (size=27263040, align=64)
   at /usr/src/debug/vpp-23.02/src/vppinfra/mem_dlmalloc.c:635
6  0x00007ff4b522fafa in alloc_aligned_16_8 (h=0x7ff46a7815b8 <snat_main+408>, nbytes=27262976)
   at /usr/src/debug/vpp-23.02/src/vppinfra/bihash_template.c:59
7  0x00007ff4b522fd12 in clib_bihash_instantiate_16_8 (h=0x7ff46a7815b8 <snat_main+408>)
   at /usr/src/debug/vpp-23.02/src/vppinfra/bihash_template.c:163
8  0x00007ff4b5230037 in clib_bihash_init2_16_8 (a=0x7ff465f36870)
   at /usr/src/debug/vpp-23.02/src/vppinfra/bihash_template.c:245
9  0x00007ff4b52300ac in clib_bihash_init_16_8 (h=0x7ff46a7815b8 <snat_main+408>,
   name=0x7ff46a754871 "ed-flow-hash", nbuckets=262144, memory_size=0)
   at /usr/src/debug/vpp-23.02/src/vppinfra/bihash_template.c:260
10 0x00007ff46a7013e8 in reinit_ed_flow_hash ()
   at /usr/src/debug/vpp-23.02/src/plugins/nat/nat44-ed/nat44_ed.c:3264
11 0x00007ff46a7014fd in nat44_ed_sessions_clear ()
   at /usr/src/debug/vpp-23.02/src/plugins/nat/nat44-ed/nat44_ed.c:3299
12 0x00007ff46a701044 in nat44_update_session_limit (session_limit=70000, vrf_id=1)
   at /usr/src/debug/vpp-23.02/src/plugins/nat/nat44-ed/nat44_ed.c:3225
13 0x00007ff46a73d3d1 in nat44_set_session_limit_command_fn (vm=0x7ff473c8f740,
   input=0x7ff465f36ef0, cmd=0x7ff474c5ce48)
   at /usr/src/debug/vpp-23.02/src/plugins/nat/nat44-ed/nat44_ed_cli.c:1638
14 0x00007ff4b5d56527 in vlib_cli_dispatch_sub_commands (vm=0x7ff473c8f740,
   cm=0x4273f0 <vlib_global_main+48>, input=0x7ff465f36ef0, parent_command_index=97)
   at /usr/src/debug/vpp-23.02/src/vlib/cli.c:650
15 0x00007ff4b5d562c3 in vlib_cli_dispatch_sub_commands (vm=0x7ff473c8f740,
   cm=0x4273f0 <vlib_global_main+48>, input=0x7ff465f36ef0, parent_command_index=98)
   at /usr/src/debug/vpp-23.02/src/vlib/cli.c:607
16 0x00007ff4b5d562c3 in vlib_cli_dispatch_sub_commands (vm=0x7ff473c8f740,
   cm=0x4273f0 <vlib_global_main+48>, input=0x7ff465f36ef0, parent_command_index=21)
   at /usr/src/debug/vpp-23.02/src/vlib/cli.c:607
17 0x00007ff4b5d562c3 in vlib_cli_dispatch_sub_commands (vm=0x7ff473c8f740,
   cm=0x4273f0 <vlib_global_main+48>, input=0x7ff465f36ef0, parent_command_index=0)
   at /usr/src/debug/vpp-23.02/src/vlib/cli.c:607
18 0x00007ff4b5d569cb in vlib_cli_input (vm=0x7ff473c8f740, input=0x7ff465f36ef0,
   function=0x7ff4b5dc2406 <unix_vlib_cli_output>, function_arg=0)
---Type <return> to continue, or q <return> to quit---
   at /usr/src/debug/vpp-23.02/src/vlib/cli.c:753
19 0x00007ff4b5dc7b0c in unix_cli_process_input (cm=0x7ff4b5e4ae00 <unix_cli_main>,
   cli_file_index=0) at /usr/src/debug/vpp-23.02/src/vlib/unix/cli.c:2616
20 0x00007ff4b5dc825a in unix_cli_process (vm=0x7ff473c8f740, rt=0x7ff4797a5280, f=0x0)
   at /usr/src/debug/vpp-23.02/src/vlib/unix/cli.c:2745
21 0x00007ff4b5d80a25 in vlib_process_bootstrap (_a=140687718901968)
   at /usr/src/debug/vpp-23.02/src/vlib/main.c:1221
22 0x00007ff4b439e298 in clib_calljmp () at /usr/src/debug/vpp-23.02/src/vppinfra/longjmp.S:123
23 0x00007ff4698268a0 in ?? ()
24 0x00007ff4b5d80b4e in vlib_process_startup (vm=0x7ff4b43a77a3 <clib_mem_size+24>,
   p=0x7ff4698268d0, f=0x7ff474b1e580) at /usr/src/debug/vpp-23.02/src/vlib/main.c:1246
25 0x00007ff4b5dbdbe6 in vec_max_bytes (v=0x8)
   at /usr/src/debug/vpp-23.02/src/vppinfra/vec_bootstrap.h:161
26 0x00007ff474b1e598 in ?? ()
27 0x0000000000000004 in ?? ()
28 0x00000000000000ff in ?? ()
29 0x00007ff469826980 in ?? ()
30 0x00007ff4b5dbddcb in _vec_set_len (
   v=<error reading variable: Cannot access memory at address 0xfffffffffffffff5>,
   len=<error reading variable: Cannot access memory at address 0xffffffffffffffed>,
   elt_sz=<error reading variable: Cannot access memory at address 0xffffffffffffffe5>)
   at /usr/src/debug/vpp-23.02/src/vppinfra/vec_bootstrap.h:196
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

Type: fix

Signed-off-by: Huawei LI <lihuawei_zzu@163.com>
Change-Id: I52a7d229c95e4ab30f7f2cfe574440aa37bed6a2

16 months agobfd: fix bfd udp error enum incompatibility 95/37795/2
Dmitry Valter [Mon, 12 Dec 2022 11:43:33 +0000 (11:43 +0000)]
bfd: fix bfd udp error enum incompatibility

New BFD UDP errors were no longer compatible with BFD errors. This was causing
out-of-bound reads and ASAN test crashes.

Fix this issue by statically checking if these enums are compatible.

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: I92fddd26270f946bc16ade840c94e5496e2cb88a

16 months agoipsec: new api for sa ips and ports updates 59/37059/11
Arthur de Kerhor [Wed, 31 Aug 2022 17:13:03 +0000 (19:13 +0200)]
ipsec: new api for sa ips and ports updates

Useful to update the tunnel paramaters and udp ports (NAT-T) of an SA
without having to rekey. Could be done by deleting and re-adding the
SA but it would not preserve the anti-replay window if there is one.
Use case: a nat update/reboot between the 2 endpoints of the tunnel.

Type: feature
Change-Id: Icf5c0aac218603e8aa9a008ed6f614e4a6db59a0
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
16 months agointerface: fix format_vnet_interface_output_trace 66/37666/3
luoyaozu [Wed, 16 Nov 2022 08:26:53 +0000 (16:26 +0800)]
interface: fix format_vnet_interface_output_trace

format vlib_buffer_t::flags into interface output trace

Type: fix

Signed-off-by: luoyaozu <luoyaozu@foxmail.com>
Change-Id: Icb48a6d3a7ebdff7a3d42efe62723b0f0f1ea507

16 months agonat: disable nat44-ed/ei features on interface deletion 46/37746/2
Vladislav Grishenko [Sun, 4 Dec 2022 10:02:03 +0000 (15:02 +0500)]
nat: disable nat44-ed/ei features on interface deletion

After deleting a sw interface with nat44 features, the next created
sw interface will get the same sw_index reused and therefore will
erroneously have the same nat features enabled.

Type: fix
Change-Id: I1d84f842ab7ab2a757668ae1a111efe67e1e924d
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
16 months agovcl: enable gso for 'sendmsg' in LDP mode. 98/37798/2
Dou Chao [Tue, 29 Nov 2022 11:41:34 +0000 (19:41 +0800)]
vcl: enable gso for 'sendmsg' in LDP mode.

Some upon apps(e.g. Nginx-quic) package it's several protocol buffers into a struct msg
which is a combination of gso_buffer and gso_size.
but if HostStack regardless the gso_size to the buffer and split the buffer with default mss,
that cause peer client failed on parsing the package.

Type: improvement
Signed-off-by: Dou Chao <chao.dou@intel.com>
Change-Id: I805eb642be826038ba96d1b85dad8ec0c0f6c459
Signed-off-by: Dou Chao <chao.dou@intel.com>
16 months agovapi: implement vapi_wait() for reads 87/37787/2
Matthew Smith [Fri, 2 Dec 2022 20:46:16 +0000 (20:46 +0000)]
vapi: implement vapi_wait() for reads

Type: improvement

The function vapi_wait() is intended to allow a caller to block while
waiting until the API queue can be read/written. It was a stub that
returned VAPI_ENOTSUP. Add code which implements the wait on being able
to read an incoming message.

Had to touch a few other things in vapi.h to make checkstyle.sh happy
after changing the prototype of vapi_wait().

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: Ida80c1a1d34fe297ab23268087be65ea53ad7040

16 months agobuild: don't overwrite quicly build/install logs 67/37767/3
Dave Wallace [Wed, 7 Dec 2022 18:06:47 +0000 (13:06 -0500)]
build: don't overwrite quicly build/install logs

- append make output to quicly build & install logs

Type: make

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I4cfe7afdaa633295968c25902b12f58100f8ca69

16 months agotests: tapv2, tunv2 and af_packet interface tests for vpp 74/37374/14
Naveen Joy [Tue, 4 Oct 2022 21:22:05 +0000 (14:22 -0700)]
tests: tapv2, tunv2 and af_packet interface tests for vpp

Tests gso/gro-coalesce features on tapv2, tunv2 and af_packet
interfaces to ensure that packet transmission is enabled correctly
for various MTU sizes and interface combinations in bridged and
routed topologies for IPv4 and IPv6. Interface tests are
dynamically generated at run time from the config file
vm_test_config.py.

Type: test

Change-Id: I5f9d8cc80d20b4e34011fc8a87e35659bd9613bc
Signed-off-by: Naveen Joy <najoy@cisco.com>
16 months agolinux-cp: set severity of noisy message to debug 86/37786/2
Matthew Smith [Fri, 2 Dec 2022 21:00:03 +0000 (21:00 +0000)]
linux-cp: set severity of noisy message to debug

Type: improvement

The log buffer and event buffer get lots of messages written like
"Processed 2 messages" by linux-nl when its enabled. This can crowd out
more important messages and should only actually be stored if debug
messages are desired. Change from logging with NL_INFO() to NL_DBG().

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I9055432f7ef35d3e0ad59dce307d2b3c6284002f

16 months agopapi: fix VPP_API_DIR 92/37792/1
Pim van Pelt [Mon, 12 Dec 2022 00:00:16 +0000 (00:00 +0000)]
papi: fix VPP_API_DIR

Docstring in VPP Python API says that find_api_dir() will search for
environment variable VPP_API_DIR first and foremost, except it doesn't.
Prepend VPP_API_DIR if it exists, and allow dirs to be omitted in case
it will be the empty list []

Type: fix
Signed-off-by: pim@ipng.nl
Change-Id: Ic892e4bb7d8ff50f18e64ddfd2a61343883f07ea

16 months agomisc: VPP 22.10 Release Notes 36/37536/2
Andrew Yourtchenko [Wed, 19 Oct 2022 09:23:03 +0000 (09:23 +0000)]
misc: VPP 22.10 Release Notes

Type: docs

Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: If0f2ca0344640b064fde52b8f2c09a340ed9c71b
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 07e0c05e698cf5ffd1e2d2de0296d1907519dc3d)

16 months agonat: fixed return values of enable/disable call 95/37695/5
Filip Varga [Wed, 23 Nov 2022 18:47:56 +0000 (10:47 -0800)]
nat: fixed return values of enable/disable call

NAT44 enable/disable return status was used
instead of appropriate VNET_API_ERROR_ code.

Type: fix
Signed-off-by: Filip Varga <filipvarga89@gmail.com>
Change-Id: If944866bf3061afdc91284c0ad475135e529bdc4

16 months agohttp_static: clean up http redirect generation 85/37785/1
Dave Barach [Fri, 9 Dec 2022 14:07:17 +0000 (09:07 -0500)]
http_static: clean up http redirect generation

Don't redirect to "favicon.ico/index.html" if you can't find
"favicon.ico".

If asked to serve up a nonexistent path, see if the path ends with a
known suffix: ".jpg, .html, .ico" etc. If it does, flunk the request
on the spot: "Error 404 Not Found." Do not issue a redirect.

This change will not break the obvious corner case: if the browser
asks for "its_a_dir.mp3/index.html" - and the file exists - the server
will produce it.

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I91aad90be05b98ba2b40e240d13d71816aed4526

16 months agohttp_static: derive mime type from file extensions 68/37768/3
Dave Barach [Wed, 7 Dec 2022 19:19:15 +0000 (14:19 -0500)]
http_static: derive mime type from file extensions

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I0f087477e257f5119d7d6182d19f8796773a1f19

16 months agotcp: avoid retransmit head with no data 57/37757/3
Florin Coras [Tue, 6 Dec 2022 16:39:15 +0000 (08:39 -0800)]
tcp: avoid retransmit head with no data

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iefabc7b9dd1109fd6dcf65e5d9794173421b7369

16 months agohs-test: use assert-like approach in test cases 54/37754/3
Maros Ondrejicka [Tue, 6 Dec 2022 14:38:05 +0000 (15:38 +0100)]
hs-test: use assert-like approach in test cases

Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I1653001461d4dfc52f1fb3a9e0cf458a506b8324

16 months agovat2: add plugin-path parameter 52/37752/4
Ole Troan [Tue, 6 Dec 2022 13:41:41 +0000 (14:41 +0100)]
vat2: add plugin-path parameter

Add plugin-path parameter to aid external plugin development.
Multiple directories are supported as a colon separated list.

Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Ida35dedceccd0019ea68e56f7a3672c530258447