vpp.git
20 months agordma: fix coverity 249197 97/36997/2
Benoît Ganne [Tue, 23 Aug 2022 15:05:58 +0000 (17:05 +0200)]
rdma: fix coverity 249197

flags is u64, makes sure we do not overflow when shifting.

Type: fix

Change-Id: Ieea34187c0b568dc4d24c9415b9cff36907a5a87
Signed-off-by: Benoît Ganne <bganne@cisco.com>
20 months agovppinfra: fix coverity 249217 27/36927/2
Andrew Yourtchenko [Wed, 17 Aug 2022 13:48:11 +0000 (13:48 +0000)]
vppinfra: fix coverity 249217

Zero-initialize the temporary struct.

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

20 months agoclassify: fix coverity 249223 42/36942/2
Andrew Yourtchenko [Thu, 18 Aug 2022 12:38:00 +0000 (12:38 +0000)]
classify: fix coverity 249223

Day1 latent integer overflow.

vnet_classify_add_del defines new_hash as u32 - so replace a u64 type with u32
in split_and_rehash as well.

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

20 months agonat: simplify per-protocol code by using an array 46/36946/5
Jon Loeliger [Wed, 17 Aug 2022 17:08:31 +0000 (12:08 -0500)]
nat: simplify per-protocol code by using an array

rather than using obfuscated macro hacery, simplify
the per-protocol data management by directly using
an array of NAT protocol types.

Type: refactor

Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I6fe987556ac9f402f8d490da0740e2b91440304c

20 months agovlib: memory leak in vlib_register_errors on create and delete interface 47/36947/2
Steven Luong [Thu, 18 Aug 2022 20:20:30 +0000 (13:20 -0700)]
vlib: memory leak in vlib_register_errors on create and delete interface

format returns a vector which must be free or memory is leaked.

From show memory
  3716528    66716 0x7fffbfeb0db0 _vec_resize_internal + 0xe6
                                  _vec_add + 0x164
                                  do_percent + 0xb82
                                  va_format + 0xb9
                                  format + 0x156
                                  vlib_register_errors + 0x76c
                                  setup_tx_node + 0x5c
                                  vnet_register_interface + 0xca6
                                  vnet_eth_register_interface + 0xdd
                                  memif_create_if + 0x975
                                  memif_create_command_fn + 0x461
                                  vlib_cli_dispatch_sub_commands + 0xec8

(gdb) list *(vlib_register_errors + 0x76c)
0x7ffff6e8280c is in vlib_register_errors (/home/sluong/vpp/vpp/src/vlib/error.c:224).
219
220   vec_validate (nm->node_by_error, n->error_heap_index + n_errors - 1);
221
222   for (u32 i = 0; i < n_errors; i++)
223     {
224       t.format = (char *) format (0, "%v %s: %%d", n->name, cd[i].name);
225       vm->error_elog_event_types[n->error_heap_index + i] = t;
226       nm->node_by_error[n->error_heap_index + i] = n->index;
227     }

Type: fix

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

20 months agoipsec: enable UDP encap for IPv6 ESP tun protect 75/36875/3
Matthew Smith [Tue, 9 Aug 2022 22:19:38 +0000 (22:19 +0000)]
ipsec: enable UDP encap for IPv6 ESP tun protect

Type: improvement

If an SA protecting an IPv6 tunnel interface has UDP encapsulation
enabled, the code in esp_encrypt_inline() inserts a UDP header but does
not set the next protocol or the UDP payload length, so the peer that
receives the packet drops it. Set the next protocol field and the UDP
payload length correctly.

The port(s) for UDP encapsulation of IPsec was not registered for IPv6.
Add this registration for IPv6 SAs when UDP encapsulation is enabled.

Add punt handling for IPv6 IKE on NAT-T port.
Add registration of linux-cp for the new punt reason.
Add unit tests of IPv6 ESP w/ UDP encapsulation on tun protect

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

20 months agounittest: fix coverity 274736 40/36940/2
Andrew Yourtchenko [Thu, 18 Aug 2022 12:30:20 +0000 (12:30 +0000)]
unittest: fix coverity 274736

Free up the vapi context in case of failure.

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

20 months agowireguard: fix error type for crypto backend 43/36943/2
Benoît Ganne [Thu, 18 Aug 2022 13:03:45 +0000 (15:03 +0200)]
wireguard: fix error type for crypto backend

Crypto backend errors should not be using the same error as missing
keypair.

Type: fix

Change-Id: I78c2b3df3f08a354463b7824349b08627f2b023c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
20 months agowireguard: fix ipv6 handshake packet 45/36945/2
Benoît Ganne [Thu, 18 Aug 2022 14:49:17 +0000 (16:49 +0200)]
wireguard: fix ipv6 handshake packet

IPv6 payload length should not include the size of the IPv6 header.

Type: fix

Change-Id: Iedcd17d0af8d72d9b5f8f9b605da7c99e151bc9d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
20 months agovppinfra: correct clib_bitmap_set() return comment 44/36944/2
Jon Loeliger [Thu, 18 Aug 2022 14:19:43 +0000 (09:19 -0500)]
vppinfra: correct clib_bitmap_set() return comment

Fix a copy-n-paste issue that left clib_bitmap_set()'s return
type documentation incorrect.  Chnage it to indicate that
the function returns a new pointer for the bitmap that could
be different due to a possible reallocation.

Type: docs

Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: Ia193c4673c0e4d1760e91cd7f80ebe1868a3c9b5

20 months agonat: Replace port refcounts with simple bitvectors 31/36931/3
Jon Loeliger [Tue, 16 Aug 2022 19:05:18 +0000 (14:05 -0500)]
nat: Replace port refcounts with simple bitvectors

Previously, each address maintained an array of 32-bit
reference counts for each of 65K possible ports for each
of 4 NAT protocols.  Totalling 1MB per address.  Wow.

A close read of the code shows that an "is used" check
precedes each attempted reference count increment.
That means the refcount never actually gets above 1.
That in turn means algorithmically, a bit vector is
sufficient.  And one need not be allocated for more
than the highest validated port referenced.

These changes introduce a dynamically sized bit vector
replacing the reference counts, for a maximum of 32K
if all 4 protocols use port 65535.  In fact, protocol
OTHER is never used, so at most 24K will be used, and
none of it will be "statically" allocated per address.

Type: fix
Fixes: 85bee7548bc5a360851d92807dae6d4159b68314

Change-Id: I7fd70050e7bf4871692a862231f8f38cf0158132
Signed-off-by: Jon Loeliger <jdl@netgate.com>
20 months agodns: fix coverity 249189, 249198 39/36939/2
Andrew Yourtchenko [Thu, 18 Aug 2022 12:17:05 +0000 (12:17 +0000)]
dns: fix coverity 249189, 249198

Zero-initialize the temporary struct on stack.

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

20 months agonsh: fix coverity 249169 38/36938/1
Andrew Yourtchenko [Thu, 18 Aug 2022 12:02:53 +0000 (12:02 +0000)]
nsh: fix coverity 249169

Zero-initialize the temporary struct on stack.

Type: fix
Change-Id: I651f87deeb79c6c073d5c510435fa268893a3b0e
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
20 months agoip-neighbor: Declarative .api counters. 95/36895/2
Neale Ranns [Sat, 13 Aug 2022 10:58:11 +0000 (10:58 +0000)]
ip-neighbor: Declarative .api counters.

Type: improvement

plus the addition of the 'thorttle' counter of IP6.

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

20 months agoip: Use .api declarative counters for ICMP. 77/36877/2
Neale Ranns [Fri, 12 Aug 2022 01:50:24 +0000 (01:50 +0000)]
ip: Use .api declarative counters for ICMP.

Type: improvement

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

20 months agoikev2: accept key exchange on CREATE_CHILD_SA 79/36879/4
Atzm Watanabe [Fri, 12 Aug 2022 05:29:31 +0000 (14:29 +0900)]
ikev2: accept key exchange on CREATE_CHILD_SA

In RFC 7296, CREATE_CHILD_SA Exchange may contain the KE payload
to enable stronger guarantees of forward secrecy.
When the KEi payload is included in the CREATE_CHILD_SA request,
responder should reply with the KEr payload and complete the key
exchange, in accordance with the RFC.

Type: improvement
Signed-off-by: Atzm Watanabe <atzmism@gmail.com>
Change-Id: I13cf6cf24359c11c3366757e585195bb7e999638

20 months agoikev2: fix possible SEGV 04/36804/2
Atzm Watanabe [Fri, 5 Aug 2022 09:48:25 +0000 (18:48 +0900)]
ikev2: fix possible SEGV

Type: fix
Signed-off-by: Atzm Watanabe <atzmism@gmail.com>
Change-Id: Icbd452b43ecaafe46def1276c98f7e8cbf761e51

21 months agosvm: fix coverity 249207,249209 26/36926/3
Andrew Yourtchenko [Wed, 17 Aug 2022 13:44:16 +0000 (13:44 +0000)]
svm: fix coverity 249207,249209

Zero-initialize the temporary struct.

Type: fix
Change-Id: I6f7a35ace6002aa75dc986c7c7eca614c9c5c3ed
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
21 months agovlib: fix coverity 274744 25/36925/2
Andrew Yourtchenko [Wed, 17 Aug 2022 13:26:54 +0000 (13:26 +0000)]
vlib: fix coverity 274744

Add a missing null check

Type: fix
Change-Id: Id1b27341480c9d62185496ae1d832360119ec198
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
21 months agovlib: fix coverity 274750 24/36924/2
Andrew Yourtchenko [Wed, 17 Aug 2022 13:24:11 +0000 (13:24 +0000)]
vlib: fix coverity 274750

Add a missing null check.

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

21 months agomemif: crash on recceiving a bad descriptor 04/36904/2
Steven Luong [Mon, 15 Aug 2022 19:45:43 +0000 (12:45 -0700)]
memif: crash on recceiving a bad descriptor

We validate each descriptor via memif_validate_desc_data and set
desc_status to non-zero for the corresponding descriptor when
the descriptor is bad. However, desc_status is not propagated back to
xor_status in memif_validate_desc_data which eventually sets
ptd->xor_status.

Not setting ptd->xor_status causes us to treat all descriptors as
"simple". In that case, when we try to copy also the bad descriptors to
the buffers, it results a crash since desc_data is not set to point
to the correct memory in the descriptor.

The fix is to set xor_status in memif_validate_desc_data such that if
there is a bad descriptor in the frame, "is_simple" is set to false and
we have to selectively copy only the good descriptors to the buffers.

Type: fix

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

21 months agowireguard: fix fib entry tracking 16/36916/1
Alexander Chernavin [Wed, 17 Aug 2022 08:30:43 +0000 (08:30 +0000)]
wireguard: fix fib entry tracking

Type: fix

After peers roaming support addition, FIB entry tracking stopped
working. For example, it can be observed when an adjacency is stacked on
a FIB entry by the plugin and the FIB entry hasn't got ARP resolution
yet. Once the FIB entry gets ARP resolution, the adjacency is not
re-stacked as it used to. This results in endless ARP requests when a
traffic is sent via the adjacency.

This is broken because the plugin stopped using "midchain delegate" with
peers roaming support addition. The reason is that "midchain delegate"
didn't support stacking on a different FIB entry which is needed when
peer's endpoint changes. Now it is supported there (added in 36892).

With this fix, start using "midchane delegate" again and thus, fix FIB
entry tracking. Also, cover this in tests.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Iea91f38739ab129e601fd6567b52565dbd649371

21 months agofib: support "midchain delegate" removal 92/36892/2
Alexander Chernavin [Fri, 12 Aug 2022 13:19:49 +0000 (13:19 +0000)]
fib: support "midchain delegate" removal

Type: improvement

Currently, once an adjacency is stacked on a FIB entry via
adj_midchain_delegate_stack(), "midchain delegate" is created for the
adjacency and the FIB index is stored there. And all further calls to
adj_midchain_delegate_stack() even passing another FIB index will cause
the function to still use the stored one. In other words, there is
currently no way to stack an adjacency on another FIB index if "midchain
delegate" already exists for it.

Being able to stack on another FIB index is needed for the wireguard
plugin. As per the protocol, peers can roam between different external
endpoints. When an authenticated packet is received and it was sent from
a different endpoint than currently stored, the endpoint needs to be
updated and all futher communication needs to happen with that endpoint.
Thus, the corresponding to that peer adjacencies need to be stacked on
the FIB entry that corresponds to the new endpoint.

With this change, add adj_midchain_delegate_remove() that removes
"midchain delegate". When stacking on another FIB entry is needed,
existing "midchain delegate" can be removed and then, a new one created
with a new FIB index via adj_midchain_delegate_stack().

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ibc1c99b248a5ef8ef64867f39f494fab627a1741

21 months agotests: move "venv" to "build-root" directory from "test" directory 93/36893/3
Saima Yunus [Wed, 10 Aug 2022 07:25:31 +0000 (03:25 -0400)]
tests: move "venv" to "build-root" directory from "test" directory

Type: refactor

- refactored VPP test code to remove "ignore_path" variable
  from "discover_tests" function and "run_test" code
- configured VPP test makefile, config file, and 'run.sh' shell script
  to move "venv" directory from "test" dir to "build-root" dir

Signed-off-by: Saima Yunus <yunus.saima.234@gmail.com>
Change-Id: Id2beecbb99f24ce13ed118a1869c5adbef247e50

21 months agonat: fix potential out-of-bound worker array index 05/36305/8
Jing Peng [Tue, 31 May 2022 15:20:31 +0000 (11:20 -0400)]
nat: fix potential out-of-bound worker array index

In several NAT submodules, the number of available ports (0xffff - 1024)
may not be divisible by the number of workers, so port_per_thread is
determined by integer division, which is the floor of the quotient.
Later when a worker index is needed, dividing the port with port_per_thread
may yield an out-of-bound array index into the workers array.

As an example, assume 2 workers are configured, then port_per_thread
will be (0xffff - 1024) / 2, which is 32255. When we compute a worker
index with port 0xffff, we get (0xffff - 1024) / 32255, which is 2,
but since we only have 2 workers, only 0 and 1 are valid indices.

This patch fixes the problem by adding a modulo at the end of the division.

Type: fix
Signed-off-by: Jing Peng <pj.hades@gmail.com>
Change-Id: Ieae3d5faf716410422610484a68222f1c957f3f8

21 months agovrrp: fix SIGABRT crash by ASSERT() when deleting vrrp vr(MASTER state) 96/36896/2
luoyaozu [Sun, 14 Aug 2022 04:55:48 +0000 (12:55 +0800)]
vrrp: fix SIGABRT crash by ASSERT() when deleting vrrp vr(MASTER state)

we need cancel vrrp_vr_timer when deleting vrrp vr

Type: fix

Signed-off-by: luoyaozu <luoyaozu@chinatelecom.cn>
Change-Id: I8ea01f1943d6e3e60c4990c5be945de613bc8b53

21 months agodocs: fix spellcheck error for Ubuntu 22.04 14/36514/4
Saima Yunus [Thu, 16 Jun 2022 22:26:21 +0000 (15:26 -0700)]
docs: fix spellcheck error for Ubuntu 22.04

Type: fix

Signed-off-by: Saima Yunus <yunus.saima.234@gmail.com>
Change-Id: I975990aeead6d34f0317a37e917bd92c0c89276e

21 months agohttp_static: validate session before sending 78/36878/2
Florin Coras [Fri, 12 Aug 2022 02:28:58 +0000 (19:28 -0700)]
http_static: validate session before sending

Type: fix

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

21 months agobuild: remove cnxk support from dpdk external deps 74/36874/3
Dave Wallace [Thu, 11 Aug 2022 19:29:54 +0000 (15:29 -0400)]
build: remove cnxk support from dpdk external deps

- the cnxk code fails to link using the gcc-11 toolchain
  included in the ARM64 Ubuntu-22.04 distro. This is required
  for Ubuntu-22.04 CI jobs (both docker image building & CI
  job execution on ARM64)
- Currently unable to replicate this failure on the dpdk repo.

Type: fix

Change-Id: Ice44aef9f0f721b4c88ac78f92a14bda87dc80a6
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
21 months agoip: only set rx_sw_if_index when connection found to avoid following crash like tcp... 68/36868/2
Xiaoming Jiang [Thu, 11 Aug 2022 15:04:48 +0000 (15:04 +0000)]
ip: only set rx_sw_if_index when connection found to avoid following crash like tcp punt

Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: I894a881cec1888b392d26fdfb385f97c31113ef1

21 months agompls: Use the .api for the definition of error/info counters 18/36818/2
Neale Ranns [Tue, 9 Aug 2022 01:24:41 +0000 (01:24 +0000)]
mpls: Use the .api for the definition of error/info counters

Type: improvement

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

21 months agoip: Use .api declared error counters 19/36819/3
Neale Ranns [Tue, 9 Aug 2022 03:03:29 +0000 (03:03 +0000)]
ip: Use .api declared error counters

Type: improvement

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

21 months agoipsec: Use .api declared error counters 20/36820/3
Neale Ranns [Tue, 9 Aug 2022 03:34:51 +0000 (03:34 +0000)]
ipsec: Use .api declared error counters

Type: improvement

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

21 months agoarp: Use the new style error count declaration 17/36817/3
Neale Ranns [Tue, 9 Aug 2022 00:59:37 +0000 (00:59 +0000)]
arp: Use the new style error count declaration

Type: improvement

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

21 months agolinux-cp: FIB lookup for P2MP tunnel interfaces 14/36814/2
Matthew Smith [Fri, 22 Apr 2022 18:02:32 +0000 (18:02 +0000)]
linux-cp: FIB lookup for P2MP tunnel interfaces

Type: improvement

If a tun/L3 interface is paired with a multipoint tunnel interface,
pass packets arriving from the host to ip[46]-lookup instead of
cross-connecting them to the tunnel interface. Adjacencies are used
to drive the rewrite for Multipoint tunnel interfaces, so the generic
adjacency used with a P2P tunnel will not work correctly.

Change-Id: I2d8be56dc5029760978c05bc4953f84c8924a412
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
21 months agotunnel: Fix API encoding of tunnel flags 83/36083/6
Neale Ranns [Thu, 5 May 2022 06:07:20 +0000 (06:07 +0000)]
tunnel: Fix API encoding of tunnel flags

Type: fix

API and internal flags do not match 1:1.

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

21 months agoikev2: do not accept rekey until old SA is deleted 22/36822/3
Atzm Watanabe [Tue, 9 Aug 2022 05:00:03 +0000 (14:00 +0900)]
ikev2: do not accept rekey until old SA is deleted

Type: fix
Signed-off-by: Atzm Watanabe <atzmism@gmail.com>
Change-Id: I11b6107492004a45104857dc2dae01b9a5a01e3b

21 months agobfd: Express node stats using the .api file 16/36816/2
Neale Ranns [Tue, 9 Aug 2022 00:03:17 +0000 (00:03 +0000)]
bfd: Express node stats using the .api file

Type: improvement

This method allows the assignment of a severity to the error.

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

21 months agobfd: More descriptive error codes during packet receive handling 15/36815/3
Neale Ranns [Fri, 5 Aug 2022 03:40:43 +0000 (03:40 +0000)]
bfd: More descriptive error codes during packet receive handling

Type: improvement

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

21 months agowireguard: add peers roaming support 97/36797/4
Alexander Chernavin [Thu, 4 Aug 2022 08:11:57 +0000 (08:11 +0000)]
wireguard: add peers roaming support

Type: feature

With this change, peers are able to roam between different external
endpoints. Successfully authenticated handshake or data packet that is
received from a new endpoint will cause the peer's endpoint to be
updated accordingly.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ib4eb7dfa3403f3fb9e8bbe19ba6237c4960c764c

21 months agowireguard: add handshake rate limiting support 15/36715/5
Alexander Chernavin [Wed, 20 Jul 2022 13:01:42 +0000 (13:01 +0000)]
wireguard: add handshake rate limiting support

Type: feature

With this change, if being under load a handshake message with both
valid mac1 and mac2 is received, the peer will be rate limited. Cover
this with tests.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Id8d58bb293a7975c3d922c48b4948fd25e20af4b

21 months agoip-neighbor: ARP and ND stats per-interface. 67/33167/8
Neale Ranns [Fri, 16 Jul 2021 14:00:16 +0000 (14:00 +0000)]
ip-neighbor: ARP and ND stats per-interface.

Type: feature

stats of the like from:
  https://datatracker.ietf.org/doc/html/draft-ietf-rtgwg-arp-yang-model-03#section-4

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

21 months agovnet: install reass headers 32/36432/4
Mohammed Hawari [Tue, 14 Jun 2022 09:44:45 +0000 (11:44 +0200)]
vnet: install reass headers

Change-Id: I42a138628b06a412b8fce7fb4fc500caf9057169
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
21 months agovlib: vlib_validate_buffer_enqueue_with_aux_x1 26/36326/4
Mohammed Hawari [Thu, 2 Jun 2022 11:55:36 +0000 (13:55 +0200)]
vlib: vlib_validate_buffer_enqueue_with_aux_x1

This change implement a flavour of vlib_validate_buffer_enqueue_x1 with
aux data support

Change-Id: I2ecf7af49cf15ecd23b12d8acd57fe90546c1af7
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
21 months agointerface: fix show_or_clear_hw_interfaces 10/36810/2
Mohammed Hawari [Mon, 8 Aug 2022 08:31:11 +0000 (10:31 +0200)]
interface: fix show_or_clear_hw_interfaces

Change-Id: I2f3163a7a158afa8e2debc6f545c3d1a2a12ac1d
Type: fix
Fixes: 3414977152ae6362277158dc732e6b9958a6e618
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
21 months agodevices: af_packet, fix tx stall by retrying failed sendto 38/35438/5
Mohammed Hawari [Thu, 24 Feb 2022 14:19:01 +0000 (15:19 +0100)]
devices: af_packet, fix tx stall by retrying failed sendto

Change-Id: I6bed66f740b34673a4883eda1c7f7310c57e131b
Type: fix
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Signed-off-by: Benoît Ganne <bganne@cisco.com>
21 months agowireguard: add dos mitigation support 14/36714/4
Alexander Chernavin [Wed, 20 Jul 2022 12:43:42 +0000 (12:43 +0000)]
wireguard: add dos mitigation support

Type: feature

With this change:
 - if the number of received handshake messages exceeds the limit
   calculated based on the peers number, under load state will activate;
 - if being under load a handshake message with a valid mac1 is
   received, but mac2 is invalid, a cookie reply will be sent.

Also, cover these with tests.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I3003570a9cf807cfb0b5145b89a085455c30e717

21 months agoikev2: fix rekeying with multiple notify payloads 09/36809/2
Atzm Watanabe [Mon, 8 Aug 2022 06:45:36 +0000 (15:45 +0900)]
ikev2: fix rekeying with multiple notify payloads

Type: fix
Signed-off-by: Atzm Watanabe <atzmism@gmail.com>
Change-Id: I065bd5c26055d863d786023970e7deeed261b31c

21 months agovnet: On rx-mode set, return error for an actual error. 07/36807/1
Wayne Morrison [Fri, 5 Aug 2022 13:47:24 +0000 (09:47 -0400)]
vnet: On rx-mode set, return error for an actual error.

In set_hw_interface_change_rx_mode(), when vnet_hw_if_set_rx_queue_mode()
returns an error it actually returns success.  This has been changed to
return a clib_error_return() value.

Type: fix
Change-Id: Iba39c875d9e15463cb6492d8a966234560a1f522
Signed-off-by: Wayne Morrison <wmorrison@netgate.com>
21 months agotests: fix node variant selection 77/36777/2
Benoît Ganne [Fri, 29 Jul 2022 08:52:34 +0000 (10:52 +0200)]
tests: fix node variant selection

Type: fix
Fixes: 4830e4f78fb8e46b23a1a0711cd06969a77d8d95

Change-Id: Iddc73dbda633acd72bd82e52f8ae83c17e3940f6
Signed-off-by: Benoît Ganne <bganne@cisco.com>
21 months agovppapigen: make json in parallel 48/36448/5
Nathan Skrzypczak [Thu, 16 Jun 2022 15:00:02 +0000 (17:00 +0200)]
vppapigen: make json in parallel

Type: improvement

This patches makes the make json-api-files
run in parallel in the same python runtime.

Default number of workers is 8, and run time
goes from ~20s to ~2s on average.

Change-Id: Id8cff013889db2671f6b6b4af9a019460c656f81
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
21 months agotests: run a test inside a QEMU VM 37/32637/23
Naveen Joy [Tue, 11 May 2021 17:31:18 +0000 (10:31 -0700)]
tests: run a test inside a QEMU VM

Use the script test/run.py to run a test named test_vm_tap
inside a QEMU VM. The run script builds out a virtual env,
launches a light weight QEMU VM, mounts host directories,
starts VPP inside the VM and runs the test. The test named
test_vm_tap, creates two tap v2 interfaces in separate Linux
namespaces and using iPerf, streams traffic between the VM
and VPP. All data files are stored in the directory named
/tmp/vpp-vm-tests. To clean up, use the make test-wipe
command.
Usage:
test/run.py --vm --debug --test test_vm_tap

Type: improvement

Change-Id: I4425dbef52acee1e5b8af5acaa169b89a2c0f171
Signed-off-by: Naveen Joy <najoy@cisco.com>
21 months agodpdk: enable interrupt support for vmxnet3 66/36766/2
Benoît Ganne [Wed, 27 Jul 2022 15:50:46 +0000 (17:50 +0200)]
dpdk: enable interrupt support for vmxnet3

Type: feature

Change-Id: I0abbe925d6b9d3dd7196cd8beaf4f471beb45bd6
Signed-off-by: Benoît Ganne <bganne@cisco.com>
21 months agoarping: validate am->interfaces before check address 96/36796/5
GaoChX [Thu, 4 Aug 2022 02:04:33 +0000 (10:04 +0800)]
arping: validate am->interfaces before check address

May cause pointers point to unexpected non-zero addresses if not
validate vec

Type: fix

Change-Id: Ie4d3343d6734125b98e0dc962e33e0c7514da829
Signed-off-by: GaoChX <chiso.gao@gmail.com>
21 months agowireguard: add processing of received cookie messages 13/36713/3
Alexander Chernavin [Wed, 20 Jul 2022 10:48:56 +0000 (10:48 +0000)]
wireguard: add processing of received cookie messages

Type: feature

Currently, if a handshake message is sent and a cookie message is
received in reply, the cookie message will be ignored. Thus, further
handshake messages will not have valid mac2 and handshake will not be
able to be completed.

With this change, process received cookie messages to be able to
calculate mac2 for further handshake messages sent. Cover this with
tests.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I6d51459778b7145be7077badec479b2aa85960b9

21 months agoipsec: fix coverity warnings found in fast path implementation 02/36702/2
Piotr Bronowski [Mon, 18 Jul 2022 16:45:22 +0000 (16:45 +0000)]
ipsec: fix coverity warnings found in fast path implementation

This patch fixes followig coverity issues:
CID 274739 Out-of-bounds read
CID 274746 Out-of-bounds access
CID 274748 Out-of-bounds read

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

21 months agoip6-nd: fix ip6 ra cli issue 79/36779/2
Takanori Hirano [Fri, 29 Jul 2022 11:21:30 +0000 (20:21 +0900)]
ip6-nd: fix ip6 ra cli issue

Fix parse problem with per-prefix settings (e.g. valid-lifetime)
in ip6 ra.

Type: fix
Signed-off-by: me@hrntknr.net
Change-Id: I2a00bf5b9621ebc16211227d70e376fc2f61bae1

21 months agosession: fix a crash when using unregistered transport proto 68/36768/2
Filip Tehlar [Thu, 28 Jul 2022 08:39:13 +0000 (08:39 +0000)]
session: fix a crash when using unregistered transport proto

Type: improvement

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

21 months agoip6-nd: copy mac address to wrong buffer current_data 85/36585/2
liangrq [Mon, 4 Jul 2022 08:23:21 +0000 (16:23 +0800)]
ip6-nd: copy mac address to wrong buffer current_data

Type: fix

Receive router solicitation in pop vlan interface, it will cause copy mac address to wrong buffer current_data and can not reply the solicitation right

Signed-off-by: liangrq <liangrq@efly.cc>
Change-Id: Ic40a5a47a52c8187aaf6c6854df761529e6f24d9

21 months agovppinfra: fix formatting of format_base10 03/36703/5
Pim van Pelt [Tue, 19 Jul 2022 08:32:22 +0000 (08:32 +0000)]
vppinfra: fix formatting of format_base10

format_base10 reads 64b but is fed 32b values at the callsite; change
to u64 consistently. The function has only one call site in
interface/monitor.c which has a few additional bugs (spurious
character, and ambiguous 'bits' versus 'bytes' in the output).

Type: improvement
Signed-off-by: Pim van Pelt <pim@ipng.nl>
Change-Id: I360f0d439cc13c09bd3f53db8184bd12ad4bc2e9

21 months agolibmemif: fix chain buffer support 73/36673/3
Mohsin Kazmi [Mon, 18 Jul 2022 11:21:05 +0000 (11:21 +0000)]
libmemif: fix chain buffer support

Type: fix

This patch fixes chain buffer support as transmit side
missing to set the flag to the descriptor in case of
chain buffers.

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

21 months agolinux-cp: fix endianess for autoendian methods 10/36710/6
Stanislav Zaikin [Tue, 19 Jul 2022 14:08:15 +0000 (16:08 +0200)]
linux-cp: fix endianess for autoendian methods

If an API methos is specified as "autoendian" it should use macros with
_END at the end.

Type: fix

Change-Id: I73b7b4f6996b30631c4355ace156ed0665c4b8ad
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
21 months agovcl: new vcl api to get detailed session errors 00/36700/4
Radha krishna Saragadam [Mon, 18 Jul 2022 14:11:05 +0000 (19:41 +0530)]
vcl: new vcl api to get detailed session errors

Sometimes VPP rejects application connection requests
due to various reasons. Some errors application can
retry to get a successful connection.
In a non-blocking session, VCL sends EPOLLHUP.
An application can call a new API
vppcom_session_get_error to find the details and retry
depending on the error.

Type: fix

Signed-off-by: Radha krishna Saragadam <krishna_srk2003@yahoo.com>
Change-Id: If0e21a8e25701f66a190a2799b2209e0c31f897c

21 months agolinux-cp: change namespace to netns 09/36709/4
Stanislav Zaikin [Mon, 18 Jul 2022 06:55:04 +0000 (08:55 +0200)]
linux-cp: change namespace to netns

namespace is a keyword for c++ compilers

Type: fix

Change-Id: Ia8fc9ef1cc15fe9d0e40b3f543f9e8f411203b89
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
21 months agostats: add loops per second counter in the stats segment. 01/36701/3
Radha krishna Saragadam [Mon, 18 Jul 2022 14:20:23 +0000 (19:50 +0530)]
stats: add loops per second counter in the stats segment.

This change adds loops per second in the stats segment.
Applications using the stats segment to monitor VPP
can use this for better monitoring

Type: fix

Signed-off-by: Radha krishna Saragadam <krishna_srk2003@yahoo.com>
Change-Id: I53081f40ee918eec9763513a639b9d8a02488b20

21 months agosession: increase retries to grab mq lock 99/36699/4
Radha krishna Saragadam [Mon, 18 Jul 2022 13:53:06 +0000 (19:23 +0530)]
session: increase retries to  grab mq lock

With thousands of UDP sessions,
Sometimes VPP needs more time to grab the MQ lock for a session.
So increased tries from 5 to 75.

Type: fix
Signed-off-by: Radha krishna Saragadam <krishna_srk2003@yahoo.com>
Change-Id: Id8b877255aedcdcf206e9d0869fe5246645d76e7

21 months agolinux-cp: API downgrade due to namespace keyword 98/36698/2
Matthew Smith [Mon, 18 Jul 2022 13:19:26 +0000 (13:19 +0000)]
linux-cp: API downgrade due to namespace keyword

Type: fix

A user had trouble compiling C++ code to work with the linux-cp APIs
because some messages contain a field called namespace, which is a
reserved word for C++. We wish to rename those fields so the messages
which are affected are being set to in_progress.

Change-Id: I3bd1dc898c146a9980161a562b2b453313bb58fd
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
21 months agodpdk: fix mlx5 dpdk init with no-multi-seg 37/36437/2
Tianyu Li [Fri, 10 Jun 2022 09:30:47 +0000 (09:30 +0000)]
dpdk: fix mlx5 dpdk init with no-multi-seg

Build vpp with MLX DPDK PMD,
make DPDK_MLX4_PMD=y DPDK_MLX5_PMD=y DPDK_MLX5_COMMON_PMD=y build-release
With no-multi-seg in startup.conf,
Mellanox NIC init failed with following message,

rte_eth_rx_queue_setup[port:2, errno:-12]: Unknown error -12
mlx5_net: port 2 Rx queue 0: Scatter offload is not configured and
no enough mbuf space(2176) to contain the maximum RX packet length(2065)
with head-room(128)

In Mellanox NIC PMD driver, 'di.max_rx_pktlen' is returned as 65536,
and 'di.max_mtu' is returned as 65535, which makes
the driver_frame_overhead logic not suitable for Mellanox NICs.
So skip the logic code if MAX_MTU is returned as 65535.

Type: fix
Fixes: 1cd0e5dd533f ("vnet: distinguish between max_frame_size and MTU")
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I027b76b8d07fb453015b8eebb36d160b4bc8df9c

22 months agotests: add fast path ipv6 python tests for outbound policy matching 42/36642/3
Piotr Bronowski [Fri, 8 Jul 2022 12:45:51 +0000 (12:45 +0000)]
tests: add fast path ipv6 python tests for outbound policy matching

This patch introduces set of python tests for fast path ipv6, based on
ipv4 tests. Some missing parts of ipsec framework has been added
in order to test ipv6 implementation.

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

22 months agoipsec: fast path outbound policy matching implementation for ipv6 41/36641/4
Piotr Bronowski [Fri, 8 Jul 2022 12:45:05 +0000 (12:45 +0000)]
ipsec: fast path outbound policy matching implementation for ipv6

With this patch fast path for ipv6 policy lookup is enabled.
This impelentation scales and outperforms original implementation when
the number of defined flows is higher thatn 100k.

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

22 months agoquic: fix coverity warning 58/36658/2
Florin Coras [Tue, 12 Jul 2022 18:24:34 +0000 (11:24 -0700)]
quic: fix coverity warning

Type: fix
Fixes: 5b4b4c0

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

22 months agoperfmon: add Arm event bundles 92/36192/10
Zachary Leaf [Mon, 23 May 2022 11:23:40 +0000 (06:23 -0500)]
perfmon: add Arm event bundles

Included statistic bundles (all NODE type):
  - Instructions and CPU cycles, including IPC
  - Data cache access/refills/%
  - Data TLB cache access/refills/%
  - Instruction cache access/refills/%
  - Instruction TLB cache access/refills/%
  - Memory/Bus accesses, memory errors
  - Branch (mis)predictions, architecturally & speculatively executed
  - Processor frontend/backend stalls (stalled cycles)

Type: feature
Signed-off-by: Zachary Leaf <zachary.leaf@arm.com>
Tested-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: I7ea4a27c8df8fc7222b743a98bdceaff727e4112

22 months agoperfmon: enable perfmon plugin for Arm 30/33630/13
Zachary Leaf [Thu, 12 May 2022 07:26:00 +0000 (02:26 -0500)]
perfmon: enable perfmon plugin for Arm

This patch enables statistics from the Arm PMUv3 through the perfmon
plugin.

In comparison to using the Linux "perf" tool, it allows obtaining
direct, per node level statistics (rather than per thread). By accessing
the PMU counter registers directly from userspace, we can avoid the
overhead of using a read() system call and get more accurate and fine
grained statistics about the running of individual nodes.

A demo of perfmon on Arm can be found at:
https://asciinema.org/a/egVNN1OF7JEKHYmfl5bpDYxfF

*Important Note*
Perfmon on Arm is dependent on and works only on Linux kernel versions
of v5.17+ as this is when userspace access to Arm perf counters was
included.

On most Arm systems, a maximum of 7 PMU events can be configured at once
- (6x PMU events + 1x CPU_CYCLE counter). If some perf counters are in
use elsewhere by other applications, and there are insufficient counters
remaining to open the bundle, the perf_event_open call will fail
(provided the events are grouped with the group_fd param, which perfmon
currently utilises).

See arm/events.h for a list of PMUv3 events available, although it is
implementation defined whether most events are implemented or not. Only
a small set of 7 events is required to be implemented in Armv8.0, with
some additional events required in later versions. As such, depending on
the implementation, some statistics may not be available. See Arm
Architecture Reference Manual for Armv8-A, D7.10.2 "The PMU event number
space and common events" for more information.

arm/events.c:arm_init() gets information from the sysfs about what
events are implemented on a particular CPU at runtime. Arm's
implementation of the perfmon source callback .bundle_support uses this
information to disable unsupported events in a bundle, or in the case
no events are supported, disable the entire bundle.

Where a particular event in a bundle is not implemented, the statistic
for that event is shown as '-' in the 'show perfmon statistics' cli
output, by disabling the column.

There is additional code in perfmon.c to only open events which are
marked as implemented. Since we're only opening and reading events that
are implemented, some extra logic is required in cli.c to re-align
either perfmon_node_stats_t or perfmon_reading_t with the column
headings configured in each bundle, taking into account disabled
columns.

Userspace access to perf counters is disabled by default, and needs to
be enabled with 'sudo sysctl kernel/perf_user_access=1'.

There is a check built into the Arm event source init function
(arm/events.c:arm_init) to check that userspace reading of perf counters
is enabled in the /proc/sys/kernel/perf_user_access file.

If the above file does not exist, it means the kernel version is
unsupported. Users without a supported kernel will see a warning
message, and no Arm bundles will be registered to use in perfmon.

Enabling/using plugin:
  - include the following in startup.conf:
    - plugins { plugin perfmon_plugin.so { enable }
  - 'show perfmon bundle [verbose]' - show available statistics bundles
  - 'perfmon start bundle <bundle-name>' - enable and start logging
  - 'perfmon stop' - stop logging
  - 'show perfmon statistics' - show output

For a general guide on using and understanding Arm PMUv3 events, see
https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/arm-neoverse-n1-performance-analysis-methodology

Type: feature
Signed-off-by: Zachary Leaf <zachary.leaf@arm.com>
Tested-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: I0620fe5b1bbe78842dfb1d0b6a060bb99e777651

22 months agoperfmon: make less arch dependent 91/36191/4
Zachary Leaf [Mon, 23 May 2022 11:22:27 +0000 (06:22 -0500)]
perfmon: make less arch dependent

In preparation for enabling perfmon on Arm platforms, move some Intel
/arch specific logic into the /intel directory and update the CMake to
split the common code from arch specific files.

Since the dispatch_wrapper code is very different on Arm/Intel,
each arch can provide their own implementation + conduct any additional
arch specific config e.g. on Intel, all indexes from the mmap pages are
cached. The new method intel_config_dispatch_wrapper conducts this
config and returns a pointer to the dispatch wrapper to use.

Similarly, is_bundle_supported() looks very different on Arm/Intel, so
each implementation is to provide their own arch specific checks.

Two new callbacks/function ptrs are added in PERFMON_REGISTER_SOURCE to
support this - .bundle_support and .config_dispatch_wrapper.

Type: refactor
Signed-off-by: Zachary Leaf <zachary.leaf@arm.com>
Change-Id: Idd121ddcfd1cc80a57c949cecd64eb2db0ac8be3

22 months agowireguard: fix coverity warnings 38/36638/2
Artem Glazychev [Fri, 8 Jul 2022 12:01:19 +0000 (19:01 +0700)]
wireguard: fix coverity warnings

Type: fix

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

22 months agodpdk: add ID for 4xxx QAT VF 40/36640/1
Matthew Smith [Wed, 6 Jul 2022 15:52:20 +0000 (10:52 -0500)]
dpdk: add ID for 4xxx QAT VF

Type: improvement

Enable use of 4th gen QAT devices. Will be available on Sapphire Rapids.

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

22 months agogre: fix returning the flags in the API 91/36591/2
Ivan Shvedunov [Tue, 5 Jul 2022 11:13:35 +0000 (15:13 +0400)]
gre: fix returning the flags in the API

Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: I5ecfb242e5905c9bd8ce19cd9ab6efd657ee14d4

22 months agovppinfra: fix memory leak in sparse_vec_free() 89/36589/2
Sergey Matov [Mon, 23 Nov 2020 17:35:28 +0000 (21:35 +0400)]
vppinfra: fix memory leak in sparse_vec_free()

Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Signed-off-by: Sergey Matov <sergey.matov@travelping.com>
Change-Id: I4ec1a68b7266f05ab7c543cd8207afb29e740743

22 months agomisc: pass NULL instead of 0 for pointer in variadic functions 88/36588/2
Andreas Schultz [Fri, 15 May 2020 09:50:07 +0000 (11:50 +0200)]
misc: pass NULL instead of 0 for pointer in variadic functions

0 is not NULL (at least not in all cases), passing 0 into a variadic
function in a place where the consumer reads it as pointer might
leave parts of the pointer uninitilized and hence filled with random
data.

It seems that this used to work with gcc, but clang seems to treat the
0 in those places as a 32bit integer.

Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Change-Id: I37d975eef5a1ad98fbfb65ebe47d73458aafea00

22 months agobuffers: protect against bad thread indices 27/36427/2
Jon Loeliger [Mon, 13 Jun 2022 15:39:32 +0000 (10:39 -0500)]
buffers: protect against bad thread indices

There is a very rare bug in NAT processing that yeilds a thread
index of ~0.  When this happens, vlib_get_frame_queue_elt()
suffers a segfault and VPP quits.  Prevent an outright fault
by dropping the packet instead.

Type: fix
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I48c7a268925bb821ea15e58db5d4bfb211c40c09

22 months agovcl: check if listener valid on disconnect cleanup 38/36538/2
Florin Coras [Wed, 29 Jun 2022 03:01:20 +0000 (20:01 -0700)]
vcl: check if listener valid on disconnect cleanup

Type: fix

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

22 months agomisc: VPP 22.06 Release Notes 35/36535/2
Andrew Yourtchenko [Thu, 23 Jun 2022 05:18:21 +0000 (05:18 +0000)]
misc: VPP 22.06 Release Notes

Type: docs
Change-Id: I15971b21fd660b4893218640c0d5e5a5247868f1
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 0d352a97c5e3ad1f5f6eab18a978a14b0b9e06a8)

22 months agovrrp: while delete vr can't delete multi virtual address. 10/36510/7
GaoChX [Tue, 28 Jun 2022 08:25:03 +0000 (16:25 +0800)]
vrrp: while delete vr can't delete multi virtual address.

Here is bug example:
vpp# create loopback interface
loop0
vpp# vrrp vr add loop0 vr_id 1 priority 100 192.168.1.1 192.168.1.2
vpp# vrrp vr del loop0 vr_id 1
vpp# vrrp vr add loop0 vr_id 1 priority 100 192.168.1.1 192.168.1.2
vrrp vr add: vrrp_vr_add_del returned -105

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

22 months agosr: SRv6 Path Tracing Sink node behavior 47/36547/2
Ahmed Abdelsalam [Wed, 29 Jun 2022 17:11:08 +0000 (17:11 +0000)]
sr: SRv6 Path Tracing Sink node behavior

Type: feature
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
Change-Id: I2d3a0211abfee3501d3d77c80da20e67e1e9e133

22 months agovlib: enqueue_to_next_with_aux implementation 07/36307/5
Mohammed Hawari [Tue, 31 May 2022 16:11:05 +0000 (18:11 +0200)]
vlib: enqueue_to_next_with_aux implementation

Change-Id: I0e1bb39d765ec3efa7b28ca02fb7beeb23607e51
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
22 months agoclassify: use 32 bits hash 49/36349/4
Benoît Ganne [Wed, 8 Jun 2022 08:49:17 +0000 (10:49 +0200)]
classify: use 32 bits hash

classify hash used to be stored as u64 in buffer metadata, use 32 bits
instead:
 - on almost all our supported arch (x86 and arm64) we use crc32c
   intrinsics to compute the final hash: we really get a 32-bits hash
 - the hash itself is used to compute a 32-bits bucket index by masking
   upper bits: we always discard the higher 32-bits
 - this allows to increase the l2 classify buffer metadata padding such
   as it does not overlap with the ip fib_index metadata anymore. This
   overlap is an issue when using the 'set metadata' action in the ip
   ACL node which updates both fields

Type: fix

Change-Id: I5d35bdae97b96c3cae534e859b63950fb500ff50
Signed-off-by: Benoît Ganne <bganne@cisco.com>
22 months agosr: code refactor and style fix 46/36546/3
Ahmed Abdelsalam [Wed, 29 Jun 2022 16:30:21 +0000 (16:30 +0000)]
sr: code refactor and style fix

Type: refactor
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
Change-Id: Iff5e85952273526d5c9d9e7e73bd2b6c15bcd7f6

22 months agosvm: check svm_msg_q_size_to_alloc success 48/36548/1
Ofer Heifetz [Wed, 29 Jun 2022 17:18:27 +0000 (20:18 +0300)]
svm: check svm_msg_q_size_to_alloc success

svm_msg_q_size_to_alloc must return a valid base address, if it fails
pass up the error for handling

Type: fix

Change-Id: I408492f65f646862122acb9a187819b3bbf4f91c
Signed-off-by: Ofer Heifetz <oferh@marvell.com>
22 months agosr: Add support for SRv6 Path Tracing Infrastructure 40/36540/3
Ahmed Abdelsalam [Wed, 29 Jun 2022 11:08:42 +0000 (11:08 +0000)]
sr: Add support for SRv6 Path Tracing Infrastructure

This patch adds support for the infrastructure
required to support SRv6 Path Tracing defined in
https://datatracker.ietf.org/doc/draft-filsfils-spring-path-tracing/

Type: feature

Change-Id: If3b09d6216490a60dd5a816577477b6399abc124
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
22 months agohsa: reduce number of preallocated vcl test server sessions 37/36537/2
Florin Coras [Wed, 29 Jun 2022 02:21:32 +0000 (19:21 -0700)]
hsa: reduce number of preallocated vcl test server sessions

Type: improvement

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

22 months agoipsec: add fast path python tests 10/36210/9
Fan Zhang [Wed, 25 May 2022 20:03:40 +0000 (20:03 +0000)]
ipsec: add fast path python tests

This patch introduces set of python tests for fast path, based on
flow cache tests. There was a bug in calculating of policy mask when
adding to fast path, which has been fixed. Memory size for bihash
tables for both ip4 and ip6 outbound fast path policies
has been increased.

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

22 months agotests: add ipsec flow performance unit test 99/36099/16
Piotr Bronowski [Thu, 5 May 2022 18:51:21 +0000 (18:51 +0000)]
tests: add ipsec flow performance unit test

This patch adds performacne and functional tests for ip4
outbound traffic policy matching.
Test setup is configurable in startup.conf and though the test
parameters. Cache, fast path, fast path burst mode can be enabled
and disabled,
and performance for different lookup setup can be measured.

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

22 months agoipsec: show fast path flag in cli 16/36316/5
Fan Zhang [Wed, 25 May 2022 19:42:08 +0000 (19:42 +0000)]
ipsec: show fast path flag in cli

This patch updates the "show ipsec spd" cli to display
policies maintained by fast path bihash table.

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

22 months agoipsec: add fast path configuration parser 98/36098/15
Piotr Bronowski [Fri, 6 May 2022 13:52:24 +0000 (13:52 +0000)]
ipsec: add fast path configuration parser

Parser can be configured from the level of startup.conf file:
fast path can be enabled and disabled.

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

22 months agoipsec: add spd fast path matching 97/36097/15
Piotr Bronowski [Tue, 10 May 2022 14:06:29 +0000 (14:06 +0000)]
ipsec: add spd fast path matching

This patch adds matching functionality for spd fast path
policy matching. Fast path matching has been introduced
for outbound traffic only.

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

22 months agoipsec: make match function inline 75/36175/13
Piotr Bronowski [Tue, 10 May 2022 14:06:29 +0000 (14:06 +0000)]
ipsec: make match function inline

This patch introduces ipsec_output.h file. Matching implementation is
moved there. The reason behind is the possibility of unit testing
matching mechanism. Therefore we need to have functions that are in
scope of our intrest there and since these are inline their
implementation needs to be moved to the header file as well.

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

22 months agoipsec: add/delete ipsec fast path policy 96/36096/18
Piotr Bronowski [Tue, 10 May 2022 13:18:22 +0000 (13:18 +0000)]
ipsec: add/delete ipsec fast path policy

This patch introduces functions to add and delete fast path
policies.

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

22 months agosession: fix connected udp accepts 36/36536/2
Florin Coras [Tue, 28 Jun 2022 23:01:35 +0000 (16:01 -0700)]
session: fix connected udp accepts

Type: fix

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

22 months agosession quic: allow custom config of rx mqs seg size 15/36515/3
Florin Coras [Tue, 28 Jun 2022 21:34:45 +0000 (14:34 -0700)]
session quic: allow custom config of rx mqs seg size

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Idc0fdebfea29c241d8a36128241ccec03eace5fd

22 months agodocs: fix broken links 05/36505/5
Pratikshya Prasai [Mon, 27 Jun 2022 15:02:04 +0000 (11:02 -0400)]
docs: fix broken links

Type: docs

Signed-off-by: Pratikshya Prasai <pratikshyaprasai2112@gmail.com>
Change-Id: I729de9e18624c63a72ec415a05c55617cb360c47