vpp.git
16 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

16 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

16 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

16 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

16 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

16 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

16 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>
16 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>
16 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

16 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>
16 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>
16 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

16 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>
16 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>
16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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

16 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>
16 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

17 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

17 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>
17 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

17 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>
17 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>
17 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

17 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

17 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>
17 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

17 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

17 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)

17 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

17 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

17 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

17 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

17 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

17 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

17 months agopapi: export packed message structures 59/37759/4
Ole Troan [Tue, 6 Dec 2022 16:42:24 +0000 (17:42 +0100)]
papi: export packed message structures

Use the Python API binding to generate a set of API messages
in binary format, that can later be replayed independently
of the Python API.

Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Iaab6ca31fd2809193e461ab53f7cc7332a231eb5
Signed-off-by: Ole Troan <ot@cisco.com>
17 months agotests: multiple apidir locations 36/37736/7
Ole Troan [Thu, 1 Dec 2022 10:22:06 +0000 (11:22 +0100)]
tests: multiple apidir locations

To support testing of external plugins, add support to the test framework and PAPI
for specifying a list of locations to look for api.json files.

Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I128a306e3c091dc8ef994801b1470b82d2f4595d
Signed-off-by: Ole Troan <ot@cisco.com>
17 months agoapi: avoid sigpipe for unruly api client 56/37756/4
Ole Troan [Tue, 6 Dec 2022 16:07:39 +0000 (17:07 +0100)]
api: avoid sigpipe for unruly api client

if the api client didn't wait for the last message, we'd get a SIGPIPE
from Unix and VPP would crash.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Iac7705ec09ccd67cc249cc9a9525a7cb379e2f6f
Signed-off-by: Ole Troan <ot@cisco.com>
17 months agopapi: fix async support for socket transport 58/37758/3
Ole Troan [Tue, 6 Dec 2022 16:30:49 +0000 (17:30 +0100)]
papi: fix async support for socket transport

Async use of the API is much faster than blocking calls.
Seemed like it only worked over shared memory transport.
This patches re-enables support for async calls over socket
transport.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I05f3b362035ce0a1c16788ba9003a35601ddb04e
Signed-off-by: Ole Troan <ot@cisco.com>
17 months agohttp_static: misc bug fixes 61/37761/2
Dave Barach [Wed, 7 Dec 2022 00:53:15 +0000 (19:53 -0500)]
http_static: misc bug fixes

The request vector generated by hss_ts_rx_callback() must be NULL
terminated.

The hss_main_t use_ptr_thresh member must be a u64 since
unformat_memory_size() expects it. Otherwise, the adjacent u8
enable_url_handlers may have an accident.

Type: fix

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

17 months agoclassify: increase metadata from 16- to 32-bits 38/37738/3
Benoît Ganne [Thu, 1 Dec 2022 14:58:36 +0000 (15:58 +0100)]
classify: increase metadata from 16- to 32-bits

The metadata in classifier entries is used to index a fib or a dpo in
the acl nodes which can exceeds UINT16_MAX in large configurations.
To maintain entries size and alignment, decrease next_index from 32- to
16-bits: next_index should not exceed 16-bits in VPP, as it is already
shown by vlib_buffer_enqueue_to_next() or dpo_id_t.dpoi_next_node.

Type: fix

Change-Id: I4fd1b3cd495319420044c219036b2d2ea952270a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
17 months agohs-test: manage containers and volumes within test suite 60/37760/3
Maros Ondrejicka [Tue, 6 Dec 2022 18:46:24 +0000 (19:46 +0100)]
hs-test: manage containers and volumes within test suite

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

17 months agohs-test: test tcp with loss 69/37669/12
Maros Ondrejicka [Wed, 16 Nov 2022 11:51:11 +0000 (12:51 +0100)]
hs-test: test tcp with loss

This adds basic, functional-only, test of TCP connection with delay and
packet loss introduced by Network Delay Simulator.

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

17 months agohttp_static: fix http(s) redirects 53/37753/2
Dave Barach [Tue, 6 Dec 2022 13:39:29 +0000 (08:39 -0500)]
http_static: fix http(s) redirects

Add an http redirect template to generate correct-looking "301 Moved
Permanently" replies.

Supply a default value of 1<<31 for the use_ptr_thresh config parameter.

Expose hss_session_get() so friend plugins which register GET / POST
handlers with the http_static server can add data to the session fifos.

Type: fix

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

17 months agostats: return empty vector rather than NULL if stat_segment_dump_r() is run on an... 44/37744/2
Andrew Yourtchenko [Fri, 2 Dec 2022 21:22:37 +0000 (21:22 +0000)]
stats: return empty vector rather than NULL if stat_segment_dump_r() is run on an empty vector from ls

The return value in this function is initialized with 0, so if a vector of length 0 is passed
to stat_segment_dump_r, then this return value is never populated, resulting in inability
to distinguish between a successful dump of an empty vector and an error.

Solution: call vec_alloc(). As a side effect might get some trivial speed-up.

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

17 months agosession: move connects to first worker 13/35713/69
Florin Coras [Fri, 18 Mar 2022 15:33:08 +0000 (08:33 -0700)]
session: move connects to first worker

Type: improvement

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

17 months agoquic: update to quicly v0.1.4 39/37739/7
Dave Wallace [Thu, 1 Dec 2022 03:29:07 +0000 (22:29 -0500)]
quic: update to quicly v0.1.4

Type: improvement

Change-Id: I707399b8ba617a659476bfd7d793f04a1283e694
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
17 months agohs-test: add test suite features 35/37735/5
Maros Ondrejicka [Thu, 1 Dec 2022 08:56:37 +0000 (09:56 +0100)]
hs-test: add test suite features

Test suite now supports assertions which on fail stop test case run,
also it allows to create docker containers which are going to be
stopped automatically after the test run is finished.

Type: improvement
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I2834709b1efd17b8182d36cc0404b986b4ed595d
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
17 months agobuffers: revert protect against bad thread indices 41/37741/1
Benoît Ganne [Fri, 2 Dec 2022 14:30:56 +0000 (15:30 +0100)]
buffers: revert protect against bad thread indices

This change was introduced to workaround a bug in the NAT code, but
we should not woraround plugin bugs in infra.

Type: fix
Fixes: f8631ce7e8886136b4543a7926ffdf1bc760fb11

Change-Id: Id6ee281cf1fe8466b6522905fc2a176716e3d52f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
17 months agovlib: clib_panic if sysconf() can't determine page size on startup 29/37129/4
Andrew Yourtchenko [Thu, 15 Sep 2022 11:56:50 +0000 (11:56 +0000)]
vlib: clib_panic if sysconf() can't determine page size on startup

Account for the potential of sysconf() returning -1 if it can not
get the page size and make it a fatal error.

Coverity: 277313
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I8cae6a35ec2f745c37f1fe6557e5fa66720b4628

17 months agovnet: fix trace flag copying in icmp4 55/37655/2
Klement Sekera [Mon, 14 Nov 2022 10:29:17 +0000 (11:29 +0100)]
vnet: fix trace flag copying in icmp4

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

17 months agovhost: convert vhost device driver to a plugin 88/37488/8
Steven Luong [Wed, 19 Oct 2022 19:46:29 +0000 (12:46 -0700)]
vhost: convert vhost device driver to a plugin

convert vhost device driver to a plugin as described in
https://jira.fd.io/browse/VPP-2065

Type: improvement

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ibfe2f351bcaed36a04b136d082ae414145dd37b5

17 months agoavf: support generic flow 63/37563/8
Ting Xu [Fri, 21 Oct 2022 08:48:44 +0000 (16:48 +0800)]
avf: support generic flow

Support generic flow in native avf.

Enable necessary RSS hash function for generic flow. Extend some
structures and functions from for FDIR only to for both RSS and FDIR
flows. Modify virtual channel message to align with ice kernel driver.

Add functions to parse generic flow patterns. The parsing results will
be delivered to the kernel driver and create corresponding flow rules.

Type: feature
Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I82ce102a21993f1bae8a8bf23e491d5e1c261f61

17 months agowireguard: add atomic mutex 61/37361/5
Gabriel Oginski [Thu, 6 Oct 2022 06:58:45 +0000 (06:58 +0000)]
wireguard: add atomic mutex

The initiate handshake process can be called a numbers times for each
peers, then the main VPP thread called by Wireguard starting to
allocate memory. This behaviour can lead to out of memory when VPP has
a lot of Wireguard tunnels concurrently.

This fix add mutex to send only once handshake initiate at time for
each peers.

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

17 months agohsa: session rpc for echo client cli notifications 60/37660/10
Florin Coras [Mon, 14 Nov 2022 20:57:30 +0000 (12:57 -0800)]
hsa: session rpc for echo client cli notifications

Also, use connected udp for builtin echo apps

Type: improvement

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

17 months agostats: add boot time in stats segment 28/37728/4
Ole Troan [Mon, 28 Nov 2022 12:13:24 +0000 (13:13 +0100)]
stats: add boot time in stats segment

Write time into /sys/boottime on VPP start.
This allows a stateless control plane agent to validate if it's reconnecting to the same
VPP instance.

Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Iba7f334339c46142045e43da6efab11612e7b9c0
Signed-off-by: Ole Troan <ot@cisco.com>
17 months agoudp: refactor port allocation and sharing 49/37649/16
Florin Coras [Fri, 11 Nov 2022 19:37:36 +0000 (11:37 -0800)]
udp: refactor port allocation and sharing

Type: improvement

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

17 months agosession: transport endpt cleanup on owner thread 40/37640/15
Florin Coras [Wed, 9 Nov 2022 23:54:39 +0000 (15:54 -0800)]
session: transport endpt cleanup on owner thread

Maintain a single writer multiple readers usage model for transport
endpoints pool.

Type: improvement

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

17 months agowireguard: compute checksum for outer ipv6 header 18/37518/5
Artem Glazychev [Tue, 25 Oct 2022 11:48:40 +0000 (18:48 +0700)]
wireguard: compute checksum for outer ipv6 header

Type: fix

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I477e92712e441c91789afdf9be389d967acfa799

17 months agostats: fix the memory leak in stat_client.c 30/37730/3
Andrew Yourtchenko [Mon, 28 Nov 2022 17:56:16 +0000 (17:56 +0000)]
stats: fix the memory leak in stat_client.c

The issue can be reproduced by running "vpp_get_stats tightpoll"

The root cause is that the control flow discards the "result" struct
being prepared, along with pointer its allocated name.
This results in a memory leak.

Type: fix
Change-Id: Ibf884e92314f19b983a0159fc1257b3fa0110443
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
17 months agordma: fix for-loop initialization in scalar path 20/37720/7
Jieqiang Wang [Fri, 25 Nov 2022 07:26:55 +0000 (15:26 +0800)]
rdma: fix for-loop initialization in scalar path

When n_rx_packets is less then 16(VEC256) or 8(VEC128), code execution
will fall into scalar path of processing packets. But with a wrong
initialization value for n_left set to zero, i in the for-loop will
equal to n_rx_packets. This leads to the bypass of required ip4 checksum
validation and byte count endianness conversion in scalar path.
Besides, refactor the code using while instead of for-loop to keep
consistency with VPP code style.

Type: fix
Fixes: bf93670c515d ("rdma: fix ipv4 checksum check in rdma-input node")

Signed-off-by: Lijian Zhang <lijian.zhang@arm.com>
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: Ib4e8cb5202735f8b060c99caddf26035657551e1

17 months agoipsec: use correct reply message 25/37725/2
Vratko Polak [Fri, 25 Nov 2022 16:10:10 +0000 (17:10 +0100)]
ipsec: use correct reply message

Type: fix
Fixes: 815c6a4fbcbb636ce3b4dc98446ad205a30670a6
Ticket: VPP-2068

Change-Id: I42d678b0e28ac4d0b524dfc2dbd01bbad020cf24
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
17 months agovapi: write enumflag types to vapi headers 08/37608/2
Matthew Smith [Wed, 9 Nov 2022 17:45:19 +0000 (17:45 +0000)]
vapi: write enumflag types to vapi headers

Type: fix
Fixes: a51f9b3747

Some IPsec message type definitions were not being written to
ipsec.api.vapi.h. These include ipsec_sad_entry_add_del_v3 and
ipsec_sad_entry_add.

The cause appears to be that tunnel_flags, which is defined in
tunnel_types.api is a special case of enum called an enumflag. These do
not appear to have been handled in the code that generates the vapi
header files.

This patch adds processing of enumflag objects for vapi.

Change-Id: Ie506c4fcb5a07fe97a330ba11c252d1df98adfd9
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
17 months agoipsec: remove redundant policy array in fast path spd 16/37516/3
Piotr Bronowski [Sun, 9 Oct 2022 23:05:00 +0000 (23:05 +0000)]
ipsec: remove redundant policy array in fast path spd

Fast path spd was explicitely storing array of policy id vectors.
This information was redundand, as this inofrmation is already stored
in bihash table. This additional array was affecting performance
when adding and removing fast path policies.
The other place that needed refactoring after removing this array  was
cli command showing fast path policies.

Type: feature

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

17 months agoudp: preallocate ports sparse vec map 80/37680/6
Florin Coras [Sat, 19 Nov 2022 02:29:23 +0000 (18:29 -0800)]
udp: preallocate ports sparse vec map

Not ideal. The sparse vector used to map ports to next nodes assumes
only a few ports are ever used. When udp transport is enabled this does
not hold and, to make matters worse, ports are consumed in a random
order.

This can lead to a lot of slow updates to internal data structures
which in turn can slow udp connection allocations until all ports are
eventually consumed.

Consequently, reallocate sparse vector, preallocate all ports and have
them point to UDP_NO_NODE_SET. We could consider switching the sparse
vector to a preallocated vector but that would increase memory
consumption for vpp deployments that do not rely on host stack.

For reference, populating one of the v4 or v6 sparse vectors in reverse
order takes about 9.8s on a skylake cpu.

Type: improvement

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

17 months agohs-test: document host stack test framework 91/37591/12
Maros Ondrejicka [Tue, 8 Nov 2022 07:00:51 +0000 (08:00 +0100)]
hs-test: document host stack test framework

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

17 months agointerface: remove the pending interrupt from deleting interface 74/37674/3
Mohsin Kazmi [Thu, 17 Nov 2022 14:04:49 +0000 (14:04 +0000)]
interface: remove the pending interrupt from deleting interface

Type: fix

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

17 months agohs-test: auto register test actions 87/37687/4
Filip Tehlar [Tue, 22 Nov 2022 11:49:22 +0000 (12:49 +0100)]
hs-test: auto register test actions

Type: improvement

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

17 months agosr: srv6 path tracing api 93/37593/4
Julian Klaiber [Tue, 8 Nov 2022 07:44:06 +0000 (08:44 +0100)]
sr: srv6 path tracing api

Implements the API for SRv6 Path Tracing

Type: feature

Signed-off-by: Julian Klaiber <julian@klaiber.me>
Change-Id: Iefa7e512c8e1894595a9e3f5d42eab4160db1f28

17 months agogso: add gso documentation 05/37505/3
Mohsin Kazmi [Fri, 21 Oct 2022 17:49:12 +0000 (17:49 +0000)]
gso: add gso documentation

Type: docs

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

17 months agovpp-swan: Fix segfault for multiple addresses 92/37692/3
Timur Celik [Tue, 22 Nov 2022 16:03:14 +0000 (17:03 +0100)]
vpp-swan: Fix segfault for multiple addresses

In order to loop over the list of `vl_api_ip_address_details_t`,
increment the pointer by one instead of `i`.

Type: fix
Change-Id: I8554d1388d67bb95e029eddf444d383fb85ecac7
Signed-off-by: Timur Celik <mail@timurcelik.de>
17 months agolinux-cp: fix FIB_ENTRY_FLAG_ATTACHED 57/37657/3
Alexander Skorichenko [Mon, 14 Nov 2022 11:59:56 +0000 (11:59 +0000)]
linux-cp: fix FIB_ENTRY_FLAG_ATTACHED

Type: fix
   
Fib entries for attached routes when sourced from
FIB_SOURCE_API or FIB_SOURCE_CLI
get the FIB_ENTRY_FLAG_ATTACHED flag raised on the source.
Such a route added from linux-cp doesn't get this flag.
   
Fix this flag for linux-cp sources by passing it to the
fib entry's update/create function in lcp_router_route_add().

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
Change-Id: I24278ef86886cfee8a14acb250fb6992a754cc3c

17 months agopolicer: adding documentation 75/37675/6
Maxime Peim [Thu, 17 Nov 2022 15:29:10 +0000 (15:29 +0000)]
policer: adding documentation

Type: docs

Several kinds of policers are implemented in VPP.
However, they could differ from the RFCs it is
said they are from.

Additionally, the CLI command's help has been
updated with the current list of acceptable
parameters.

Signed-off-by: Maxime Peim <mpeim@cisco.com>
Change-Id: Ic9bf94e1094bea0fcc87ccaa882c2c5f88824041

17 months agoacl: fix set acl-plugin cli unformat free. 63/37663/2
Huawei LI [Tue, 15 Nov 2022 11:38:54 +0000 (19:38 +0800)]
acl: fix set acl-plugin cli unformat free.

Type: fix

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

17 months agotests: add VCL Thru Host Stack TLS in interrupt mode 46/37646/3
Filip Tehlar [Fri, 11 Nov 2022 10:56:54 +0000 (11:56 +0100)]
tests: add VCL Thru Host Stack TLS in interrupt mode

Type: test

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

17 months agoipsec: improve ipsec policy adding performance 17/34817/3
Xiaoming Jiang [Sat, 8 Oct 2022 02:40:45 +0000 (02:40 +0000)]
ipsec: improve ipsec policy adding performance

Type: improvement
Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I91ba1ff4c1085f4aca60ca111cbbaf14a3b4d761

17 months agotls: memory leak due to missing call to vnet_crypto_key_del 79/37679/1
Steven Luong [Fri, 18 Nov 2022 22:17:42 +0000 (14:17 -0800)]
tls: memory leak due to missing call to vnet_crypto_key_del

We add the crypto key to the vnet crypto library via vnet_crypto_key_add.
However, when the session is disconnected, we don't call
vnet_crypto_key_del and the memory is leaked in vnet_crypto library
as well as in pico tls key store.

It seems dispose crypto is the appropriate place to add
vnet_crypto_key_del.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: If6d1266baf686fefe5bb81330ce60b35c8ff574e

17 months agoipsec: Failure at the start of the batch should not invalidate the rest of the batch 77/37677/2
Neale Ranns [Fri, 18 Nov 2022 04:24:09 +0000 (04:24 +0000)]
ipsec: Failure at the start of the batch should not invalidate the rest of the batch

Type: fix

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Icd1e43a5764496784c355c93066273435f16dd35

18 months agosession: add transport main structure 70/37570/5
Florin Coras [Thu, 3 Nov 2022 19:50:13 +0000 (12:50 -0700)]
session: add transport main structure

Leave tp_vfts vector out for now.

Type: improvement

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