Compare commits

...

966 Commits

Author SHA1 Message Date
0dfaadec8c vlib: reset stop_timer_handle on expired processes
Type: fix

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

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

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

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

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

Change-Id: I266da438e76e1fc356016da0b9b4941efac1c28a
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 9aa4ac55b0)
2023-09-13 17:02:00 +00:00
3be288f0d9 vlib:process node scheduling use timing_wheel have problem.
The time wheel should not be started in the loop while processing expired events.
can be set  p->stop_timer_handle = ~0 to solve.

Type: fix

Signed-off-by: jinsh <jinsh11@chinatelecom.cn>
Change-Id: Ie9a4293f39f981f50d280b39a5d958d319ee2300
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit b7756b26a9)
2023-09-13 17:01:20 +00:00
feb08c9c40 vcl: fix crash issue when connect an IP that VPP can't resolve
Type: fix

Change-Id: Id0e56906da7cee7be955e87935b073fdd04c78e7
Signed-off-by: qinyang <qiny@yusur.tech>
2023-05-29 02:23:09 -07:00
6206eaba4e nat: fix nat44 vrf handlers
Change of enums used in REPLY_MACRO() to appropriate one
for handlers:
-vl_api_nat44_ed_add_del_vrf_table_t_handler
-vl_api_nat44_ed_add_del_vrf_route_t_handler

Type: fix

Change-Id: I58e97817b1678da7c025c0d03a8b938a4e0f7b6c
Signed-off-by: Daniel Béreš <daniel.beres@pantheon.tech>
(cherry picked from commit 2c03879ce4)
2023-03-31 15:24:48 +00:00
c4cccb444a avf: fix bit calculation function fls_u32
In avf the function fls_u32 is used to calculate the power of 2.
Fix the expression of this function.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I27160de8588a5efb3f24306597a5a240deb3ab74
(cherry picked from commit dc95634a23)
2023-03-03 13:02:32 +00:00
40225dbe13 avf: fix checksum offload configuration
Fix some configurations of avf checksum offload to get the correct
udp and tcp checksum. Change Tx checksum offload capability since
avf supports ipv4, tcp and udp offload all. Remove the operation to
swap bit of checksum.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I55a916cc9ee6bef5b2074b5b6bb5f517fc2c178d
(cherry picked from commit 26d841870f)
2023-03-03 13:01:47 +00:00
985d12d8c4 avf dpdk: fix incorrect handling of IPv6 src address in flow
In current flow creating process in native avf and dpdk-plugins, when
parsing the input arguments, it does not copy IPv6 src address correctly,
so that IPv6 src address will not be configured in any flow rule, and
any packet with the same address will not be matched.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Ic957c57e3e1488b74e6281f4ed1df7fd491af35c
(cherry picked from commit 11d9d02459)
2023-03-03 13:01:32 +00:00
9e43eb7a3c avf: fix incorrect flag for flow director
When parsing flow action type in avf, there is an incorrect flag for
flow director, which makes flow director rule created unexpectedly.

Type: fix
Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Id9fed5db8ccacd5cc6c2f4833183364d763188c1
(cherry picked from commit 25ab42e33b)
2023-03-03 13:01:18 +00:00
5516fc0f3b misc: VPP 23.02 Release Notes
Type: docs
Change-Id: I88ae8452ed1b39a4c6d82b790f63f31deae4c2fa
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-02-21 12:57:31 -05:00
5e1efcc56a misc: VPP 22.10.1 Release Notes
Type: docs
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I70374ea376c895d92d5789debf4b437113e3d884
(cherry picked from commit 57302fe52f)
2023-02-11 00:23:18 +00:00
ed376872ca misc: VPP 22.06.1 Release Notes
Type: docs
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I8770a35c801126ffd2de8f58d79e6616642709a9
(cherry picked from commit 1513b381d8)
2023-02-10 14:24:40 -05:00
be1b844214 packetforge: fix lack of edge for ipv6 after gtppsc
Add one new edge for ipv6 after gtppsc so that packetforge can parse
this protocol combination.

Type: fix
Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I1bae1ec617c4867de2e0b3de27eda77b89e5580c
(cherry picked from commit 656a550f1f)
2023-02-08 02:21:33 +00:00
c7131df872 packetforge: fix order of dst/src address of mac
In the defination of mac node, the order of dst and src address is
reversed. Swap their order in this patch.

Type: fix
Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I039accc0a881eef12f13c75c5becf8b7df97d525
(cherry picked from commit 02bdd3f5cb)
2023-02-08 02:21:01 +00:00
a641763c5f vcl: drop lock on segment attach failure
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3bc2c7986f492b7b7dfbc84e4893202354223790
(cherry picked from commit aaad4f977c)
2023-02-08 02:20:36 +00:00
d1eaed02f3 vcl: add ldp implementation for recvmmsg
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7322abc3d3b0aa81399667bf02b03786fc62c958
(cherry picked from commit f1a232fd86)
2023-02-08 02:20:22 +00:00
90c9bb871f vcl: better handlig of ldp apis that rely on gnu source
Control use of apis that rely on _GNU_SOURCE being defined with compile
time macro.

Also fixes sendmmsg and recvmmsg which were not probably wrapped.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I207de23210d4b9dc960bb4289159502760c5614d
(cherry picked from commit 3684794336)
2023-02-08 02:19:58 +00:00
c6fe2c3053 ipsec: fix AES CBC IV generation (CVE-2022-46397)
For AES-CBC, the IV must be unpredictable (see NIST SP800-38a Appendix
C). Chaining IVs like is done by ipsecmb and native backends for the
VNET_CRYPTO_OP_FLAG_INIT_IV is fully predictable.
Encrypt a counter as part of the message, making the (predictable)
counter-generated IV unpredictable.

Fixes: VPP-2037
Type: fix

Change-Id: If4f192d62bf97dda553e7573331c75efa11822ae
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-02-08 01:06:52 +00:00
2a3d41cea2 session: fix out of bounds event memcpy
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If5300653edd2dad470985f4591959d00cad2a43b
(cherry picked from commit af2e88d964)
2023-02-03 20:16:29 +00:00
390874b73b vppapigen: fix incorrect comments in json
Type: fix

Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I241cefbbce98cf6fef83f36bd87ae2c1f4b067f0
(cherry picked from commit a4f994f31e)
2023-02-03 18:02:22 +00:00
701ba9cfe3 tls: openssl: fix SSL_read partial read scenario
When application performs SSL_read from the app rx-fifo, it can
pre-allocate multiple segments, but there is an issue if the OpenSSL
manages to partially fill in the first segment, in this case, since
data is assumed to be copied over by OpenSSL to the pre-allocated
segments(s), vpp uses svm_fifo_enqueue_nocopy API which performs
zero copy by passing the pre-allocated segment to SSL_read.

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

Type: fix

Signed-off-by: Ofer Heifetz <oferh@marvell.com>
Change-Id: I941a89b17d567d86e5bd2c35785f1df043c33f38
(cherry picked from commit 905ec87977)
2023-02-03 03:58:51 +00:00
42b5a8767c misc: Initial changes for stable/2302 branch
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Icea0f6987e3fd240167cab4d2304cd3962997a41
2023-01-18 13:08:39 +00:00
613e6dc0bf lb: add source ip based sticky load balancing
This patch adds source ip based sticky session, which is already
implemented in many hardware LBs and software LBs. Note that sticky
sessions may be reset if the hash is recalculated as ASs are added
or deleted.

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

Type: feature
Signed-off-by: Nobuhiro MIKI <nmiki@yahoo-corp.jp>
Change-Id: I3eb3680a28defbc701f28c873933ec2fb54544ab
2023-01-18 10:53:23 +00:00
893a0c3130 build: use CMAKE_C_COMPILER_LAUNCHER for ccache
In some situations, CMake will find ccache in /usr/bin but /usr/bin
might not present in PATH. The former fix for this was to place the
ccache configuration logic before the project() declaration, but since
CMake 3.4 there is a new variable to be used which handles this case.

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

Type: fix
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: Ie026e02b2b06e2dca2d62da5fea7b1a104bcc7c3
2023-01-18 10:10:59 +00:00
5d2346801b vppapigen: include comments in json
Type: feature
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Ibd796adea734b64d9209c5e18c5b9800cbaf62c6
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-01-18 01:32:24 +00:00
f4fe0168a6 hs-test: zero timeout on docker stop
Should drop execution time for all tests by about 80%.

Type: test

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib6b4ef9fb4e7745a61b40c0b34e53e4046ccdbcc
2023-01-18 01:06:19 +00:00
531ac242a7 pppoe: fix memcpy out of bounds with gcc-11 on arm
In function ‘memcpy’,
    inlined from ‘clib_memcpy_fast’ at /home/vpp/src/vppinfra/string.h:86:10,
    inlined from ‘memcpy_s_inline’ at /home/vpp/src/vppinfra/string.h:157:7,
    inlined from ‘vnet_pppoe_add_del_session’ at /home/vpp/src/plugins/pppoe/pppoe.c:356:7:
 error: ‘__builtin_memcpy’ offset [0, 5] is out of the bounds [0, 0] [-Werror=array-bounds]
   34 |   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cc1: all warnings being treated as errors

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

Type: fix
Fixes: 62f9cdd82c ("Add PPPoE Plugin")
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: If9fb409cfbbac77c15559d103987f0130bf30255
2023-01-18 00:47:36 +00:00
936b8ddcf7 vppinfra:fix pcap write large file(> 0x80000000) error.
Type: improvement

Signed-off-by: aihua2013 <51931196@qq.com>
Change-Id: I22670f49abfb5d1fd728686fc7d65fb40ea6bda2
2023-01-18 00:42:25 +00:00
738cf73b2c tests: improve packet checksum functions
Fool-proof assert_checksum_valid so that one does not verify checksum on
wrong layer (because of how scapy internally works).

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

Type: improvement
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I39a2b50ec5610f969cfde9796416ee3a50ae0ba3
2023-01-18 00:39:57 +00:00
cc16e7bad7 pci: fix musl crash
The musl libc does not support closedir(0) resulting in a crash. Only
call closedir() if we successfully opened it.

Type: fix

Change-Id: I3198454f44735501047afc42b94b2fea273212f4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-01-18 00:38:09 +00:00
a35f56663f hs-test: add http proxy env to container builds
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8c116efb41d561e30fd0db1388cdba903e2edffe
2023-01-17 17:44:30 +00:00
f643b6f671 hs-test: autodetect ubuntu version during build
Since VPP binaries are being compiled on host system,
it makes sense to autodetect Ubuntu version when building test images
so that containers would be running version equal to host system.

Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I0e13d9ba1ddcd3ad5835bce1b8cccfc048e5e528
2023-01-17 17:38:47 +00:00
4da8be4dba acl: CLI allow replace, allow deletion
Allow the CLI caller to specify an optional [index <idx>] index,
which will remove the ACL at that index. This mimicks the API behavior,

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

Type: improvement
Signed-off-by: pim@ipng.nl
Change-Id: I5f240f7a4e3bca14e8122917e8a5186d80094de2
2023-01-17 16:36:28 +00:00
463d5f95a0 vlib: install dma.h to fix out-of-tree plugins
Change-Id: I7888ab58abced93859ce15d0dbd1c3d7c94a02f5
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: fix
Fixes: 0654242d1e
2023-01-17 12:21:14 +01:00
f34f32f319 hs-test: better directory structure
Move config files to resources and docker files to separate directory

Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I24dd0705c4a463c06de525f28cb54d882527320a
2023-01-16 20:51:09 +00:00
3f951433b8 hs-test: restrict concurrency on envoy
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I8b06f4554a6ee5b13de829e47eaa82431a76c332
2023-01-16 20:47:33 +00:00
f4b82f52e8 wireguard: add local variable
The current implementation of wireguard use dereference value from
pointer, but between get and dereference the value from pointer can be
occur change in pool memory, which means that this pointer can be
invalid. Since current implementation doesn't handle with invalid
pointers, segfault can occur.

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

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Ic161ab08266e584493338c682d827ea1fd754b98
2023-01-16 16:09:35 +00:00
1d9780a43f ipsec: fix transpose local ip range position with remote ip range in fast path implementation
In fast path implementation of spd policy lookup  opposite convention to
the original implementation has been applied and local ip range has been
interchanged with the remote ip range. This fix addresses this issue.

Type: fix
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I0b6cccc80bf52b34524e98cfd1f1d542008bb7d0
2023-01-16 14:54:06 +00:00
e917bf75d9 vlib: add const to char* params of several funcs
These functions do not need modifiable strings.
It helps with linker sections as well as C++ compatibility.
It is a good style to use const where approriate.

Type: refactor
Signed-off-by: void234@gmail.com
Change-Id: Ib437a01663aa61860c6a938d869ed1111da71ec7
2023-01-14 12:12:25 +00:00
e5465324dd vppinfra: add const to char* params of several funcs
These functions do not need modifiable strings.
It helps with linker sections as well as C++ compatibility.
It is a good style to use const where approriate.

Type: refactor
Signed-off-by: void234@gmail.com
Change-Id: I8d1e922197b3594122296e8c1af57e0a8ec0bf3d
2023-01-14 12:12:25 +00:00
1d84abc93e vcl: set deq notify flag on epoll connected sessions
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I021f8e8bba247b0050d390a37dbc75900dc6a598
2023-01-13 20:23:00 +00:00
8851ccfe4a hs-test: use equal ubuntu versions in test images
Official nginx image is based on Debian with older libc version,
that causes a runtime fail when VPP libraries are compiled in Ubuntu
which has newer libc.
Using equal version of Ubuntu in VPP image and in nginx image
ensures that running nginx won't fail due to different libc versions.

Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I48f3b23be30a9d9d9144351437ce163d64a4bb6b
2023-01-13 19:54:01 +00:00
609d8e9186 vppinfra: fix else if check in _vec_set_len()
Type: fix

Signed-off-by: Liangxing Wang <liangxing.wang@arm.com>
Change-Id: I1f757abccd228b9e73f25c96754738c8e6bff259
2023-01-13 17:17:06 +00:00
48ceadcf39 build: cmake NAMELINK_COMPONENT in vpp libraries
Installs the unversioned .so symlink in the -dev component.
This prevent debian lintian error:
link-to-shared-library-in-wrong-package

NAMELINK_COMPONENT was added in cmake 3.12

Type: make
Change-Id: I9d743218fa1f6b677659d745525e399ff66e73f4
Signed-off-by: Nick Brown <nickbroon@gmail.com>
2023-01-13 14:24:44 +00:00
f9a1748798 af_xdp: update af_xdp driver plugin to depend on libxdp
AF_XDP support is deprecated in libbpf since v0.7.0 [1], the libxdp library
now provides the functionality which once was in libbpf, this commit updates
af_xdp plugin to depend on libxdp, libbpf still remains a dependency even if
libxdp is present, as it need use libbpf APIs for program loading.

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

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

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

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

Type: improvement

Change-Id: Ifbf6e3aa38bc6e0b77561f26311fd11c15ddb47e
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
2023-01-13 09:57:00 +00:00
809eb669c7 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
2023-01-12 23:03:22 +00:00
dcca9e75a1 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
2023-01-12 16:21:55 +01:00
af5744c359 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
2023-01-12 13:18:36 +00:00
6903da2323 abf: exclude networks with deny rules
Type: improvement

Signed-off-by: Josh Dorsey <jdorsey@netgate.com>
Change-Id: Iee43ca9278922fc7396764b88cff1a87bcb28349
2023-01-12 02:17:37 +00:00
058237e581 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
2023-01-11 19:23:22 +00:00
f719adfa89 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
2023-01-11 19:21:49 +00:00
c04d8c41d1 virtio: add option to bind interface to uio driver
Type: improvement

Change-Id: I30e66370c927afeb62ba3a2b3334bdc2a31d4561
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-01-11 15:26:41 +00:00
6a07348f4a pci: add option to force uio binding
Type: improvement

Change-Id: Ifea4badd58f7e2b5e792d7506f6747851a08587f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-01-11 15:23:44 +00:00
eea6edcda8 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
2023-01-11 15:15:57 +00:00
1ce802d654 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>
2023-01-11 15:15:46 +00:00
f06a518f8b nat: do not use nat session object after deletion
Type: fix

Change-Id: Ifc709b6e7217a893d13aee6d3019e699637366ef
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-01-11 07:13:27 +00:00
897fbba434 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
2023-01-10 23:09:01 +00:00
1ee30fd5d2 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>
2023-01-10 21:25:23 +00:00
f457f1fa02 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>
2023-01-10 20:51:05 +00:00
9bc72ac8de udp: avoid listener cleanups with active opens
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibff9f32e4fcaf0344207d8e43f3547180cbd4eef
2023-01-10 18:25:32 +00:00
a9e266ea4a 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
2023-01-10 16:55:26 +00:00
2b1b1154c4 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
2023-01-10 15:20:08 +00:00
c21775bd5c 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
2023-01-10 02:49:29 +00:00
6d39c1e07e 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
2023-01-10 02:47:58 +00:00
993c86f339 hs-test: remove exec flags from source files
Type: style

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ia87b28e81b6fd06c8c3681bf3cb1dd6ce8c84f41
2023-01-09 15:48:40 +01:00
f3ee2b636a 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
2023-01-09 12:14:23 +01:00
c204c87c18 hs-test: add nginx test
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Idd5352f254df0d1f36c1270e73440c9287247b81
2023-01-09 11:39:06 +01:00
227660b996 session: avoid dgram dequeues with no transport
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1a3393b579caeb5dc25b60bc1b4a71706fb07051
2023-01-06 20:48:15 +00:00
cfaf440202 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>
2023-01-06 11:20:30 +01:00
57f177d0b7 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
2023-01-04 17:00:15 +00:00
6c89a35846 vppinfra: fix function prototypes
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Idbdfdf2d3fdbb64366f50d5a7458c4073a4f2746
2022-12-26 14:25:36 -05:00
21b8fd3245 docs: update home-gateway use-case
Type: fix
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I720b1395ee8714de2e2386b31a0f2c041272042a
2022-12-25 08:48:01 -05:00
c5b0fcd159 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>
2022-12-23 17:18:53 +00:00
b89db0cf75 misc: fix crash using tracedump plugin with socket API clients
Type: fix
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
Change-Id: I208724a515c9a38c4032f101bdf73aa87b1c13be
2022-12-22 19:48:05 +01:00
413447451e 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
2022-12-21 18:34:34 +00:00
bca76580b1 af_packet: move to plugin
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I3ec857adb3a9e8a778072a202a4d23f4101e83b2
2022-12-21 18:33:51 +00:00
bb98aac422 hs-test: small improvements
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ifa56da632b139acd5e743c3076c24b5b55388924
2022-12-21 17:06:39 +00:00
24adebad27 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>
2022-12-21 14:51:34 +00:00
15952b261f udp: fix tx handling of non-connected sessions
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I659b9914fcfa4619a68e9807ef241f88c96b3bd0
2022-12-20 21:45:03 +00:00
8753180a80 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
2022-12-20 18:49:49 +00:00
8c626b41ea 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 2ca88ff978
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 2ca88ff978,
so it keeps the behavior of using the my_client_index stored
in api_main_t.

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

Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: Idf8c1d1056cbd631cc3057cf7acc486216fa8303
2022-12-20 12:08:06 +00:00
db823ed6e9 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
2022-12-19 17:11:52 +00:00
aff4d320f0 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
2022-12-19 08:07:11 +00:00
f1b97bf1d9 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
2022-12-19 08:06:53 +00:00
415b6a7c75 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
2022-12-16 17:25:27 +00:00
4117b24acb 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>
2022-12-16 10:13:24 +00:00
863d1c8711 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
2022-12-15 13:58:43 +00:00
3abb32c6fe 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>
2022-12-15 13:19:57 +00:00
243a0433ff 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>
2022-12-14 16:57:14 +00:00
4b9935cd54 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
2022-12-14 14:07:11 +00:00
051579d0f2 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
2022-12-13 16:04:56 +00:00
e416893a59 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>
2022-12-13 01:43:01 +00:00
d3ccb0c2fb 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
2022-12-12 14:48:22 +00:00
1588222e72 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
2022-12-12 00:00:49 +00:00
74ceb38a19 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 07e0c05e69)
2022-12-10 00:30:15 +00:00
36c7e7cb34 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
2022-12-09 18:24:08 +00:00
c62ddb61a5 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
2022-12-09 09:07:58 -05:00
c0a2527a83 http_static: derive mime type from file extensions
Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I0f087477e257f5119d7d6182d19f8796773a1f19
2022-12-08 15:40:02 +00:00
919fdad6bc tcp: avoid retransmit head with no data
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iefabc7b9dd1109fd6dcf65e5d9794173421b7369
2022-12-07 21:29:33 +00:00
98a91e8260 hs-test: use assert-like approach in test cases
Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I1653001461d4dfc52f1fb3a9e0cf458a506b8324
2022-12-07 16:05:20 +00:00
fe1fb3c31a 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
2022-12-07 10:34:04 +00:00
bcdde1a0a1 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>
2022-12-07 10:33:37 +00:00
37157dad51 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>
2022-12-07 10:33:20 +00:00
d7413835e1 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>
2022-12-07 10:33:07 +00:00
f22824bbef 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>
2022-12-07 10:32:53 +00:00
287c1252c1 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
2022-12-07 04:01:11 +00:00
bd9cde810b 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>
2022-12-07 03:02:46 +00:00
0e79abbe2e hs-test: manage containers and volumes within test suite
Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I614111814af5a99dcaa22c8581ea2d339572ae1c
2022-12-06 20:06:35 +00:00
5b746319d8 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
2022-12-06 20:12:40 +01:00
55fbf55c17 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
2022-12-06 11:25:15 -05:00
9067f3332e 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
2022-12-05 09:50:18 +00:00
309f7aac17 session: move connects to first worker
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I035e3fdbb52eca010ad7b2c20ca2930cb1645978
2022-12-02 22:59:13 +00:00
06bbab0c45 quic: update to quicly v0.1.4
Type: improvement

Change-Id: I707399b8ba617a659476bfd7d793f04a1283e694
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-12-02 21:38:41 +00:00
11a03e972e 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>
2022-12-02 21:35:10 +00:00
b01efc557b 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: f8631ce7e8

Change-Id: Id6ee281cf1fe8466b6522905fc2a176716e3d52f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-12-02 15:58:39 +01:00
ea0b890cbf 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
2022-12-02 13:49:11 +00:00
5163d59810 vnet: fix trace flag copying in icmp4
Type: fix
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I0a947b74e40499327910c1ed10923f7a869039d6
2022-12-02 13:46:41 +00:00
7eba44d1ec 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
2022-12-02 13:43:11 +00:00
a6d16b7130 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
2022-12-02 13:42:28 +00:00
583d4c94dc 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
2022-12-01 06:47:07 +00:00
4afdfb4a06 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
2022-11-30 17:48:42 +00:00
5010bbd3c4 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>
2022-11-30 11:55:44 +00:00
e1f2058b54 udp: refactor port allocation and sharing
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4f7314ddf95d26f1939bd3772d29d011fb4cea47
2022-11-29 23:51:59 +00:00
bf27ca8021 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
2022-11-29 23:51:59 +00:00
b9e391e7b0 wireguard: compute checksum for outer ipv6 header
Type: fix

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I477e92712e441c91789afdf9be389d967acfa799
2022-11-29 14:15:00 +00:00
3f885f97f0 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>
2022-11-29 13:48:45 +00:00
6db2758611 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: bf93670c51 ("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
2022-11-29 12:58:51 +00:00
520cde4067 ipsec: use correct reply message
Type: fix
Fixes: 815c6a4fbc
Ticket: VPP-2068

Change-Id: I42d678b0e28ac4d0b524dfc2dbd01bbad020cf24
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2022-11-29 10:49:36 +00:00
d1c75063da 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>
2022-11-28 21:34:00 +00:00
14bf6a8fb0 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
2022-11-28 21:20:28 +00:00
797562c860 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
2022-11-28 19:31:59 +00:00
7943c90b2e hs-test: document host stack test framework
Type: docs
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I47d2794283a85a644448e60538f543644a0edfdc
2022-11-26 01:51:25 +00:00
530c5ee1fe interface: remove the pending interrupt from deleting interface
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I3138f97519d216b89a9c46865271db1f9ddd53cd
2022-11-25 12:43:40 +00:00
1a9dc75fe8 hs-test: auto register test actions
Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Icb5db6f69eda93181aba69b1f8676a73c0a4561b
2022-11-25 00:37:20 +00:00
b79d09bbfa 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
2022-11-24 11:51:02 +00:00
0036dcf6b2 gso: add gso documentation
Type: docs

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I8a96e6cc73b5f7ab3049fef37aafba43f3ef4d84
2022-11-23 19:28:36 +00:00
20721177ec 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>
2022-11-23 14:46:32 +00:00
f0781829d5 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
2022-11-23 00:33:24 +00:00
ed5f291a22 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
2022-11-22 19:21:25 +00:00
9a8d12d9b3 acl: fix set acl-plugin cli unformat free.
Type: fix

Signed-off-by: Huawei LI <lihuawei_zzu@163.com>
Change-Id: Icb5450f4bd0eaef7684eb7e3816d1d6051e889d7
2022-11-22 16:13:25 +00:00
99a66f4b7f tests: add VCL Thru Host Stack TLS in interrupt mode
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I7d5a9e9fedfc85bd7fad88f8eae1e46476ec0b7b
2022-11-21 17:51:54 +00:00
e479eae29a ipsec: improve ipsec policy adding performance
Type: improvement
Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I91ba1ff4c1085f4aca60ca111cbbaf14a3b4d761
2022-11-21 15:33:21 +00:00
dfd169816e 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
2022-11-18 14:23:08 -08:00
fe2d23f916 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
2022-11-18 08:09:29 +00:00
0b466ad75d 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
2022-11-15 16:21:16 +00:00
568ef46866 crypto-ipsecmb: fix plugin crash in VirtualBox
Plugin checks just for AVX2 instruction set, while the v1.3 of IPsec
Multi-Buffer library checks for both AVX2 and BMI2 sets during init.
VirtualBox VM doesn't provide BMI2 by default to guest operating system.

Result is that VPP plugin decides to use AVX2 initialization and library
then doesn't do it. Since flush_job remains empty, the self-check fails
and with that the whole VPP crashes on start-up.

Type: fix
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I6b661f2b9bbe6dd03b499c55c38a9b814e6d718a
2022-11-14 21:03:02 +00:00
468d7876b9 hs-test: skip vcl reattach test
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I594ecc347f367887890a3182e7c24028bf9a7f50
2022-11-14 20:59:01 +00:00
abf81c3add build: fix lib install dir and add vat2 lib install when build rpm.
Type: fix

Signed-off-by: Huawei LI <lihuawei_zzu@163.com>
Change-Id: I5ac557756ff2b3de13ce328a27ffdd289ab3173e
2022-11-13 01:29:07 +00:00
6af9330c63 http: use safe pool realloc
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I572017433a1ba0f8576522f02138928e303e10ab
2022-11-11 18:01:31 +00:00
ec315bf7b4 srtp: use safe pool reallocs
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I15fea1f90640ea54cafe3ea929e871ec6e86fc67
2022-11-11 18:01:21 +00:00
9688b3bda2 session: safe pools for cut-through sessions
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6dd400285ae475974c416f9b94e8a5b4b6257ca1
2022-11-11 01:01:50 +00:00
e8d8d47dca session: reduce safe pool expand rate
Make sure they only double in size.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I18d5508c7f32836deb3b25943e8e3af39d0dbc33
2022-11-10 19:51:42 +00:00
406f4840a8 misc: ignore clangd cache folder
Type: make
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: Id6ee2cbf3bf14083a470ef45ef1b6ff3ff8d03aa
2022-11-10 19:29:03 +00:00
37b5cccb93 linux-cp: fix lcp_itf_pair_create()'s memory leak
need free args.error if args.rv < 0

Type: fix

Signed-off-by: luoyaozu <luoyaozu@foxmail.com>
Change-Id: I8ceebfc36f51798d8d1a8e4c41bec33d74344396
2022-11-10 18:48:09 +00:00
b15a0000ff hs-test: add http client connect test
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: If705d311065e128b4b6df7d8d80910e4be72d3e6
2022-11-10 18:35:31 +00:00
ee4172ef0a http: support client connect
Type: feature

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I0738c0aefb41ab6c0ff717cfccd1df75ddb481fa
2022-11-10 18:35:31 +00:00
ea6c878d5f nat: updating my maintainer email address
Type: fix

Signed-off-by: Filip Varga <filipvarga89@gmail.com>
Change-Id: I1f5069df2dc743ecd1269e947dd375cb1b84970f
2022-11-10 16:12:18 +00:00
657bdf781a tests: initial asf framework refactoring for 'make test'
Type: refactor

Change-Id: I41455b759a5d302ad5c4247c13634c471e7d49a8
Signed-off-by: Pratikshya Prasai <pratikshyaprasai2112@gmail.com>
Signed-off-by: Saima Yunus <yunus.saima.234@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-11-09 21:22:33 -05:00
4dbd641136 sr: fix added for configuring vlan sub interface as iif interface in End.AD.Flow localsid
Type: fix
Signed-off-by: ChinmayaAgarwal <chinmaya.agarwal@hsc.com>
Change-Id: Ifad23978b98c5e05d86f6254bfb65baa0b380436
2022-11-09 15:56:48 +00:00
80c5fb76fc acl: verify that src and dst have sane and same address family
API refactoring moved the address-family tag from rule
level down to prefix level.

This necessarily warrants the check that they are the same.

Also, add a check that the address family is sane.

Change-Id: Ia63b688cc9e7c9e9cc773e89708d9e9f99185fb7
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-11-09 15:37:36 +00:00
90943e5a04 ip: fix unformat_ip_address forcing version to IP4 for some IP6 addresses
dd2f12ba made use of ip46_address_is_ip4() in order to determine whether
the address is ipv4 or ipv6 within unformat_ip_address - however, its
logic is correct only for some addresses. e.g. a valid IPv6 address of :: (unspecified)
will result in "true" result. This is probably not an issue for most
of the cases (the unspecified address is quite rare),
however if the unformat_ip_address is used as part of the
prefix parsing, the ::/0 is a fairly often utilized construct,
which gets parsed as 0.0.0.0

Solution: return the old logic, but use a temporary
variable to avoid overwriting the target memory on failure.

Type: fix
Fixes: dd2f12ba6a.
Change-Id: I272f740dfdf07036cec68516e153f0701a53233d
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-11-09 13:07:20 +00:00
1f4b6518da policer: improvement show policer cli.
cli show policer's help info is not consistent
with it's arguments.

Type: improvement

Signed-off-by: Huawei LI <lihuawei_zzu@163.com>
Change-Id: I8332fe97ba343e98511db9ff1bb6afd6f3c657cd
2022-11-08 05:43:06 +00:00
66b735ac97 prom: fix stats vector leak
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I620447c9aa8606a125063cdd724bfe74f8a870f6
2022-11-07 15:57:50 +00:00
61fdfd51d1 nat: fix per-vrf session bookkeeping
Each NAT44 ED session has a per_vrf_sessions_index referencing
an element in the thread-local vector per_vrf_sessions_vec.
However this index can be possibly invalidated by vec_del1() in
per_vrf_sessions_cleanup(), before a session is registered.
Such a stale index can cause an assertion failure in function
per_vrf_sessions_is_expired() when we use it to locate the
per_vrf_sessions object.

A possible sequence to reproduce is:

1. Create two NAT44 ED sessions s1, s2 so that two per_vrf_sessions are created:
     index 0: between VRF pair 10 and 11 (expired=0, ses_count=1)
     index 1: between VRF pair 20 and 21 (expired=0, ses_count=1)
   For the sessions we have:
     s1->per_vrf_sessions_index == 0
     s2->per_vrf_sessions_index == 1

2. Delete the first session via CLI, now the two per_vrf_sessions become:
     index 0: between VRF pair 10 and 11 (expired=0, ses_count=0)
     index 1: between VRF pair 20 and 21 (expired=0, ses_count=1)
   For the sessions we have:
     s2->per_vrf_sessions_index == 1

3. Delete the VRF 11:
     index 0: between VRF pair 10 and 11 (expired=1, ses_count=0)
     index 1: between VRF pair 20 and 21 (expired=0, ses_count=1)
   For the sessions we have:
     s2->per_vrf_sessions_index == 1

4. Create a new session s3 between VRF pair 20 and 21 so that the first
   per_vrf_sessions will be deleted:
     index 0: between VRF pair 20 and 21 (expired=0, ses_count=2)
   For the sessions we have:
     s2->per_vrf_sessions_index == 1
     s3->per_vrf_sessions_index == 0
   Here, note that the actual index of per_vrf_session is changed due
   to vec_del1(). The new session is added after the cleanup so it gets
   the correct index. But the index held by the existing session is not
   updated.

5. Trigger the fast path of the session s2. To achieve this, session
   s2 could be created in step 1 by
     ping -i20 -Iiface_in_vrf_10 1.1.1.1
   and steps 2-4 should then be performed within the 20-second interval.

This patch fixes this by changing per_vrf_sessions_vec to a pool so
that indicies are kept intact.

Type: fix
Signed-off-by: Jing Peng <jing@meter.com>
Change-Id: I4c08f9bfd50134bcb5f08e50ad61af2bddbcb645
2022-11-07 08:00:23 +00:00
9ff833d8f4 nat: fix byte order error.
fix byte order error about the struct snat_address_t's member net.
for example configurations:
  set interface ip table loop1 1
  set interface ip addr loop1 10.10.10.2/24
  nat44 add address 10.10.10.2 tenant-vrf 1
the snat address's net should be "as_u8 = {0xa, 0xa, 0xa, 0x0}",
but now it's "as_u8 = {0x0, 0xa, 0xa, 0x2}" because of missing
transition of byte order about the member net of snat_address_t.
(gdb) p/x *snat_main->addresses
$3 = {addr = {data = {0xa, 0xa, 0xa, 0x2}, data_u32 = 0x20a0a0a,
      as_u8 = {0xa, 0xa, 0xa, 0x2}, as_u16 = {0xa0a, 0x20a},
      as_u32 = 0x20a0a0a}, net = {data = {0x0, 0xa, 0xa, 0x2},
      data_u32 = 0x20a0a00, as_u8 = {0x0, 0xa, 0xa, 0x2},
      as_u16 = {0xa00, 0x20a}, as_u32 = 0x20a0a00},
      sw_if_index = 0x3, fib_index = 0x1,addr_len = 0x18}
(gdb)

Type: fix

Signed-off-by: Huawei LI <lihuawei_zzu@163.com>
Change-Id: I4f25f0639ae90a7f2e8715b44f825571283d994d
2022-11-07 07:58:55 +00:00
ce1ff6a9b1 ip6-nd: set router flag on NA if appropriate
Type: fix

The router flag on a neighbor advertisement can be used by neighbors to
detect that a router has changed to a host (RFC 4861 section 4.4).

If a neighbor adds routes after receiving a router advertisement sent
by VPP and subsequently receives a neighbor advertisement sent by VPP,
it may remove any routes it added based on the RA if the NA does not
have the router flag set. It appears that this is how windows behaves.

When sending a neighbor advertisement, set the router flag if sending
RAs is enabled on the interface.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I1f3e42bbd8ea1a4c116b1ce5a8273652d4cd763d
2022-11-06 12:48:15 +00:00
f094ce7653 ip6-nd: initialize radv_info->send_radv to 1
Otherwise, the newly configured interface will never send RADV's.

See below. In the typical case, suppress = 0 and is_no = 0, which
propagates the current value of radv->send_radv:

  radv_info->send_radv =
    (suppress != 0) ? ((is_no != 0) ? 1 : 0) : radv_info->send_radv;

No other bit of code will set send_radv, at least in straightforward
ways.

Type:fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: If9368155f7676460ca1f87729c2b3c453405d08d
2022-11-05 19:11:12 +00:00
23c989642c hsa: echo client crash when it fails to connect to remote
When echo client fails to connect to remote, it should quit.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I787423bdc61a58eea48bab7bd8b73137626c02b4
2022-11-05 00:03:11 +00:00
a6a01f1fe5 classify: fix crash when update nonexistent classify table.
vpp crash when update nonexistent classify table.
Program received signal SIGABRT, Aborted.
0x00007fbf3b49b337 in raise () from /lib64/libc.so.6
(gdb) bt
0  0x00007fbf3b49b337 in raise () from /lib64/libc.so.6
1  0x00007fbf3b49ca28 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  0x00007fbf3bb611c7 in debugger () at /usr/src/debug/vpp-23.02/src/vppinfra/error.c:84
4  0x00007fbf3bb61529 in _clib_error (how_to_die=2, function_name=0x0, line_number=0, fmt=0x7fbf3d03af08 "%s:%d (%s) assertion `%s' fails")
   at /usr/src/debug/vpp-23.02/src/vppinfra/error.c:143
5  0x00007fbf3c67062c in vnet_classify_add_del_table (cm=0x7fbf3d438f00 <vnet_classify_main>, mask=0x7fbf00fdc088 "", nbuckets=2, memory_size=2097152,
   skip=4, match=1, next_table_index=4294967295, miss_next_index=4294967295, table_index=0x7fbeed930b98, current_data_flag=0 '\000',
   current_data_offset=0, is_add=1, del_chain=0) at /usr/src/debug/vpp-23.02/src/vnet/classify/vnet_classify.c:780
6  0x00007fbf3c672bf4 in classify_table_command_fn (vm=0x7fbefb465740, input=0x7fbeed930ef0, cmd=0x7fbefc45ec18)
   at /usr/src/debug/vpp-23.02/src/vnet/classify/vnet_classify.c:1622
7  0x00007fbf3d52b527 in vlib_cli_dispatch_sub_commands (vm=0x7fbefb465740, cm=0x4273f0 <vlib_global_main+48>, input=0x7fbeed930ef0,
   parent_command_index=1064) at /usr/src/debug/vpp-23.02/src/vlib/cli.c:650
8  0x00007fbf3d52b2c3 in vlib_cli_dispatch_sub_commands (vm=0x7fbefb465740, cm=0x4273f0 <vlib_global_main+48>, input=0x7fbeed930ef0,
   parent_command_index=0) at /usr/src/debug/vpp-23.02/src/vlib/cli.c:607
9  0x00007fbf3d52b9cb in vlib_cli_input (vm=0x7fbefb465740, input=0x7fbeed930ef0, function=0x7fbf3d597406 <unix_vlib_cli_output>, function_arg=0)
   at /usr/src/debug/vpp-23.02/src/vlib/cli.c:753
10 0x00007fbf3d59cb0c in unix_cli_process_input (cm=0x7fbf3d61fe00 <unix_cli_main>, cli_file_index=0)
   at /usr/src/debug/vpp-23.02/src/vlib/unix/cli.c:2616
11 0x00007fbf3d59d25a in unix_cli_process (vm=0x7fbefb465740, rt=0x7fbf00f7bfc0, f=0x0) at /usr/src/debug/vpp-23.02/src/vlib/unix/cli.c:2745
12 0x00007fbf3d555a25 in vlib_process_bootstrap (_a=140458063833296) at /usr/src/debug/vpp-23.02/src/vlib/main.c:1221
13 0x00007fbf3bb74204 in clib_calljmp () at /usr/src/debug/vpp-23.02/src/vppinfra/longjmp.S:123
14 0x00007fbef10028a0 in ?? ()
15 0x00007fbf3d555b4e in vlib_process_startup (vm=0x7fbf3bb7d70f <clib_mem_size+24>, p=0x7fbef10028d0, f=0x7fbf00f06ae0)
   at /usr/src/debug/vpp-23.02/src/vlib/main.c:1246
16 0x00007fbf3d592be6 in vec_max_bytes (v=0x8) at /usr/src/debug/vpp-23.02/src/vppinfra/vec_bootstrap.h:161
17 0x00007fbf00f06af8 in ?? ()
18 0x0000000000000004 in ?? ()
19 0x00000000000000ff in ?? ()
20 0x00007fbef1002980 in ?? ()
21 0x00007fbf3d592dcb 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) f 5
   0x00007fbf3c67062c in vnet_classify_add_del_table (cm=0x7fbf3d438f00 <vnet_classify_main>, mask=0x7fbf00fdc088 "", nbuckets=2, memory_size=2097152,
   skip=4, match=1, next_table_index=4294967295, miss_next_index=4294967295, table_index=0x7fbeed930b98, current_data_flag=0 '\000',
   current_data_offset=0, is_add=1, del_chain=0) at /usr/src/debug/vpp-23.02/src/vnet/classify/vnet_classify.c:780
780		  t = pool_elt_at_index (cm->tables, *table_index);
(gdb) p *table_index
$1 = 8
(gdb) p cm->tables
$2 = (vnet_classify_table_t *) 0x0
(gdb)

Type: fix

Signed-off-by: Huawei LI <lihuawei_zzu@163.com>
Change-Id: I1c5f6168f0a7e1d1989ce07ec6c30c6fd9f0aaa9
2022-11-04 20:48:42 +00:00
a923ce5915 nat: cleanup of deprecated features
Type: refactor

1) Removed deprecated API.
  - These specific APIs do not have repleacement
    because features that they controled
    aren't part of current NAT44-ED
    implementation anymore.

2) Removed unused typedef of port allocation funciton.
  - Missed left over removed.

Change-Id: Ib3f763449065eda7cdcb2c6565a9cae51baf23d6
Signed-off-by: Filip Varga <filipvarga89@gmail.com>
2022-11-04 15:43:49 +00:00
208e7dc362 tls: crash in mbedtls due to ctx is already free
_clib_error (how_to_die=2, function_name=0x0, line_number=0, fmt=0x7fffb3a7e1b5 "%s:%d (%s) assertion `%s' fails") at src/vppinfra/error.c:143
mbedtls_ctx_get (ctx_index=0) at src/plugins/tlsmbedtls/tls_mbedtls.c:114
tls_ctx_get (ctx_handle=536870912) at src/vnet/tls/tls.c:310
tls_app_session_cleanup (s=0x7fffbf102040, ntf=SESSION_CLEANUP_SESSION) at src/vnet/tls/tls.c:624
app_worker_cleanup_notify (app_wrk=0x7fffbef95f80, s=0x7fffbf102040, ntf=SESSION_CLEANUP_SESSION) at src/vnet/session/application_worker.c:445
session_cleanup_notify (s=0x7fffbf102040, ntf=SESSION_CLEANUP_SESSION) at src/vnet/session/session.c:262
session_free_w_fifos (s=0x7fffbf102040) at src/vnet/session/session.c:268
session_delete (s=0x7fffbf102040) at src/vnet/session/session.c:287
session_transport_delete_notify (tc=0x7fffbdf63c40) at src/vnet/session/session.c:1159
tcp_handle_cleanups (wrk=0x7fffbef46d40, now=133.30033046694487) at src/vnet/tcp/tcp.c:1298
tcp_update_time (now=133.30033046694487, thread_index=2 '\002') at src/vnet/tcp/tcp.c:1309
session_update_time_subscribers (smm=0x7ffff7f75ce0 <session_main>, now=133.30033046694487, thread_index=2) at src/vnet/session/session_node.c:1817
session_queue_node_fn (vm=0x7fffbdfad1c0, node=0x7fffbe0b1340, frame=0x0) at src/vnet/session/session_node.c:1934
dispatch_node (vm=0x7fffbdfad1c0, node=0x7fffbe0b1340, type=VLIB_NODE_TYPE_INPUT, dispatch_state=VLIB_NODE_STATE_POLLING, frame=0x0, last_time_stamp=4722227957546624) at src/vlib/main.c:960

Putting a breakpoint in gdb, I found out ctx was free in mbedtls_app_close.
Looking at app_close function in picotls and openssl, I don't see they
free ctx and they don't crash when processing cleanup. I am inclined to
think that mbedtls_ctx_free should not be called in mbedtls_app_close

    at src/plugins/tlsmbedtls/tls_mbedtls.c:92
    at src/plugins/tlsmbedtls/tls_mbedtls.c:559
    at src/vnet/tls/tls.c:360
    thread_index=2) at src/vnet/tls/tls.c:762
    conn_index=536870912, thread_index=2 '\002')
    at src/vnet/session/transport.c:332
    at src/vnet/session/session.c:1608
    elt=0x7fffbdfef3dc)
    at src/vnet/session/session_node.c:1672
    node=0x7fffbe0b1340, frame=0x0)
    at src/vnet/session/session_node.c:1966
    node=0x7fffbe0b1340, type=VLIB_NODE_TYPE_INPUT,
    dispatch_state=VLIB_NODE_STATE_POLLING, frame=0x0,
    last_time_stamp=4721919444027682)
    at src/vlib/main.c:960

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic5c13e659aee618c8accee42af9f40931b62f467
2022-11-03 21:46:40 +00:00
e69d974385 misc: fix failing TestNs/TestHttpTps test in hstf
Type: fix
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I03cbd05d6d887d2ce8e7b7d20522e04012c5fe7a
2022-11-03 16:35:55 +00:00
7a87c71542 session: fix tx_fifo clear and incorrect bitmap invalidation
The tx_fifo of session may not be set up yet, if app request to
disconnect the session, svm_fifo_dequeue_drop_all will crash.

In debug image, ho_session_alloc will do clib_bitmap_validate to
prevent race condition, however the input is not correct which
will make vpp crash.

Type: fix
Change-Id: Ia8bff325d238eacb671e6764ea2a4eecd3fca609
Signed-off-by: Dongya Zhang <fortitude.zhang@gmail.com>
2022-11-03 16:22:54 +08:00
39d6deca5f sr: SRv6 Path Tracing Midpoint behaviour
Type: feature

Signed-off-by: Julian Klaiber <julian@klaiber.me>
Change-Id: I866a2d2e06013380309c98a54078c1b3f6ad76fc
2022-11-02 14:31:46 +00:00
de0c1af447 vpp-swan: remove step to copy vpp_sswan source for docker image
Since vpp_sswan plugin already merged in /vpp/extras/strongswan,
no need to provide additional vpp_sswan source files for docker image.

Type: fix

Signed-off-by: Yulong Pei <yulong.pei@intel.com>
Change-Id: I35bad22b1046e0dddbcf39e1af38d589d1438239
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
2022-11-01 20:20:50 +00:00
768f284351 quic: use safe pool realloc
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia03c3fe0ca669b319dec8decd503254d0a95e58b
2022-10-31 15:24:18 +00:00
009303dc06 tls: use safe pool reallocs
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia2c771cbf826526d2d06b6da022509ab02917350
2022-10-31 15:24:18 +00:00
d82c39e5ff tests: session in interrupt mode
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I2deba97a8dfff907f0e2452e9347d6a68474ce92
2022-10-31 14:12:46 +00:00
e7adafeaf7 build: add extra rpm build dependencies
make install-ext-dep failed with,
sudo rpm -Uih vpp-ext-deps-23.02-4.aarch64.rpm
error: Failed dependencies:
        perl(IBswcountlimits) is needed by vpp-ext-deps-23.02-4.aarch64

vpp-ext-deps have dependencies on infiniband-diags and libibumad

Type: fix

Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I2aea453f53d6507285b4f87f04c6dfc4845098cd
2022-10-29 01:14:39 +00:00
648c29243f cnat: Fix unformat_cnat_snat_interface_map_type
Fix initialization of the table u32 var which is leading to the incorrect
unformat of interface map type

Type: fix

Signed-off-by: Miguel Borges de Freitas <miguel-r-freitas@alticelabs.com>
Change-Id: I1e56acd0e4c735df755e85b172bb6623bf47a57b
2022-10-28 08:45:56 +00:00
0db15758ed vcl: register workers when reattaching to vpp
Type: improvement
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I82a286e2872338974c1930138c30db78103ae499
2022-10-27 15:06:27 +00:00
d810a6e218 session: add session event log for session state
To aid sesipon debug, add session event log in SM debug to track
the session state.

Type: improvement

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I6909cf969cd5b6a3ea5a06d08ae32c2f1d48f686
2022-10-26 18:03:30 +00:00
5efc0cdf48 virtio: use current_data as l2_hdr_offset
Type: fix

virtio transmit node uses header offsets to set the
appropriate metadata for packet with offloads. But
l2_hdr_offset is not correctly set by previous node(s).
This patch makes use of curren_data field as l2_hdr_offset.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Id2f41a7650be45c9cc1ebacc7bec298be79bf218
2022-10-25 19:29:33 +00:00
4561d6d251 devices: fix the l2 hdr offset in af_packet transmit side
Type: fix

af_packet transmit node uses header offsets to set the
appropriate metadata for packet with offload. But
l2_hdr_offset is not correctly set by previous node.
This patch makes use of curren_data field as l2_hdr_offset.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I751a725af5c231a443eed22231a867eb7f3894e0
2022-10-25 19:29:30 +00:00
4c89b189b2 udp: use new wrk context for connections
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9c4050f96c310f1e6eb2cae8d908c44968526c3c
2022-10-25 17:19:03 +00:00
1c29dfb7bb udp: postpone cleanup of udp connections
Avoid deleting connections in session layer io event handler.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I87b3e53f9039161688467d9716875583ad797c07
2022-10-25 17:19:03 +00:00
186798270a rdma: set correct CQE flags
CQE flags located in bits 16-31 at offset 0x1c should be defined as
actual numbers instead of indexes. Besides, L3 header type for IPv4 is
10(2 in decimal) and for IPv6 is 01(1 in decimal) according to CQE entry
fields description of page 120 in Mellanox Programmer Reference Manual.
(https://network.nvidia.com/files/doc-2020/ethernet-adapters-programming-manual.pdf)

Fixing this issue will lead to correct CQE flags printing for rdma-input
node when buffer trace is enabled.

Type: fix

Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: I9b578ca5cbd8cd93a577aa83131e31c79f60430e
2022-10-25 15:18:21 +00:00
bf93670c51 rdma: fix ipv4 checksum check in rdma-input node
- cqe_flags pointer should be incremented accordingly otherwise only the
first element in cqe_flags will be updated
- flag l3_ok should be set for match variable when verifying if packets
are IPv4 packets with flag l3_ok set
- mask/match variables should be converted to network byte order to
match the endianness of cqe_flags
- vector processing of checking cqe flags will set return value to
0xFFFF by mistake if packet numbers are not multiple of 16(VEC256) or
8(VEC128)

Type: fix

Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: I9fec09e449fdffbb0ace8e5a6ccfeb6869b5cac1
2022-10-25 15:18:02 +00:00
813c1bd257 hash: add local variable
The current implmentation of the hash table is not thread-safe.
This design leads to a segfault when VPP handling a lot of tunnels for
Wireguard, where one thread modify the hash table and other threads
starting to lookup at the same time.

The fix add a local variable to store how many bits are used by a user
object.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Iecf6b3ef9f308b61015c66277cc459a6d019c9c1
2022-10-25 08:30:02 +00:00
c9d916c7cc packetforge: fix GTP-Extension header field data
Fix the incorrect fields data of GTP-Extension header.

Type: fix
Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Iafc5e852910649afcf0e583a5513b1ab33f5b5e8
2022-10-25 02:07:35 +00:00
938bff8084 docs: update cnat docs to current vpp version
The documentation for the cnat plugin is highly outdated specially on
the snat section.

Type: docs

Signed-off-by: Miguel Borges de Freitas <miguel-r-freitas@alticelabs.com>
Change-Id: I30b0c6295d3c812b636374753af3c37f29b0cc53
2022-10-24 16:19:45 +00:00
a57549ad22 dpdk: add Intel QAT 200xx series support
Type: feature

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: I2fd1e321983ac5caa03aac8705dfc596985c35f7
2022-10-24 13:22:20 +00:00
0d36720f8d vppinfra: fix incorrect sizeof() argument due to typo
fixes coverity 282527

Type: fix
Fixes: fecb2524ab
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I9ac72c3802e66369a8f24c92451e33f22c058f24
2022-10-24 13:20:07 +00:00
cb3a6bdea9 crypto: fix dead nn foreach
Pass vec_foreach args in the right order

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: I90d3dfb70ee2dbd9a48ae9ecfd2c1526a74d0786
2022-10-24 09:35:45 +00:00
4897257dbe gso: remove vxlan header include file dependency
vxlan will be moved to a plugin. Remove vnet files from including
vxlan header include files.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I4268110b4ed54f7ae3ffecd6db0e3025122fa59c
2022-10-24 09:00:05 +00:00
8b90d89b05 devices: add support for af-packet v2
Type: feature

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I2ccaf1d512dcb72e414be8c69cbb538ebbe0e933
2022-10-21 16:32:56 +00:00
65bff88c36 crypto-sw-scheduler: fix queue iterator
When there are several workers, iterator can and will skip
head iterator and it will last until BARRIER_SYNC_TIMEOUT won't
expire and will cause SIGABRT with `worker thread deadlock`

Type: fix

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: Id4def4d5894e077ae27592367b141ecd822e86af
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2022-10-20 20:47:29 +00:00
5569a85a1e tests: enable extended test runs in run.py
Change-Id: I5f712614910dc69f04c43efd8958ef8e87906b9e
Type: test
Signed-off-by: Naveen Joy <najoy@cisco.com>
2022-10-20 19:52:23 +00:00
f8ee39ff71 udp: support for disabling tx csum
Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I84843eb3a0a66c64cd46536624633e0dae1c4681
2022-10-20 18:14:32 +00:00
20de85b6da session: add session debug cli
- add session debug cli to enable fine control of which event logs
are enable/disable with below syntax
  session debug {show | group <list> level <n>}
  list may be entered with a dash, "0-4"
  or it may be entered with a comma, "0,1,4"
- fix compilation errors when SESSION_EVT is enable
- change SESSION_EVT_FREE_HANDLER to use DEC_SESSION_ED instead of
DEC_SESSION_ETD because the transport may already be free when the
handler is called

Type: improvement

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Iab2989e0a847bb59002ef16494eebcc1d112b2ae
2022-10-20 15:16:08 +00:00
049dee954f virtio: fix the missing unlock
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I7003162ee72c39c44be1e7ff0d27f4416b3eca5a
2022-10-20 14:05:43 +00:00
f0d71c6b7f crypto-ipsecmb: support previous ipsecmb versions
Backward compatibility was broken when updating ipsecmb version to 1.3.

Type: improvement
Signed-off-by: marcel.d.cornu@intel.com
Change-Id: I87a76859ec5e2ef6be0bc2af0960fa2494ce4297
2022-10-19 10:12:34 +01:00
8c1be054b9 udp: explicit udp output node
This allows for custom next node selection on output.

Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib0fee71a01847184e95c18097bbbfdadfbd9d030
2022-10-19 01:00:52 +00:00
472d0da7a0 session: pass sep.opaque to listen session
Change-Id: I34ce2cc4585bfbd679d7d66d5bef69ddb268bb57
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-10-18 16:46:06 +00:00
fecb2524ab vppinfra: send minimal needed mask to the set_mempolicy syscall
Type: fix
fixes: 561ae5d

Change-Id: I0d98f5b43bc9ab5d31463b285177a11a10b864d2
Signed-off-by: Damjan Marion <dmarion@me.com>
2022-10-18 15:41:23 +00:00
1cc592b17c virtio: fix the tx side hdr offset
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ibb4b17b954c55bcb37ede57d398966f244735c3d
2022-10-17 18:32:31 +00:00
cacde12127 devices: fix the header offsets in af_packet
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I7fc645c46d285ceb13903f5835c99e9b6a9e5b07
2022-10-17 18:32:11 +00:00
79f6dbac75 gso: fix the metadata for gro packets
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I3a059b9dcbbcb597a7822f4f35fb275a7c197647
2022-10-17 18:31:47 +00:00
19a168496b ip: fix the pseudo header checksum
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I5eb83cbd0f8534dc50ecb907b3582717e8709aa2
2022-10-17 18:31:19 +00:00
f284c14c7b cnat: Add sctp support
This patch adds SCTP support in the CNat translation primitives.
It also exposes a clib_crc32c_with_init function allowing to set
the init value to start the crc32 with instead of 0.

Type: feature

Change-Id: I86add4cfcac08f2a5a34d1e1841122fafd349fe7
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-10-17 16:25:01 +00:00
2a6f35f24c crypto-ipsecmb: bump ipsecmb library to v1.3
- Use the latest IPsec Multi-Buffer library release v1.3
- Use ipsec-mb burst API for HMAC-SHAx algorithms
- Use ipsec-mb burst API for AES-CBC and AES-CTR algorithms

The new burst API available in ipsecmb v1.3 brings significant
performance improvements for certain algorithms compared to the job API.

Type: feature
Signed-off-by: marcel.d.cornu@intel.com
Change-Id: I3490b35a616a2ea77607f103426df62438c22b2b
2022-10-17 13:41:50 +00:00
80c0ae2437 vlib: Counter free needs to NULL the allocated counter vector
otherwise the next time the counter is validated this is dangling.

Type: fix
Fixes: 58fd481d73

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ifa8d5ff27175cf6dfb30cbf023fa3251fe5c780e
2022-10-17 05:43:14 +00:00
368dab3699 ip-neighbor: delete redundant help information in cli.
Delete redundant help information in ip neighbor's
cli. There is no code implementation about fib-id and
proxy in the cli's subsequent process.

Type: fix

Signed-off-by: Huawei LI <lihuawei_zzu@163.com>
Change-Id: I1e276aad030409e3f2f62fee489ea95d316e67b5
2022-10-16 20:52:07 +00:00
d2d90ee048 linux-cp: fix infinite loop in CLI lcp default
CLI lcp default clear or lcp default netns  hangs in an infinite while loop.

Type: fix

Signed-off-by: luoyaozu <luoyaozu@foxmail.com>
Change-Id: I699338abc045c84361707260adbb5b574a383170
2022-10-15 19:44:25 +08:00
662c59a80a l2: coverity complains dead codes
Coverity complains dead codes in 2 places due to a recent commit as
pointed out in Fixes. The dead codes are
      if (seed < L2_BD_ID_MAX % 2)
        is_seed_low = 1;
and
      if (is_seed_low)
        seed += (2 * (i % 2) - 1) * i;

seed can never be less than (L2_BD_ID_MAX % 2).
Consequently, is_seed_low is always 0.

There is also other problem. The inner loop is iterating only once.

The fix is to greatly simplify the code to generate a random bd_id.

Type: fix
Fixes: Ieb6919f958f437fc603d5e1f48cab01de780951d

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I318773b9a59950920e051548ef14e36054ebd5e6
2022-10-13 23:58:41 +00:00
10e5b4a016 session: make session code compile with SESSION_DEBUG enable
Session debug code does not compile anymore due to vlib_mains global
variable disappearing over time. Replace it with vlib_get_main_by_index
call.

Add a cmake variable and pass it from make command line to enable
session debug. Notice transport debug is required for session debug.

make rebuild VPP_EXTRA_CMAKE_ARGS=-DVPP_TCP_DEBUG_ALWAYS=ON VPP_EXTRA_CMAKE_ARGS+=-DVPP_SESSION_DEBUG=ON

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic2e887c6b10b77cbabd56934f4931fcfa04a6751
2022-10-13 18:25:46 +00:00
af36e96d07 gomemif: migrate to govpp repository
Type: make
Signed-off-by: Matus Halaj <mhalaj@cisco.com>
Change-Id: I1d48c7e44fdf23438132996fd3288b29da1fe36e
2022-10-13 18:23:10 +00:00
70892fcada docs: fix memory traces command
Type: fix

Change-Id: I8fc949da209a5067c702952fbd0e6ce77b921d02
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-10-13 18:05:24 +00:00
eeaf6c8973 misc: avoid permission issue when running envoy
Because envoy didn't have permission for `envoy.log` file it would stop.
This made tests involving envoy fail.
Adding `ENVOY_UID` environment variable makes envoy run as root,
which avoids the problem.

Type: fix
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I910416ad1c87137396e7da89c13de7739ce74c70
2022-10-13 13:54:25 +00:00
ce62d6f01c vpp-swan: fix linked library to plugin
Due to refactor keeping api common code in vlibapi, changes order
linked library to this plugin.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Id94c0b78cbce4954d34a82123506a76370b12b23
2022-10-12 21:16:54 +00:00
65d25b4b16 ip: migrate ip4 full reassembly to use vlib_buffer_enqueue_to_next
Type: improvement

Change-Id: Ibf683c9ba8a2751e0b40920f6735cfe0a35a6e6d
Signed-off-by: Damjan Marion <dmarion@me.com>
2022-10-12 17:07:05 +00:00
42ed836fbd ip: simpler and faster ip4_full_reass_drop_all
Type: improvement
Change-Id: I4a75583ce718ba6466cd09ca8373fd43988ef62a
Signed-off-by: Damjan Marion <dmarion@me.com>
2022-10-12 16:55:52 +00:00
dd298e804a misc: fix issues reported by clang-15
Type: improvement

Change-Id: I3fbbda0378b72843ecd39a7e8592dedc9757793a
Signed-off-by: Damjan Marion <dmarion@me.com>
2022-10-12 16:04:13 +02:00
0f8f4351b0 l2: Add bridge_domain_add_del_v2 to l2 api
https://jira.fd.io/browse/VPP-2034

Type: fix
Signed-off-by: Laszlo Kiraly <laszlo.kiraly@est.tech>
Change-Id: Ieb6919f958f437fc603d5e1f48cab01de780951d
2022-10-11 23:21:03 +00:00
7498aadd23 tests: don't use tmp as the default log dir with run.py
The log file directory is configurable with run.py using the
--log-dir argument. This patch removes the use of /tmp as
the default dir for storing all test logs. The default
log dir is now set to show the year, month and day
of the test run. This provides a more meaningful aggregation
of test logs for effective troubleshooting. The default log
dir is set to <CWD>/test-run-YYYY-MM-DD.

Type: improvement
Change-Id: I6c9002e961f6e06fc953ca42d86febf4f218e566
Signed-off-by: Naveen Joy <najoy@cisco.com>
2022-10-11 23:19:30 +00:00
6531cf5d1c vppinfra: fix AddressSanitizer
When checking for CLIB_SANITIZE_ADDR to enable specific behavior for
AddressSanitizer, we must have vppinfra/clib.h included as it is defined
there.

Type: fix

Change-Id: I9060c3c29c1289d28596c215a1d1709b2ea7c84e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-10-11 15:13:47 +00:00
91246bc6a2 nat: report time between current vpp time and last_heard
existing details report the last_heard as the seconds since VPP
started, this is not very useful, so report additionaly
time_since_last_heard in seconds between VPP time and
last_heard.

Change-Id: Ifd34b1449e57919242b1f0e22156d3590af3c738
Type: improvement
Signed-off-by: Dave Cornejo <dcornejo@netgate.com>
Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
2022-10-11 14:28:18 +00:00
06923b33a9 fib: fix crash when create vxlan/vxlan-gpe/geneve/gtpu tunnel.
Fix vpp crash when create vxlan/vxlan-gpe/geneve/gtpu tunnel
with 0.0.0.0 dst ip in debug build. The ASSERT should be move
out of fib_prefix_from_ip46_addr, which may be called when
create vxlan/vxlan-gpe/geneve/gtpu tunnel with 0.0.0.0 dst ip.

How to reproduce:
1. build debug vpp and run vpp
2. create vxlan t src 192.168.0.2 dst 0.0.0.0 vni 1 instance 1
   create vxlan-gpe tunnel local 192.168.0.2 remote 0.0.0.0 vni 1
   create geneve tunnel local 192.168.0.2 remote 0.0.0.0 vni 1
   create gtpu tunnel src 192.168.0.2 dst 0.0.0.0 teid 1

Type: fix

Change-Id: I19972f6af588f4ff7fd17de1b16b9301e43d596f
Signed-off-by: Huawei LI <lihuawei_zzu@163.com>
2022-10-11 03:37:36 +00:00
23b33ec02b tcp: cmake option VPP_TCP_DEBUG_ALWAYS=ON not taken by all files
Some files include tcp_debug.h without including <vpp/vnet/config.h>
As a result, those files do not get VPP_TCP_DEBUG_ALWAYS option
set. The fix is to include <vpp/vnet/config.h> in tcp_debug.h

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I0c141147f1e8d1b49c5a1440fac1e97cbd96aaa7
2022-10-07 14:01:54 -07:00
8a0a9d2600 tests: disable broken wireguard tests on vpp_debug image
Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I3a53d57e42f4c1f5ba0de6d2b181c7f2ad083a3a
2022-10-07 20:00:33 +00:00
8d97a5cd1c tcp: build image with TCP_DEBUG_ALWAYS via make
Add cmake option to enable TCP_DEBUG_ALWAYS.
make rebuild VPP_EXTRA_CMAKE_ARGS=-DVPP_TCP_DEBUG_ALWAYS=ON
make rebuild VPP_EXTRA_CMAKE_ARGS=-DVPP_TCP_DEBUG_ALWAYS=OFF

Type: improvement

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I911a8d615f76516ae0a988bc6135c3b0d8fcb3df
2022-10-07 19:42:26 +00:00
14b118b4c7 build: retain dpdk_mlx_default setting for ci script
- tell git to ignore all build/external generated files

Type: make

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I4af26a76a0248939366cd09b577d422af801c0c3
2022-10-07 12:32:33 +00:00
b3605eab5a urpf: add mode for specific fib index lookup
this patch adds a mode to urpf in order to perform the lookup in a specified vrf instead of the interface vrf
Type: feature
Change-Id: Ieb91de6ccdfbf32b6939364f3bebeecd2d57af19
Signed-off-by: hedi bouattour <hedibouattour2010@gmail.com>
2022-10-07 04:18:54 +00:00
9260b8861e fib: add fib_entry_get_path_list_for_source
Type: improvement
Change-Id: Ie035bebf64226691cffc84484e4bf7310287d1b7
Signed-off-by: Damjan Marion <dmarion@me.com>
2022-10-07 04:17:21 +00:00
ba3d5afb92 abf: return status of attachment add/del
Type: fix

The handler for abf_itf_attach_add_del was always returning 0. Set rv to
the return value of call to abf_itf_attach() or abf_itf_detach().

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: Ibb888bb148e6e03fc2776e2384b3a6e26148a429
2022-10-07 04:16:36 +00:00
6ff8e90ed4 vcl: add api to check if vcl disconnected from vpp
Type: feature
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I98bc108360f9d04a33126865ce49d2702cbe9cdf
2022-10-06 20:32:43 +00:00
426f8f239f gso: set the header offsets in gro hdr fixup
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I9d5004f8764b1833e5ca825bc52345e23770c6bc
2022-10-06 16:57:30 +00:00
6b8874eb2d gso: fix the checksum for odd number of data bytes
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I07b694323e0f6745dec2b846785026b152d78af6
2022-10-06 16:56:48 +00:00
82ec908acb gomemif: update to libmemif version 4.0
Type: improvement

This patch provides:
1. interrupt mode support,
2. abstract socket support,
3. overriding responder example and divides it to two examples:
	-icmp_responder_cb
	-icmp_responder_poll

Signed-off-by: Daniel Béreš <dberes@cisco.com>
Change-Id: I99c86d053521760c457541fc596ed554f4077608
2022-10-06 12:22:07 +00:00
a58055d6b2 fib: only invoke adj delegate create callback on mcast adj create
adj_delegate_adj_created() is incorrectly called when an existing
adj is found and returned. This can lead to crashes in some cases
in the pmtu delegate:

(gdb) bt
0  0x00007f2aa8fc9ce1 in raise () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007f2aa8fb3537 in abort () from /lib/x86_64-linux-gnu/libc.so.6
2  0x0000564361b5403a in os_exit (code=code@entry=1) at ./src/vpp/vnet/main.c:437
3  0x00007f2aa9271a3e in unix_signal_handler (signum=11, si=<optimized out>, uc=<optimized out>) at ./src/vlib/unix/main.c:188
4  <signal handler called>
5  0x00007f2aa9970d5a in fib_table_get_table_id_for_sw_if_index (proto=FIB_PROTOCOL_IP4, sw_if_index=<optimized out>) at ./src/vnet/fib/fib_table.c:1156
6  0x00007f2aa964aebf in ip_pmtu_adj_delegate_adj_created (ai=8) at ./src/vnet/ip/ip_path_mtu.c:197
7  0x00007f2aa9993ee5 in adj_delegate_adj_created (ai=ai@entry=8) at ./src/vnet/adj/adj_delegate.c:166
8  0x00007f2aa998dbde in adj_mcast_add_or_lock (proto=proto@entry=FIB_PROTOCOL_IP6, link_type=link_type@entry=VNET_LINK_IP6, sw_if_index=sw_if_index@entry=7) at ./src/vnet/adj/adj_mcast.c:95
9  0x00007f2aa95c7b3e in ip6_link_enable (sw_if_index=7, link_local_addr=link_local_addr@entry=0x0) at ./src/vnet/ip/ip6_link.c:217
10 0x00007f2aa9621587 in vl_api_sw_interface_ip_enable_disable_t_handler (mp=0x7f2a4fa5ad10) at ./src/vnet/ip/ip_api.c:108
11 0x00007f2aaa3b7e44 in msg_handler_internal (free_it=0, do_it=1, trace_it=<optimized out>, msg_len=<optimized out>, the_msg=0x7f2a4fa5ad10, am=0x7f2aaa3cc020 <api_global_main>) at ./src/vlibapi/api_shared.c:593
12 vl_msg_api_handler_no_free (the_msg=0x7f2a4fa5ad10, msg_len=<optimized out>) at ./src/vlibapi/api_shared.c:810
13 0x00007f2aaa3a1702 in vl_socket_process_api_msg (rp=<optimized out>, input_v=<optimized out>) at ./src/vlibmemory/socket_api.c:208
14 0x00007f2aaa3a95d8 in vl_api_clnt_process (vm=<optimized out>, node=<optimized out>, f=<optimized out>) at ./src/vlibmemory/memclnt_api.c:429
15 0x00007f2aa9226f37 in vlib_process_bootstrap (_a=<optimized out>) at ./src/vlib/main.c:1235
16 0x00007f2aa91824a8 in clib_calljmp () at /builds/graphiant/graphnos/vpp/debian/output/source_dir/src/vppinfra/longjmp.S:123
17 0x00007f2a47cf5d60 in ?? ()
18 0x00007f2aa922853f in vlib_process_startup (f=0x0, p=0x7f2a494dc000, vm=0x7f2a489ed680) at ./src/vlib/main.c:1260
19 dispatch_process (vm=0x7f2a489ed680, p=0x7f2a494dc000, last_time_stamp=<optimized out>, f=0x0) at ./src/vlib/main.c:1316
20 0x0000000000000000 in ?? ()
(gdb)

Type: fix

Change-Id: I2d3c041e0be8284471771c7882c89f743baab0e5
Signed-off-by: Peter Morrow <pdmorrow@gmail.com>
2022-10-05 10:54:13 +00:00
41404bf64c ip: reassembly - custom context instead of VRF
Change-Id: Id8d6ab96a710cdd207068cf19a6363bbcd584de4
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-10-05 09:34:48 +00:00
2805daa541 ip: reassembly - custom context of ipv6
Change-Id: Ia5ec7fc0c71e6a0ad1b43df24bb6b88e616d260d
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-10-05 09:34:28 +00:00
99e26c120f build: change make verify gate os to ubuntu 22.04
- Also fix log output to remove hardcoded compiler version

Type: make

Change-Id: I1b224d8e9a042c58dbae689a8be706089cc1377f
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-10-05 04:00:15 +00:00
45e4e9444d rdma: unhackish build of rdma-core
Change-Id: I2040b560b2a00f8bd176ae6ad46035678a2b249e
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-10-04 15:44:17 +00:00
4e939ced65 build: mlx dpdk-rdma compatibility matrix
- Verify mlx_rdma_dpdk_matrix.txt versions,
  build MLX drivers in dpdk if the versions match.
  Also output version comparison results to a file
  for CI job to send notification email when the
  versions do not match.

Change-Id: Id1384ba4ea4b1f855f4d77d1d8e2c38683abfe1f
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-10-04 15:44:17 +00:00
6161bba1ea tcp: replace tcp_time_now with tcp_time_now_us
It looks like tcp_time_now has been deprecated for a while and the
replacement is tcp_time_now_us

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ifaed2632baa49d489d4e03f2623d8cc9a6f36e64
2022-10-03 17:16:21 +00:00
9503eb59c1 sr: new messages created to return packet statistics in sr localsid details
Type: improvement
Signed-off-by: ChinmayaAgarwal <chinmaya.agarwal@hsc.com>
Change-Id: I27d5981a77d4166a92db9ecf73d9b0eed962ec19
2022-10-03 16:12:20 +00:00
1fb62c0bcc fib: fix dpo-receive address in ip6-ll fibs
Need to fill frp_addr for local path, it's used by dpo-receive.
If not, address output can be invalid:

$ sudo vppctl sh ip6-ll fe80::dcad:ff:fe00:3/128
IP6-link-local:loop3, fib_index:2, locks:[IPv6-nd:1, ]
fe80::dcad:ff:fe00:3/128 fib:2 index:55 locks:2
  IPv6-nd refs:1 entry-flags:connected,import,local, src-flags:added,contributing,active,
    path-list:[72] locks:2 flags:shared,local, uPRF-list:58 len:0 itfs:[]
      path:[82] pl-index:72 ip6 weight=1 pref=0 receive:  oper-flags:resolved, cfg-flags:local,glean,
        [@0]: dpo-receive: 8000💯fe80::dcad:ff on loop3

 forwarding:   unicast-ip6-chain
  [@0]: dpo-load-balance: [proto:ip6 index:57 buckets:1 uRPF:58 to:[0:0]]
    [0] [@2]: dpo-receive: 8000💯fe80::dcad:ff on loop3

Type: fix
Change-Id: Ib9874c5eac74af789e721098d512a1058cb8e404
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
2022-09-30 03:49:49 +00:00
5c801b362a udp: add udp encap source port entropy support
Encode entropy value in UDP source port when requested per RFC 7510.
CLI already has "src-port-is-entropy", use zero UDP source port in API
to avoid breaking changes, since zero port is not something to be used
in wild.
Also, mark UDP encapsualtion API as mp-safe as already done for CLI.

Type: feature
Change-Id: Ieb61ee11e058179ed566ff1f251a3391eb169d52
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
2022-09-30 03:48:42 +00:00
a30495ce0d gso: clear the offload flags from segmented buffers
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I2901628d23f9b81edb32d0ced3877e5799a6cec7
2022-09-29 16:31:20 +00:00
a2eb507055 api: deprecate vl_msg_api_set_handlers
Type: refactor

Change-Id: I7b7ca9ec62cb70243c5b7e87968eab1338d67ec8
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-09-29 15:36:00 +00:00
95875774bc vpp-swan: Add scripts for testing
Added scripts to reparing setups for testing

To prepare and run containers:
sudo ./extras/strongswan/vpp_sswan/docker/run.sh prepare_containers

To prepare setups:
sudo ./extras/strongswan/vpp_sswan/docker/run.sh config

To clean-up settups:
sudo ./extras/strongswan/vpp_sswan/docker/run.sh clean

To deleted all containers and images in Docker:
sudo ./extras/strongswan/vpp_sswan/docker/run.sh deleted

Type: feature
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I77f01c0419dccc95f610046c8552ae825f2c7e12
2022-09-28 17:46:04 +00:00
4e88e041ad vpp-swan: Add plugin for vpp-swan
Added plugin vpp-swan is a plugin that helps offloading
Strongswan IPsec ESP process from Linux Kernel to VPP.

Type: feature
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Iec77945892453fac1890d3c49d7d86fc6b09c893
2022-09-28 17:45:26 +00:00
cf9144e65f tests: stabilize wireguard ratelimiting test
Type: test

"test_wg_handshake_ratelimiting_multi_peer" has been unstable recently
because the test strongly relies on execution speed. Currently, the test
triggers ratelimiting for peer 1 and sends handshake initiations from
peer 1 and 2 mixed up. After that, the test expects that all handshake
initiations for peer 1 are ratelimited and a handshake response for peer
2 is received.

Ratelimiting is based on the token bucket algorithm. The more time
passes between triggering ratelimiting for peer 1 and sending a mixture
of handshake initiations from peer 1 and 2, the more tokens will be
added into the bucket for peer 1. Depending on delays between these
steps, the number of tokens might be enough to process handshake
initiations from peer 1 while they are expected to be rejected due to
ratelimiting.

With this change, these two steps are combined into one and the logic
modified. The test triggers ratelimiting for both peer 1 and 2. Packets
that trigger ratelimiting and that are to be rejected are sent in one
batch that is going to reduce delays between packet processing. Also,
verify that number of rejected handshake messages is in expected range
instead of verifying the exact number as it still may slightly vary.

Also, this should finish making the wireguard tests stable on Ubuntu
22.04 and Debian 11.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I3407d15abe1356dde23a241ac3650e84401c9802
2022-09-28 13:58:19 +00:00
ce668aa3f6 af_xdp: change RLIMIT_MEMLOCK before load bpf program
default RLIMIT_MEMLOCK is 64. if we use multi af_xdp interfaces or
load complex bpf program, libbpf will return permission error.

root cause is default 64 is not large enough. So we change it before
load bpf program.

Type: fix

Change-Id: Ia6aed19c9256c498cf1155586a54a32b3f444105
Signed-off-by: Chen Yahui <goodluckwillcomesoon@gmail.com>
2022-09-28 08:06:01 +00:00
76a1d0580a tests: enable ipsec-esp 'make test' testcases on ubuntu-22.04
Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I016fd169813e369208089df122477152aaf9ffc2
2022-09-27 13:11:53 -04:00
31ce1a63c0 wireguard: stop sending handshakes when wg intf is down
Type: fix

Currently, when a wg interface is administratively disabled initially or
during operation, handshake packets continue to be sent. Data packets
stop being sent because routes pointing to the wg interface will not be
used. But data keys remain.

With this fix, when a wg interface is administratively disabled during
peer creation, avoid connection initialization to the peer. Data keys
and timers should be empty at this point. When a wg interface is
disabled during operation, disable all peers (i.e. stop all timers,
clear data keys, etc.). Thus, state should be identical in both cases.
When a wg interface is administratively enabled, enable all peers (i.e.
get ready to exchange data packets and initiate a connection). Also,
cover these scenarios with tests.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ie9a620077e55d519d21b0abc8c0d3c87b378bca3
2022-09-27 16:15:54 +00:00
05554c6e98 crypto-openssl: use no padding for encrypt/decrypt
Internaly, vpp uses it's own padding, so all the data
is padded using blocksize in /src/vnet/ipsec/ipsec.c

 Openssl should add it's own padding, but the data
is already padded. So on decrypt stage when padding
should be removed, it can't be done. And it produces
error `bad decrypt`
 Previous versions of openSSL decrypted data almost
at the beginning of EVP_DecryptUpdate/EVP_DecryptFinal_ex
and produced the same error, but data was already decrypted.
Now it's not, so some algorithms could have some problems
 with it

PS. openSSL 3.x.x

Type: fix

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: If715a80228548b4e588cee222968d9da9024c438
2022-09-27 15:11:07 +00:00
1834b04d20 af_xdp: compile error undeclared identifier 'SOL_XDP'
Type: fix

Signed-off-by: Chen Yahui <goodluckwillcomesoon@gmail.com>
Change-Id: Ia447420f692f1487d343886845d648d766e43c27
Signed-off-by: Chen Yahui <goodluckwillcomesoon@gmail.com>
2022-09-27 14:30:43 +00:00
d925246879 vnet: fix ip4 version and IHL check
Validate version and IHL regardless of present options.
Originally VPP would accept seriously damaged headers in case IHL != 5.

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: Ifd59622efa63dfad7f6e4858dec40ccac3274574
2022-09-27 14:25:05 +00:00
522a5b3332 wireguard: fix re-handshake timer when response sent
Type: fix

As per the protocol:

  A handshake initiation is retried after "REKEY_TIMEOUT + jitter" ms,
  if a response has not been received...

Currently, if retransmit handshake timer is started, it will trigger
after "REKEY_TIMEOUT + jitter" ms and will try to send a handshake
initiation via wg_send_handshake() given that no responses have been
received. wg_send_handshake() will verify that time stored in
REKEY_TIMEOUT has passed since last handshake initiation sending and if
has, will send a handshake initiation. Time when a handshake initiation
was last sent is stored in last_sent_handshake.

The problem is that last_sent_handshake is not only updated in
wg_send_handshake() when sending handshake initiations but also in
wg_send_handshake_response() when sending handshake responses. When
retransmit handshake timer triggers and a handshake response has been
sent recently, a handshake initiation will not be sent because for
wg_send_handshake() it will look like that time stored in REKEY_TIMEOUT
has not passed yet. Also, the timer will not be restarted.

wg_send_handshake_response() must not update last_sent_handshake,
because this time is used only when sending handshake intitiations. And
the protocol does not say that handshake initiation retransmission and
handshake response sending (i.e. replying to authenticated handshake
initiations) must coordinate.

With this fix, stop updating last_sent_handshake in
wg_send_handshake_response().

Also, this fixes tests that used to wait for "REKEY_TIMEOUT + 1" seconds
and did not receive any handshake initiations. Then they fail.

Also, long-running tests that send wrong packets and do not expect
anything in reply may now receive handshake intiations, consider them as
replies to the wrond packets, and fail. Those are updated to filter out
handshake initiations in such verifications. Moreover, after sending
wrong packets, error counters are already inspected there to confirm
packet processing was unsuccessful.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I43c428c97ce06cb8a79d239453cb5f6d1ed609d6
2022-09-27 10:50:32 +00:00
ab15770ec6 vcl: repatch "align the RST behaviour with kernel"
The previous patch[37164] was a bit flawed.

Type: fix
Signed-off-by: Yacan Liu <liuyacan@corp.netease.com>
Change-Id: Ia9d8b9c7853e8f4b960ce7de26d0384243deb667
2022-09-27 03:46:08 +00:00
670724c51e tests: disable failing tests on ubuntu-22.04 debian-11
Type: test

Change-Id: I7b2314a731c83b3dcd69c999edb8ebed53839724
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-09-27 03:26:15 +00:00
fe45f8f5af api: replace print functions wth format
Type: improvement
Change-Id: I7f7050c19453a69a7fb6c5e62f8f57db847d9144
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-09-26 08:14:29 +00:00
b704971248 api: keep api common code in vlibapi
Type: refactor
Change-Id: I6edbff9a02fcb3c592ccfe8f47ddb3f848be1b6d
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-09-26 08:12:57 +00:00
617d429d2e bfd: add tracing support to bfd-process
Outgoing packets can be now traced via:

trace add bfd-process <count>

Type: improvement
Change-Id: Ia19af6054289b18f55e518dbea251a2bee9b9457
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2022-09-23 00:43:11 +00:00
06abf23526 ipsec: introduce fast path ipv6 inbound matching
This patch introduces fast path matching for inbound traffic ipv6.
Fast path uses bihash tables in order to find matching policy.
Adding and removing policies in fast path is much faster than in current
implementation. It is still new feature and further work needs
and can be done in order to improve the perfromance.

Type: feature

Change-Id: Iaef6638033666ad6eb028ffe0c8a4f4374451753
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
2022-09-21 15:11:54 +00:00
a2a7a4031b misc: Initial 23.02-rc0 commit
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Ie89d68ea4e462dfd7276a75f420268f15394258d
2022-09-21 12:03:02 +00:00
320272a7eb docs: enhance install vpp docs
Type: docs

Change-Id: Ic1439ce658d9d53208b29d85440a6cc225ed5b74
Signed-off-by: fatelei <fatelei@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-09-20 21:31:27 -04:00
c119e796f5 nat: adding docs for nat44-ed sub plugin
Type: docs

Change-Id: Icfa2bdc9367f8438b53da7c89caec263ed6ab056
Signed-off-by: Filip Varga <fivarga@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-09-20 23:10:35 +00:00
ed9b67429e fib: add cli support for explicit link type
This adds the ability to specify we want an IPv4 route via an IPv6 adj
and vice-versa.

Type: improvement

Change-Id: I5f7f1ab89fc60244d31c26155bbd9b0db690257c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-09-20 22:35:55 +00:00
6b4c6e1624 arp: check for manually added proxy-arp entries
When manually adding neighbor entries for proxy-arp, those will be
fib-adj entries. Check for proxy-arp instead of dropping immediately.

Type: improvement

Change-Id: Id311159f2966c99719dc2a67d4d2bc92bf366029
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-09-20 22:34:59 +00:00
8ffe8f6092 misc: experimental script to get the list of the reviewers for a commit
The script accepts zero or one argument (the commit hash), and outputs
the detected components, the component maintainers,
and the final suggested reviewer list. See the script
for the example output.

Change-Id: Ief671fe837c6201bb11fd05d02af881822b0bb33
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-09-20 20:54:28 +00:00
ce4b645178 packetforge: add packetforge for generic flow to extras
Add a new tool packetforge to extras. This tool is to support generic flow.
Packetforge is a library to translate naming or json profile format flow
pattern to the required input of generic flow, i.e. spec and mask. Using
python script flow_create.py, it can add and enable a new flow rule for
an interface via flow VAPI, and can delete an existed flow rule as well.
Command examples are shown below. Json profile examples can be found in
./parsegraph/samples.

Naming format input:
python flow_create.py --add -p "mac()/ipv4(src=1.1.1.1,dst=2.2.2.2)/udp()"
-a "redirect-to-queue 3" -i 1
python flow_create.py --del -i 1 -I 0

Json profile format input:
python flow_create.py -f "./flow_rule_examples/mac_ipv4.json" -i 1

With this command, flow rule can be added or deleted, and the flow
entry can be listed with "show flow entry" command in VPP CLI.

Packetforge is based on a parsegraph. The parsegraph can be built by
users. A Spec can be found in ./parsegraph as guidance. More details
about packetforge are in README file.

Type: feature

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Ia9f539741c5dca27ff236f2bcc493c5dd48c0df1
2022-09-20 20:44:42 +00:00
f5e0a17c9c vcl: align the RST behaviour with kernel
When ESTABLISHED TCP connection is terminated by an RST packet,
EPOLLHUP + EPOLLRDHUP would be updeliever by VCL. If not using
VPP, app would receive EPOLLHUP + EPOLLERR + EPOLLIN(if requested) +
EPOLLRDHUP(if requested).

libevent will interpret the two cases as different EV combinations.

Below is the code snippet for libevent v2.12:

  if (what & EPOLLERR) {
    ev = EV_READ | EV_WRITE;
  } else if ((what & EPOLLHUP) && !(what & EPOLLRDHUP)) {
    ev = EV_READ | EV_WRITE;
  } else {
    if (what & EPOLLIN)
      ev |= EV_READ;
    if (what & EPOLLOUT)
      ev |= EV_WRITE;
    if (what & EPOLLRDHUP)
      ev |= EV_CLOSED;
 }

Type: fix
Signed-off-by: Yacan Liu <liuyacan@corp.netease.com>
Change-Id: Ice3d2861183b6ea499f66b727bbe175eeae5cb05
2022-09-20 16:56:40 +00:00
c872cec3f0 tests: run tests against a running VPP
Usage:
test/run.py -r  -t {test_filter}
Instead of starting a new instance of VPP, when the -r argument
is provided, test is run against a running VPP instance. Optionally,
one can also set the VPP socket directory using the -d
argument. The default location for socket files is
/var/run/user/${uid}/vpp and /var/run/vpp if VPP is started
as root.

Type: improvement

Change-Id: I05e57a067fcb90fb49973f8159fc17925b741f1a
Signed-off-by: Naveen Joy <najoy@cisco.com>
2022-09-20 13:54:58 +00:00
229f5fcf18 misc: add test framework for host stack
Type: feature

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I5a64a2c095cae3a4d5f8fdc73e624b010339ec8e
2022-09-19 21:00:18 +00:00
6cacc94de3 cnat: coverity fix
Type: fix

Change-Id: Ib127331507724f853071e66ca1ddfc773a8ed200
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-09-19 15:47:32 +00:00
e95b246c7b tests: skip tests failing on ubuntu 22.04
Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I218059de5d05680d661f302293475b6c2a7bf81d
2022-09-19 13:59:05 +00:00
a58dae61ae igmp: validate ip router alert option length
It's known there're one or more 32-bit increments in the ip
header. So just check ip router alert option length with minimal
performance impact, and don't care of the total options length.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: I46dd06516f793846b931a1dc8612f2735f8d24d3
2022-09-19 01:46:57 +00:00
755b529c11 abf: add API parameter n_paths range checks
Also check for non-zero rpath length in CLI cmd.
While there, no need to use "else" after a return.
Also while there, notice and fix numerous input_line
buffer leaks and fix them.

Type: fix
Fixes: 669d07dc01

Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I18ea44b7b82e8938c3e793e7c2a04dfe157076d8
2022-09-19 01:39:05 +00:00
6e3b3b7672 build: install missing headers
Type: fix

Change-Id: I4eb2a7190de90553c91133f940e068ed649120cb
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-09-19 01:27:03 +00:00
de98906648 teib: fix segv during failed deletion of entry
Type: fix

If an attempt is made to delete a teib entry and the entry does not
exist, a message is logged. The format string contained an extra "%U",
which results in a segv.

Change-Id: I9b1d6ba63601982ba6ac8607cf710e34c311702a
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2022-09-19 01:26:18 +00:00
114b154659 arp: update error reason when checking for proxy-arp
When we follow arp feature arc for proxy-arp, we should still update
the error reason in case proxy-arp cannot handle the arp request and
drops it.

Type: improvement

Change-Id: I046df017ca2056cfc12af0f0a968b401058bcd6d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-09-19 01:25:15 +00:00
59abf89dda linux-cp: fix some CLI error messages
Type: fix

If unrecognized input was provided to the commands which add or delete a
pair, the error message was being created incorrectly and only displayed
something like "unknown input `'". Provide the correct argument to
format_unformat_error so that the actual unrecognized input is printed.

There also was no error or useful information printed if only the base
command were provided without any additional arguments. This should
print a warning about what required data was missing. Reorganize code to
handle this and to make sure that memory gets freed appropriately.

Change-Id: If454714f50cf41b3b56cfadfbf017f1d160e13a4
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2022-09-19 01:24:19 +00:00
ccd83cb501 lisp: fix coverity 277315
Handle the case of the mapping not being found by GID.

Type: fix
Change-Id: Ibce3b9e8419c0dddca97b4d0d5a71f25dfd529d8
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-09-18 23:19:16 +00:00
dd0144a456 virtio: add support for per queue packet counter
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I21a701a556b88a9d81f0e074a59fa34b3746b1d9
2022-09-16 16:16:53 +00:00
c795b8836d vcl: add hugepage for vcl configure and svm
add hugepage for vcl configure and svm

Type: feature

Signed-off-by: Junfeng Wang <drenfong.wang@intel.com>
Change-Id: I6a8905e3fec23d840e629114b1e5a403d0a258ef
2022-09-15 23:15:26 +00:00
0654242d1e session: support dma option
add dma support to session, acclerate host-stack with dma

Type: feature

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Signed-off-by: Junfeng Wang <drenfong.wang@intel.com>
Change-Id: I3d492921d69d9e3e0b34d33adc33fba3bde9e1cc
2022-09-15 23:12:55 +00:00
6e1eaad216 prom: fix coverity 277312, 277317
If one attempts to add a pattern with zero length, first time
it will succeed, and the second time it will cause an invalid memcmp call.

Solution: do not allow to add zero-length patterns.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Ic08e021486153be605a4b12a2fe4422307bf68d2
2022-09-15 11:46:30 +00:00
5f694d1ecf nat: fix nat44-ed port range with multiple workers
The number of available dynamic ports is set to (0xffff - 1024) =
64511, which is not divisable by the pow2 number of workers - the
only integer divisors are 31 and 2081.
So, total dynamic port range of all workers will be less than it:
    1 wrk: n = (port_per_thread = 64511/1)*1 = 64511 + 1025 = 65536
    2 wrk: n = (port_per_thread = 64511/2)*2 = 64510 + 1025 = 65535
    4 wrk: n = (port_per_thread = 64511/4)*4 = 64508 + 1025 = 65533
    8 wrk: n = (port_per_thread = 64511/8)*8 = 64504 + 1025 = 65529
    ...
As seen, with multiple workers there are unused trailing ports for every
nat pool address and that is the reason of out-of-bound index in the
worker array on out2in path due (port - 1024) / port_per_thread math.
This was fixed in 5c9f9968de, so packets
to unused ports will go to existing worker and dropped there.

Per RFC 6335 https://www.rfc-editor.org/rfc/rfc6335#section-6:
6.  Port Number Ranges
   o  the System Ports, also known as the Well Known Ports, from 0-1023
      (assigned by IANA)
   o  the User Ports, also known as the Registered Ports, from 1024-
      49151 (assigned by IANA)
   o  the Dynamic Ports, also known as the Private or Ephemeral Ports,
      from 49152-65535 (never assigned)

According that let's allocate dynamic ports from 1024 and have full port
range with a wide range of the workers number - 64 integer divisors in
total, including pow2 ones:
    1 wrk: n = (port_per_thread = 64512/1)*1 = 64512 + 1024 = 65536
    2 wrk: n = (port_per_thread = 64512/2)*2 = 64512 + 1024 = 65536
    3 wrk: n = (port_per_thread = 64512/3)*3 = 64512 + 1024 = 65536
    4 wrk: n = (port_per_thread = 64512/4)*4 = 64512 + 1024 = 65536
    5 wrk: n = (port_per_thread = 64512/5)*5 = 64510 + 1024 = 65534
    6 wrk: n = (port_per_thread = 64512/6)*6 = 64512 + 1024 = 65536
    7 wrk: n = (port_per_thread = 64512/7)*7 = 64512 + 1024 = 65536
    8 wrk: n = (port_per_thread = 64512/8)*8 = 64512 + 1024 = 65536
    ...
Modulo from 5c9f9968de is still required
when the numbers of workers is not the integer divisor of 64512.

Type: fix
Fixes: 5c9f9968de
Change-Id: I9edaea07e58ff4888812b0d86cbf41a3784b189e
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
2022-09-15 08:39:19 +00:00
b3778cce70 ip-neighbor: fix debug log format output
Type: fix

Signed-off-by: luoyaozu <luoyaozu@foxmail.com>
Change-Id: Ibfebe4da0197d1f60bf9edd3873fe1f776b680a4
2022-09-15 08:37:29 +00:00
121a16af69 ip: show fib index in ip4 reassembly trace
Type: improvement
Change-Id: I371237803e2c3cb0e1b42b94f422867465e2bff6
Signed-off-by: Damjan Marion <dmarion@me.com>
2022-09-14 15:13:21 +00:00
d7c030d606 ipsec: make chacha20-poly1305 available via API
Type: feature

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: I4e03f60f34acd7809ddc5a743650bedbb95b2e98
2022-09-14 08:18:54 +00:00
51a7e44172 vlib: add vlib_frame_bitmap_is_bit_set
Type: improvement
Change-Id: I2f3fab893a10b060f91b07ee17b8727d241830ea
Signed-off-by: Damjan Marion <dmarion@me.com>
2022-09-12 20:20:42 +00:00
993b6bee63 ipsec: introduce fast path ipv4 inbound matching
This patch introduces fast path matching for inbound traffic ipv4.
Fast path uses bihash tables in order to find matching policy. Adding
and removing policies in fast path is much faster than in current
implementation. It is still new feature and further work needs
and can be done in order to improve perfromance.

Type: feature

Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: Ifbd5bfecc21b76ddf8363f5dc089d77595196675
2022-09-12 11:55:14 +02:00
a27aa6b413 fib: fix path copy function to deal with provided DPO in exclusive path
DPO in the new copy was not locked ...

Type: fix
Fixes: 0bfe5d8

Change-Id: I39f1368de459af91c4bb857d98a4b531bd5692a6
Signed-off-by: Damjan Marion <dmarion@me.com>
2022-09-09 16:12:29 +00:00
9f5b36926b vlib: don't leak node frames on refork
Free node frames in worker mains on refork. Otherwise these frames are
never returned to free pool and it causes massive memory leaks if
performed under traffic load

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: I15cbf024a3f4b4082445fd5e5aaa10bfcf77f363
2022-09-09 16:03:14 +00:00
10672be9e2 vppinfra: add clib_array_mask_set_u32()
Type: improvement
Change-Id: Idf1fb054d5ff495d772d01a79cbc6cd1b409d377
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-09-09 17:09:38 +02:00
de4eb7fa21 nat: fix nat44-ed-in2out fast path next node
When a session is found expired, the next node of in2out fast path
should be in2out slow path instead of out2in slow path.

Type: fix
Signed-off-by: Jing Peng <jing@meter.com>
Change-Id: If1dd920502089c25b33bea5434823b0496a44499
2022-09-09 13:16:08 +00:00
4a5564da10 fib: missing headers
Type: improvement
Change-Id: I7f52222706200c31a731fadfb84513549ccb532d
Signed-off-by: Damjan Marion <dmarion@me.com>
2022-09-09 13:08:47 +00:00
6a3f0ab2fd wireguard: eliminate some calls to main thread
Type: improvement

Roaming functionality allows the peer address to change. The main thread
was being called to update a peer's address if necessary after
processing a received packet. Check in the worker whether this is
necessary before incurring the overhead of the RPC to the main thread.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I02184b92dc658e0f57dd39993a3b2f9944187b45
2022-09-08 13:41:54 +00:00
503225c458 avf: check for VLAN_TOGGLE capability
The ability to modify the vlan setting must be checked prior to using
VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2 both for inner and outer vlan
stripping

Change-Id: Iffe306c34b81a6077ad6ba5deb3f5b61b5475897
Type: fix
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-09-08 12:02:14 +00:00
563d34ba9d dpdk-cryptodev: reduce request to enable async
Originally initialization cryptodev device(s) calls double request
to enabled async mode and increased ref count twice for async mode.
Due to this cannot be change any assigned async handlers to other
async crypto engine.

The fixes reduce double request to enable async mode in initialization
cryptodev device(s) and VPP can be change assigned async handlers
to other crypto engine after disabled all async feature, for example:
ipsec, wireguard.

Type: fix

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: If22e682c3c10de781d05c2e09b5420f75be151c3
2022-09-07 18:51:23 +00:00
987318e0d1 build: Cleanup python2 from suse build and uplift opensuse version
- default to opensuse-leap 15.4, no python2 support in this version
 - deprecate version openSUSE 15.0, openSUSE 15.3 still supported

Type: make

Signed-off-by: Laszlo Kiraly <laszlo.kiraly@est.tech>
Change-Id: Ic7178ff5238e2669bc45166c1f13d3f077f6069b
Signed-off-by: Laszlo Kiraly <laszlo.kiraly@est.tech>
2022-09-07 13:04:14 +00:00
5085d8a945 vrrp: fix cli functions according to short_help
test output before fix:
  DBGvpp# vrrp proto start sw_if_index 1 vr_id 1
  vrrp proto: unknown input `sw_if_index 1 vr_id 1'
  DBGvpp# vrrp vr track-if add sw_if_index 1 vr_id 1 track-index 1
priority 30
  vrrp vr track-if: Please specify an interface

Type: fix

Signed-off-by: luoyaozu <luoyaozu@foxmail.com>
Change-Id: Ib8ba67e920b23008d9246318ec8f8f17bf0bea95
2022-09-06 19:31:15 +00:00
edb0d4563c ip: fix punt socket overflow
client_pathname is usually smaller than pc->caddr.sun_path. snprint()
ensures we stop at the NULL character or sizeof(sun_path) whichever
comes 1st. It also guarantees NULL character termination.

Type: fix

Change-Id: I9fc2a706beab931d50d32d03f7fafca7c6c2fb0b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-09-05 09:29:35 +00:00
934f9b095f build: set OS_ID_LIKE only if unset
cmake MATCHES directive with the empty regex "" always match, including
non-empty strings.

Type: fix
Fixes: 534dfc1f18

Change-Id: If085b29da15a6d7fc680cebb823183fd3c7eea68
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-09-01 12:53:15 +00:00
1363331f0f ipsec: fix coverity 249212
zero-initialize the variables

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I51c3856865eab037f646a0d184e82ecb3b5b3216
2022-08-31 19:14:56 +00:00
738eaa6f49 build: remove lto flags in dpdk build
- Ubuntu 22.04 enables LTO by default and dpdk
  adds lto flags to CFLAGS. This CI jobs to fail
  with OOM-Kill (especially on ARM64) due to lto
  consuming large amounts of memory.

Type: make

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I5a3d3a08e2caddb4790b281b80b16081567aed5b
2022-08-31 18:58:42 +00:00
bf12efc432 udp: store mss and sw_if_index to udp_connection_t
Store mss and sw_if_index to udp_connection_t and display them via
show sessipn verbose 2

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I32928f3f4195b178873dc1bada702e035d99c464
2022-08-31 16:19:15 +00:00
005ef97f80 nat: fix coverity 249194
Zero-initialize a variable.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Iccf2eb4bf26755d6cd93fc70df3c5481d69ce7eb
2022-08-31 16:01:08 +00:00
ab46a3c973 nat: fix coverity 249178
Zero-initialize the variable

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I4ee127ac3e2a3beffa11bbc96db1f3254b3f7c5d
2022-08-31 16:00:14 +00:00
e4046528d4 pppoe: fix coverity 218437, 218401
Initialize the session index in case of error to ~0,
so is defined in case trace needs to copy it.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Iddf6df42c09d2abc11e5821944eb4f41692e6e3e
2022-08-31 15:29:35 +00:00
62fc78761c gso: zero-initialize gho struct
It may contain garbage in debug builds resulting in wrong
gho detected flags and offsets.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Ia79633262185016f527e7dc6c67334cda6f055f2
2022-08-31 15:26:19 +00:00
6556a9944f devices: fix coverity warning
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I0a58c0f54d8be31a0a78bef00152fb2cc193840e
2022-08-31 11:14:28 +00:00
89733a15ce devices: add support for polling mode
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I8d84dc8b7f5c5e863c32838cfafc3d366e2a7e00
2022-08-31 09:15:31 +00:00
36cb2f03ae dpdk: fix arm iavf rx vector path on 22.03
dpdk 22.03 introduces iavf driver but misses rx vector path on Arm.
This causes VF fail to receive packet when running VPP device test
with no-multi-seg configuration.

Add iavf basic Neon RX support to fix this.

Type: fix
Fixes: 2f132efc3c ("dpdk: bump to DPDK v22.03")

Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I75ae74c8060428cee0e1c235feab1246c014801e
2022-08-30 23:56:06 +00:00
7dc351f689 l2: skip arp term for locally originated packets
Mark arp packet as locally originated when probing/replying and don't apply any
arp-term logic against it.

Type: fix
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
Change-Id: I305ff5cac8cac456decf92f21b961aa4ce286079
2022-08-30 18:37:20 +00:00
c37ce79076 tcp: do not overcount ooo bytes
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic81702bffb5b3189db48efe1ab3b237fa2bf75f2
2022-08-30 18:14:26 +00:00
4cbc8b20c7 dma_intel: fix the wrong unformat type
The unformat type for "%d" should be u32 or int, otherwise the 'did' in
high stack address will be overflow to zero by the 'qid' which is in the
low stack address.

Like input "dev wq3.2" will return "did=0, qid=2".

Type: fix
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Change-Id: I0fe1d5b03e2c47e0a7925193e2c2f1ccc31d3e90
2022-08-30 18:13:18 +00:00
fcb2132d74 memif: Process bad descriptors correctly in memif_process_desc
When there is a bad descriptor, it may in the beginning, in the middle,
or at the end of the batch if the batch has more than 3 descriptors.
When processing a bad descriptor is encountered in the batch, we need to
rollback n_buffers in memif_process_desc(), or the statement in the same
function
	    memif_add_copy_op (ptd, mb0 + src_off, bytes_to_copy,
                               dst_off, n_buffers - 1);
is wrong because it picks up the wrong buffer_vec_index of the bad
descriptor while parsing a good descriptor immediately following the
bad descriptor. n_buffers was incremented in the beginning of
while (n_left) loop.

The other problem is we should count the number of bad packets and
reduce ptd->n_packets to get the correct number of packets for subsequent
processing in device_input.

The last fix is to check if n_buffers == 0 in device_input and skip
doing any descriptor copy. This case can happen when all the descriptors
are bad in the batch.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I28ed1d87236b045657006755747b5750a9a733be
2022-08-30 18:12:03 +00:00
76b8aa00f7 ethernet: fix coverity 214973
Ensure that the ethernet_input_inline_dmac_check which directly derefererences ei,
is called only if ei is set.

Type: fix
Change-Id: I2d3bce63ee457825a5d375a6102225f3abf67703
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-08-30 14:41:51 +00:00
618afb5fb0 vlib: fix coverity 274750, part 2
Add another missing null check.

Type: fix
Change-Id: Iec4de548810efe369a6e61b8787131230506cff6
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-08-30 14:11:30 +00:00
a21b38e17a vlib: fix coverity 277203
Fix integer overflow.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I72de6f88be064f188204d0f6d3167a3a8d7de58d
2022-08-30 14:10:52 +00:00
3c285b54aa dpdk: bump to 22.07
Type: feature

This patch bumps DPDK version to 22.07.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: I72ecb31ca15774aed4453778042120610020a0c1
2022-08-30 14:05:00 +00:00
966e6ff173 ethernet: refactor the redundant code
Following the discussion during the review
of  b46a4e69e5,
remove the redundant ei0. This resulted in realization
that in order for this code to do anything useful,
the ei must be always non-zero, so rewrite the logical
condition for it. Also, make it a conjunction which seems simpler
to understand.

Type: improvement
Change-Id: Ibd7b2a63e4aeaf97eb1a98af8e69aed2ff7dd577
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-08-30 11:40:37 +00:00
a9bfef73a7 vlib: use error description when dropping packets
Using the error name makes it less explicit in the packet trace than
the error description when a packet is dropped. Example of the trace
when the TTL is <=1:

01:03:17:015278: drop
  ip4-input: time_expired

We should have "ip4 ttl <= 1" instead of "time_expired"

Type: fix
Change-Id: Ic9decf10d609cc938e39d0f449359e41c406267e
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
2022-08-29 23:56:22 +00:00
186b2156c0 ethernet: fix mac address increment error
Using "ip neighbor <ip-addr> <mac-addr> static count <count>" to add
static ARP entries will output wrong mac addresses due to lack of
big/little endian conversion. Fix this error by converting mac address
from big endian to little endian before doing the self-increment.

Before patched:

vpp# ip neighbor rdma-0 198.18.1.1 01:aa:bb:cc:dd:e0 static count 5
vpp# show ip neighbor
    Time                       IP                    Flags      Ethernet              Interface
      4.4400               198.18.1.5                  S    05:aa:bb:cc:dd:e0 		rdma-0
      4.4399               198.18.1.4                  S    04:aa:bb:cc:dd:e0 		rdma-0
      4.4399               198.18.1.3                  S    03:aa:bb:cc:dd:e0 		rdma-0
      4.4399               198.18.1.2                  S    02:aa:bb:cc:dd:e0 		rdma-0
      4.4399               198.18.1.1                  S    01:aa:bb:cc:dd:e0 		rdma-0

After patched:

vpp# ip neighbor rdma-0 198.18.1.1 01:aa:bb:cc:dd:e0 static count 5
vpp# show ip neighbor
    Time                       IP                    Flags      Ethernet              Interface
      4.4528               198.18.1.5                  S    01:aa:bb:cc:dd:e4 		rdma-0
      4.4528               198.18.1.4                  S    01:aa:bb:cc:dd:e3 		rdma-0
      4.4528               198.18.1.3                  S    01:aa:bb:cc:dd:e2 		rdma-0
      4.4527               198.18.1.2                  S    01:aa:bb:cc:dd:e1 		rdma-0
      4.4527               198.18.1.1                  S    01:aa:bb:cc:dd:e0 		rdma-0

Type: fix
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: Iec1e00e381e4aba96639f831e7e42e070be3f278
2022-08-29 23:55:08 +00:00
d2acfbc8f8 fib: fix coverity 249175
Add an assert to express the constraint to coverity without
incurring the overhead in release builds.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I2c22f8b2565c645d95c9c0be37381060e151420f
2022-08-29 23:52:39 +00:00
165c963ec5 fib: fix coverity 253539
Add an ASSERT so coverity is aware of the assumption taken,
without incurring any penalty in release build.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I3e7e1e77059492315409efbed47657f9e56d167c
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-08-29 23:52:13 +00:00
b46a4e69e5 ethernet: fix coverity 218549
Check that the pointer is non-null before dereferencing it.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I611a1042d08bbe455dd09a4fa5711fe86c440240
2022-08-29 21:20:58 +00:00
f4f1b959c0 nat: fix coverity 249202
In case of a bad packet, the bihash kv is not initialized before being
copied in the trace. Make sure it is initialized to 0.

Type: fix

Change-Id: I22fcfe99f3586d0fa128493059547a56557b8fb5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-08-29 11:56:08 +02:00
8a34484057 libmemif: fix the buffer size
Type: fix

Previously, libmemif can only use buffer size which
have to be power of 2. memif protocol does not enforce
this. This patch fixes this issue.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ic71e6a51685e2c2228c744920797064d4c7c65c9
2022-08-29 07:07:07 +00:00
6e284ef6ce libmemif: add support for custom buffer-size and headroom in icmp example app
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I2bdaee7938a3747e3217d6901ec3c66f1ee3da61
2022-08-29 07:05:23 +00:00
a01be735f2 linux-cp: fix coverity 216937
Initialize the host_sw_if_index to ~0 so in the error cases
the variable is set to something predictable.

Type: fix
Change-Id: Ic55e4f0cbfa286e85dfb54b89b5321af18a439a1
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-08-26 14:57:00 +00:00
c8d1c8cfb8 nsh: fix coverity 249201
Zero-initialize the temporary struct, else a->map.adj_index is being used unset.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Ia02636ea1e911250d6aa5e413de48e1e09863880
2022-08-26 13:11:14 +00:00
000a4ebed7 build: disable gcc warning stringop-overflow for gcc-10 or greater
- this warning causes build errors with gcc on ubuntu 22.04

Type: make

Change-Id: Id8f6ab44b2315ce8a4564ea924d799ecb6f57fdf
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-08-25 17:47:35 -04:00
abd5669422 vlib: introduce DMA infrastructure
This patch introduces DMA infrastructure into vlib. This is well known
that large amount of memory movements will drain core resource. Nowadays
more and more hardware accelerators were designed out for freeing core
from this burden. Meanwhile some restrictions still remained when
utilizing hardware accelerators, e.g. cross numa throughput will have a
significant drop compared to same node. Normally the number of hardware
accelerator instances will less than cores number, not to mention that
applications number will even beyond the number of cores. Some hardware
may support share virtual address with cores, while others are not.

Here we introduce new DMA infrastructure which can fulfill the
requirements of vpp applications like session and memif and in the
meantime dealing with hardware limitations.

Here is some design backgrounds:

  Backend is the abstract of resource which allocated from DMA device
  and can do some basic operations like configuration, DMA copy and
  result query.

  Config is the abstract of application DMA requirement. Application
  need to request an unique config index from DMA infrastructure. This
  unique config index is associated with backend resource. Two options
  cpu fallback and barrier before last can be specified in config.
  DMA transfer will be performed by CPU when backend is busy if cpu
  fallback option is enabled. DMA transfer callback will be in order
  if barrier before last option is enabled.

  We constructs all the stuffs that DMA transfer request needed into
  DMA batch. It contains the pattern of DMA descriptors and function
  pointers for submission and callback. One DMA transfer request need
  multiple times batch update and one time batch submission.

  DMA backends will assigned to config's workers threads equally. Lock
  will be used for thread-safety if same backends assigned to multiple
  threads. Backend node will check all the pending requests in worker
  thread and do callback with the pointer of DMA batch if transfer
  completed. Application can utilize cookie in DMA batch for selves
  usage.

DMA architecture:

   +----------+   +----------+           +----------+   +----------+
   | Config1  |   | Config2  |           | Config1  |   | Config2  |
   +----------+   +----------+           +----------+   +----------+
        ||             ||                     ||             ||
   +-------------------------+           +-------------------------+
   |  DMA polling thread A   |           |  DMA polling thread B   |
   +-------------------------+           +-------------------------+
               ||                                     ||
           +----------+                          +----------+
           | Backend1 |                          | Backend2 |
           +----------+                          +----------+

Type: feature

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Change-Id: I1725e0c26687985aac29618c9abe4f5e0de08ebf
2022-08-25 19:05:40 +00:00
9a6ad01c0d wireguard: fix ipv6 payload_length computation
The ipv6 header length should not be counted in the ipv6 payload length.
This is similar to https://gerrit.fd.io/r/c/vpp/+/36945.

Type: fix
Change-Id: I22de0ff828175829102a85288513ee3f55709108
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2022-08-25 13:01:58 +02:00
d3456b8d85 vlib: allow longer version string
Type: improvement

When trying to use a version string in a downstream build that appends a
timestamp to the standard version string, compiling fails because the
version string is too long for the version and version_required fields
in vlib_plugin_registration_t. Increase the size of those arrays from 32
to 64 chars.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I3632139e5ae7110aa4769359f380ad29522ad4ed
2022-08-24 15:17:16 +00:00
4b4aded6af ipsec: fix coverity 249204
Zero-initialize the temporary struct, else coverity complains about a bunch of uninitialized fields.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I45dc42134f06917a7459d615804f978a175bec0f
2022-08-24 09:08:32 +00:00
9cd37fb28c linux-cp: handle AF_BRIDGE neighbors
Type: improvement

VPP crashes when a linux-cp tap is added to a bridge on the host system
because rtnl_neigh_get_dst() returns NULL for the neighbor message that
is sent by the kernel.

Check for NULL before trying to use the address from a neighbor in a
netlink message.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I8a683d815a09620df9c0cc76e18df39828428e2c
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2022-08-23 22:12:58 +00:00
1a1c59d1a2 lisp: address the issues raised by coverity 249165
Add the error checks in parsing, aimed to avoid parser walking past the end of packet in case the data
is garbage.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I9541b555a18baf63cb8081bcd7a4c2750f2ed012
2022-08-23 18:25:48 +00:00
a6b2d7ed5a 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>
2022-08-23 17:39:18 +00:00
174f5c8502 vppinfra: fix coverity 249217
Zero-initialize the temporary struct.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I8d73feae427a17470c47d1551ba7078213b589fc
2022-08-23 15:10:49 +00:00
aac685640a 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
2022-08-23 15:09:54 +00:00
5b88feeb7f 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
2022-08-19 10:44:26 -05:00
c428fd5d94 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
2022-08-19 15:06:42 +00:00
6f1eb484c8 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
2022-08-19 14:13:36 +00:00
47c1b1c633 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
2022-08-18 23:22:28 +00:00
97d3d54c91 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>
2022-08-18 23:16:53 +00:00
fa7441ffc2 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>
2022-08-18 15:34:40 +00:00
32b93d4800 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
2022-08-18 15:32:28 +00:00
07c42c0eea 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: 85bee7548b

Change-Id: I7fd70050e7bf4871692a862231f8f38cf0158132
Signed-off-by: Jon Loeliger <jdl@netgate.com>
2022-08-18 15:23:51 +00:00
635930f5bb 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
2022-08-18 14:09:20 +00:00
cc488fc766 nsh: fix coverity 249169
Zero-initialize the temporary struct on stack.

Type: fix
Change-Id: I651f87deeb79c6c073d5c510435fa268893a3b0e
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-08-18 12:03:25 +00:00
6e4a56e656 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
2022-08-18 08:30:36 +00:00
b29c60660a ip: Use .api declarative counters for ICMP.
Type: improvement

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I3d36faa60075658fd59eb5bbe16efcb48664691b
2022-08-18 08:29:21 +00:00
c65921f774 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
2022-08-18 08:03:13 +00:00
138f65c5b7 ikev2: fix possible SEGV
Type: fix
Signed-off-by: Atzm Watanabe <atzmism@gmail.com>
Change-Id: Icbd452b43ecaafe46def1276c98f7e8cbf761e51
2022-08-18 06:31:52 +00:00
3ebe1efce1 svm: fix coverity 249207,249209
Zero-initialize the temporary struct.

Type: fix
Change-Id: I6f7a35ace6002aa75dc986c7c7eca614c9c5c3ed
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-08-17 15:47:23 +00:00
cbc10399d4 vlib: fix coverity 274744
Add a missing null check

Type: fix
Change-Id: Id1b27341480c9d62185496ae1d832360119ec198
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-08-17 15:35:17 +00:00
a3018af21d vlib: fix coverity 274750
Add a missing null check.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Ie6234804e2b89adc918ef9075f9defbb1fd35e44
2022-08-17 15:30:52 +00:00
fc025725b8 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
2022-08-17 14:23:37 +00:00
ae60538925 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
2022-08-17 09:04:27 +00:00
d5e4e25849 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
2022-08-17 01:53:29 +00:00
c7f93b321d 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
2022-08-16 20:27:37 +00:00
5c9f9968de 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
2022-08-16 19:32:14 +00:00
b5339c64d1 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
2022-08-14 13:17:46 +08:00
57cf5087e0 docs: fix spellcheck error for Ubuntu 22.04
Type: fix

Signed-off-by: Saima Yunus <yunus.saima.234@gmail.com>
Change-Id: I975990aeead6d34f0317a37e917bd92c0c89276e
2022-08-12 18:45:39 +00:00
28d5c1231c http_static: validate session before sending
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I18b9d0d67f5fe4c1714427259df29026153d8dd1
2022-08-12 02:13:59 +00:00
f5b8e8d624 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>
2022-08-11 21:37:40 +00:00
30be19ce98 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
2022-08-11 15:13:51 +00:00
41a85c0a26 mpls: Use the .api for the definition of error/info counters
Type: improvement

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I9d25f5459ab70d9cf8556e44cfddfd7029e5b540
2022-08-11 06:55:11 +00:00
e22a704162 ip: Use .api declared error counters
Type: improvement

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I822ead1495edb96ee62e53dc5920aa6c565e3621
2022-08-11 06:54:16 +00:00
93688d7341 ipsec: Use .api declared error counters
Type: improvement

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ica7de5a493389c6f53b7cf04e06939473a63d2b9
2022-08-11 06:51:07 +00:00
13a74ae25d arp: Use the new style error count declaration
Type: improvement

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ifda8ca8d26912c750a77d2ca889e1638ca83d85a
2022-08-11 06:48:27 +00:00
ee15f8682c 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>
2022-08-11 00:32:46 +00:00
9fac9c8fd5 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
2022-08-11 00:09:43 +00:00
7e6ffba672 ikev2: do not accept rekey until old SA is deleted
Type: fix
Signed-off-by: Atzm Watanabe <atzmism@gmail.com>
Change-Id: I11b6107492004a45104857dc2dae01b9a5a01e3b
2022-08-10 07:44:55 +00:00
5c7e579f77 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
2022-08-10 00:18:05 +00:00
0c50dbb767 bfd: More descriptive error codes during packet receive handling
Type: improvement

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I8907fecde6d48f5362f0f91372d5a9a1bba6f931
2022-08-10 00:16:35 +00:00
fee9853a4f 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
2022-08-09 15:55:45 +00:00
a6328e51e0 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
2022-08-09 15:42:43 +00:00
fd2417b2a4 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
2022-08-09 14:17:46 +00:00
896b184b78 vnet: install reass headers
Change-Id: I42a138628b06a412b8fce7fb4fc500caf9057169
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-08-09 12:30:06 +00:00
16052480c3 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>
2022-08-09 12:28:20 +00:00
83caa62efa interface: fix show_or_clear_hw_interfaces
Change-Id: I2f3163a7a158afa8e2debc6f545c3d1a2a12ac1d
Type: fix
Fixes: 3414977152
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-08-09 08:16:32 +00:00
8a419d5b5d 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>
2022-08-08 14:36:32 +00:00
ce91af8ad2 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
2022-08-08 14:24:06 +00:00
03aae96379 ikev2: fix rekeying with multiple notify payloads
Type: fix
Signed-off-by: Atzm Watanabe <atzmism@gmail.com>
Change-Id: I065bd5c26055d863d786023970e7deeed261b31c
2022-08-08 16:33:39 +09:00
389aae573f 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>
2022-08-05 10:54:44 -04:00
09ef592a32 tests: fix node variant selection
Type: fix
Fixes: 4830e4f78f

Change-Id: Iddc73dbda633acd72bd82e52f8ae83c17e3940f6
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-08-05 12:05:32 +00:00
1b299fa467 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>
2022-08-05 08:33:10 +00:00
7ea7ab5f21 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>
2022-08-04 12:19:35 -07:00
157e4f5d24 dpdk: enable interrupt support for vmxnet3
Type: feature

Change-Id: I0abbe925d6b9d3dd7196cd8beaf4f471beb45bd6
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-08-04 17:15:58 +00:00
5fcec2053e 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>
2022-08-04 06:45:31 +00:00
44ec846f4a 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
2022-08-03 18:35:40 +00:00
818806062c 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
2022-08-02 10:15:43 +00:00
69977d2398 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
2022-07-29 11:30:18 +00:00
92d296551b session: fix a crash when using unregistered transport proto
Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I39e3e007da2b99321bebf3e1c1ebb1d87547f532
2022-07-28 15:38:18 +00:00
4a817a5d7e 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
2022-07-28 08:13:48 +00:00
a5266c6bb5 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
2022-07-26 17:03:20 +00:00
8636a32041 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
2022-07-25 14:03:48 +00:00
c8cd079a00 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>
2022-07-21 08:34:15 +02:00
dd92bdeb07 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
2022-07-20 14:47:09 +00:00
3f245e687c 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>
2022-07-19 21:42:03 +00:00
eccb5c21cc 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
2022-07-19 20:37:55 +00:00
add763797f 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
2022-07-19 20:09:22 +00:00
99e3b8b84e 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>
2022-07-19 18:23:28 +00:00
574d99439d 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: 1cd0e5dd53 ("vnet: distinguish between max_frame_size and MTU")
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I027b76b8d07fb453015b8eebb36d160b4bc8df9c
2022-07-18 21:22:53 +00:00
651cc01b64 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
2022-07-15 12:45:34 +00:00
86f8208af4 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
2022-07-15 12:45:19 +00:00
963e9b583b quic: fix coverity warning
Type: fix
Fixes: 5b4b4c0

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If4bd8f30cd23d862109cab665251ad89804b1734
2022-07-12 18:10:24 +00:00
af82211d33 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
2022-07-12 15:29:23 +00:00
268d7be66b 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
2022-07-12 15:29:23 +00:00
c7d43a5eb1 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
2022-07-12 15:29:23 +00:00
20ac58e5c5 wireguard: fix coverity warnings
Type: fix

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I62f13ee8cb9b86f8106505fd32a03d66c1a73bce
2022-07-11 13:47:31 +00:00
08f39102bf 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
2022-07-08 14:16:38 +00:00
55050c31c2 gre: fix returning the flags in the API
Type: fix

Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: I5ecfb242e5905c9bd8ce19cd9ab6efd657ee14d4
2022-07-06 01:46:35 +00:00
ac199fcd9b 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
2022-07-06 01:46:14 +00:00
972dc17634 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
2022-07-06 03:32:18 +04:00
f8631ce7e8 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
2022-07-01 14:11:10 +00:00
b52bd3a23a vcl: check if listener valid on disconnect cleanup
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie057d0d5a51d3226a1a188cf9d48a5d82dc4a3c7
2022-06-30 18:02:47 +00:00
108abc0320 misc: VPP 22.06 Release Notes
Type: docs
Change-Id: I15971b21fd660b4893218640c0d5e5a5247868f1
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 0d352a97c5)
2022-06-30 18:00:49 +00:00
5b3d543878 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
2022-06-30 17:27:46 +00:00
d50e661d66 sr: SRv6 Path Tracing Sink node behavior
Type: feature
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
Change-Id: I2d3a0211abfee3501d3d77c80da20e67e1e9e133
2022-06-30 13:27:28 +00:00
cd758e6af5 vlib: enqueue_to_next_with_aux implementation
Change-Id: I0e1bb39d765ec3efa7b28ca02fb7beeb23607e51
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-06-29 21:25:26 +00:00
b03eec969f 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>
2022-06-29 21:23:38 +00:00
b0057282d6 sr: code refactor and style fix
Type: refactor
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
Change-Id: Iff5e85952273526d5c9d9e7e73bd2b6c15bcd7f6
2022-06-29 21:20:33 +00:00
ffa7bac6f5 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>
2022-06-29 20:21:27 +03:00
c933bb7e37 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>
2022-06-29 15:28:43 +00:00
0c3ca59e3f hsa: reduce number of preallocated vcl test server sessions
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7afc6116ca9a609992f26d9e78084732bba1b2ea
2022-06-29 14:15:10 +00:00
ab0bf0c0cb 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
2022-06-29 10:34:22 +00:00
422544363c 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
2022-06-29 10:33:41 +00:00
93bc431df3 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
2022-06-29 09:11:41 +00:00
4da8a63a93 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
2022-06-29 09:11:12 +00:00
e1dce37588 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
2022-06-29 09:10:33 +00:00
829bff853e 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
2022-06-29 09:09:37 +00:00
0464310fd3 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
2022-06-29 09:05:51 +00:00
fc20c8e50f session: fix connected udp accepts
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0963bae4b56b08c0a9ab4ee1f2738013217e1fb7
2022-06-28 22:52:51 +00:00
cf5c774b59 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
2022-06-28 21:34:36 +00:00
365fabea1e docs: fix broken links
Type: docs

Signed-off-by: Pratikshya Prasai <pratikshyaprasai2112@gmail.com>
Change-Id: I729de9e18624c63a72ec415a05c55617cb360c47
2022-06-28 20:04:47 +00:00
d699a347c0 ipsec: introduce spd fast path types
This patch introdcues basic types supporting fast path lookup.
Fast path performs policy matching with use of hash lookup
(particularly bihash tries has been used for that purpose). Fast path
lookup addresses situation where huge number of policies is created
(~100k or more). In such scenario adding/removing a policy
and policy matching is not efficient and poorly scales (for example
adding 500k policies takes a few hours. Also lookup time
increases significantly). With fast path adding and matching up to
1M flows scales up linearly (adding 1M of policies takes about 150s
on the test machine vs many hours in case of original implementation,
also matching time is significantly improved). Fast path will not
deal well with a huge number of policies that are spanning large
ip/port ranges. Large range will be masked out almost entirely leaving
only a few bits for calculating the hash key. Such keys will tend to
 gather much more policies than other keys and hash will match most of
the packets anihilating advantages of hashing. Having said that
we also think that it is not the real life scenario.

Type: feature
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I600dae5111a37768ed4b23aa18426e66bbf7b529
2022-06-28 15:04:08 +00:00
815c6a4fbc ipsec: change wildcard value for any protocol of spd policy
Currently 0 has been used as the wildcard representing ANY type of
protocol. However 0 is valid value of ip protocol (HOPOPT) and therefore
it should not be used as a wildcard. Instead 255 is used which is
guaranteed by IANA to be reserved and not used as a protocol id.

Type: improvement
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I2320bae6fe380cb999dc5a9187beb68fda2d31eb
2022-06-28 14:53:07 +00:00
5b4b4c05ff quic:fix crash rx_fifo full or grow
if when the rx_fifo grows, svm_fifo_enqueue() return -4,
stream_data->app_rx_data_len += rlen type conversion occurs,
Finally,stream->recvstate.data_off calculation is wrong.

Type:fix

Signed-off-by: fanxb <fxb_mail@163.com>
Change-Id: Iae11f0c453f32d836f4148d70e3b121545a53a90
2022-06-17 18:16:57 +08:00
d6c3b1f1fc stats: fix prometheus exporter crash on large number of FIB entries
Type: fix

Currently, prometheus exporter may crash because of memory exhaustion
when dumps metrics if the FIB contains large number of routes.

With this fix, increase memory size for prometheus exporter to be able
to handle large number of FIB entries.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ia2b9a665368883c87448deee9bcf8d2ac1168357
2022-06-15 14:42:17 +00:00
15b13813bc docs: fix spelling errors
- also add docs-spell to checkstyle-all make target

Type: fix
Fixes: 5f6422db9

Change-Id: I8e9d7d17a03ee7b55f4e1785983459c43af267f7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-06-14 12:10:12 -04:00
ada7e4eeda ip: reassembly - Add node level stats, fix customapp behavior
Type: fix

Added stats for success and failure cases
Fixed Custom app behaviors for the error / drop cases

Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Change-Id: Id6e981c7be5c5b3cee5af2df505666d5558da470
2022-06-14 12:11:11 +00:00
bbc99f445c build: update makefile for ubuntu 22.04 docker executors
* apt '—force-yes' is deprecated in the version of apt in Ubuntu 22.04
* several Ubuntu-22.04-specific packages (e.g. python3-virtualenv, libssl-dev, clang clang-format-11)
are needed in the current VPP installation as well

Type: fix

Signed-off-by: Saima Yunus <yunus.saima.99@gmail.com>
Change-Id: I96ead90152f692233da812cdc853792bedb47c3c
2022-06-13 19:46:48 +00:00
5f6422db9c docs: cleaning up VPP documents by deleting unnecessary info.
- cleaned up the 'build/run VPP' docs

Type: docs

Signed-off-by: Saima Yunus <yunus.saima.99@gmail.com>
Change-Id: I9dbddbe1932804b8d507cb2f1631cd7116e59072
2022-06-13 18:38:47 +00:00
78f672bbc6 rdma: bump to rdma-core 41.0
Type: improvement

Change-Id: Ifdbb879d3018996c09f0caf55df11038ead173a2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-06-13 11:54:02 +00:00
2d7665758e dpdk: add support allow/block scan mode for vmbus dev
Type: improvement
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: Id3f45968cd24f53350dce365b2cc9b3191ec836f
2022-06-13 11:50:07 +00:00
2211277f3a vcl: fix iperf3 server crash issue when it runs over vpp host stack.
Issue:

Let iperf3 server run via ldp and vcl on top of vpp's host stack. If
iperf3 client connects this iperf3 server with tcp MSS setting option,
iperf3 server will always crash.

Root cause:

When MSS option is specified by iperf3 client, iperf3 server will
recreate the listening socket firstly, then call setsockopt() to set MSS
immediately. Iperf3 code can be referred here:
58332f8154/src/iperf_tcp.c (L186).
However, in vcl layer vpp_evt_q of this recreated session is not
allocated yet. So iperf3 server crashes with vpp_evt_q null pointer access.

Fix:

Add session vpp_evt_q null pointer check in vcl_session_transport_attr().
Add a vcl test case for this MSS option scenario.

Type: fix
Signed-off-by: Liangxing Wang <liangxing.wang@arm.com>
Change-Id: I2863bd0cffbe6e60108ab333f97c00530c006ba7
2022-06-10 18:11:58 +00:00
0d5f1a6c54 vppinfra: fix bihash_8_16 entry format function
Type: fix

Change-Id: I1e8655baaf09b455f7f0052452402a372f738d0f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-06-10 09:55:59 +02:00
c2ab1bdbc7 hsa: allow first segments larger than 4g for proxy
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9c502a491ff56806a2e631f7a4c18903a2e93ab2
2022-06-10 04:31:59 +00:00
c629f90752 ip: improve ip ACL traces
Type: improvement

Change-Id: I85c73cb940d81d0b249eda0d57de135bcd798418
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-06-10 01:09:57 +00:00
f4cfa2a8a0 vppinfra: missing __clib_export for clib_pmalloc_alloc_aligned
Type: improvement
Change-Id: I7489327d8b9c5f69b4ceb2159456f00f8a3612df
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-06-09 16:03:44 +00:00
b3559cef77 udp: add cli to dump registered ports
Type: improvement

Change-Id: Ic949e3136a7cf27011d098a50e91920f83226ea9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-06-08 16:28:29 +00:00
42928beec9 wireguard: increment interface RX counters
Type: improvement

When packets were received and processed successfully, increment the
byte/packet counters for the tunnel interface.

Change-Id: I42855607ac6916de641be42aac86c9942cc97140
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2022-06-08 15:20:29 +00:00
b376e92f44 classify: fix sesssion details api
We were not allocating space for the
variable length payload in the response
message.

Type: fix

Change-Id: I345102f4555f66c5632ab0882ca1dd178e98eb7b
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-06-07 18:30:44 +02:00
96158834db vlib: fix crash on packet on deleted interface
If ip4_neighbor_probe (or any other) is sending packet to a deleted interface,
ASSERT trips and dataplane crashes. Example:

create loopback interface instance 0
set interface ip address loop0 10.0.0.1/32
set interface state GigabitEthernet3/0/1 up
set interface state loop0 up
set interface state loop0 down
set interface ip address del loop0 10.0.0.1/32
delete loopback interface intfc loop0
set interface state GigabitEthernet3/0/1 down
set interface state GigabitEthernet3/0/1 up
comment { the following crashes VPP }
set interface state GigabitEthernet3/0/1 down

This sequence reliably crashes VPP:

(gdb)p n->name
$4 = (u8 *) 0x7fff82b47578 "interface-3-output-deleted”

If the interface doesn't exist, return ~0 and be tolerant of this in the
two call sites of counter_index()

Type: fix
Signed-off-by: Pim van Pelt <pim@ipng.nl>
Change-Id: I90ec58fc0d14b20c9822703fe914f2ce89acb18d
2022-06-07 14:17:44 +00:00
9cca694c8f sr: SRv6 TEF behavior support
Adding support for the SRv6 TEF (Timestamp, Encapsulation and Forward) behavior defined in
draft-filsfils-spring-path-tracing (https://datatracker.ietf.org/doc/draft-filsfils-spring-path-tracing/).

Type: feature

Change-Id: I7f38b593147daf8d27af9c983448cf82947e5bed
Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
2022-06-07 12:37:25 +00:00
1477c7262a wireguard: fix crash by not sending arp via wg interface
Type: fix

Currently, neighbor adjacencies on a wg interface are converted into a
midchain only if one of the peers has a matching allowed prefix
configured. If create a route that goes through a wg interface but the
next-hop address does not match any allowed prefixes, an ARP/ND request
will try to be sent via the wg interface to resolve the next-hop address
when matching traffic occurs. And sending an ARP request will cause VPP
to crash while copying hardware address of the wg interface which is
NULL. Sending an ND message will not cause VPP to crash but the error
logged will be unclear (no source address).

With this fix, convert all neighbor adjacencies on a wg interface into a
midchain and update tests to cover the case. If there is no matching
allowed prefix configured, traffic going such routes will be dropped
because of "Peer error". No changes if there is matching allowed prefix
configured.

Also, fix getting peer by adjacency index.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I15bc1e1f83de719e97edf3f7210a5359a35bddbd
2022-06-05 21:14:09 +00:00
db8dd260d5 hsa: dealloc proxy fifos on right thread
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia66c12e1da126d0d8d101b645e6dc8454c3826d6
2022-06-03 15:21:24 -07:00
7b8d26c136 hsa: refactor proxy session lookup and cleanup
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic68627bbca676cc78b0be05bc1fa0f386f5d27fa
2022-06-03 14:02:24 -07:00
af21b2e699 session: fix double free in CLI
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I646ac946d0b07929dfdd1966a4f4a3b697768040
2022-06-03 12:30:18 +00:00
eaa83c0439 ipfix-export: Fix frame leak in flow_report_process_send()
The flow_report_process_send() function always allocates a frame.
However, when no template_send is needed, template_bi is ~0.
When this happens, no vectors are placed in the frame.  When
the frame is then "put", a check for n_vectors == 0 prevents
the frame from actually being placed back on the free list.
Fix that by using a direct call to vlib_frame_free() when
there are no frame vctors.

Type: fix
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I936b5cea4cb3c358247c3d2e1a77d034a322ea76
2022-06-02 15:27:53 -05:00
512223490a session: make sure fifos are freed on right thread
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3c573641bd95fe899823b66f6c59a2525a18d293
2022-06-01 14:56:15 -07:00
082dc14b4a stats: swap used and total stats
Type: fix

reported stats seem to have mixed up used and total counters

Signed-off-by: Leland Krych <leland.krych@gmail.com>
Change-Id: I221c7b114c0da2ed53171d7f047a4bda07ee6cb2
2022-06-01 14:40:03 +00:00
7c3096dac7 papi: vpp_serializer.py - replace slow bytes() with fast bytearray()
https://docs.python.org/3/library/stdtypes.html

"if concatenating bytes objects, you can similarly use bytes.join() or io.BytesIO, or you can do in-place concatenation with a bytearray object. bytearray objects are mutable and have an efficient overallocation mechanism"

Type: improvement

Signed-off-by: Viktor Velichkin <avisom@yandex.ru>
Change-Id: Id20d337f909cce83fcd9e08e8049bb0bf5970fbc
2022-06-01 14:36:40 +00:00
321bd106a6 vlib: add VLIB_NUM_WORKERS_CHANGE_FN() handler
Allows features to update their data structures after change in number
of worker threads.

Type: improvement
Change-Id: Icd4d197e28608f5bbb1edd13eb624cd98e33cafe
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-06-01 11:34:03 +00:00
dd2f12ba6a ip: unformat_ip_address should no modify its argument on failure
When failing to match an ip address, we should not reset the ip address
that could have been initialized by a previous match.

Type: fix

Change-Id: I026766391eb3eb8230f75f66bf4b681e774741d9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-06-01 08:15:07 +00:00
d1ca70c7e1 nat: disable nat44-ei-in2out-output ttl check
Type: fix

A packet passing through nat44-ei-in2out-output,
has its ttl value validated in earlier nodes.
"ip4-input" node checks ttl for locally generated packets.
"ip4-rewrite" node validates ttl in forwarded packets.

Thus for example, the ED counterpart disables ttl checks
in its "nat44-ed-in2out-output" node.
This patch updates nat44 EI conditions for ttl checks to
those currently used in nat44 ED case, meaning no extra ttl
validation for in2out when output-feature is enabled.

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
Change-Id: Idd15d7c9a746b60c0a6dac5537d00ef10c257fdc
2022-05-31 21:27:02 +00:00
78d24f3e5e vppapigen: fix make go-api for go1.18
This patch updates the go-api-files logic for supporting go1.18.
Notable changes are that `go get ...` changed to `go install`
and that we need to bump the govpp binapigen version to integrate
a go1.18 fix.

This patch also simplifies the cli execution syntax

Type: fix

Change-Id: I1d8aac65490fe3ea4c1965a4775b6bf8d5c05d26
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-05-30 13:15:57 +00:00
776ee6748a build: add python3-pip dependency
- python3 pip module is missing on a new Ubuntu installation

Type: fix

Signed-off-by: Saima Yunus <yunus.saima.99@gmail.com>
Change-Id: I5a9886cd5f9226dc0a968c2f70a7c436a06ddf50
2022-05-27 20:54:34 +00:00
449efe9d05 ip: reassembly - Fixing buffer leaks, corruption in v6 reasm
Type: fix

*Buffer leaks and corruptions during internal errors, either overriding
or missing to add the buffer to the list

Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Change-Id: I1ead1eca1cde10a36d60dbfcfe36ca6375690b03
2022-05-27 17:37:36 +00:00
8b85929fb7 ip: reassembly - pacing reassembly timeouts for v6
Type: fix

Pace the main thread activity for reassembly timeouts, to avoid barrier syncs

Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Change-Id: Iebe9a38d2a7a6471afa6621f12bb545668dc8384
2022-05-26 15:03:47 +00:00
dac97e2c62 docs: update spelling word list and fix typos
- update wordlist and fix typos so that 'make docs-spell' passes
- sort spelling_wordlist.txt
- update docs maintainers list

Type: docs

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I38ac7850c604c323427d2bb6877ea98bd10bcc38
2022-05-25 21:18:35 +00:00
e0301eeb7b misc: Initial 22.10-rc0 commit
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Ia1f2a8006edb8e57545a04a16edfb9704c3e904e
2022-05-25 10:45:43 +00:00
1e167a4aad docs: make docs build incremental
This patch makes the `make docs` directive incremental
avoiding re-running the siphon when the source hasn't
changed, and leveraging sphinx internal cache.
It adds a `make rebuild-docs` directive for cases where
this caching logic might break, e.g. in CI.
The virtualenv doesn't also get recreated on each build,
which might be enough when writing docs, provided
automated process leverage its rebuild counterpart.

Type: improvement

Change-Id: Ie90de3adebeed017b249cad81c6c160719f71e8d
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-05-24 16:58:36 -04:00
26c39878ad tests: fix ipsec sdp cases with parrallel job
Serveral IPSec SPD cases re-use the same test class name,
leads to test error when do parrallel test with TEST_JOBS=16,
change the test class names to unique values.

Type: fix
Fixes: 7cd35f5d68
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: Ia5768654ddb6274531222761cc82b226d97325a9
2022-05-24 18:01:43 +00:00
152a9b6165 tests: fix default failed dir setting
When running tests via run.sh, default setting of None would cause
failed directory symlink to appear in vpp workspace with an ugly name.
This patch places the symlink in temporary directory.

Type: fix
Fixes: b23ffd7ef2
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: Ic1715eba7ac1f82f71855e2aeb9b659d27bbb3af
2022-05-24 16:13:09 +00:00
0bfc222e3d devices: add af-packet v3 api
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I4679acbe4fd4400d57c0a79b0a6c74c8f1639703
2022-05-24 15:09:33 +00:00
337960b8a4 flow: support generic flow and RSS action in vapi
Add generic flow type and rss action type to vapi. It is to support
creating generic flow rule via vapi.

Type: feature

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Ifeaa007679487e02bd2903dc591d80a1caba33bc
2022-05-24 14:04:41 +00:00
69be089900 vppinfra: fix memory trace
Type: fix

reset the memory trace if mem trace is turned on

Signed-off-by: Leung Lai Yung <benkerbuild@gmail.com>
Change-Id: Ib99355b9ed42ff66c720bbea5cbbf03c65820d12
2022-05-24 14:04:06 +00:00
e71492655f vlib: implement aux data handoff
Type: improvement
Change-Id: I20b41537a249a55f01004e45392b34adaa8fd792
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-05-24 14:03:00 +00:00
9a8d3d7107 api: start enum values from 0
C enum values by default start from 0.
All unassigned names should get value as value of previous name plus one.
The problem was that default value was 0 and adding one for the first
value would make generated api files start from 1 instead of 0.

Type: fix

Change-Id: I772d6411435648de3ec514f57025ef1acae87338
Signed-off-by: Filip Varga <fivarga@cisco.com>
2022-05-24 12:36:29 +02:00
d8366d085f dpdk: fix update link state
Type: fix

Correct vnet_hw_interface_t flags update on link state changes.
Currently incomplete set of flags is applied on each change,
only flags related to the most recent change are being set correct.
E.g. setting the link up would erase the duplex part of the flags.

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
Change-Id: I5b95e1c0eaea0c283b108dbf7f809682ec9064eb
2022-05-23 16:33:51 +00:00
8abbdf509b linux-cp: fix display of link_speed
Type: fix

Don't set link speed for tap interface when link speed is unknown

Signed-off-by: Anton Nikolaev <anikolaev@netgate.com>
Change-Id: Ia97277b3bf7c958fa665e4ead8d0e48f02921e69
2022-05-23 15:36:51 +00:00
beafecfc2e ip: reassembly - fixing stepping index in a better way
Type: fix

pool_is_free_index() check is performed only for the first element

Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Change-Id: Icadc715a9b54761ec69805a134a69a262137536d
2022-05-23 09:40:18 +00:00
bc8c210f1d ip: reassembly - adding custom reassembly node
Type: fix

Custom node functionality is missing in v6,  so bringing in similar to v4 functionality into ip6 as well

Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Change-Id: I28b0be2fc55a00bfc0b456b1caaa1dcf5641a44e
2022-05-23 09:39:41 +00:00
096c8cc680 virtio: use the internal hdr offsets of buffer metadata for offloads
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ie63c360f2e42e9e5799f5c536453823ea95ed3b8
2022-05-20 12:46:54 +00:00
cada9eb789 api: refactor api data storage
single struct to hold all api handler, flags, etc.
Provide functions to toggle flags instead of writing directly to
internal data.

Type: refactor
Change-Id: I4730d7290e57489de8eda34a72211527e015b721
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-05-19 18:32:23 +02:00
bf95e3efde ikev2: fix tunnel direction
Type: fix

Change-Id: I480b1fcace1c27a5cb2d2956cec80b379105b55d
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
2022-05-19 14:51:17 +00:00
8b874fc6a8 ip: reassembly - pacing reassembly timeouts
Type: fix

Pace the main thread activity for reassembly timeouts, to avoid barrier syncs

Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Change-Id: If8c62a05c7d28bfa6ac530c2cd5124834b4e8a70
2022-05-19 13:35:33 +00:00
add6a384e9 stats: fix collector updates of symlinks
A node name is not bound to a node index. For example, if an interface
is deleted and re-added, the indexes of its nodes "<itfc_name>-tx"
and "<itfc_name>-output" may change. Thus, when the collector updates
the nodes stats, it should first delete all the symlinks for nodes that
have changed their names before adding new symlinks. Otherwise, it
could attempt to add already existing symlinks or delete valid ones.

Example of a series of command that triggers a crash in the assert
`ASSERT (node_data[i].symlinks[j] != CLIB_U32_MAX);`:

```
create loopback interface
create loopback interface
```
Wait for the nodes stats to update, then:
```
delete loopback interface intfc loop0
delete loopback interface intfc loop1
create loopback interface
create loopback interface
```

Type: fix

Change-Id: Ief8e7135e5c02dc6bc64dc94b76cff21ea9ab3a9
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
2022-05-19 12:30:58 +00:00
14a7442e73 ip: reassembly - increasing the nbuckets for reass
Type: fix

Adding stats from debugging point of view

Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Change-Id: I3118d3fd5d630fad80a42ab960e30459789123cf
2022-05-19 07:17:42 +00:00
01e593e8e5 vppinfra: fix non-vector build on x86_64
Type: fix
Fixes: 56f54af
Change-Id: Id03185953eb16da3a3276d2f21d64499784bbf17
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-05-18 20:10:16 +00:00
9196ed798a misc: update config script in IKEv2 test
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Iba82f8e0f18f3e1e4da57f4c23ba9272e87afd93
2022-05-18 09:46:33 +00:00
3fda200c4c ip: reassembly - increasing the nbuckets for reass
Type: fix

as number of reass contexts increasing based on workers, increasing the number of nbuckets for bihash

Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Change-Id: I83d061a709ecb8845ce745b18d03fdefc795787f
2022-05-18 07:47:39 +00:00
61f6a4c4f0 interface: fix overflow of link speed.
Type: fix

There were several places where mbps were converted to kbps for
link_speed, but often drivers of devices set link speed to unknown
(0xFFFFFFFF) on initialization, so there was multiplication of
link_speed equal 0xFFFFFFFF(UINT32_MAX) by 1000, this provides
overflow of unsigned int, and as result link_speed was equal
4295 Gbps, but actually link_speed is unknown.

Signed-off-by: Anton Nikolaev <anikolaev@netgate.com>
Change-Id: Ib462ed6ed685654af4687041e115bfb74e640f13
2022-05-17 19:42:17 +00:00
59a08e6509 acl: memory leak in acl_fa_session_cleaner_process
The statement
  pw0->pending_clear_sw_if_index_bitmap =
    clib_bitmap_dup (pw0->serviced_sw_if_index_bitmap);
will cause pw0->pending_clear_sw_if_index_bitmap's previous
vector to be gone. Need to free it prior to calling clib_bitmap_dup()

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I20de780e73daea7be17efa0bf660af2592cd4680
2022-05-16 18:54:44 -07:00
86c7856eda flowprobe: add api messages to obtain current state
Type: improvement

With this change:
 - add dump/details messages to obtain interfaces for which IPFIX flow
   record generation is enabled;
 - add get message to obtain parameters;
 - add a new message to set parameters with validation present and to
   correspond with get/set naming;
 - add tests for get/set parameters and dump/details interfaces.

Change-Id: I09f6ec990171ac8bcb9d2f5c92629803b8ab6c28
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2022-05-16 20:53:19 +00:00
99b9639845 ip: format table ids with %u
Type: fix

Change-Id: I69f7e23b23e8cfcfe57ba019862470e0eb4b06db
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-05-16 10:44:45 +02:00
3153f007c0 vlib: exec cli line-by-line processing and script updates
Type: improvement
Change-Id: I82e7c0acc547794bcc7c42f4b8881a8251bf7a9b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-05-16 01:31:54 +00:00
342044a3b5 session: revert "fix session cli maybe parse wrong args if executed in files"
Fixed at infra level.

Type: improvement
Change-Id: I43cf16870c1d2e12189073f7786d62375c46e2c2
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-05-14 00:30:42 +02:00
c50bcbd6c2 vlib: process startup config exec scripts line by line
This fixes long standing annoyance that CLIs with optional args cannot
be executed from file, as they cannot distinguish between valid optional
args and next line in the file.

Multiline statements can be provided simply by using backslash before \n.
Also comments are supported - everything after # is ignored up to the
end of the line.

Example:

 # multiline cli using backslash
show version \
       verbose # end of line comment

packet-generator new { \
   name x \
   limit 5 \
   # comment inside cmultiline cli \
   size 128-128 \
   interface local0 \
   node null-node \
   data { \
       incrementing 30 \
   } \
}

Type: fix

Change-Id: Ia6d588169bae14e6e3f18effe94820d05ace1dbf
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-05-13 16:58:03 +00:00
c0a08cadee dpdk: fix overflow in mtu arithmetic
When the driver's max_rx_pktlen is >= 65536, max_supported_frame_size
overflows and queue creation fails.

Change-Id: If78707cb698adf8619ec44a852dd05d570917577
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: fix
2022-05-13 09:35:13 +00:00
d0e0e06984 tests: fix pnat tests formatting
Type: fix

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I944dc8418e7ab541ae96141c15e04abb33635ac4
2022-05-13 08:34:34 +00:00
e0f901a048 ip: reassembly - Fixing buffer leaks, corruption
Type: fix

*Buffer leaks and corruptions during internal errors, either overriding
or missing to add the buffer to the list

Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Change-Id: I6c2406cff53a741e800e2d05593696f3e9fd6ff5
2022-05-13 07:41:24 +00:00
6f5ddf3461 flowprobe: add support for reporting on inbound packets
Type: feature

Currently, the plugin supports only IPFIX flow record generation for
outbound packets.

With this change:
 - add a new API message for enabling the feature on an interface that
   accepts direction (rx, tx, both);
 - update existing debug command for feature enabling to accept
   direction;
 - update existing debug command for showing currently enabled feature
   on interfaces to display direction;
 - update templates to include a direction field;
 - generate flow records on the specified direction and data path;
 - report direction in flow data;
 - update tests to use the new API;
 - add tests for inbound flows.

Change-Id: I121fd904b38408641036ebeea848df7a4e5e0b30
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2022-05-13 07:34:41 +00:00
0891b6aa44 pnat: add support to wildcard IP Protocol field if not specified
- add pnat_binding_add_v2 which explicitly requires match mask to
  set to PNAT_PROTO if we want to match on IP Protocol
- fix pnat_binding_add backward compatibility i.e. no need to set
  match mast to PNAT_PROTO

Type: improvement

Signed-off-by: Fahad Naeem <fahadnaeemkhan@gmail.com>
Change-Id: I5a23244be55b7d4c10552c555881527a4b2f325f
2022-05-12 07:30:33 +00:00
e2159bd2d3 tests: fix checkstyle-python
Add --check to black to pass back error value and fail checkstyle if
a reformat would occur.

Type: fix
Fixes: d9b0c6fbf7
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I9a1fbe224929fc461ff833a589f73ca06e7cc9d6
2022-05-11 16:25:40 +00:00
d6ea087174 api: revert the changes to atexit for shared memory client
2ca88ff978 introduced the change
into the shared memory atexit, which breaks IPSec tests in some
environments.

Type: fix
Fixes: 2ca88ff978
Change-Id: Ia132cb045e8d66f55e41d29cffdca3458d61096d
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-05-11 13:47:10 +00:00
3ddee3f572 dpdk: clear the RTE_MEMPOOL_F_NON_IO
This mempool flag should be cleared when the mempool is populated, to
reproduce the behaviour of rte_mempool_populate_iova in DPDK 22.03

Change-Id: I4c0e07efca9df2e472e8e393689127c01cf66da2
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: fix
Fixes: 2f132efc3c
2022-05-11 10:46:21 +00:00
d9b0c6fbf7 tests: replace pycodestyle with black
Drop pycodestyle for code style checking in favor of black. Black is
much faster, stable PEP8 compliant code style checker offering also
automatic formatting. It aims to be very stable and produce smallest
diffs. It's used by many small and big projects.

Running checkstyle with black takes a few seconds with a terse output.
Thus, test-checkstyle-diff is no longer necessary.

Expand scope of checkstyle to all python files in the repo, replacing
test-checkstyle with checkstyle-python.

Also, fixstyle-python is now available for automatic style formatting.

Note: python virtualenv has been consolidated in test/Makefile,
test/requirements*.txt which will eventually be moved to a central
location.  This is required to simply the automated generation of
docker executor images in the CI.

Type: improvement
Change-Id: I022a326603485f58585e879ac0f697fceefbc9c8
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-05-10 18:52:08 +00:00
f90348bcb4 nat: improve icmp type detection performance
Replace code with branchless code.

Type: improvement

Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ic38a20ad33483c1c26f90a927f8b963b0ead4a87
2022-05-10 16:03:09 +00:00
bb912f2e25 ip: reassembly: add documentation
Type: docs
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I23008cde47d8b7a531346eab02902e2ced18742a
2022-05-10 16:01:25 +00:00
e63a2d44d1 ip: fix buffer leaks in reassembly
Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I952ba7e042779855e29628d048da7edec1caaafd
2022-05-10 16:01:03 +00:00
fdc17b1ae7 vhost: memory leak upon deleting vhost-user interface
We allocate vring_spinlock for all vrings in the vui, not just the ones
being used. So when we free the vui, we have to free vring_spinlock for
all vrings, not just the one being used.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I3951fda71ce6e11474b04302116ea9e08b404758
2022-05-09 00:35:48 +00:00
01f6c73530 devices: fix crash on invalid interface
Type: fix

A simple "create host-interface name xxx" is enough to trigger the bug:
The interface is not found, and we goto error with apif=NULL

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
Change-Id: I2f894176d39b3d15efab054dc7340e7a0600a2e8
2022-05-08 14:00:11 +00:00
da052b62bd session: fix session cli maybe parse wrong args if executed in files
Type: fix

Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: Id19a52df4f237cf5d85d305fdc279ab7df2d6f4b
2022-05-06 17:46:14 +00:00
0530d09f9e stats: add vlib_stats_free_string_vector
Type: improvement
Change-Id: Ifa9f908b24b5fe867826601d32eeb4f0d639fbeb
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-05-06 12:15:00 +00:00
6d953240bc vppinfra: free vector against its heap
Type: fix
Change-Id: Ie292ee56dd5265a56ef472554aaf086e61da7089
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-05-06 12:14:32 +00:00
4cfb46d4f8 stats: strings in string vector are c strings
Type: fix
Change-Id: I9cf9376f2813f7bceecc6a9d714dcb98df77615d
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-05-06 12:45:11 +02:00
4ba3c0a8d8 dpdk: fix generic flow input parsing in FDIR
This patch fixes the issue that in DPDK FDIR generic flow parsing, the
inputs will be changed during processing, which will lead to a failure
in vnet flow when creating generic flow rules.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I107735a305ff48593d66746e0cd642c76ad5700d
2022-05-05 09:27:36 +00:00
4ebcd95e62 rdma: two small improvements for rdma interface
- fix branch prediction for checking rdma ERROR flag
- add the missing right angle bracket to help message

Type: improvement
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Reviewed-by: Lijian Zhang <lijian.zhang@arm.com>
Reviewed-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I2ce667631b3e3f60939069e2a16ddba0ff12a695
2022-05-05 07:04:01 +00:00
0499d8839d vat2: fix argument parsing
Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I6d40ce90330d644469937a24eec47ea5bd5b649b
2022-05-05 05:34:19 +00:00
e5a3ae0179 policer: output interface policer
Type: improvement

Change-Id: Ibc1b5059ed51c34334340534e9eb68121f556bce
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
2022-05-05 00:19:12 +00:00
0ec1c6dc68 udp: remove buggy assert in udp encap
It looks like in a distant past we were using a vnet_rewrite but this
no longer the case.

Type: fix

Change-Id: Ib8d336aec7d5abd7749f543739f531144e76e551
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-05-05 00:16:27 +00:00
6e7ebb00af tls: free app session if connect notify refused
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iee6784c37a835b49d962ae6f87c279cbe65dde15
2022-05-04 21:05:11 +00:00
08183d7904 vhost: use_custom_mac set in create_vhost_user_if_v2
Type: fix

set use_custom_mac for args in create_vhost_user_if_v2 API
Add testcase for custom mac-address

Signed-off-by: Fahad Naeem <fahadnaeemkhan@gmail.com>
Change-Id: Iac64d818e0f1e6d36187fe769ee33d202aaafd05
Signed-off-by: Fahad Naeem <fahadnaeemkhan@gmail.com>
2022-05-04 15:18:18 +00:00
98ca76ab87 ipsec: support per next-header next-nodes
Type: feature

Change-Id: I940b6c9d206e407f3e17d66c97233cd658984e61
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-05-03 21:59:39 +00:00
77c821ccc6 tests: handle removed interface
Catch exception if sw_if_index is invalid when querying interface
binding config. If the interface is not there, it's surely not bound to
any table ...

Type: improvement
Change-Id: I1f3e04a631653feb5c2350662b6a041adccefa1f
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2022-05-03 15:07:41 +00:00
2ca88ff978 vapi: support api clients within vpp process
Add vapi_connect_from_vpp() and vapi_disconnect_from_vpp()
calls to allow API clients from within VPP process.

Add a new memclnt_create version that gives the user a
knob to enable or disable dead client scans (keepalive).

Type: feature
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Id0b7bb89308db3a3aed2d3fcbedf4e1282dcd03f
Signed-off-by: Ole Troan <ot@cisco.com>
2022-05-02 16:26:24 +02:00
6a2868734c dhcp: fix dhcp_compl_event
This patch fixes two problems:

1. The lease field in the dhcp_compl_event message can include a list of
vl_api_domain_server_t structs, but no memory is allocated for it.
2. The DNS server address is not copied properly, resulting in wrong IP4
addresses in the event message.

Type: fix

Signed-off-by: Jing Peng <pj.hades@gmail.com>
Change-Id: I42c533e7af697568c69714011d983f88368a7e15
2022-05-02 06:46:18 +00:00
39d88cc0d4 build: use env to find bash path
Type: make
Change-Id: I9f87134ac05d99051888024f889f05dae8e3feec
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-29 19:10:24 +02:00
16ca1a9856 vppinfra: fix clib_mem_destroy
Passing wrong pointer to clib_mem_vm_unmap...

Type: fix
Change-Id: I1f695d77bc45d9a6de3a4a3da1fbe6faebdad15e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-29 16:02:43 +00:00
687cf6faf2 tests: fix handling failed test case
Add missing parameter where required.

Type: fix
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I8cd7c31848836e3233cb79d1dd21884167db4354
2022-04-29 09:58:48 +00:00
16ce09db9e tests: fix assert_nothing_captured
Type: fix
Fixes: 26cd0242c9
Change-Id: I9a88221af65f170dc6b1f0dc0992df401e489fa2
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2022-04-29 09:57:47 +00:00
8eeb851d6f build: remove mbedtls from rpm dependencies
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I50dfed0fba3c8547f5c52998cf777f2ed1d2e4a5
2022-04-28 23:11:42 +00:00
39fdefdc90 wireguard: Document wireguard async mode default
Type: improvement
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I446eb86c097d1bf99f05ee47f1c550689d70ced2
2022-04-28 14:51:50 +00:00
07c73690e9 af_xdp: more meaningful frame_size error message
Type: improvement

Change-Id: If3a83848ae0741334887c654b65e424b99caa73c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-04-28 14:45:22 +00:00
975e0dfe16 session: fix coverity warning
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I67f5a2c8902dd14c09472c25599b3b1b493a6948
2022-04-28 14:09:15 +00:00
ed1f9adad7 vapi: Fix build when directory contains @
During build some header guards are created based on full path where
build is happening.  If one directory contains @ character build breaks
because compiler believes it's a macro declaration.

Jenkins adds `@${EXECUTOR_NUMBER}` suffix to workspace directory when
it uses more than one executor for that job, breaking the build.

Replace any @ character on guard name by _ to get it fixed.

Type: fix
Change-Id: Id0f4cfc33fda95e168541aa4e353a0d08aa3b664
Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
2022-04-27 17:54:50 -03:00
3bad8b62d8 linux-cp: sync addr and neigh only for lcp interfaces
Type: fix

Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
Change-Id: I792467b73449074e59c4232b1f82d134c399624c
2022-04-26 21:55:01 +00:00
c69655e3bd libmemif: timer causes spin at 100% cpu
In case of timer is set and expires:
1. timer_fd is readable and stay readable.
2. timer_fd is part of epoll_fd set. This makes epoll_pwait()
   calls return immediately instead of sleeping.

Type: fix

Signed-off-by: Daniel Béreš <dberes@cisco.com>
Change-Id: I9b228464fe45b83def9b182c885d6febf428049c
2022-04-26 15:46:00 +00:00
b95e6d4e75 flow: enable RSS queue group action for 5G enhancement
Enable the flow action for RSS queue group. Packets can be distributed
among queues in group based on specific fields. Queues must be continous
in the group. This feature is to support 5G enhancement requirement.

Type: feature

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I74fdc617659bcb61f00b3b1934c95ab1c73bb8f3
2022-04-26 15:45:07 +00:00
d82f471a05 session: export session counts to stats segment
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I02aec410eaa7ccb999159b6967414fbaf4e76a3f
2022-04-26 15:10:14 +00:00
c5d81b91be stats: string vector and node collector improvements
Type: improvement
Change-Id: Ibdadeb4e685f45a93f45504a84709391489abb6a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-26 10:32:11 +00:00
45e0539639 build: add option to build only for native CPU
Significantly reduces compilation time for uses who are interested
to run binaries only on the build machine.

Type: make
Change-Id: I431f6f7374b6dfa8b3f7c72dc69f3d5cafd1f6bb
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-25 13:49:37 +02:00
4e6222d598 build: fix 16-8-8 mtrie build option
VPP_IP_FIB_MTRIE_16 should be defined only if the option is enabled
instead of being defined as "ON" or "OFF".

Type: fix

Change-Id: Ib4e29a827bcbd84c8012f05ad264c1408ffccee7
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-04-24 13:11:27 +00:00
a0d5433a6c hsa: vcl test client epoll worker loop
Supports more connections and track connect time. Can be used to measure
CPS. Only works in unidirectional mode for now.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I70bc6a271996407dd16a96115f509bd680a0f302
2022-04-21 18:17:11 -07:00
94ba931b32 session: fix ctrl evt rpc elt pool realloc
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I79bfe91e81983b619c61a32285d8e038c2654147
2022-04-22 01:05:06 +00:00
80d100cd59 session svm: fix mq producer wait on q and ring
Make sure producer drops lock when it waits for empty ring slot.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id77d54ee8c01bed20c9eaf5ad372ed4b1e9fa712
2022-04-21 16:48:15 +00:00
5297447bd6 nat: tweak rfc7857 tcp connection tracking
The RFC7857 state machine introduced in 56c492a is a trade-off.
It tries to retain sessions as much as possible and also offers
some protection against spurious RST by re-establishing sessions if data
is received after the RST. From experience in the wild, this algorithm is
a little too liberal, as it leaves too many spurious established sessions
in the session table.

E.g. a oberserved pattern is:
client      server
         <- FIN, ACK
ACK      ->
ACK      ->
RST, ACK ->

With the current state machine this would leave the session in established state.

These proposed changes do:
 - require 3-way handshake to establish session.
   (current requires only to see SYNs from both sides)
 - RST will move session to transitory without recovery if data is sent after
 - Only a single FIN is needed to move to transitory

Fixes: 56c492aa05
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I92e593e00b2efe48d04997642d85bd59e0eaa2ea
Signed-off-by: Ole Troan <ot@cisco.com>
2022-04-21 10:35:58 +00:00
e0c875551f devices: remove redundant access in af-packet input
Type: fix

current_data is set to 0 for each packet in af-packet input node.
It is not required to include it to calculate the headers offset.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I538d8c04e24c758155b3f8d6a1532472ef549459
2022-04-19 12:39:12 +00:00
8c2bdf8619 session: add support for listen proxies
Listener proxies are allowed to listen on IPs that are not local.
Configurable only by builtin apps for now.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idb380ee3584a088878a03d45fd85e7bb0deeb590
2022-04-18 21:19:24 +00:00
1afa2b62ce nat: fix deleting nat ei out interface feature
Type: fix

Set is_add function argument to 0 when deleting interface role.

Change-Id: I6ca88d6511e1c88285e51b3750eb501fde2b341b
Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
2022-04-18 19:28:17 +00:00
66d6146ad5 rpm-packaging: remove mbedtls dependency
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idf325b7f1ce75e973dbea4d5836609590c85dc38
2022-04-18 16:22:15 +00:00
515aa75112 hsa: vcl test client allow non-blocking connects
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If7dd56e76efc31ed66b865e2c7231d22ec2322b4
2022-04-16 11:03:23 -07:00
9fda33da5c hsa: support configurable vcl client wrk loop
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5e49f43b18ff011ce0b7259ed58854d81f910826
2022-04-15 17:53:52 +00:00
4b922ff051 stats: store heap in the directory_entry vector
Type: improvement
Change-Id: I878803d14d1070ef5a00ed9d3f72022906d55191
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-15 17:53:11 +00:00
8cb5d36c7e build: c compiler version warnings
Type: make
Change-Id: I9455da47f03383df822436d1adc4c4b5e58c7cf9
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-15 17:52:43 +00:00
105cb1e4cf api: fix infinite loop in show api dump CLI
The following illustrates the problem:

./build-root/install-vpp_debug-native/vpp/bin/vpp api-trace { on } unix { cli-listen /tmp/vpp-api-cli.sock } plugins { plugin dpdk_plugin.so { disable } }
sleep 5
./build-root/install-vpp_debug-native/vpp/bin/vppctl -s /tmp/vpp-api-cli.sock show version
./build-root/install-vpp_debug-native/vpp/bin/vppctl -s /tmp/vpp-api-cli.sock show api dump file /tmp/api-table.master-api-baseline compare

The last CLI hangs in an infinite loop.

Fix the typo which got in during the conversion of _vec_len to read-only:

.@@ -1285,7 +1285,7 @@ extract_name (u8 * s)
.   rv = vec_dup (s);
.
.   while (vec_len (rv) && rv[vec_len (rv)] != '_')
.-    _vec_len (rv)--;
.+    vec_dec_len (rv, 0);
.

Type: fix
Fixes: 8bea589cfe
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I4f895348ae0ebaaba9da97c3a440912d38210f10
2022-04-15 15:46:57 +00:00
8b153de6cd vlib: disable cpu pinning if not configured
In some environment like when running a lot of functional tests, it can
be useful to run more VPP instances than CPU and let the Linux scheduler
decide what to do. This change disable cpu pinning altogether in the
single-threaded case, provided that no main-core is explicitely
specified in the config

Type: improvement

Change-Id: I8c2f36fdd49c00f9adaaeb4c81aefb27c3420a9b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2022-04-14 19:20:43 +00:00
aad4298df0 gtpu: fix memory leak
Type: fix

Free the old rewrite string before assigning a new rewrite string for the updated new tteid value.

Signed-off-by: Leung Lai Yung <benkerbuild@gmail.com>
Change-Id: I1ec19bce6afda3dfdc31c8724b32ac7b9bc84e89
2022-04-14 17:56:09 +00:00
b909dfc27e build: Ignore buildinfo file
During deb package build, a .buildinfo file is created at build-root.
Add this to .gitignore.

Type: make

Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
Change-Id: Id86c21e22aa2b9e4b559cfc0bc662de835fa1621
2022-04-14 17:53:49 +00:00
7cd35f5d68 ipsec: perf improvement of ipsec4_input_node using flow cache
Adding flow cache support to improve inbound IPv4/IPSec Security Policy
Database (SPD) lookup performance. By enabling the flow cache in startup
conf, this replaces a linear O(N) SPD search, with an O(1) hash table
search.

This patch is the ipsec4_input_node counterpart to
https://gerrit.fd.io/r/c/vpp/+/31694, and shares much of the same code,
theory and mechanism of action.

Details about the flow cache:
  Mechanism:
  1. First packet of a flow will undergo linear search in SPD
     table. Once a policy match is found, a new entry will be added
     into the flow cache. From 2nd packet onwards, the policy lookup
     will happen in flow cache.
  2. The flow cache is implemented using a hash table without collision
     handling. This will avoid the logic to age out or recycle the old
     flows in flow cache. Whenever a collision occurs, the old entry
     will be overwritten by the new entry. Worst case is when all the
     256 packets in a batch result in collision, falling back to linear
     search. Average and best case will be O(1).
  3. The size of flow cache is fixed and decided based on the number
     of flows to be supported. The default is set to 1 million flows,
     but is configurable by a startup.conf option.
  4. Whenever a SPD rule is added/deleted by the control plane, all
     current flow cache entries will be invalidated. As the SPD API is
     not mp-safe, the data plane will wait for the control plane
     operation to complete.
     Cache invalidation is via an epoch counter that is incremented on
     policy add/del and stored with each entry in the flow cache. If the
     epoch counter in the flow cache does not match the current count,
     the entry is considered stale, and we fall back to linear search.

  The following configurable options are available through startup
  conf under the ipsec{} entry:
  1. ipv4-inbound-spd-flow-cache on/off - enable SPD flow cache
     (default off)
  2. ipv4-inbound-spd-hash-buckets %d - set number of hash buckets
     (default 4,194,304: ~1 million flows with 25% load factor)

  Performance with 1 core, 1 ESP Tunnel, null-decrypt then bypass,
  94B (null encrypted packet) for different SPD policy matching indices:

  SPD Policy index    : 2          10         100        1000
  Throughput          : Mbps/Mbps  Mbps/Mbps  Mbps/Mbps  Mbps/Mbps
  (Baseline/Optimized)
  ARM TX2             : 300/290    230/290    70/290     8.5/290

Type: improvement
Signed-off-by: Zachary Leaf <zachary.leaf@arm.com>
Signed-off-by: mgovind <govindarajan.Mohandoss@arm.com>
Tested-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: I8be2ad4715accbb335c38cd933904119db75827b
2022-04-14 12:46:51 +00:00
e1fd3903ef crypto-openssl: use getrandom syscall
The sys/random.h header, which provides the getrandom syscall wrapper,
was only added in glibc2.25. To make it compatible with older version,
we can directly call the syscall.

Type: improvement
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: I93c5f8a49c0323511a4e34273f0b3c0e24663bfd
2022-04-13 16:50:03 +00:00
6da7740154 vppinfra: fix GCC 7.3 build error with asm inline
GCC added asm inline in 8.3, so we change asm inline to asm volatile.

Type: fix
Fixes: d5045e68a7 ("vppinfra: introduce clib_perfmom")
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: I9f7781ba9de66211404348ff477a17059b408a78
2022-04-13 13:30:41 +02:00
46f1dbc198 build: fix rpm build nasm not found
Type: make
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I7ac1d0472edf8d48eac21a7b580a06456bf60c30
2022-04-13 09:26:33 +00:00
a80a5b00aa vppinfra: fix clang-10 build error with asm inline
clang start to support parse asm inline from clang-11,
Use asm volatile instead.

Type: fix
Fixes: d5045e68a7 ("vppinfra: introduce clib_perfmom")
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I00e5e19856caaed94e22f8fa6cf4f918483976a4
2022-04-13 14:13:08 +08:00
e4fa1d2f6b vppinfra: vector perf improvements
Type: improvement
Change-Id: I37c187af80c21b8fb1ab15af112527a837e0df9e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-12 22:40:52 +00:00
65e770d895 ip: fix arc start in ip46-local for local mfib entries
Type: fix

After changes made in f840880, VRRP IPv6 cannot reply for neighbor
solicitations requesting the link layer address of the configured
virtual address.

VRRP IPv6 enables the vrrp6-nd-input feature in the ip6-local feature
arc for an interface on which a virtual router is configured. When
neighbor solicitations arrive on that interface, ip6-local should start
feature arc walk for that interface and the messages should be processed
by vrrp6-nd-input. The problem is that currently, the feature arc is
started for the interface obtained from the receive DPO that has
interface unset (i.e. max u32) for local mfib entries. Thus, the feature
arc is started not on the interface the messages were received on and
vrrp6-nd-input is not traversed.

With this fix, if interface obtained from the receive DPO is unset, use
RX interface from the buffer to start the ip46-local feature arc.

Also, enable tests of this case for both IPv4 and IPv6 address families
that are currently tagged as extended and not run on every change. They
configure VRRP with priority 255 and are expected to be stable.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I11ef3d5a7a986e04431e8613d1510b8666094bd7
2022-04-12 16:06:43 +00:00
d0249ebcb2 hsa: fix coverity warning
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9cf21ee7ad363dd1af5ca75f07bfe38d8fe749f9
2022-04-12 07:34:35 -07:00
c15fc34b8f hsa: vcl test client option to close only client
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I45c63e0a7d7179a0f27ca3f093bd3cf7458a12d3
2022-04-12 08:06:16 +00:00
c792b9f5e9 tcp: limit persist segment size if window available
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie1ae401d5105aa42761d3cac5dfbe523f3995c87
2022-04-12 08:06:02 +00:00
679c0de84e tests: fix bihash unit test threads count
In test_bihash_threads, if a test thread fails to be created,
it is still counted towards the total thread count, which could
lead to never-ending test loop. This patch fixes the issue.

Type: fix

Signed-off-by: Jing Peng <pj.hades@gmail.com>
Change-Id: Ic0f1d4dde9c5ea672b52f0e2e49f16d42f982b77
2022-04-12 08:05:43 +00:00
98859a41a4 teib: use nexthop table id
Use the specified nexthop table id instead of the interface table id.

Type: fix

Change-Id: I61bf61d50d2716fcd9a6e35df4d60222dc4f36d5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-04-11 19:03:42 +02:00
f21710c6e2 interface: fix the offloads
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I9f3d1a8574b15f09a458baad98c815e087fd60b8
2022-04-11 16:01:20 +00:00
179711d869 tls: fix connected notifications with no app wrk
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I805131b4e3d0cb2fab1d3bf76db659c67522c2e8
2022-04-11 10:07:31 +00:00
c520dcb49f tests: fix bihash unittest error reporting
This patch fixes test_bihash_unittest in two ways:

1. The number of searches, namely tm->search_iter, defaults to 0,
thus disabling the test. This patch changes the default to 1.

2. Test errors are reported by clib_warning() instead of being
returned, thus the caller test/test_bihash.py  is never aware of them.
This patch returns the errors constructed by clib_error_return().

Type: fix

Signed-off-by: Jing Peng <pj.hades@gmail.com>
Change-Id: I60e99a829ebe6aa2a56e7a9332cf973afa100311
2022-04-11 10:07:19 +00:00
c73984a0fc devices: refactor fanout support
Type: refactor

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I9e68ecb91f6433f68a8a87dd066f3e369f25a3c9
2022-04-11 07:22:26 +00:00
9a93bc14b5 build: add clang-14
clang-14 is default for Upcoming Ubuntu 22.04 LTS...

Type: make
Change-Id: I65328d0e90a4c13d5766e51da8b90a8899b773d9
Signed-off-by: Damjan Marion <dmarion@me.com>
2022-04-10 20:20:48 +00:00
2f13076de7 devices: fix the offset for af-packet
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I12b2e53ddb797cc809a2d742d17a1a60edde385d
2022-04-08 17:52:31 +00:00
6120441f9f linux-cp: fix setting mtu on hardware interfaces
Type: fix
Fixes: 616447c392

In lcp_router_link_mtu(), either vnet_hw_interface_set_mtu() or
vnet_sw_interface_set_mtu() is called, based on whether this appears to
be a physical interface. The test to determine whether this is true was
incorrect and probably never worked right so vnet_sw_interface_set_mtu()
was always being called. This causes some breakage with Recent changes
to code which manages interface MTUs. Fix the test so the right function
is called.

Change-Id: I1ecccbce37d5a1e53b2349ed40f3d0d27eb03569
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2022-04-08 16:18:33 +00:00
90998bc002 dpdk: add multi-txq support
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I9f061a05d947bc2867e1b962bf0522ad344bcc1a
2022-04-08 16:17:49 +00:00
bf91b48cbb build: opensuse: remove nasm, change to clang
Type: make

Signed-off-by: Laszlo Kiraly <laszlo.kiraly@est.tech>
Change-Id: I3951be5be95a7fb76f54c4ce0daab0748cb8419c
2022-04-08 16:16:19 +00:00
1c8c6d302a stats: fix vector overrun in expend check
Do not access allocated elements beyond the end of the vector. They are
allocated, but not yet valid both logically (they are at best NULLs) and
according to ASAN.

Type: fix
Change-Id: Iaf43767d6d3bd4c24c7c5a0ba9b3410bbeeb0556
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
2022-04-08 16:15:32 +00:00
d5045e68a7 vppinfra: introduce clib_perfmom
Type: improvement
Change-Id: I85a90774eb313020435c9bc2297c1bdf23d52efc
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-08 15:53:10 +00:00
dfc4316407 vppinfra: clib_interrupt_get_next reading unallocated memory
The clib interrupt structure has a couple of fields at the start of
the cacheline, and then in the next cacheline it has a bitmap, which
is then followed by an atomic bitmap.  The size of the bitmaps is
based on the number of interrupts, and when the memory is allocated
the number of interrupts needed is used to size the overall block of
memory. The interrupts typically map to pool entries, so if we want
to store 512 entries then we store them in indices 0..511. This
would then take 8 6 4bit words, so each bitmap would be this size
when the struct is allocated.

It is possible to walk over the end of the allocated data with certain
sizes, one of which is 512. The reason this happens with 512 is that
the check to see when to exit the loop is returning when offset is
greater than the value needed to fit all the values.  In this case
512 >> 6 = 8. If there had only been 511 entries then the size would
have been 511 >> 6 = 7, and so it would have fitted in the space.

Therefore modify the check to also check that we are not looking into
the memory beyond what we have allocated in the case where the
number of interrupt is one of the boundary values like 512.

Also add a similar check first time round the loop as it is
possible we could have ate same problem there too.

Add a new test file to verify the new code works. The old version
of the code made this test fail when run with the address
sanitizer. Without the sanitiser it tended to pass because the
following memory was typically set to 0 even though it was
uninitialised.

Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I2ec4afae43d296a5c30299bd7694c072ca76b9a4
2022-04-08 15:35:39 +00:00
853530b528 vppinfra: add bright colors to format_table
Type: improvement
Change-Id: I21de21af6dea9e39df5e912e20e56d878a40659f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-08 15:24:28 +02:00
ba2f55154c api: Do not assert of short message lengths
Type: improvement

Short message lengths are correctly handled by the code, asserting makes unit tests that verify this behaviour (e.g. test_ip_punt_api_validation) fail/crash with a debug image.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ib3a377e5d49fde0eee252b92f0e58a8a0d0d83ec
2022-04-08 12:09:45 +00:00
1cbcdcef20 tls http: run config fns after init ones
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia4d8aaafeb3629f421601edffefe9c61c3e69dba
2022-04-07 16:11:06 +00:00
e0c0280d9b tls: fix session pool realloc on accept
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I68ada775810bb4a4f280962a979605b211562a52
2022-04-07 14:44:28 +00:00
788676b211 devices: add cli support for checksum and gso disable
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I33a29cf11998736347eca5016eee112619d847c1
2022-04-07 11:22:41 +00:00
43daea8309 vppinfra: add vec_new_heap()
Type: improvement
Change-Id: Iab3d65b6276829ad1e522e66380d1797e37579b8
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-06 12:22:20 +00:00
2b6479c07e devices: add cli support to disable qdisc bypass
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ie5f2bdb8fb559680bab863a7c24a49360e005b58
2022-04-06 11:42:08 +00:00
eecec8ceba stats: avoid linear search for empty entry
Type: improvement
Change-Id: Ie4cdc6d8906da3d1cd18a8f1d7076283546d3003
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-06 11:25:03 +00:00
8271dfdff3 interface: unregister node counters on interface delete
Type: fix
Change-Id: I2562ae5833b542c29bcd5025a9a6756e5de95a42
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-06 10:52:42 +00:00
6e061e784d vppinfra: add MAX macros for clib types
Type: improvement
Change-Id: I1bca733d2a35733275efa46ee0a23bf572365c74
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-06 12:08:40 +02:00
3791a034d1 vlib: clear frame flags on free
Type: fix

Change-Id: If4a7ac244832ef72d82c71b0277bc110b9500537
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
2022-04-06 08:28:13 +00:00
aa659ef5c3 build: remove nasm
Type: make
Change-Id: I5ee34e9d7156ccdc7a8310e8332347d850459495
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-06 08:19:14 +00:00
4ab55146ae wireguard: prevent segfault on non-adj packets
An unexpected packet that shows up on a Wireguard interace
that happens not to have a forwarding peer will cause a
segfault trying to index the vector of peers by adjacency.
Rather than segfaulting, recognize a non-adjacent packet
and drop it instead.

This leaves open the question of what _should_ be
happening to, say, IPv6 multicast packets.

Signed-off-by: Jon Loeliger <jdl@netgate.com>
Type: fix
Fixes: edca1325cf
Change-Id: Ic0a29e6cf6fe812a4895ec11bedcca86c62e590b
2022-04-05 14:16:31 -05:00
2f132efc3c dpdk: bump to DPDK v22.03
This patch bumps dpdk version from 21.11 to 22.03.

Type: feature
Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Change-Id: I152a7857378371d3fd26d7473421c2b3113cd3ee
2022-04-05 16:16:30 +00:00
3a183dbe45 dpdk: macros changes for dpdk 22.03
New dpdk version deprecates some macros used by VPP.
This patch changes them to 22.03 version.

Type: improvement
Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Change-Id: Ic362ed318dc1ad88bb682ef13fbd6159171fbaef
2022-04-05 16:16:30 +00:00
c233bc3581 dpdk: compatibility layer for dpdk 22.03 bump
New version of dpdk changes some macros names.
This patch ensures VPP will be compatible with older dpdk versions.

Type: improvement
Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Change-Id: I3d9736278e70064610a1dcad5f2d2f6eb26e0d4b
2022-04-05 16:16:30 +00:00
57eb4b6269 dpdk: fix max frame size
Type: fix
Change-Id: I70f9ec2eb6c9c1494a4ecd56e06898f6162a0e0e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-05 16:02:30 +00:00
35cf8aa93b nat: nat44 cli bug fix
Two similar CLI paths "nat44" and "nat44 add interface address"
caused unexpected behavior. If "nat44 add interface address"
command would fail the vlib cli processing function would
call "nat44" handler. This would also clean any previously
set errors from the first command and basically return
same error returned by "nat44" handler for every failed
command that starts with the same path string.

Fixes nat44-ed and nat44-ei plugin.

Change-Id: I1aac85c8ae2932da582a2b78243521d1bf8a0653
Ticket: VPP-2021
Type: fix
Signed-off-by: Filip Varga <fivarga@cisco.com>
2022-04-05 15:07:14 +00:00
79934e855f vppinfra: refactor address sanitizer
Type: refactor
Change-Id: I5ca142ec1557d5b5c3806b43553ad9d3b5ea1112
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-05 14:46:15 +00:00
0c740a6d8a tap: fix the coverity warning
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I609fb28e58286ff490d12384b03dd713830379b3
2022-04-05 14:23:02 +00:00
61a2c8939d devices: remove redundant code af-packet
Type: refactor

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Id485f525057163582dc7a83f7dab7a8b2e759270
2022-04-05 14:17:38 +00:00
a94563e128 devices: fix the received blocks counters
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: If7d9c94dcdc32fa66763e18bd3be7d28b2d17946
2022-04-05 14:16:51 +00:00
fd78a1f65b crypto-openssl: use getrandom to reseed openssl
Type: improvement

Change-Id: I84d594d8baaf18056580455f3b2790d0f31b7b0f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-04-05 11:37:22 +00:00
024a21d920 rdma: bump to rdma-core 39.1
Type: improvement

Change-Id: I638b67cddf2d1b573002b494a555c0b1ab94181f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-04-05 11:37:02 +00:00
b46334bf05 vppinfra: use AVX512 compare for equality testing
This commit only update is_equal flavours to use
_mm512_cmpneq_epi64_mask() but clang-format decided to also reformat the
whole block.

Type: improvement

Change-Id: I530cf91e8bceaf15022556f803b27de4f8583217
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-04-05 11:36:42 +00:00
3ce1d14e1f devices: fix the coverity warnings for af-packet v3
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ie647fb280831af23925c4b5f659f1dade6d37eff
2022-04-05 11:31:05 +00:00
a117c01c2b build: ./configure basic cross-compilation support
$ sudo dpkg --add-architecture arm64
[update APT sources.list]
$ sudo apt install qemu crossbuild-essential-arm64 libssl-dev:arm64 libuuid1:arm64 libnl-3-dev:arm64 libnl-route-3-dev:arm64
$ ./configure -w -a aarch64
$ ninja
$ uname -m
x86_64
$ bin/vpp unix interactive
    _______    _        _   _____  ___
 __/ __/ _ \  (_)__    | | / / _ \/ _ \
 _/ _// // / / / _ \   | |/ / ___/ ___/
 /_/ /____(_)_/\___/   |___/_/  /_/

vpp# show cpu
Model name:               armv8
Microarch model (family): unknown (implementer 0x55 part 0x32c PASS 89.1519459600)
Flags:                    fp asimd aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve
Base frequency:           .06 GHz
vpp#

Type: make
Change-Id: Ib8bf2c7e38f109db42225db2e3182ceb8871baaf
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-05 12:33:48 +02:00
8bea589cfe vppinfra: make _vec_len() read-only
Use of _vec_len() to set vector length breaks address sanitizer.
Users should use vec_set_len(), vec_inc_len(), vec_dec_len () instead.

Type: improvement
Change-Id: I441ae948771eb21c23a61f3ff9163bdad74a2cb8
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-04 23:17:13 +00:00
a2b358b1fa udp: use pool safe reallocs
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5bd0b300af07424d1ce4807fa0b17e375001f089
2022-04-04 22:30:48 +00:00
b01873208b tcp: use safe realloc pool
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8ba93643236aaa50eeb4755b74821a8c4ca6179b
2022-04-04 22:30:17 +00:00
72c04bb7df interface api: restore order of context value
vl_api_sw_interface_tx_placement_get_t_handler is autoendian.
So (contrary to most other uses) the context is in native order there.
Thus, send_interface_tx_placement_details needs to convert back
before using REPLY_MACRO_DETAILS5 macro.

Type: fix
Fixes: 0d05c0d214

Change-Id: I00a3734cafa66d7d76c7edaea526a1eae0448ad9
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2022-04-04 22:29:43 +00:00
86aabbbeee tls: set client ckpair only for non-test ckp
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7287e40ad95dfe061fd8a7b0e99921d5540e030d
2022-04-04 22:28:56 +00:00
13f34ba4ab tls: null terminate openssl chiphers
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5d4e68730a75337a2e532e72f366b62d6973235e
2022-04-04 21:24:45 +00:00
564005b094 vlib: remove unused fields
Type: refactor
Change-Id: I449fcea92a1c96dd7dd0bcad893060ad1c614351
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-04 19:12:10 +00:00
2e90b299ac vlib: improve exec path search
Fixes VPP invocation with relative path, i.e.:

$ bin/vpp unix interactive

Type: improvement
Change-Id: I0278710bb472b92e31389b2d28955c3d33550230
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-04 19:12:10 +00:00
0dde175732 session: use session layer rpc for evts sent to main
Fix race with connects for iperf3 udp test.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ief725b80047911e87ba24736dc0a60aa8bcdac50
2022-04-04 19:08:47 +00:00
c7ef4f391b vlib: fix memory leak in load_one_plugin
Type: fix
Fixes: 500ba9f
Change-Id: I32872a084276d9b38ff07cdccccb746c0212777f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-04 18:06:15 +02:00
8b231fbe9a vppinfra: fix alloc and alignment in fifo
Type: fix
Change-Id: Ia9f715f6074c72ff581fba1740273cfebe48c0f1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-04-04 16:53:48 +02:00
5a7aa51f00 devices: add multi-queue support for af-packet
Type: feature

Change-Id: I0f4e6517fcfa07ffb0aba89b159ac1337937a508
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2022-04-04 14:22:36 +00:00
3414977152 interface: read only one line in show hardware
Type: fix

Change-Id: I442496585fc24b7458535ad1a1d8db525c258540
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2022-04-04 12:46:20 +00:00
5e06e4f311 svm: Close client shm fd
Type: fix

Signed-off-by: Emmanuel Scaria <emmanuelscaria11@gmail.com>
Change-Id: I41bb6e16735b77efa744b0368eed7dfa9583e960
2022-04-03 16:39:25 +00:00
7539e4b552 vrrp: add stats support and update API
Add simple counter statistics to VRRP, based on a subset of those
defined in RFC8347.

Add an update API that allows in-place modification of an existing
instance. The method returns a vrrp_index which can be used both for
retrieving statistics and to modify non-key parameters. Also add a
delete method which will take that vrrp_index as parameter.

Type: improvement
Signed-off-by: Emanuele Di Pascale <lele84@gmail.com>
Change-Id: I2cd11467b4dbd9dfdb5aa748783144b4883dba57
2022-04-01 18:10:35 +02:00
2518dca440 dpdk: fix vlan creation on ixgbe
Type: fix

VLAN programming is currently enabled for IXGBE. However, that is only
supported for IXGBE_VF.

With this fix, disable VLAN programming for IXGBE.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I37b1d0733988c964d2b0f5a49328effacec1cb6f
2022-04-01 15:49:38 +00:00
d2c8dcfd8f dpdk: fix coverity issue
Type: fix

This patch fixes the following DPDK plugin issue:

CID 253333:  Control flow issues  (DEADCODE)

The change also includes some cosmetic changes for error
handling.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: I830020bc3ae9a508f3a905f78333fa3ae25ce784
2022-04-01 15:42:23 +00:00
d3915dc1b5 session: leverage new pool functions in safe realloc
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2c264c31d2470b11b94d68411fa8266387319146
2022-04-01 15:40:34 +00:00
691c630b79 nat: VRF routing & FIB improvements
This patch affects how destination fib is choosen during session
creation. Default behavior of choosing fib based on output
interfaces is kept.

Configuration gives you the ability to change default behavior
to direct or restrict traffic between different FIB tables.

NAT specific VRF routing options:
a) keeping communication in the same VRF
b) option to add multiple destination VRFs
c) option to control the resolution order of destination VRFs

TX FIB resolution is based on looking up RX FIB entry in NATs
VRF table and picking the first FIB that resolves
destination address.

Ticket: VPP-2009
Type: improvement

Change-Id: If500c48d7ce3466533ad9581c0847870788fc4fb
Signed-off-by: Filip Varga <fivarga@cisco.com>
2022-04-01 13:26:04 +00:00
b68108203a nat: nat44-ed cleanup & fixes
Set deprecated option on unsupported API calls.
Cleaned up API calls with deprecated option. Removed
in progress option from long term used API calls.

Removed obsolete/unused nodes, functions, variables.

Fixed set frame queue nelts function. Calling API
would incorrectly not fail even though frame queue nelts
can only be set before first call nat44_plugin_enable.

Moved all formatting functions to _format.c file.

Type: refactor
Change-Id: I3ca16e0568f8d7eee3a27c3620ca36164833a7e4
Signed-off-by: Filip Varga <fivarga@cisco.com>
2022-04-01 13:26:04 +00:00
9a485d01fa tls: enable host verification by hostname
Type: improvement

Signed-off-by: satna <satbeervarma9596@gmail.com>
Change-Id: I1b1db60fa1a0e47fce273bc07b01887813fd3c48
2022-04-01 06:45:40 +00:00
2473858233 vppinfra: vectors with non-default heap
Type: improvement
Change-Id: Ic675ad4edbf27b7230fc2a77f00c90c46d6350c3
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-31 20:50:21 +00:00
4b20830b49 vlib: add support for workers sync
Adds api that allows workers to synchronize through main thread.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1e75e2fb5144d397d19b13c4dfc7e937f11c044c
2022-03-31 20:24:50 +00:00
b3a5b39efb stats: use vlib_stats_validate in collector
Type: refactor
Change-Id: Ib2bf9f11209eb310b289b3202b2beeccc3637df0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-31 18:32:33 +02:00
66c858385f stats: convert error counters to normal counters
Change-Id: I9794da718805b40cc922e4f3cf316255398029a9
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Ole Troan <ot@cisco.com>
2022-03-31 15:51:26 +00:00
8f60318aca session: fix coverity warning
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6ddb172d7b4f0ba06b0117d71853a22702a3466b
2022-03-31 15:43:54 +00:00
d04ea4443f vcl: fix api detach if attach failed
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idd1df83bb01951c2455b23c08e3cc1fcd9b91064
2022-03-31 15:43:28 +00:00
8a4a7c216a crypto: drop the frame if there is no handler
If async engines are disbaled and async is turned on vpp tries to
enqueue frame with nonexisting handler which leads to segfault.
This patch checks for handler and drops the frame in case it doesn't
exist.

Type: fix
Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Change-Id: I67211867ee29dc41cc9f0733e8e0b3ea86677f85
2022-03-31 11:55:09 +02:00
d918cc54eb tls: support to reinitialise ca_chain wo restart
Type: improvement

Signed-off-by: Saravanan Murugesan <sarmurug@cisco.com>
Change-Id: I90e90678ae6586019cc842f9d504d53991cfabe4
2022-03-30 21:20:32 +00:00
80af13d740 ip: Reference count the enabling the punt feature
Type: fix

otherwise punt features are applied multiple times to the same packet if enabled multiple times

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: If0cbd9065275f68a10fd6d35e4f7a7c7508245e0
2022-03-30 18:31:21 +00:00
299571aca3 vppinfra: vector allocator rework
- support of in-place growth of vectors (if there is available space next to
  existing alloc)
- drops the need for alloc_aligned_at_offset from memory allocator,
  which allows easier swap to different memory allocator and reduces
  malloc overhead
- rework of pool and vec macros to inline functions to improve debuggability
- fix alignment - in many cases macros were not using native alignment
  of the particular datatype. Explicitly setting alignment with XXX_aligned()
  versions of the macro is not needed anymore in > 99% of cases
- fix ASAN usage
- avoid use of vector of voids, this was root cause of several bugs
  found in vec_* and pool_* function where sizeof() was used on voids
  instead of real vector data type
- introduce minimal alignment which is currently 8 bytes, vectors will
  be always aligned at least to that value (underlay allocator actually always
  provide 16-byte aligned allocs)

Type: improvement
Change-Id: I20f4b081bb13bbf7bc0ace85cc4e301787f12fdf
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-30 18:27:13 +00:00
9539647b89 udp: fix inner packet checksum calculation in udp-encap
When computing the inner packet checksum, the code wrongly
assumes that the IP version of the inner packet is the
same of the outer one. On the contrary, it is perfectly
possible to encapsulate v6 packets into v4 and viceversa,
so we need to check the IP format of the inner header before
calling vnet_calc_checksums_inline.

Ticket: VPP-2020
Type: fix

Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: Ia4515563c164f6dd5096832c831a48cb0a29b3ad
Signed-off-by: Mauro Sardara <msardara@cisco.com>
2022-03-30 17:51:33 +00:00
591efc2f57 hsa: refactor echo clients
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I30cc31c438d357d48576fba84e54809455960eaa
2022-03-29 16:58:36 -07:00
8f63d38e99 tls: Support for client certificate-key pair
Type: improvement

Signed-off-by: sarmurug <sarmurug@cisco.com>
Change-Id: Ibbfe827b9c4c603a6fe7cc49970a46bd683194ce
2022-03-29 17:13:59 +00:00
5760fdfb8c vlib: fix unaligned runtime_data
Align runtime_data to 8 bytes to avoid alignment issues with any
pointers in runtime_data located structures.

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: I9cb1b73595e654a4b15c45f87b43fa6cfbcb6e51
2022-03-29 16:58:58 +00:00
4db6183802 dpdk: make log pipe non-blocking on both sides
Type: fix
Change-Id: I857403b9d93ee4c17f2dd5ac8e6dafd66260a252
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-29 15:53:49 +00:00
fbc4ad5fd4 linux-cp: fix tap interface attrs in case the sw pool realloc'd
Creating tap interface / sub interface causes allocation of a new
software interface with possible sw interface pool reallocation.
In such case accessing L3 MTU and interface flags by obsolete sw
pointer is UAF.
Instead, keep desired tap interface MTU value before sw intreface
creation and refetch sw pointer right before sw flags inheritance.

Type: fix
Fixes: b89c1ddcb3
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I21ea46d146d11060bb9bedc77377ab17ae9e22e8
2022-03-29 15:24:58 +00:00
bf82a66de7 vnet: set frame overhead at interface registration
Type: fix
Fixes: 1cd0e5dd53

In vnet_eth_register_interface(), max frame size was being used where
frame overhead was intended.

Change-Id: I6e6de25e2d616caaf35730ab3d15235ec679ebdd
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2022-03-29 15:12:21 +00:00
720820e64b crypto-openssl: fix seed calculation
Type: fix
Fixes: 91f17dc
Change-Id: I860b6d5d5e9cf47d84fde0a2c92be43125038694
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-29 14:19:10 +00:00
851215a04f linux-cp: handle ipv4 routes when link goes down on subif
Type: improvement

Currently, the plugin can monitor link state changes on hardware
interfaces for which a linux-cp pair exists. When the link goes down on
one of the hardware interfaces, the plugin processes IPv4 routes that
resolve through that interface according to the configurations:
del-static-on-link-down and del-dynamic-on-link-down.

The problem is that link state changes are not signaled for
subinterfaces and the code that handles IPv4 routes is not triggered.
When the link on a hardware interface goes down, it implies
that subinterfaces added to that interface also will have the link in
the down state.

With this change, when the link goes down on a hardware interface,
iterate over subinterfaces added to the interface and apply the same
logic of routes processing as for hardware interfaces.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I97337d2e328437c73f2d99a00737768778f197a1
2022-03-29 13:31:02 +00:00
1c5b127d22 linux-cp: add support for table flush if multiple interfaces
Type: improvement

lcp_router_table_flush() is used to remove routes from the given route
table if they are resolved through the given interface with specified
FIB source. Currently, if you need to remove routes from a route table
that are resolved through one of the interfaces from a vector, the
function has to be executed for every interface from the vector. Every
execution walks the route table again.

With this change, lcp_router_table_flush() accepts a vector of
interfaces. Thus, the function can walk a single route table once and
delete routes that resolve through one of the interfaces from the
vector.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I6d99384064d279dea24bb4dc1790a1af943be41c
2022-03-29 12:49:45 +00:00
53e575ce8a perfmon: fix order in cmakelists.txt
Fix ordering in CMakeLists.txt

Type: refactor

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I8e71e4fbc048a80c4b250c2a66cfd8a522bde5f4
2022-03-29 10:10:48 +00:00
81878a9e3c perfmon: fix non-NULL terminated C-string
format() expects a NULL-terminated C-string as format string.

Type: fix

Change-Id: Ib428cf2debbf98850eed512907175f8ae8ba3c04
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-29 10:10:24 +00:00
e74c04fc9f libmemif: refactor examples
- icmp_responder: responds to ICMPv4 and ARP requests
- loopback: connects two interfaces and sends a
  verification packet from master memif to slave memif
  where it is looped back
- loopback (reverse path): reverses direction of packet
  in loopback application (slave memif to master memif)

Type: refactor

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ie90aaa3367269408efb6c5d538ad5aa827432238
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-03-28 22:34:33 +00:00
7d6f7d0d67 linux-cp: Fix API response
* Correct endianness issue
* lip_namespace is a vector not a string
* Provide null termination to avoid unpack() failures in the client

Responses in the python API now look like:
lcp_itf_pair_details(_0=328, context=3, phy_sw_if_index=1,
  host_sw_if_index=3, vif_index=19, host_if_name='ice0',
  host_if_type=<vl_api_lcp_itf_host_type_t.LCP_API_ITF_HOST_TAP: 0>,
  namespace='dataplane')
lcp_itf_pair_details(_0=328, context=3, phy_sw_if_index=2,
  host_sw_if_index=4, vif_index=20, host_if_name='ice1',
  host_if_type=<vl_api_lcp_itf_host_type_t.LCP_API_ITF_HOST_TAP: 0>,
  namespace='dataplane')
lcp_itf_pair_details(_0=328, context=3, phy_sw_if_index=5,
  host_sw_if_index=6, vif_index=21, host_if_name='ice0.1234',
  host_if_type=<vl_api_lcp_itf_host_type_t.LCP_API_ITF_HOST_TAP: 0>,
  namespace='dataplane')

Type: fix
Signed-off-by: Pim van Pelt <pim@ipng.nl>
Change-Id: If4bf06a8b70977676ec7f5b1413cee6cc9d1714a
2022-03-28 17:41:25 +00:00
d53e13de8e crypto-native: avoid overflow load on data
Type: improvement
Change-Id: I5317afa02fa1525a7d8df595b56eb6546ccded57
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-28 15:22:06 +02:00
7bf2317b45 vlib: use pthread_attr_setstack() to set thread stack
Type: improvement
Change-Id: I4c7f2f63651df4362ce1e0e36d885fedf55595c6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-28 10:05:05 +00:00
87997686ee vppinfra: avoid mem overflow in hash_memory()
Change-Id: Ic81aafd5f378de06e5ea8cdd6a59e07ff1a7afca
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-28 10:04:31 +00:00
a5bfe6cd0e ip: add barrier sync, ip4_ply_pool expand case
ply_create() is not thread safe when the ip4_ply_pool expands.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Ie11cc8b1ba587d5e9239a60f4e288492da61368e
2022-03-28 07:33:49 +00:00
3ace4d62e2 tests: fix core file message
Prevent crashing on nonexistent VPP binary path class member when creating
testsuite core message.

Type: fix
Fixes: b23ffd7ef2
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: Ib9b3dc8c69317e6561e5404bbdcbf672e417cbcd
2022-03-27 09:21:34 +00:00
30bb344ab6 linux-cp: fix name formatting
Format host interface name as vector rather than c-string.
Otherwise non-null-terminated vector overrun triggers ASAN.

Type: fix
Fixes: 1705a6baef
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: Ib204e57ee17c7ed3bfeb568dcdd834d7d7519102
2022-03-27 09:21:06 +00:00
5b47a6d014 session: simplify safe pool realloc
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1c55c054fea6c6886d8287a9b6e264a308f89504
2022-03-26 20:10:59 +00:00
416e1fffec hsa: echo client connects as rpc
Do connects in an session layer rpc instead of doing cli process sleeps.
Performance with 4 workers goes from ~120k/180k first run/warmed up to
~135k/240k

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id184913e9898f8db099e29a605f3a9b1fc67be63
2022-03-25 19:11:46 -07:00
5b12d2694e build: update .clang-format
Type: make
Change-Id: Iedf7af3f070cc3875f44adba38523b72f5e5ab43
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-25 21:07:38 +00:00
64841a9004 crypto-native: avoid mem overflow when loading IV
Type: improvement
Change-Id: I946d91e67c332ecac0b09d50980529b9d4e74f9c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-25 20:17:27 +01:00
f211f77777 vppinfra: add vec128_t, vec256_t and vec512_t types
Convenient for type conversion

Type: improvement
Change-Id: I35a770e06e6318fb4249b70021ed6f6c93b07162
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-25 19:12:32 +00:00
38235c38e1 l2: avoid overflow read of mac address
Type: improvement
Change-Id: I99d2c69ede39b3ba5604e1811ce12209c47f5caf
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-25 17:08:44 +00:00
3d390ba8de docs: Add getting started with GoVPP
Type: docs

Change-Id: I8e739ccf78b8dadf81cf4a4c32407355b2576942
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-25 16:12:35 +00:00
2586bd6e1c docs: Fix macos clang-format docs
Type: docs

Change-Id: Iaa2f5e2bb92342c1612cb3addbb9bfdc26623d99
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-25 16:12:03 +00:00
d373ebef01 linux-cp: handle ipv4 routes when link goes down
Type: improvement

Currently, when the link goes down on an interface, routes that resolve
through that interface and created with Nexthop API are removed by the
kernel. However, IPv4 routes remain in the FIB because the kernel
doesn't send any notifications about that.

And for the plugin working with user-space applications that create
routes in the kernel using Nexthop API there should be a mechanism to
synchronize the FIB and the kernel in this case.

With this change, add two new startup configuration options to the
plugin to be able to control what should happen with static and dynamic
routes managed by the plugin on link down:
  - del-static-on-link-down (disabled by default, delete routes created
    with the linux-cp static FIB source on link down),
  - del-dynamic-on-link-down (disabled by default, delete routes created
    with the linux-cp dynamic FIB source on link down).

Then, monitor link state changes on interfaces for which a linux-cp pair
exists. If the link goes down on one of the interfaces, process routes
that resolve through that interface according to the new configurations.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I0fbaeeca3f3d1fcd22e8eebb08a0a4a3d0dfe5b8
2022-03-25 13:15:21 +00:00
d545f04d3c build: print compiler version
Type: make
Change-Id: I1bad5f84797a1bfeb41420f408540604d461f440
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-25 11:18:46 +00:00
b9feb61e8f fib: fix ip6-ll fib selection for non-ethernet interfaces
Fixes case when packet to link-local address is received over
gre/mpls or other non-ethernet interface and ip6-ll fib for it
is undefined.
If by a chance ip6-ll fib index is valid, packet will be passed
to some ip6 fib with possibilities to be sent out over unrelated
interface or be looped again into ip6-link-local dpo till oom
and crash.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Ie985f0373ea45e2926db7fb0a1ff951eca0e38f6
2022-03-25 07:57:58 +00:00
89d74bdee8 devices: fix high vector rate per dispatch
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ibd23648483b38696271154237e81081480bb16e0
2022-03-25 02:15:57 +00:00
f55183a245 session: reorganize local port allocation
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5bbf8d584efdec57908c61f8626bcc81590401b3
2022-03-25 00:04:30 +00:00
b3262478ea misc: update my email-address
Type: fix
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I756bff7ecedf36cc685a20ba63c9d5229fc2ff32
2022-03-24 18:01:16 +01:00
0d03284efc bfd: use local error index when incrementing node counters
When incrementing node counters with vlib_node_increment_counter
the local error index should be passed in. vlib_node_increment_counter
adds the local index to the nodes base index to get the counter to
write to. If we pass in the global counter index, the offset gets
added again in the fn, and we then potentially write into memory that
is not part of the counter vector.

Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I43be33a51bcb52d520495d326b971c1d848d96b5
2022-03-24 19:12:47 +00:00
05ead78945 session: safe reallocs for transport endpoint pool
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6c86d0691bd0594d8b2c05d83d004be1aa8c5e21
2022-03-24 16:08:12 +00:00
aa7cfd04e7 ip: The check for 'same packet' must include the FIB index
Type: fix

otherwise if two packets arrive with the same source address but from different VRFs, then they are treated as the same and they use the same LB and thus share the same fate. but the lookup, when done, results in two different LBs, and hence the fate can be different.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Id6e16f7c577a561d9ddd7066339fa4385361d07f
2022-03-24 15:39:16 +00:00
e99f762346 ip6-nd: stop sending RA by default
Type: improvement

Currently, RA message sending is enabled by default - both periodic and
in response to RS message. However, RFC 4861 section 6.2.1 says the
following:

  Note that AdvSendAdvertisements MUST be FALSE by default so that a
  node will not accidentally start acting as a router unless it is
  explicitly configured by system management to send Router
  Advertisements.

With this change, RA message sending is disabled by default and
"test_ip6.TestIPv6.test_rs" updated appropriately.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I2a8865199cb665c59268504aefe2976e5ee96dc2
2022-03-24 14:26:28 +00:00
fbc633f554 mpls: Set the MTU field in the frag-needed ICMP when doing MPLS fragmentation
Type: fix

The reported MTU should include the MPLS label overhead

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I3df6d2e0b13f49701e187a766a157498dcaafbc0
2022-03-24 13:56:43 +00:00
bb498ccb1c crypto-native: fix index in VAES aes-cbc encrypt
Type: fix

Change-Id: Id7ae0d4c53cbca3785964f0bef92e9cd589d4ce9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-24 13:34:09 +00:00
534dfc1f18 build: set OS_ID_LIKE on to be OS_ID on Debian proper
OS_ID_LIKE from /etc/os-release is used to determine
the type of packaging. On Debian it ends up being empty,
so the "ninja package" does not work for out of tree plugin
builds.

Solution: if OS_ID_LIKE is not set, set it to OS_ID

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I077d4fdb509ea94b187d11391b1f49edb94c4e30
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-03-24 12:34:54 +00:00
4e26a78525 dpdk: enable int mode for virtio
The way of specifying which interface supports what has changed.
Re-add support for adaptive mode in virtio.

Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I2f8ffa6311a4081b93fb08a7e92408b8bffbae64
2022-03-24 12:27:31 +00:00
5d0fa2f85c build: exclude dlmalloc.[ch] from checkstyle verification
- dlmalloc.[ch] is an imported open source library which
  somehow manages to choke clang-format-diff to the point
  of consuming ~1 minute to run against a single character
  diff.

Type: make

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I16c6d6da664da8634aa682dce9d2120072626730
2022-03-24 11:43:33 +00:00
60bb453427 fib: Fix crash when removing a covering prefix
Type: fix

When a covering entry is removed from the table, the covered entries first see it 'updated' and then 'removed'.
the crash occurs because the covered prefixes share (simple pointer copy) the covereds hash table of path extensions. During the cervers deletion this hash table has been removed and the update of the covered crashes when recaluationg forwarding becuase it uses the free'd hash.
Fix is to refetch the shared hash table (which is NULL) when the covered is updated.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Icefca9d7b21da975111d0e974d75f663fc0cc00c
2022-03-24 11:29:27 +00:00
03b22e62e1 dpdk: copy the enable_rxq_int flag from driver to conf
The support for interrupt mode is not being respected as it is not
copied into the driver conf, which is what is checked when trying to
enable it.

Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I2e502306e27bd98f8037d1a0a396201e099b50b5
2022-03-23 21:45:18 +00:00
89a561f204 classify: fix typo in AVX-512 find entry
Type: fix
Fixes: 26bc9f3c85

Change-Id: Idab52bf856c03ded7b181608c3db1313aa2e33de
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-23 21:41:55 +00:00
4859d8d8e8 vlib: send full error message to syslog
Currently the last character of the error message string
is temporarily changed to a null byte '\0' before the string
is sent to syslog(3), resulting in confusingly incomplete log
entries.

This patch changes the syslog format to "%.*s" so that the
maximum number of characters to be printed could be controlled.

Type: improvement

Signed-off-by: Jing Peng <pj.hades@gmail.com>
Change-Id: I1bd6295c19b51b962a3d8ee3016cd91ffb2a4eaf
2022-03-23 18:52:50 +00:00
9deb2ec335 devices: add tx trace for af-packet
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ib96ee54eaf967bf435d6da910a6b582e87fbedc0
2022-03-23 18:47:15 +00:00
c1fd17bd10 devices: add support for offloads
Type: improvement

This patch adds support for:
  1) GSO
  2) checksum offload

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ib00629888c62da04d58db36ce021993769e736c9
2022-03-23 18:47:15 +00:00
219cbcb29f devices: af-packet v3 support
Type: feature

CPU usage ~20% less than v2.
Performance improvement 20% more than v2.
High vector rate.

Change-Id: I24bc594200f42664b59d07b44d44578e61068bbc
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2022-03-23 18:47:15 +00:00
8d7cdc808f vppinfra: deprecate clib_mem_is_vec
Use of clib_mem_is_heap_object is not reliable enough for production use
as it relies on just few bytes of memory allocator chunk header.

Type: improvement
Change-Id: I48c8adde8b6348b15477e3a015ba515eb7ee7ec2
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23 18:41:13 +00:00
f87acfaf73 vppinfra: change vlib_register_node so it takes format string for node name
This allows specifying both c string and vector for node name
and removes need for crafting temporary string.

Type: improvement
Change-Id: I0b016cd70aeda0f68eb6f9171c5152f303be7369
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23 18:40:16 +00:00
ba465b970e dpdk: fix rx/tx burst function name
Type: fix
Fixes: 65105c95fe ("dpdk: improve logging")
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I69d616c7e6e7b5395ebf083b1ac5c3e85f99bbdd
2022-03-23 18:33:45 +00:00
495c320a7f vppinfra: fix bihash key comparison for 512-bits vectors
bihash keys are less than 64-bytes, do not overflow.

Type: fix

Change-Id: Ic55407eb9ccca38058f7e62b363ec05c8445fbcb
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-23 18:33:03 +00:00
d24b86ecce vlib: avoid use of vector of voids
Type: fix
Change-Id: I76e28854db8a1e9134c816c0c5d81b031dc4e27d
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23 18:32:05 +00:00
e2d0c6e51e ip: Add unformat for flow_hash_config
Type: improvement

This also makes the is_white_space function
public

Change-Id: Ifc1c0d4509f3ecae14f09bb5fa7a2eea33c49b09
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-23 18:29:08 +00:00
8e0af7a7ff vnet: Remove the unused fields from opaque2
Type: refactor

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ibb6d19de053c306e9758dbfa827ab7bcab5de856
2022-03-23 18:27:52 +00:00
49ebbf7048 vlib: mitigate outdated new cli session events
Possible races while concurrent additon to the new sessions vector
in a one process and remove from it in an another need to be avoided.
Let the vector be changed in the new session process function only.
Also cli_file_pool element may be freed already at the new session
event arrive timepoint, still causing unexpected cli banner for
noninteracive cli sessions.

Type: fix
Fixes: 17a6721858
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I022d16dd3aad9c9330834d35c58938f04b015b08
2022-03-23 18:27:15 +00:00
2973350c81 vlib: fix memory leak on process nodes reforking
The processes vector leaked on reforking and needs to be
freed before recloning from main node processes.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Id69bc3fd42e2efacfcd521f98e6e51a9c712fef5
2022-03-23 18:25:57 +00:00
8486283cd5 vlib: leave SIGCONT signal with its default handler
Systemd always sends SIGCONT after KillSignal, to ensure that even suspended
tasks can be terminated cleanly. However, the default action of SIGCONT
handler in VPP such as unix_signal_handler() is process termination with
coredump, what is not really desired. So, leave it alike SIGSTOP with its
default handler.

Type: feature
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I54c06d21669ec3c709322d746db9e28448c31bb8
2022-03-23 18:24:56 +00:00
7f9256e31c api: better segregate client and server code
- move memory and server specific vl_msg_api_handler_with_vm_node()
   to memory server code only
 - keep api_global_main static

Apart from being cleaner, this also helps avoiding symbols conflict
when both client and server libs are loaded in the same process, as is
done by the prom plugin.
Those symbols conflict confuse ASan and can be nasty to debug.

Type: improvement

Change-Id: Iaf58596cc753ad8d3fedd8d65c4bf480ac129c2c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-23 18:23:29 +00:00
8296a1d043 perfmon: null-terminate string
Type: fix
Change-Id: I43ebb2c2922f3b8b8eddf26ccdf044f31d7b7a10
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23 17:21:23 +00:00
fa7f21bb6b stats: fix crash due to pointer taken before validate
Type: fix
Change-Id: Iee9eab18da142bfe0645761deea13b0fe911a43b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23 16:38:56 +01:00
2e7c5d33cc vppinfra: deprecate vppinfra/graph.[ch]
Type: refactor
Change-Id: Iba0466b60354955ba73f851435a7127435b7066d
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23 15:07:39 +00:00
ed59dac627 crypto-native: fix dst index typo in VAES
Type: fix

Change-Id: Ib025d8c1bc9bd651b6448d6a41fd1efa6f0b7362
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-23 14:19:15 +01:00
6bd8d3fbba session: use safe realloc for pools
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I313c916d268c4b2b448b93e90bc67da341b803e3
2022-03-22 15:14:25 +00:00
b1c0b9afac tests: add http tps test
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I56a585a8a1f588e682552913cfbdd4551e057ead
2022-03-22 14:31:45 +00:00
4a332319cc build: remove clang-format-10
- No longer used now that ubuntu-18.04 is deprecated.
- Change default to clang-format-11 in checkstyle.sh

Type: make

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I202244563738417bf4ae5b22fc8e2804bff2d25f
2022-03-22 14:28:37 +00:00
b495e34b00 memif: fix the maxmimum number of txqs
Type: fix

With multi-txq in VPP, user should be able to create
more txqs than vpp threads. MEMIF_MAX_M2S_RING should
be defined to 256 instead of number of vpp threads.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I337c3a5ea691470815653ff2dbfa862bb324b240
2022-03-22 14:12:37 +00:00
15732f5d05 fib: refetech the adj after the walk in case the pool realloc'd
Follow e3aeb38fa8

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I743911cacc026af5da392d26eaf47ab83ea1de99
2022-03-22 09:02:30 +00:00
b9ff03c805 build: fix clang-format-diff[.py] detection
Fix clang-format-diff autodetection error in case of non-standard
clang-format-diff path. Also allow finding clang-format-diff.py in
non-standard location.

Type: improvement
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I3cb76aa152a8245e62db62f5fe2ba96b1ff86428
2022-03-22 01:34:57 +00:00
b3fc65817e tests: fix DEBUG=attach functionality
Make make test-start-vpp-in-gdb work again.
Fix incorrect temp directory when using DEBUG=attach.

Type: fix
Fixes: b23ffd7ef2
Change-Id: Ie98b637acbbe0221606ccdc7b54f63885e5951a4
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2022-03-22 00:50:23 +00:00
f0574da2b7 stats: fix vlib_stats_validate_will_expand_internal
Type: fix
Change-Id: If4c0b23aaa4fc57c0783efcbe349aba5e5885b30
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-21 21:13:31 +00:00
e09bd48e35 session: linked list of events to be handled by main
Minimize amount of rpcs from first worker to main

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3794ff028a17d18b7bff69ede2b62e1e2d45ae77
2022-03-21 12:53:15 -07:00
38659d8f2c sr: fix srv6 definition of behavior associated to a LocalSID
The behavior associateted to a LocalSID accordig to the definition should be u8 instead of u16;

Type: fix

Signed-off-by: Francesco Lombardo <franclombardo@gmail.com>
Change-Id: I6dd60d5facc1c3f20900cb393619349e82eef38c
Signed-off-by: Francesco Lombardo <franclombardo@gmail.com>
2022-03-21 18:18:00 +00:00
8a96c6d0e7 vppinfra: use clib_mem_alloc
Type: refactor
Change-Id: I26a2a410f8f4070d10696f796d5887842cad3916
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-21 17:46:23 +00:00
d23c55fa56 wireguard: dont stacksmash bad peer base64 keys
Just like commit 252647482b24bb3474e8f13bc86100718176832f
did for Wireguard interface keys, prevent stack smashing
the peer keys.

Integer math on 32 bytes of base64 data might yield 33 bytes
of data in some poorly formed user input of private key values.
Rather than smashing the stack (detected) and aborting, simply
allow for the possible yet irrelevant 33-rd byte of data.

Type: fix
Fixes: edca1325cf
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I9f77b3faaaa01d3123b356c958db60c87238db9c
2022-03-21 16:25:21 +00:00
f479179598 wireguard: improve peer dump details
- Add peer_index, table_id, and keep-alive.
- Fix some lingering cut-n-paste issues in the API file.

Type: improvement
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I6fc0729ba0268bbcda0248f680979c44e68b6b0c
2022-03-21 15:56:36 +00:00
17ecd853e9 vppinfra: add new bihash exports
This adds two new exported functions
for the clib_bihash

* clib_bihash_add_with_overwrite_cb allowing
to pass a callback to be called on overwriting
a key with bucket lock held.
* clib_bihash_add_del_with_hash doing an add_del
with a precomputed hash.

Type: feature

Change-Id: I1590c933fa7cf21e6a8ada89b3456a60c4988244
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-21 11:27:29 +00:00
d0d4b43374 hsa: add support for SAPI in vpp_echo
Type: feature

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: If24a43b7f79e05092306562c192de03994dec550
2022-03-21 06:04:34 +00:00
3cfd529bd0 vppinfra: deprecate vec numa macros
More generic vector heap code coming in another patch...

Type: refactor
Change-Id: I2327128fb3aba9d5d330f46a35afec32e1e3942e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-18 22:17:45 +00:00
f56b007356 tests: fix the RND_SEED parsing
The random seed is not an integer, so the current code does not allow reproducing a test run by running e.g.

RND_SEED=1647595144.0940742 make test

Solution: make the random seed a positive float.

Also, add the missing positiveness check to the positive_integer function.

Type: fix

Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I858bab0a9b828b99c20a2252aeecb9e2dda4ee21
2022-03-18 20:11:26 +00:00
53d8d4fd62 session: add infra for safe pool reallocs
This is not to be used lightly.

The idea is to forces pool reallocs to be done only on main thread with
a barrier to make sure pools are always reallocated without
peekers/readers. If rpcs are delayed and the pool runs out of elements,
workers will block waiting for barrier and force the realloc.

Consumers of this api should be session layer and transports.

Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I533272a29534338935a3fcf7027c0e7af2ca948c
2022-03-18 20:05:42 +00:00
c8e4110cd1 udp: avoid grabbing vlib main if not needed
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I88a747cac70cb88755f50c7b337207f4ba256530
2022-03-18 20:05:00 +00:00
1aa6afb3cf misc: Auto close PRs to GitHub mirror
Introduce a GitHub Action to auto close PRs submitted via GitHub
Will add a helpful comment to point folks towards gerrit.

Type: feature

Signed-off-by: Ed Warnicke <hagbard@gmail.com>
Change-Id: I3c4a2590d4e38edd1061e65e800cfdb124c43866
2022-03-18 12:26:04 -05:00
66d4cb5a21 vppinfra: refactor *_will_expand() functions
Type: refactor
Change-Id: I3625eacf9e04542ca8778df5d46075a8654642c7
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-18 13:16:36 +00:00
05563c9a90 vppinfra: deprecate vec_free_h()
vec_free() does the work

Type: refactor
Change-Id: I8a97607c3b2f58d116863642b32b55525dc15d88
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-18 13:16:30 +00:00
a4a28f04cb vppinfra: use stored vec header size to find header
Type: refactor
Change-Id: Iaa1e43c87c5725ab33ea8489bff2a7bda18b9c79
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-18 13:16:24 +00:00
86bbdf926c vppinfra: fixed pool from heap
Immediate benefit is ability to use hugepage backed memory.

Type: improvement
Change-Id: Ibcae961aa09ea92d3e931a40bedbc6346a4b2039
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-18 14:15:29 +01:00
762cfd408b cnat: Fix conflicting rsession
When dNAT-ing to a VIP, it can happen
that the return session conflicts with
another forward session than the one
we own.

This patchs adds a rsession_flags
CNAT_SESSION_RETRY_SNAT that makes cnat_session_create
search for a free src port to use for the
resulting return session.

It also makes forward & return session
share their fate in the session scanner.

Type: fix

Change-Id: Id0edf59abf8e5bc0c0d8941ba289c4563c77dee0
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-18 11:33:51 +00:00
6798e9ec34 memif: fix rx/txqueue RC on connected
Type: fix

Calling vnet_hw_if_register_tx_queue should
be done with the worker barrier held, as
virtio-pre-input might be grabbing a queue
while a memif connect event is triggered.

Change-Id: Ie1272cdfd2477faf7a4e10f30778279872f04916
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-18 10:10:22 +00:00
0b77e31282 ip: fix assert in ip4_ttl_inc
There is no need to verify the checksum for packets that have the IP
checksum offload flag set. This uses the same logic as
ip4_ttl_and_checksum_check.

Type: fix

Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Change-Id: I177b07212a992362a4c965c074dcecf1e504c593
2022-03-18 08:25:11 +00:00
19658c990b bfd: remove source IP check from session add
Checking for existence of source address on interface prevents creating
session before assigning address to said interface. Removing this check
allows more flexibility when configuring BFD feature.

Type: improvement
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: Ia57960e29b5dbdb758a7a64193c28f21482f229e
2022-03-18 08:13:21 +00:00
f540d1e11d vlib: fix vlib_mains vector alignment
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib3d1ac6c82bc0c00e445b15d4102e4fd755f8e2d
2022-03-17 23:22:10 +00:00
eeb31ec723 vcl: fix invalid socket read
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ic8cc12788d9062f30faa992afaecc0c64078c4d7
2022-03-17 23:08:22 +00:00
5c45d1cf1b vppinfra: vec_max_len, vec_mem_size use stored header size
Type: improvement
Change-Id: I17778e89674da0e8204713302e2293377bdabcbc
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-17 20:31:14 +00:00
1da361f9ea vppinfra: store vector header size and alignment into header
On the forst vector alloc values are stored into header.
Later, when vector grows values from header are used istead of provided
ones.

In the debug image code will assert if same values are not provided.

Type: improvement
Change-Id: I8fdcfa495e9c1df0f6392c90f634e8c74b73b328
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-17 20:31:14 +00:00
2b702da86c vppinfra: move hash bitmap out of vec header
Type: refactor
Change-Id: Ibd29a717eaf12d795b3bceb31835d6fc655268b1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-17 20:22:36 +00:00
d591b82cc8 misc: Improve go bindings gen
Type: improvement

Change-Id: Id705dab895602a60b053296b560ca3db5b0cd344
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-17 13:05:48 +00:00
c2feb65f42 nat: fix ICMP error translation
Add missing translation of ICMP inner IP layer.
Change responsible test so that it actually tests something.

Type: fix
Fixes: 4881cb4c6f
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: Id3a6f12a7308d81b1cdf9815f857221fab2f24d9
2022-03-17 11:17:49 +00:00
541de587a9 vpp: binary-api CLI weak linking workaround
For some unknown reason sometimes calling exec() ends up on weak
exec() defined in src/vat/api_format.c which return -1 instead of using
one few lines above.

Another proof that use of weak symbols is bad idea.

Luckily this can be easily workarounded.

Type: fix
Change-Id: Ic84e8525bff75c1b8186c233cd524aac4d95c8b5
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-16 16:43:26 +01:00
e8d67719fd tcp: update error counters in listen node
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib2e1d847607c9c7d928b174b87e5c21d53153ebe
2022-03-15 21:46:34 -07:00
c6a2f1f76f tcp: update persist timer if data acked
Update persist timer if data sent during snd_wnd < snd_mss was acked.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5c75ff8ddc0e49750b2088237d32afa4eda99e7f
2022-03-15 16:27:02 +00:00
3a36682017 flow: add generic flow pattern for 5G flow enhancement
In order to support the requirement of RSS and packet steering of new
protocols, such as GTPU PDU-type and QFI, for 5G UPF, a generic pattern
is introduced in vnet flow. The generic flow pattern is based on DDP
(Dynamic Device Personalization) function and Parser Library module in
DPDK. Using generic flow pattern, we do not need to create new packet
and field type and offset in API parser for every new protocols. We can
create flows for any protocol immediately as long as supported by DDP.
The generic flow can be used to support 5G related protocols in
different scenarios.

The input of this generic pattern are two binary strings for spec and
mask. Spec is the binary presentation of the target packet type, and
mask is used to mark the target fields.

In this patch DPDK plugins is enabled for POC. Next step we will enable
generic flow in native IAVF, which is the main target.

Here is an example. If we want to create a flow for GTPU QFI,
spec is:
00000000000100000000000208004500003C00000000001100000101010102020202000
008680028000034FF001C00000000000000850100010045000014000000000000000001
01010102020202
mask is:
00000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000007F0000000000000000000000000000
00000000000000

A naming API POC is created via VAPI to help create the rule with
the target packet format similar to Scapy. It is based on a function
module called PacketForge. In this way, the user no need to create
binary string spec and mask by themselves.

Type: feature

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Id3444f95c158bdcdfeeee19d795cd9ecbeeec07c
2022-03-15 16:15:19 +00:00
218e4ec530 vlib: add vlib_frame_bitmap_and
Type: improvement
Change-Id: I531115f32c484e4c4794173d24e15f3b5b8f547b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-15 16:17:31 +01:00
b0f0f8c8dd memif: fix memif_process_desc indexing
The index i was incremented in the wrong place, and the check on the
presence of a next buffer in the chain was actually done for the
next desc_status rather than the current one.

Type: fix

Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: I74a64a34fea497900b7969cd96e1aeeb570a1bba
2022-03-15 08:15:21 +00:00
41a1bbffc6 vppinfra: fix vec capacity
Rename vec_capacity to vec_mem_size  as it returned the size of the
underlying memory allocation not the number of bytes that can be used
for vector elements.

Add new vec_max_elts macro that returns number of elements that can fit
into generic vector.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2e53a2bfa6e56a89af62d6ddc073ead58b8c49bb
2022-03-14 22:03:37 +00:00
58fd481d73 stats: refactor vlib counters
Change-Id: I09d2da73eff42c52ba1373acc99ff28f283a6725
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-14 20:30:06 +00:00
92991e5c69 dpdk: add patch to support i226v
Type: improvement

Add a patch to the DPDK 21.11 build to enable the PCI device ID for the
I226-V.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I82ff4b70e6b6e0ba0803519943190a564e85d2ac
2022-03-14 20:04:40 +00:00
ebfd2b6ac8 crypto: Enabling IOMMU DMA translation table update for QAT card
With DPDK plugin, VPP does the DMA page map in IOMMU, only when
DPDK supported ethernet devices are present. As a result, Mellanox NIC
and QAT combo doesn't work. As part of this fix, DPDK supported
crypto device check is added to do the DMA page map.

Type: fix
Signed-off-by: mgovind <govindarajan.mohandoss@arm.com>
Change-Id: I02de4588c5b021e0c9c62612137f28ed8784bea6
2022-03-14 19:58:03 +00:00
d1bd9af16e stats: support recursive locking
Type: improvement
Change-Id: I85dd3d34bcb175dd68dda34a58cd454848a0fc2b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-14 18:33:32 +00:00
85a9c101bf hsa: fix error message
Fixes a minor issue that causes printing an error message when there is no error.

Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I59f5c6af7c5aeae3e812b4cf0c75a47894bb8bbd
2022-03-14 18:04:21 +00:00
eb63caea2a vppinfra: don't account vec_header_t size twice in the pool header
Type: fix
Change-Id: I298d2a5067f7949002e6c010f892553f1eb9f477
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-14 17:55:19 +00:00
a9fe20f4b8 dpdk: improve rx burst count per loop
Type: improvement

This patch improves the per dpdk-input loop number of packets
received from the port. The change mimics how packets rx happened
before VPP 22.02/DPDK 21.11: instead of trying to rx huge number
of packets (256) in one go, rx more times with up to 32 packets
max each time.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: I804dce6d9121ab21b02e53dd0328dc52ac49d80f
2022-03-14 16:58:16 +00:00
e41fa7790f map: fix memory leak
Thanks to Ben McKeegan <ben@netservers.co.uk> for the report.

Type: fix

Change-Id: I8170dda572c326b6b1823fd330dbd5e961fdad74
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-11 21:46:00 +00:00
dcd08b278f build: Restrict tag names when discovering version
Type: improvement

When `make install-ext-deps` is called, it creates a debian changelog
file and use `git describe` to fill project version.  On downstream
consumers it's possible to have different tags that makes it to end up
using an invalid version on changelog and breaking the installation
process.

Restrict tags to be considered by git-describe to match 'v[0-9]*'
pattern to get it fixed.

Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
Change-Id: Ieabd7b42ac33735ec4d484bed9039ff20c9872f2
2022-03-11 19:13:04 +00:00
91a46cb1ff tls: remove pkg dependencies on mbedtls
The tlsmbedtls plugin should only be built if mbedtls libraries are
present.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I24364177d24ea744f24f808f492be08adff3690b
2022-03-11 19:04:46 +00:00
9c32f05751 session: fix crash during client detach
This fixes a crash caused by client closing socket before adding worker.
During detach vpp tries to delete worker based on invalid worker index.

Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I3242bcbb116ef5fd1d4c449f5bcf907e4e2f8f30
2022-03-11 16:30:23 +00:00
9652177bc1 vlib: remoove unused field
Type: refactor
Change-Id: Ieb7a595e40d801af5349c83b128fa92c7698a346
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-11 15:02:09 +01:00
62d656ace9 vlib: init logging eearlier
Type: improvement
Change-Id: I2eb5543aa470094d4c5ad420a2fcc9873b7808e1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-10 23:10:58 +00:00
85b285b900 dpdk: fix program vlans on ixgbevf
Recent "dpdk: refactor device setup" have broken vlans programming for IXGBE_VF.

Type: fix

Signed-off-by: Dzmitry Sautsa <dzmitry.sautsa@nokia.com>
Change-Id: Idacda33a473f6b10dbe002d9926661a19d0f3f97
2022-03-10 22:34:26 +00:00
2d194a02a6 devices: remove the unused code from af_packet
Type: refactor

Change-Id: If180816303909b92c9aa4ff9fd70dc7938a6cfbe
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2022-03-10 19:44:24 +00:00
ab5a124b1d build: fix centos 8 steam build install-dep
make install-dep sometimes failed at
downloading metadata for repository 'powertools-source':
disable unnecessary powertools-source repo.

Type: fix
Fixes: 1affb31ef5 ("build: fix centos-8 'make install-deps'")
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I481d6106eea38190b3ddd79e8614b2ead7130807
2022-03-10 19:40:42 +00:00
562cfa4075 ipsec: remove the redundant code
Type: refactor

Change-Id: I0a40e22e1439e13ffdbcbd6fd7cad40c8178418c
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2022-03-10 17:48:44 +01:00
6d95f8c983 tests: fix test failure with parrallel test
Several test cases re-use the same test class name,
which leads to test error when do parrallel test with TEST_JOBS=16,
change the test class names to unique values.

Type: fix
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: Iefc01d40a25ebd60533baf3a2dc98a537437e8e9
2022-03-10 14:08:19 +08:00
400d459bc1 vppinfra: fix pool_free_elts
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3425350f5e874df79716bd726900540629793beb
2022-03-09 14:03:48 -08:00
346c24723b ip: IPv4 Fragmentation fix for l2fragmetable size
Type: fix

The l2unfragmentable size is not included in the calculation of 'max', the maximum amount of data that can be added to a fragment, therefore the fragments created are too big.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Id1e949ad98203b6f8ea2f55322ef6fa3d507e2a6
2022-03-09 19:15:05 +00:00
23e5f0923b vxlan: add l2 mode test
The same test for v22.02 was already merged: https://gerrit.fd.io/r/c/vpp/+/35390

Type: improvement

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I214f6fb5b63d97ca4afe3b10fd2d3e3410b5a6e4
2022-03-09 15:04:26 +00:00
8973b07eec stats: refactor
Type: refactor
Change-Id: Ifd533a095d979dc55bfbe5fac7e0b7510a4d900c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-09 13:51:31 +00:00
317cace618 vat: fix vat_suspend crash
Deadly combination is clib_{set,long}jmp + lazy linking + tail call compiler
optimization. On the first call to clib_setjmp, dynamic linker executes loader
code which then calls clib_setjmp, so stored stack position contains dynamic
loader data. Tail call optimization simply jumps back to the calling
code when clib_longjump is called and that results in wrong return
address used from the stack.

Change-Id: Ia7d8dbd5b2c425cdd0449374aa07ab6b684a330e
Type: fix
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-09 14:47:05 +01:00
7fc0ee7f65 classify: add API to retrieve punt ACL tables
Type: feature

Change-Id: Ica3e60836c0f26518ba2c238a8c03ce3648ea69b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-08 18:16:03 +00:00
26fec718f2 ipsec: input: drop by default for non-matching pkts
As per IPSec RFC4301 [1], any non-matching packets should be dropped by
default. This is handled correctly in ipsec_output.c, however in
ipsec_input.c non-matching packets are allowed to pass as per a matched
BYPASS rule.

For full details, see:
https://lists.fd.io/g/vpp-dev/topic/ipsec_input_output_default/84943480

It appears the ipsec6_input_node only matches PROTECT policies. Until
this is extended to handle BYPASS + DISCARD, we may wish to not drop
by default here, since all IPv6 traffic not matching a PROTECT policy
will be dropped.

[1]: https://datatracker.ietf.org/doc/html/rfc4301

Type: fix
Signed-off-by: Zachary Leaf <zachary.leaf@arm.com>
Change-Id: Iddbfd008dbe082486d1928f6a10ffbd83d859a20
2022-03-08 17:43:43 +00:00
1031098b90 ip: set fib_index before exiting input ACL node
While setting an ACL, a user can specify the adjacency to follow after
the input ACL node. Thus, we may skip a lookup and enter directly a
local node (ex: ip4_local). To prevent the local source check from
failing, we need to specify the fib index. And, we have to do it just
before exiting the input ACL node because the l2_classify object
is overlapping with the fib_index in the vnet_buffer_opaque_t struct.
We could have added a padding to avoid this overlap but there is no
place for that in the structure.

Type: fix

Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
Change-Id: I383c36e4aec08d181f966f28565aefed950d2a74
2022-03-08 15:38:14 +00:00
c711bd08c8 crypto-ipsecmb: bump to ipsecmb v1.2
Type: feature

This patch bumps ipsecmb library version from 1.1 to 1.2

Signed-off-by: Marcel Cornu <marcel.d.cornu@intel.com>
Change-Id: I181e43c711fe530296c037d59b53fe3c5f2719ea
2022-03-08 09:22:17 +00:00
7e647358af linux-cp: handle ipv4 routes when interface is disabled
Type: improvement

Currently, when an interface is brought down administratively, IPv4
routes that resolve through that interface remain in the FIB. However,
the kernel removes those routes but doesn't send any notifications about
that. Desynchronization between the kernel and VPP happens.

With this change, when a notification received from the kernel
indicating that an interface was brought down, in addition to bringing
the VPP interface down, walk the IPv4 FIB bound to that interface and
remove any entries that resolve through that interface and were added
with one of the linux-cp FIB sources.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I0cd14bb63c9e6616ae1c5739b17c3bf33b186bc2
2022-03-07 19:45:39 +00:00
ec5371e3e3 ip: Fixes for IPv6 and MPLS fragmentation
Type: fix

- IPv6 fragmentation did not work if the packet spaneed multiple buffers, because the 'len' calculation to did max out at the size of a buffer
- IPv6 fragmentation did not work when the l2unfragmentable size was non-zero, it was not used in the correct places
- IPv6oMPLS fragmentation would fragment all IPv6, it should do so only for link local
- IPv6oMPLS should send back TooBig ICMP6 for non locally generated

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ie8f02cdfdd7b7e8474e62b6d0acda8f20c371184
2022-03-07 09:02:01 +00:00
7e721954d4 linux-cp: fix issue of possibly closing negative fd
Type: fix

Primarily fix an issue reported by Coverity in
lcp_nl_open_sync_socket() that close() could possibly be run with
negative fd. Also, add more checks and error logging there.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I9a88520d068392977a6eba0766451e5652fe512c
2022-03-04 22:30:21 +00:00
2286f937d9 linux-cp: stop signaling read event on every notif
Type: improvement

Currently, read event signal is sent on every notification message
received and added in the queue.

With this change, signal read event only when all currently available
notification messages are received.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ib86d189311ce01f50167e4e97feb99df0292ad96
2022-03-04 21:02:37 +00:00
f4795a9bd8 linux-cp: stop ignoring ENOBUFS while reading notif
Type: improvement

Currently, while reading notifications, ENOBUFS error is ignored and
reading continues. This was done to minimize the number of notifications
that are lost due to reopening the socket.

Now that synchronization is implemented to recover from socket errors,
ignoring ENOBUFS and reading as much notifications as possible is not
actual. Before synchronization, all currently enqueued notification are
discarded in any case.

With this change, stop reading notifications if any error occurs.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I1184d9a3aa99df63ef59bc2a67be2b1e5e0e9329
2022-03-04 18:24:09 +00:00
7e0442aaab api: harden api trace parsing
- make sure we do not overflow
 - skip unknown messages if we can

Type: fix

Change-Id: I0efbe7376d9d78f6b0ec8018c0813400e6653698
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-04 18:17:45 +00:00
f478f758b9 ping: correct the fib-index used for the reply
Type: fix

if original packet was to the link local, then the
fib index in the buffer is that of the LL table, we can't use that
to foward the response if the new destination
is global, so reset to the fib index of the link.
In other case, the fib index we need has been written
to the buffer already.

Add a test for IPv6 ping in an MPLS-VPN where int inout interface is
not the the same VRF as the response should be sent.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I18a232d90ddd3ef051a52476c5d861c87060e76f
2022-03-04 16:25:00 +00:00
5c6dd17a37 ip: rate-limit the sending of ICMP error messages
Type: improvement

For error conditions, such as TTL expired, dest unreach, etc, Rate limit the sending of ICMP error messages.
The rate limiting is done based on src,dst IP address of the received packet.
the rate limit has been chosen, somewhat arbitrarily, to be 1e-3. This is the same limit as the ARP throttling.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I4a0b791cde8c941a9bf37de6aa5da56779d3cef4
2022-03-04 16:14:11 +00:00
bc91e86674 linux-cp: ignore neighbors if ip addr is multicast
Type: improvement

When dump of neighbors is requested, the replies will also include
neighbor entries for IPv6 multicast addresses:

  GigabitEthernet0/8/0  S           ff02::16  33:33:00:00:00:16
  GigabitEthernet0/8/0  S  ff02::1:ff76:7135  33:33:ff:76:71:35
  GigabitEthernet0/8/0  S            ff02::2  33:33:00:00:00:02

Such entries are not reported in netlink notification messages and
VPP is unlikely to use these.

With this change, ignore neighbor entries when the IP address is a
multicast address.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ic712aa4904f1d559f31fd89ff4541268e2340f84
2022-03-04 15:58:42 +00:00
81e74d8e22 ip: fix overflow in ip6_ext_header_walk
ip6_ext_hdr_chain_t->eh is IP6_EXT_HDR_MAX elements.

Type: fix

Change-Id: I28b8d610d8f5c0c520c8391c37b86e837655ab12
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-04 15:57:12 +00:00
82b7991fc2 pg: fixing the cli
Type: fix
This patch removes the assert and it is unnecessary.
Because given variable is used for branch testing.

Change-Id: I64f57f909fcba205216296e86c1cde2a5dadbb45
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2022-03-04 15:56:39 +00:00
59183e9e10 pg: add support for ip mode through cli
Type: improvement

Change-Id: I5dda196ab8f1b634fcac46acd5c57a6dd726759c
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2022-03-04 15:43:43 +00:00
3626a7cf82 ipfix-export: fix the warning message for uninitialized variable
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I2b8b6a3b5a6df71e84ce2f15ef7117f390121c2f
2022-03-04 15:10:18 +00:00
9a63b6e147 classify: skip l2 header in CLI
Add the possibility to create masks and matches without l2 header in the
CLI when creating tables and entries. This is useful for tables working
on l3 and l4 only.

Type: improvement
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
Change-Id: I7da9e47d810c0b4a0938e2cb3bc31aa69ace3649
2022-03-04 14:49:15 +00:00
c396d2395a mpls: Fix the fragmentation in mpls-output.
Type: fix

the MTU needs to be adjusted to account for the label stack, since the size of fragments produced is stack+mtu.
these changes are to the use of the stack variable 'mtu'

most of the patch results from appeasing checkstyle.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I8d0e10cf52ca4dd8ecdc224ed6c54a13e4768fdd
2022-03-04 14:38:27 +00:00
0a3160b698 tunnel: Fix the format of tunnel flags
Type: fix

it only display the first flag set

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I45cddbac0d4eed8bda10bf5e0f7c9db0faf183c5
2022-03-04 14:29:09 +00:00
c8f7fd1367 vnet: use system time for pcap trace
Use system wall-clock time for packets timestamps instead of the time
since VPP started for pcap traces.

Type: improvement

Change-Id: I716165912efe8db3a8861d5c10597dc7629d2293
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-03 20:43:54 +00:00
54223ee257 vcl: validate vls_epoll_ctl inputs
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I315ef0122ccb21ccfef117a58b1dc998127618ce
2022-03-03 19:15:43 +00:00
bb5e2fc2c4 session: improve tx tracing
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4fd7ae435514eb986543302c7e3e69e04acba8cf
2022-03-03 19:15:32 +00:00
aebfc285a8 linux-cp: detect and delete stale entries after sync
Type: improvement

During synchronization, only the current actual set of entries is
loaded. If some entries are no longer present in the set being loaded
but present in VPP, they should be removed to fully syncronize.

With this change, add handlers for sync begin and end events. Begin
handlers will mark the entries as stale. End handlers will remove the
entries that are still marked as stale.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I4f7e872af3e1c9ffa6c63bcc3984ec76def1bb43
2022-03-03 19:07:18 +00:00
6db19a9f48 ipsec: remove ipsec vnet script
An updated ipsec script was identical to the existing ipsec_tun_protect script.
Remove the ipsec vnet script, and rename the ipsec_tun_protect to become the
default ipsec vnet script.

Type: fix

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: Ie05ca3e089b67a5b9499d83d4cb2adf1b6c6ffba
2022-03-03 17:32:23 +00:00
3819205bdb linux-cp: resync with kernel after nl socket error
Type: improvement

Currently, if an error happens on the netlink notification socket, the
socket gets reopened. A portion of notification messages have been lost
because of this and will never arrive on the socket. VPP will be out of
sync with the kernel networking state.

With this change, synchronize VPP state and the kernel networking state
if there was an error polling or reading the notification socket.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I8cdff89b505cd227535a0acaadb6ee757204c45e
2022-03-03 17:04:59 +00:00
758ec13718 ip: Path MTU DPO allocation function is public
Type: refactor

check for pool expansion in the DPO allocation, just in case.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I6ba7dd66313630d3f24a51700ab4486ba43d856b
2022-03-03 16:49:20 +00:00
87e92c6586 linux-cp: make check of message ts null-tolerant
Type: improvement

For some message types, timestamps are checked on netlink message to
decide whether the message should be applied. For notification messages
timestamps are expected to be always available.

With this change, before accessing the timestamp, make sure the message
info object that carries it is not null. If it is null, pass the check.
This is to be ready to process dump replies that will not need the
timestamp check and will have the message info object set to null.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ic7211c0d451d72f6a5248898b3a8f8e0bca8f7aa
2022-03-03 14:26:48 +00:00
adac308aa8 linux-cp: reflect hw link state on tap on pair creation
Type: fix

Currently, a tap interface created to be a member of a linux-cp pair has
default link state (down) and default link speed (10Mb/s). Then the
plugin monitors the link state of the paired hardware interface and if
it changes, the new link state is reflected on the tap interface. And
when the new link state is "up", the link speed is also reflected on the
tap interface.

The problem is that this scheme implies that the hardware interface's
link state is "down" at the moment of the linux-cp pair creation and
then changes. But there are cases when the link state is already "up" at
that moment. If that is the case, the link speed on the tap interface
will remain the default one until the link comes down and then comes up.

With this fix, when a linux-cp pair is created, reflect current link
state of the hardware interface being paired on the created tap
interface.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I73664d753f4daaa6d439c9ca898fb7363d21c06d
2022-03-03 13:44:19 +00:00
53f8a272a6 linux-cp: lcp fib fixes
Some possible side effects for multicast routes appears to be in
lcp_router_table_add_or_lock. so ff00/8 route will be processed
for ospf purposes the right way
 Ignore IPv6 kernel routes
 Skip adding auto routes into FIB

Type: fix

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: I35f73d629a7fffca7f7d4547adc2549b72c2048f
2022-03-02 22:24:17 +00:00
fe6d8a3706 vcl: fix segment detach post api disconnect
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0982f0f5c8186f9ed962db49a14f35aa19f6a276
2022-03-02 19:35:52 +00:00
6a2c6a0445 wireguard: improve sending WG interface dump details
Include the user_instance in wireguard interface details.
In addition to dumping all wireguard interface details,
also allow selective dumping of just one interface.

Type: improvement
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: Iaf1093c6ae3eb00a685f34b2e0171285b02fae2b
2022-03-02 11:50:55 -06:00
30a6f8286e tap: fix tun set mtu
Type: fix
Fixes: 1cd0e5dd53

Change-Id: I64318585fb3b12369b78735c681f3b747c67b53b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-02 11:09:00 +00:00
08bd44bce5 build: fix missing dependency for library
When building a VPP library out of tree using add_vpp_library, the build
sometimes fails because the library API files are not necessarily
generated before compiling this library.

This is fixed by adding the lib API files as dependencies of the
lib compilation.

Type: fix
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: I69dffaecbfd547f10115504494a47358c4624258
2022-03-02 10:54:56 +00:00
5981319a77 hsa: add tps support for random closes
Useful for stress testing.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0b1701682494a9fbf7deac311b4afd3036c50b56
2022-03-01 16:30:54 +00:00
0f8912f0d6 virtio: refactor code
Type: refactor

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I3788cc857023fafcc8eb6d6ff4524425026a75d8
2022-03-01 16:08:11 +00:00
855ad3373e vat2: include src/vlibmemory/vlib.api messages
- cli_inband is missing from vat2

Type: improvement

Change-Id: I1f22dee3ee29f3cf0f1f7c6076d5f2b2b2bf969d
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-03-01 07:01:23 +00:00
8c5e5f6402 tls: handle read write ssl errors
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If5eed7dac4951f0510a4b4b092f66f44d0d3cacd
2022-02-28 21:04:14 +00:00
3683d1b5ab tls: Receive only when the app_session is available
Type: fix

Signed-off-by: Saravanan Murugesan <sarmurug@cisco.com>
Change-Id: Icfd5e3c0bb034684c7bc43be46927294536ba08a
2022-02-28 16:33:00 +00:00
76b86b033e tls: Handle transport disconnect during client HS failures
Type: fix

Signed-off-by: Saravanan Murugesan <sarmurug@cisco.com>
Change-Id: I5f7f4b925b3d250c5b8616d1fb35edbde50a7a23
2022-02-28 06:05:59 +00:00
6379b1e713 misc: VPP 22.02 Release Notes
type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I32291160f0d22a804929d0a040472ff952f02544
Signed-off-by: Maciek Konstantynowicz <mkonstan@cisco.com>
(cherry picked from commit 7911f29c51)
2022-02-25 10:31:52 +00:00
6081dda84b vapi: Missing include file in vlib.api.vapi.h
- A call to vapi_msg_control_ping_hton() is generated in
  a static inline function in vlib.api.vapi.h, which is
  defined/generated in memclnt.api.vapi.h without
  including memclnt.api.vapi.h in vlib.api.vapi.h.
  This breaks the compilation of plugins which include
  only vlib.api.vapi.h (e.g. hicn_plugin from the HICN
  project).

Type: fix
Fixes: a1400cecb

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I5574f4ed496183ea93265f493bf3624254a865a2
2022-02-24 23:19:17 +00:00
35d2ba9331 hsa: add support for vrfs in tps
The app keeps on using the default app ns but each listen will be done
in the vrf configured.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0947e03188d55231b299916351115038e0b1f5da
2022-02-24 20:12:14 +00:00
aa0c03fa46 hsa: fix tps data offset on connection reuse
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibe92497cc5446ac5c734f8fe5c63c0167204dd09
2022-02-24 20:04:15 +00:00
447e51d4e4 session: fix session layer socket read
This fixes an issue caused by session layer reading expected part of
data (cert + key) before the client actually sends it.

Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I6ddddb08f9576211b302e814d7c2b040383e5fb7
2022-02-24 19:21:20 +00:00
26cd0242c9 tests: better reporting for unexpected packets
Raise a new UnexpectedPacketErrror, when a packet is captured
unexpectedly. This pretty-prints a terse description of said packet.

Type: improvement
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: Ibac19fc5bbd82a150fec3c90940a37af6344fd4f
2022-02-24 12:51:33 +00:00
40cfc1560e build: export missing header files required by hicn_plugin
- HICN project's hicn_plugin requires vnet header files
  fib/fib_entry_track.h and udp/udp_encap.h to be
  included in build-root/install-vpp*-*/vpp/include/vnet

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Iabd3f8fe0aee8d727758fc6ef202e859d68d63a3
2022-02-23 17:15:14 -05:00
1b026cb028 http hsa: use octet-stream content type for tps
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I925618e426b325f4fafb9ed39a2d7c2d7c7b38f3
2022-02-23 21:33:46 +00:00
4df1d35132 http: improvement reset and close handling
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I37ff8099c6c8044881379b4cd47ca8843746c315
2022-02-23 21:24:47 +00:00
f83d6668b0 http hsa: support multiple listeners for http tps
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie89326ed4e599231fc20de67c5dadbb428568bec
2022-02-23 21:24:47 +00:00
45207e0fb2 wireguard: fix dereferences null pointer
Type: fix

Fixed coverity-issue CID 248517.
Originally possible passing null pointer to one function and directly
dereferences it.
This patch fixes the issue by add a new condition to check this
pointer.

Change-Id: If506abaf08c9f003860b641971af291f68613c18
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
2022-02-23 09:15:12 +00:00
a7d7383a44 vrrp: fix thread synchronization issue
Type: fix
Fixes: 39e9428b90

When a VRRP advertisement is received by a worker thread, the worker
calls vl_api_rpc_call_main_thread() so the main thread will process the
packet and make adjustments to VR state if necessary.

The data being passed to the main thread included a pointer to the VRRP
header in the received packet buffer. Since the main thread processes
the RPC request asynchronously from the worker thread, it's possible for
the worker to drop the packet and for the buffer to be overwritten before
the main thread can process it.

Copy the fields which may be needed by the main thread into a struct
instead of passing a pointer to a packet buffer.

Change-Id: I4e899e967df5a54776b521825a80e9cce1a94f5f
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2022-02-22 13:28:53 -06:00
d9d77076b0 wireguard: prevent stacksmashing on poorly formed base64 keys
Integer math on 32 bytes of base64 data might yield 33 bytes
of data in some poorly formed user input of private key values.
Rather than smashing the stack (detected) and aborting, simply
allow for the possible yet irrelevant 33-rd byte of data.

Type: fix
Fixes: edca1325cf
Change-Id: I42acfbf3e8fbb3d517e21c53d4f80459d4800e9d
Signed-off-by: Jon Loeliger <jdl@netgate.com>
2022-02-22 18:21:41 +00:00
09cdea643a linux-cp: Only enable/disable the punt feature on the 0<->1 transition
Type: fix

otherwise the feature is enabled n times for n lcp-pairs and the packets go n times through the feature.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I8e47e4a293d6e2711f54aa09e9545e5e07728026
2022-02-22 18:20:34 +00:00
cb8b4c9486 vxlan: crash on assigning IP address to interface
Revert "vxlan: crash on configuring vxlan tunnel on l3 mode"

This reverts commit b8de7d43e4.

Reason for revert: VPP-2014

Type: fix
Fixes: b8de7d43e4

Change-Id: Ic4d10f28985ee10e0550a1bbfd465ada915e4aa6
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
2022-02-22 15:34:44 +00:00
407583ee4f fib: fix adj_get crash
adj_get() crashed in worker thread. The index is valid but was freed.

0x00007fba5fb07921 in __GI_abort () at abort.c:79
0x00007fba528de7c3 in os_panic () at /development/libvpp/src/vpp/vnet/main.c:618
0x00007fba506f2a19 in debugger () at /development/libvpp/src/vppinfra/error.c:84
0x00007fba506f2797 in _clib_error (how_to_die=2, function_name=0x0, line_number=0, fmt=0x7fba521cecd9 "%s:%d (%s) assertion `%s' fails") at /development/libvpp/src/vppinfra/error.c:143
0x00007fba51d88254 in adj_get (adj_index=79) at /development/libvpp/src/vnet/adj/adj.h:472
0x00007fba51d87642 in icmp6_neighbor_solicitation_or_advertisement (vm=0x7fb9f19a0580, node=0x7fb9bb820340, frame=0x7fb9b718bc40, is_solicitation=0) at /development/libvpp/src/vnet/ip6-nd/ip6_nd.c:134
0x00007fba51d8f479 in icmp6_neighbor_advertisement (vm=0x7fb9f19a0580, node=0x7fb9bb820340, frame=0x7fb9b718bc40) at /development/libvpp/src/vnet/ip6-nd/ip6_nd.c:348

Type: fix

Signed-off-by: Rajith P R <rajith@rtbrick.com>
Change-Id: Ibe29854137ee9680f7947450eb7e256b8c0ade31
2022-02-22 18:26:51 +05:30
cf2595dfc0 fib: fix mpls db label overflow
mpls fib DB size was 2^20 instead of intended 2^21.
Therefore large mpls labels caused DB to overflow and write
to other tables or some random objects. Or crash with ASAN.
Sometimes.

Type: fix

Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: I6db65680037a266fe47e8213464a0c16de63c06c
2022-02-22 06:40:22 +00:00
d85fe1a216 lisp: fix ip and udp checksum computation
Type: fix
Fixes: 6fdcc3d

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I820c505482801ff2ab8dac41a0016bb3a741a4ee
2022-02-21 17:32:03 +00:00
ad3187fe23 tests: add enhanced packet counter verification
Add support for inline packet counter verification to send_and_* functions.

Diff dictionary is a dictionary of dictionaries of interesting stats:

    diff_dictionary =
    {
        "err" : { '/error/counter1' : 4, },
        sw_if_index1 : { '/stat/segment/counter1' : 5,
                         '/stat/segment/counter2' : 6,
                       },
        sw_if_index2 : { '/stat/segment/counter1' : 7,
                       },
    }

It describes a per sw-if-index diffset, where each key is stat segment
path and value is the expected change for that counter for sw-if-index.
Special case string "err" is used for error counters.

This then allows more precise packet counter verification by first
defining a "zero" dictionary, e.g. for ED NAT:

        cls.no_diff = StatsDiff({
            pg.sw_if_index: {
                '/nat44-ed/in2out/fastpath/tcp': 0,
                '/nat44-ed/in2out/fastpath/udp': 0,
                '/nat44-ed/in2out/fastpath/icmp': 0,
                '/nat44-ed/in2out/fastpath/drops': 0,
                '/nat44-ed/in2out/slowpath/tcp': 0,
                '/nat44-ed/in2out/slowpath/udp': 0,
                '/nat44-ed/in2out/slowpath/icmp': 0,
                '/nat44-ed/in2out/slowpath/drops': 0,
                '/nat44-ed/in2out/fastpath/tcp': 0,
                '/nat44-ed/in2out/fastpath/udp': 0,
                '/nat44-ed/in2out/fastpath/icmp': 0,
                '/nat44-ed/in2out/fastpath/drops': 0,
                '/nat44-ed/in2out/slowpath/tcp': 0,
                '/nat44-ed/in2out/slowpath/udp': 0,
                '/nat44-ed/in2out/slowpath/icmp': 0,
                '/nat44-ed/in2out/slowpath/drops': 0,
            }
            for pg in cls.pg_interfaces
        })

and then to specify only changed counters directly when calling
one of send_and_* functions:

        self.send_and_assert_no_replies(
            self.pg0, pkts, msg="i2o pkts",
            stats_diff=self.no_diff | {
                "err": {
                    '/err/nat44-ed-in2out-slowpath/out of ports': len(pkts),
                },
                self.pg0.sw_if_index: {
                    '/nat44-ed/in2out/slowpath/drops': len(pkts),
                },
            }
        )

operator | is overloaded by StatsDiff class to perform a deep merge operation,
so in above case, dictionaries for "err" and self.pg0.sw_if_index do not
overwrite whole sub-dictionaries, rather the contents are merged,
assuring that all the remaining counters are verified to be zero.

Type: improvement
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I2b87f7bd58a7d4b34ee72344e2f871b2f372e2d9
2022-02-21 08:29:00 +00:00
107ad73e1b tests: add a generalised counter assert function
Type: improvement
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I5e0fd1019372df0cd403725b8cac52363af13718
2022-02-21 08:29:00 +00:00
140af1559e tests: allow not removing vpp objects after test
Some tests might want to keep vpp config in between test functions.
Add a flag to allow that.

Type: improvement
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I90243cd667dce922b43b381f3d52f4ac0f6bf3a7
2022-02-21 08:29:00 +00:00
caf4e754ea nat: make tcp/udp/icmp packet counters consistent
TCP/UDP packets which are dropped are not counted towards TCP/UDP
counters. Apply same behaviour to ICMP packets.

Type: improvement
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I487fa7135ac8e49431a621fac213638d2dab31c8
2022-02-21 08:29:00 +00:00
a19ad1c362 hsa: fix coverity warnings
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I4ede67c901456d57e457c648d28153423d45fb41
2022-02-18 18:48:31 +00:00
489d89c1cb perfmon: show distribution of uops delivered to frontend
Breakdown the distribution of uops delivered to the frontend.
Collerates directly with the source of the uops.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I93a57dbe56dfa0f378527844aa4e63f45a548e55
2022-02-18 14:50:07 +00:00
502714fc44 dpdk: support devargs for vmbus
Type: feature

Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: I2fd12a5b30aacdbaecb9156b829bfc06dfea377f
2022-02-18 14:45:16 +00:00
2164f7bf58 fib: Use the VLIB logger for adjacency debugging
Type: improvement

remove the [un]lock logs, they are not useful.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I903d3088b8ed9831f931208aeb6b6862a945550c
2022-02-18 14:40:28 +00:00
66593a6a63 vnet: add set_max_frame_size callbacks for several interfaces
This is required after distinguishing between max_frame_size and MTU

Type: fix
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: Ie642bee4e30ca76903bb8be5eeb6914c2c09bf35
2022-02-18 14:10:50 +00:00
c810c33f84 wireguard: fix passing null pointer
Type: fix

Fixed coverity-issue CID 248517.
Originally possibly passing null pointer to one function and
directly dereferences it.
This patch fixes the problem by add a new condition.

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I02fc6fb5d1cfd6138ea4ba2b1946fd8a7ef34d3b
2022-02-18 09:50:41 +00:00
699bea2494 tests: Consolidate the implementations of send_and_expect_X
Type: test

there were multiple instances of send_and_expect_load_balancing
and a send_and_expect_one_itf which has the same functionality as send_and_expect_one.

Put one implementation of both in framework.py (where the other send_and_X functions reside).

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I7f629d440220bee29368067f475059322e1134f7
2022-02-18 09:20:40 +00:00
aacd3ed6d5 ipsec: fix vector after remove entry in spd
Originally after remove the policy entry in spd, macro "vec_del1"
can change localization of the last entry in vector and finally the
entry list has not been sorted.
This patch fixes this issue by change executed macro "vec_delete"
instead of "vec_del1".

Type: fix

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I396591cbbe17646e1d243aedb4cdc272ed4d5e25
2022-02-18 09:15:10 +01:00
2273ffd878 wireguard: Fix wireguard device name to use user-instance
If the user supplies an instance number when creating a wireguard
interface, it should be used in the device name.  If no user-instance
is given, the device instnce (tunnel number) is used.

For example:
    vpp# wireguard create instance 17 listen-port 23023 src 1.2.3.4
            private-key MDEwMjAzMDQwNTA2MDcwODA5MTAxMTEyMTMxNDE1MTY=
    wg17

Type: fix
Fixes: edca1325cf
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: Ibf51868bf7b4b9e8a3f85557d05667207873bc91
2022-02-17 20:54:10 +00:00
7705b4916b tls http srtp: fix session index for listeners
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If5e6d0e8c686ea93674d6201c38b3a4d1c4786a5
2022-02-17 19:07:30 +00:00
b23ffd7ef2 tests: make tests less make dependent
Implement command line argument parsing instead of passing arguments via
environment variables. Add script for running tests without having to
invoke make. Deprecate running tests via make.

Type: improvement
Change-Id: I2e3054a61a2ae25d460e9be00be7d7705fbf943e
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-02-17 18:02:35 +00:00
8ccc6b3507 vcl: add support for reconnect
Supported only when eventfd option is enabled.

Type: feature

Change-Id: Ic9d6e38604e978f7bc8e54d74fe9b8f3fc53622d
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2022-02-17 17:38:47 +00:00
0cbc4bd272 ip: Move the IPv6 echo responder into the ping plugin
Type: refactor

To be consistent with the location of the IPv4 responder

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ie3a5c3ecc10755317591d7ff57b74770c2798e77
2022-02-17 16:02:49 +00:00
992a4d0d4e ipsec: Improve the handling of NAT-T keepalive messages
Type: improvement

Ethernet frames on the wire are a minimum of 64 bytes, so use the length in the UDP header to determine if the ESP payload is one bytes of the special SPI, rather than the buffer's size (which will include the ethernet header's padding).
In the case of drop advance the packet back to the IP header so the ipx-drop node sees a sane packet.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ic3b75487919f0c77507d6f725bd11202bc5afee8
2022-02-17 15:42:29 +00:00
e2b15863f9 ping: fix incorrect index while clearing ping
Type: fix

Signed-off-by: Vyshakh Krishnan <vyshakh@rtbrick.com>
Change-Id: I0b085fd2d3d9b8e08a16585c4964101b6461bf06
2022-02-17 10:58:36 +00:00
6450a179f4 dpdk: enable scatter on Rx for net/ena
Type: fix

Since commit e2a6d08bef
DPDK started advertising scattered Rx feature for elastic network adapters. Thus, dpdk
plugin doesn't have to disable it for ENA by default anymore

Signed-off-by: akolechk <akolechk@cisco.com>
Change-Id: I2d4f429be992e3c4edcc0c3adf8c55f3d5381631
2022-02-17 08:33:14 +00:00
b3919ca67a af_xdp: change flag passed to bpf_set_link_xdp_fd
Originally XDP_FLAGS_REPLACE was passed to the function.
For kernels not defining this macro (for example 5.4) in if_link.h vpp
sets it to 0.
If kernel has this macro problem appears, replace flag requires
specifying the program to be replaced. bpf_set_link_xdp_fd wraps
around __bpf_set_link_xdp_fd_replace and passes 0 as old_fd, it leads to
an error while assessing for replacement (if 0 is passed
there is no assessing for replacement).
To address this issue no flag is passed to the function, only 0.

Type: improvement
Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Change-Id: I3689ce7eb8c71c699f0e589111929979c2bbe213
2022-02-16 16:09:37 +00:00
32fd89b608 fib: Use the same adjacency that BFD is using
Type: improvement

When the adj subsystem is notified of a BFD session, it attempts to find the appropriate adjacency from the session's key.
This could lead to a mismatch between the adj used by BFD and that of FIB. The BFD session stores the adj it is using, so FIB uses that instead.
Since adj is now using the same adj as BFD, it does not need to maintain its own locks.
In BFD it is necessary to initialise the adj index used in INVALID and ensure it is not unlock before listeners are notified of the session delete.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I9630867b10bb18969475299a0c754942a8df0f44
2022-02-16 14:21:08 +00:00
558a354c8f bfd: On a point to point link use the all zeros address for the peer.
Type: fix

The adjacency used is then the same one as that used by routes in the FIB and so the BFD protection/fast-failover works for thise route, since they are children of the BFD protected adjacency.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I72e10b3074697cba8a002a4c1acf690983985157
2022-02-16 14:21:08 +00:00
bf9918a7e0 ipfix-export: pass ipv4 addr to format fn for show
When the ipfix address was changed to be an ip_address instead of
an ip4_address the output when creating an exporter via the cli
should have been modified to take the address of the v4 part of
the addr.

Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I141456cd9092c861a4c4aefba4035dbde23efcd6
2022-02-16 11:29:21 +00:00
6a51775d6c crypto: Fix for the crash in crypto
Fix for the crash when both crypto_native_plugin and DPDK QAT
are enabled in startup conf.

Type: fix
Signed-off-by: mgovind <govindarajan.mohandoss@arm.com>
Change-Id: Ib020ed7130a99080a093c70c06d47bcacd6d23b1
2022-02-16 01:15:02 +00:00
3f03ca95b6 quic: fix quic_config_fn cfg cmd parse error
Type:fix

Signed-off-by: fanxb <fxb_mail@163.com>
Change-Id: I244f6ddd0a34e82ababd375646d3bb194602b5d5
2022-02-15 20:29:22 +00:00
f7040f01a5 tcp: Do not include the tcp_packet.h file in the ip4_packet.h
Type: refactor

IP4 does not depend on TCP (it's the other way around).
This upside down dependency leads to some nasty circular includes when trying to use ip46_address.h in interface.h

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I4a1bd21543b08b9c1cf1e5563da738414734a878
2022-02-15 09:02:27 +00:00
cdaf0d8c88 bfd: add per session counters
Add udp total session counts - as stat segment entries:

/bfd/udp4/sessions
/bfd/udp6/sessions

and per session packet/byte counters:

/bfd/rx-session-counters
/bfd/rx-session-echo-counters
/bfd/tx-session-counters
/bfd/tx-session-echo-counters

These counters are per-thread and per-session id.

Adjust tests to verify proper function.

Type: refactor
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: Ie597928022b6ac74c2220019b9e8e1714295f170
2022-02-14 20:21:01 +00:00
b59f63b0e7 bfd: refactor code to fix misc warnings
This change fixes multiple unused parameter warnings, narrowing
conversion warnings and identical switch statement warnings.

Type: refactor
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I4140e939c409ce06cc5aaaf5e1b042681f7ca448
2022-02-14 20:19:28 +00:00
be74504d22 srtp: flag connections for no session layer lookup
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id78cdf742689a5cff356ac0aa3167af1c886b531
2022-02-14 15:51:11 +00:00
dd8a272e9f fib: fix incorrect display of mpls fib_index
Type: fix
Signed-off-by: Rajith P R <rajith@rtbrick.com>
Change-Id: I8c9c85081c27bfe7ee71b5b620a2a761e027789c
2022-02-14 08:19:50 +00:00
cfcc42e290 hsa: add http throughput test server app
Can be used for throughput testing over http. For instance, start
server:

http tps #implicitly listens on port 80

Then, to test throughput with curl:

curl <server_ip>/test_file_10g
curl <server_ip>/test_file_123m

Similarly, for https:

http tps uri tls://<server_ip>/443
curl -k <server_ip>/test_file_1g

Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I30ab7f0d94a7357b3f04546e4a3d3c410a733908
2022-02-13 23:34:51 +00:00
1b969c2f6a memif: Fix underflow
Type: fix

Change-Id: Id183c47328510b5db7ffcc7a4dfb41f5a3151399
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-02-13 20:10:58 +00:00
360aee3e00 http: fix support for files larger than u32
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iad7304c3a8fef14ec85c4240714feb86637411ca
2022-02-11 19:55:17 +00:00
d37328eb8b http: add startup configuration stanza
Support segment and fifo sizes for now.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie7242936de7a87df8a703eb371f665be5be4390d
2022-02-11 01:02:20 +00:00
0bce71eee3 session: use transport endpoint cfg for listen
Makes it similar to connects.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I38c328670054e1a9ba4dc4ea8fe7519a5a09e8be
2022-02-10 21:17:16 +00:00
efeea5b111 vlib: vlib frame bitmaps
Special bitmaps with VLIB_FRAME_SIZE bits.

Type: improvement
Change-Id: I48747e422e519e7b5e930fa720397459d3adbb8e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-02-10 19:12:50 +01:00
f5756175e6 tests: Fix the FIB UT
Type: test

The FIB UT fails in debug mode because there is no string associated woth its fib_node_type_t.
Change the tests to register their own type, which will give it a name.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I36e546718faa7241c088494cbae10939aca51d5a
2022-02-10 17:27:04 +00:00
791144cbc5 stats: Remove unsolicited clib_warning
It is annoying to see unsolicited message like this spew out to the
console which an end-user cares less about.
vlib_stats_rename_symlink:301: RENAME new name: /nodes/unix-cli-local:52/clocks

Type: fix
Fixes: I92a62bb1cb799e8fdc3ec4110ae3428825254f8a

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I071f3d3736c06cd95a38ec46c7e2222caad01283
2022-02-10 17:26:44 +00:00
137d4ca67b vppinfra: small optimization in clib_memset_u64
Type: improvement
Change-Id: I4b89c32c224caf8a3a4ac94b26ecefffd26c7038
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-02-10 16:31:41 +00:00
bc0ef7aef5 vppinfra: clib_memcpy_may_overrun
Faster memcpy variant when overrun of up to SIMD register size - 1 is
accepable.

Type: improvement
Change-Id: I1fb22e2989f2156caa9f34fa096e6ff9ea9ec7b6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-02-10 15:45:56 +00:00
e01ce5ad5d vppinfra:remove uXxY_is_greater
not needed, '>' works...

Type: improvement
Change-Id: I9bfbac787e8dca24e9b1bceda0922740eed26346
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-02-10 15:45:00 +00:00
f8c8809d00 session: avoid debug half-open session pool contention
Half-opens are only allocated from main with worker barrier but can be
cleaned up, i.e., session_half_open_free, from main without a barrier.
In debug images, the free_bitmap can grow while workers peek the
sessions pool, e.g., session_half_open_migrate_notify, and as a result
crash while validating the session. To avoid, proactively grow bitmap in
debug images.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2410793f933fb638651fe8dc08ba78e9bee0bd77
2022-02-10 03:09:44 +00:00
794599bcca vcl: make eventfd flag configurable from env
Type: feature

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Id25e2188c9167b2e187923ebe10660e0bc9c3c0a
2022-02-09 21:04:47 +00:00
97866a3279 fib: ip6 and mpls fib_table memory leaks on fib_table->ft_locks
ip6 and mpls fib_table->ft_locks memory leaked when the table is
deleted.
name tag is leaked for mpls table parsing.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ife68c0ddc3a6f9437a149b308310f042799c2116
2022-02-09 14:45:20 +00:00
63f2c7d701 bfd: Add an update API that has create new or modify existing semantics
Type: improvement

helps keep the agents stateless

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I3588f13c081e24f5a8083b490eb02856361e4ccb
2022-02-09 13:47:29 +00:00
023521fcb6 http_static: cleanup file handler and cache
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7aff3a02315f9f92039dd2e3af1cbd8312aec662
2022-02-08 16:44:06 -08:00
48bdf24ad2 tests: vcl: add missing host stack echo test
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I3b6e56b319aab3ffd2cc82d31e646bd42901275b
2022-02-08 16:46:11 +00:00
261a059b3d memif: memory leak when deleting memif interface
When deleting a memif interface, there is a memory leak in
mif->local_disc_string. The code that leads to memory leak is
memif_delete_if -> memif_disconect -> vec_dup

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I579c743c3d47770131153e083e65f6cd899067b3
2022-02-07 19:04:18 +00:00
a47203128b build: Make the build work on Debian 11
Debian 11 has some packages that have changed, and need adjustment.
Also - its default compiler is gcc 10, which, contrary to either gcc 8
or gcc 11 prints a bunch of warnings, which fails compilation.
And there is no gcc 11 package.

Therefore, use clang for this build.

Additionally, python 3.9 has exposed this issue:
https://bugs.python.org/issue42580

Therefore, make a local patch to scapy to tackle it.

Type: feature
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I7b9c0f852ab97fe3c1feca3f22020ac0970ba3e2
2022-02-07 18:40:51 +00:00
688d276340 igmp: make sure fib_index is set before delivering to ip4-local
IGMP packets with Router Alert option are delivered to ip4-local
without going through ip4-lookup. Make sure fib_index is initialized
properly.

Type: fix

Change-Id: Iab090a33c4c759b6d7f68c28a0b3f4da7a9de864
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-02-07 18:10:05 +00:00
fa5aabbf0b tests: Update python packages
- pip == 22.0.3
- pip-tools == 6.5.0
- setuptools == 60.7.1 (now pinned in test/Makefile)
- upgrade packages in requirements-3.txt
- install iperf3 for 'make test TEST=vcl'

Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I1bd85f10fb4f6ba87b9bc1267905e5f1b8eb16de
2022-02-07 16:39:35 +00:00
7463900dbd http_static: fix coverity warning
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6d5527c49e9085f35be988549c2f1460be7fd4f0
2022-02-06 16:58:04 -08:00
7a2574a8ca dpdk: remove dead code
rte_eth_tx_burst() returns the number of packets  actually stored in
transmit descriptors and the return type is uint16. n_sent cannot be
negative and the if branch is dead code.

Type: improvement

Change-Id: Idc2980d342756c1093ddf74ea6207d072e819331
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-02-06 11:46:49 +00:00
291307e427 stats: fix memory leaks
Type: fix
Fixes: 72e31bc2d9
Fixes: db02380
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I92a62bb1cb799e8fdc3ec4110ae3428825254f8a
Signed-off-by: Ole Troan <ot@cisco.com>
2022-02-06 11:45:11 +00:00
fdbafb8ca1 perfmon: Fix typo in debug log messages
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Type: style
Change-Id: I955c19ddbe06ef3651c03820fcc14054c63258b9
2022-02-06 11:44:49 +00:00
6c33728a35 http_static: handle empty requests
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic002444c51b1ecbbf18a49863cf01888d28c4632
2022-02-05 21:20:29 +00:00
a3d710e2d7 http: estimate tx packets for scheduler
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibca4bf59e6319ffdc1beaa084ca80f216e062af0
2022-02-05 21:19:53 +00:00
3e157100b5 session: track bytes dequeued in snd params
Also reset send params flags before calling transports to avoid explicit
resets in all transports.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1da7b3fab009728e7fee4199425ced933fa8a122
2022-02-05 21:19:53 +00:00
6eaeea9003 tests: mark the test suites broken when ASan is enabled
Mark broken test suites using @tag_fixme_asan.The main issue
is that some tests do not pass with ASan. These will need to
be fixed, but it takes time and in the meantime, new issues are
introduced that trip up ASan. When this tag is set and Asan
is enabled, failing ASan tests are skipped, so incremental
fixes can pass the CI

Type: improvement

Change-Id: I02602eb74234c25a4c701279e14704b81d4c5b71
Signed-off-by: Naveen Joy <najoy@cisco.com>
2022-02-05 20:14:37 +00:00
ea2721f766 tests: remove constant argument
Reduce number of arguments by removing an argument which is only ever
used with same constant value.

Type: refactor
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I061635b28031d75eb1f853b570e85f6e5a9094df
2022-02-05 20:11:44 +00:00
0e95c18753 tests: fix test-checkstyle-diff if no .py changed
Type: fix
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I6d23ff14380b0154f617b3ab7cd1acd5aa45106a
2022-02-05 19:42:35 +00:00
1a7344f732 prom: add option to set stat name prefix
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8b40d4e935c9280ff89a3d0f8b30bd7beac1e08a
2022-02-03 23:19:57 +00:00
e38babcdf9 http: honor max seg len in ptr buffer
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I58ecd933f36c6622f4c6b373d2d94a48f9fc9eae
2022-02-03 20:43:00 +00:00
f840880c2f ip nat: use ip rx sw_if_index in ip-local arc start
This also changes the behavior of the nat44-ei hairpinning feature.
Rather then enabling the feature on every nat interface, it is enabled
only on local0.

Type: improvement

Signed-off-by: Filip Varga <fivarga@cisco.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4e16a83c9e328aa75fc61df508b620ef743ca775
2022-02-03 20:38:18 +00:00
7285be2aab prom: basic builtin prometheus stats exporter
This is a vpp builtin alternative, not a replacement, for the existing
vpp_prometheus_exporter.

The plugin works by registering with http_static as a url handler for
stats.prom and handles requests by scraping the stats segment in the
main thread. It will therefore consume vpp process cpu cycles.

By default the plugin is disabled. To enable, first start the http
static server an then use "prom enable" cli.

Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If6888e965d1b2361f6a5546586068213d37079d1
2022-02-02 17:04:46 -08:00
c556fa49b4 bfd: restore the data within the packet after hash verification
The BFD delayed auth change test was failing intermittently within CI.
Debugging has shown it depends on the initial random seed, e.g. the below
will consistently fail:

RND_SEED=1643734669.7126195 TEST='bfd.BFDAuthOnOffTestCase.test_auth_change_key_delayed'

Same thing will happen with:
RND_SEED=1643736595.1363552
RND_SEED=1643722239.8224792

The analysis of the behavior shown that the function that is doing the hash verification,
modifies the content of the packet for the purposes of hash computation.
In case of the auth rollover, this function may be called twice - resulting in the second
comparison to be made with a bogus packet data, thus failing the check and the test.

The above values of random seed are the ones where the test makes it
to the point of this double comparison.

The solution is to restore the data within the packet after the check from the array
where we have copied it into before modifying the packet.

Change-Id: Ibb09beb4b1230032db04527bbf38fa335651866b
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-02-02 19:30:49 +00:00
bd8013ee8c http_static: add support for async tx from handlers
URL handlers can send data asynchronously if needed.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I89eae690cb26543479c7659b5dc46604cbb22eba
2022-02-02 10:35:23 +00:00
d6eed1bb20 gso: remove the assert if packet is geneve or gre encaped
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I3265d4a3843b07c2e0050e297f1e014fc5b31cf7
2022-02-01 19:06:58 +00:00
c4a48f2c39 virtio: coverity woes -- divide by zero
Coverity complains the expression, j % vif->num_txq, may encounter
divide by zero. While there is little chance that vif->num_txq is
zero, it is easy to prevent divide by zero if vif->num_txq is ever
zero.

Type: fix
Fixes: I337ec63d0868f665329d68eadf1744e080b73a0d

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I2e91f296737ce266ab70fffc1f442cc600724fa2
2022-02-01 16:33:26 +00:00
0a214804f8 stats: vpp_get_stats crashes in stat_segment_data_free
STAT_DIR_TYPE_EMPTY is not handled. This can happen when the
interface is deleted.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic1f5a1a0e7005059628d1dde31118d692c1967d8
2022-02-01 15:19:06 +00:00
dafdcf7e6d nat: memory leak on nat44_plugin_disable
We invoke nat_affinity_enable for nat44_plugin_enable.
We need to invoke nat_affinity_disable for nat44_plugin_disable
to free the memory for bihash.

Type: fix
Fixes: I2743f7b1104b627bcc5ef937e3a50655313a26ea

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I9adeb3225136e3fff853c2d5b8f9a30e98ddcf4c
2022-02-01 15:18:37 +00:00
53cee1579e nat: nat44-ei hairpinning code cleanup
Removing obsolete unused nat44-ei nodes and functions.

Type: refactor
Change-Id: I1e03e283091c3c0d92908d04037cba00a348351a
Signed-off-by: Filip Varga <fivarga@cisco.com>
2022-02-01 12:09:17 +00:00
ca5f6b851d perfmon: Add perfmon maintainer
Add Ray Kinsella as maintainer of the perfmon plugin. Update maintainers of the
sphinx documentation.

Type: refactor

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I9c05dbed3dcc9909b497df776fa01c52bc048e0f
2022-01-31 19:01:50 +00:00
a8a9a8a569 tests: correct python usage in virtualenv
Use 'python3' for all python calls in virtualenv. Using $(PYTHON_INTERP)
(set to $(PYTHON)) is incorrect when $(PYTHON) contains absolute path
(e.g. '/usr/bin/pypy3') as it uses interpreter outside of virtualenv.

Type: fix
Change-Id: I19878360cfc1ab6a591e09a079b0b69c1a1a58cf
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2022-01-31 15:08:27 +00:00
01c1fa41f0 ip: reassembly - add a way to disable for forus
Add API to disable full reassembly of "forus" packets. Mark packets
passing through ip[4|6]-local nodes with a new buffer flag and check for
that flag in reassembly.

Enable IP6 "forus" full reassembly by default to be consistent with
existing IP4 setting.

Type: improvement
Change-Id: I7067792fcd4304182654237968e4c4d9293c6143
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2022-01-31 15:07:58 +00:00
cf1e8c1eea ip: fix length calculation in ip6-receive
Replace unconditional usage of
buffer->total_length_not_including_first_buffer with a logic checking
whether that length is set to a valid value.

Type: fix
Fixes: 17478e4eb8
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I161d0957d62cc23826edd821aa5560bcfc5c1a33
2022-01-31 14:58:36 +00:00
3a1a86f87f tests: make VPP_BUILD_DIR to point to correct dir
Make VPP_BUILD_DIR hold the correct value and adjust paths where
necessary.

Type: refactor
Change-Id: I5bc60666c04919956bf26badaf1ee1f1b188ef65
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2022-01-31 14:58:19 +00:00
c0a2f0ec9b tests: support skipping to test method with STEP
Allow entering a test name on stack trace window with STEP=y option
instead of a number. This allows to run a whole suite and skip all tests
until a particular test is hit.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I23e45f8022b82545365b8921390e0e106e02b39c
2022-01-31 14:52:44 +00:00
6de58f5fd0 cnat: maglev fixes & improvements
This fixes the maglev logic which previously
included a wrong simplication.
It moves the maglev logic to its own file,
and adds a test function in the debug cli.

Type: improvement

Change-Id: I2790ae2a26fc1c5739ff02f41d436bfcafd5b380
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-01-30 15:23:09 +00:00
c454e8993d snort: feature support on interface output
support snort plugin on interface output via ip4-output fa

Type: feature

Signed-off-by: Sivaprasad Tummala <Sivaprasad.Tummala@intel.com>
Change-Id: I2d5e7d0719c03f88806b12debfe596675dbd66c1
2022-01-30 15:20:38 +00:00
9d0c638b0f perfmon: topdown level 1 and 2 for icx
Topdown level 1 and 2 for Intel Ice Lake (ICX). Limiting topdown support
to THREAD for the moment on Ice Lake, as NODE support is still
unreliable. Also removing Topdown Level 1 from Sapphire Rapids onwards,
as Topdown LeveL 2 also shows Level 1 on Sapphire, and it reduces the
overall number of bundles.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: Iaa68b711dc8b6fb1090880b411debadb3c37f8bc
2022-01-30 15:08:18 +00:00
7e8aeb876b perfmon: fix init of bundles with pseudo events
Previously Linux pseudo events were being counted as multiple fixed
events, such that a bundle with pseudo events could exceed the number of
available fixed counters. Reworked to ignore pseudo events in the
accounting for the moment.

Type: fix
Fixes: 0024e53ad
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: Ic938f8266fd04d7731afbd02e261c61ef22a8522
2022-01-30 15:08:18 +00:00
0a0e711cce perfmon: check for duplicates after other checks
Move checking for duplicate bundle names after the other checks.

Type: fix

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I7fed5be758814e166eb8756b3df090130ac13bfd
2022-01-30 15:08:18 +00:00
fdb5a5a0e4 http_static: incorporate builtinurl plugin
External handlers can still be registered via hss_register_url_handler
but url handlers must be enabled when server is created.

builtinurl plugin to be removed in a future patch

Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I94e103d908b9e118c7927b997a21ce3f67809889
2022-01-30 14:44:40 +00:00
ffd7a9876e linux-cp: check if libmnl headers are present
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Icb86be8b37fa821f05300ee4415065ca96425fcb
2022-01-30 14:44:11 +00:00
fe85d87235 perfmon: topdown backend bound core bundle
Add a bundle to measure topdown backend bound core cycles, will indicate if any
given execution port has contention.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I37d1b38c101ac42d51c10fa4452b822d34b729c9
2022-01-30 14:43:34 +00:00
1f2070a0fe misc: remove mbedtls from dependencies
Type: make

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I461d1f6289a4bb97c77952b87a35c90f37ec9d26
2022-01-29 04:26:25 +00:00
307ff11acb linux-cp: Fix coverity issue
Type: fix

Possible negative return in open(), do not use curr_ns_fd if it is
negative.  Addresses Coverity issue 248535

Signed-off-by: Pim van Pelt <pim@ipng.nl>
Change-Id: I8429ede0f1fe9fe6619e3c4dbd83adb620ea62c2
2022-01-28 16:46:12 +00:00
15d0215b9c misc: vppctl - fix coverity warning
Calculate space left to silence coverity.

Type: fix
Fixes: 31f1924346
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I9cd2e91ce74444e2625bf86721a8d3e44bf6afdd
2022-01-28 15:14:45 +00:00
aa9903cabf misc: vppctl - fix coverity warning
Check that provided path fits into defined buffer. Don't write too many
bytes to avoid having an unterminated string.

Type: fix
Fixes: 31f1924346
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I1ea8b6d6a3474c032e542b6980ed14bac72093a8
2022-01-28 14:36:39 +00:00
616447c392 linux-cp: Linux Control Plane Netlink Listener
Type: feature

please see FEATURE.yaml for details.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Signed-off-by: Pim van Pelt <pim@ipng.nl>
Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I6255fd9953d0b03e6b4fe75b67a6845a7c206f74
Signed-off-by: Pim van Pelt <pim@ipng.nl>
2022-01-28 10:46:31 +00:00
1fd912c8dd build: fix compilation on OpenSSL 3.0
So far by suppressing depreciation messages, as there was no transition
period.

Type: make
Change-Id: I9887613fd71a22bf11bf22a04c129aca4a16867f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-27 20:35:57 +00:00
0d47f20940 vppinfra: sparse_vec_free free should free the sparse_vec_header not the embedded vec_header_t
Type: fix

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ie9532543c4d4439beec8ce097eafa34588ad1266
2022-01-27 20:07:27 +00:00
4a6306aa69 perfmon: frontend and backend boundness bundles
Renamed memory stalls to topdown backend-bound-mem, added topdown
frontend-bound-latency and frontend-bound-bandwidth.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I70f42b6b63fe2502635cad4aed4271e2bbdda5f1
2022-01-27 20:02:24 +00:00
0024e53ad0 perfmon: prune bundles by available pmu counters
Prune perfmon bundles that exceed the number of available pmu counters.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I70fec26bb8ca915f4b980963e06c2e43dfde5a23
2022-01-27 20:01:45 +00:00
ae0e3e748f http_static: code cleanup
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic8838c8ef558d671740094a98b5a627a18c8c808
2022-01-27 20:01:18 +00:00
aedcfaf80c perfmon: add cli to show perf config
Added a cli to show Linux perf config for a give perfmon bundle. This
makes it easier to format Linux perf commands for next level analysis.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I9adafa7d441b72120390d186e3c8f884b1bc9828
2022-01-27 15:54:02 +00:00
a1175b726d hsa: cleanup and rename http test server
- cleanup data structures, functions and cli
- remove option to return static html. For similar results, use
http static server
- rename to http_cli.c as it better describes what the app does

Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I502e7566fba4376c68fbe41de9e45079a159e864
2022-01-26 09:08:52 -08:00
6a4a11f479 http_static: refactor to use http transport
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I66396a1879eb3c87ef64783eab82a22896413cd0
2022-01-26 16:54:46 +00:00
1d88fb97be http: generalize buffer implementation
And add support for passing of pointers

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ida3e5ae4ff7842366ae92a5f33c5e761355951a6
2022-01-26 16:54:46 +00:00
b1c9c048a2 dpdk: not having cryptodev resources should not produce warnings
Type: fix
Change-Id: Ifb2e4d93dcf8648b1bd66f4c0ee937295683bd87
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-26 11:14:00 +01:00
556b5a39b6 vppinfra: add support for mask_compare for u64
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ie323a8445f8540cd26d92eb61807afad7f7a0b74
2022-01-25 22:21:48 +00:00
6ec81f209a http hsa: avoid extra space in request
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I70f22350811ef3cd029d69af75659f95cc9a74c8
2022-01-25 19:31:33 +00:00
5f0106a76f api: vapi: honor non-blocking setting
Pass correct conditional based on how vapi is configured wrt blocking.

Type: fix
Fixes: 3fca567ff4
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I47adca19f104d7a758cb2940e93c9fd8c7cc9bfa
2022-01-25 14:35:02 +00:00
8d4db8bfb4 ip: reassembly - fix missing ip6 owner thread init
Initialize ip6 memory owner thread index in reassembly context to avoid
unnecessary handovers.

Type: fix
Fixes: 630ab5846b
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I2996caf1f82a0649c97d481b74dce24a96dce326
2022-01-25 10:01:25 +00:00
05a68d6ece bonding: refactor bonding hash functions to vnet/hash
- move bonding hash functions to vnet/hash
- register the corresponding hash function when the bond interface
is created
- remove floating point vec256 usage
- split bond_tx_inline into bond_tx_hash and bond_tx_no_hash

Type: refactor

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I1698023c48470290d11c9b2bd00996eee9aa079d
2022-01-25 09:49:54 +00:00
340bd8f1ef http: fix rescheduling when transport fifo full
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5ae1039fd614865154bae94150371e42f3e6fd2a
2022-01-25 07:20:15 +00:00
ffd9057493 wireguard: fix passing argument
Fixed coverity-issue CID 248456.
Originally passing argument of type "uint64_t *" to function:
"memcopy_s_inline".
This patch fixes the problem by changing type of passing argument and
make a portable assumption.

Type: fix

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I17e4583a05ea1263e4d8a4acc9949454e5fd92c0
2022-01-24 14:54:07 +01:00
56c492aa05 nat: TCP state tracking based on RFC 7857/RFC 6146
Implement proper state machine based on above RFCs. ACKs to SYNs/FINs
are no longer required/tracked. This is more friendly to peers and
accounts for lost packets and retransmits.

This change also means that all traffic is translated and forwarded
while in transitory timeout, which helps delivering e.g. retransmitted
FINs, FINACKs and other messages.

Also support reopening a session in transitory timeout after seeing both
FINs by seeing both SYNs again. This helps quick connection
reestablishment if the peers want to.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Signed-off-by: Miklos Tirpak <miklos.tirpak@gmail.com>
Change-Id: Ibf521c79463472db97e593bfa02b32b4a06dfd2a
2022-01-24 12:59:46 +00:00
4634d02501 dpdk-cryptodev: add support chacha20-poly1305
Originally cryptodev doesn't support chacha20-poly1305 with aad length
0.

This patch add support in cryptodev for chacha20-poly1305 with aad
length 0. This length is using in Wireguard.

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I0608920bb557d7d071e7f9f37c80cf50bad81dcc
2022-01-24 11:01:51 +00:00
afe31562a1 policer: fix memory leak
Type: fix

policer_add_del does not free "clib_error_t*" when it is not null.

Signed-off-by: Leung Lai Yung <benkerbuild@gmail.com>
Change-Id: I00ad8e53797e46adeb1819856262bb9f3c068c63
2022-01-24 10:24:15 +00:00
13b3e61c50 sr: fix coverity warning
Remove dead code. Pool element cannot be NULL.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I7812efdcdc414af8352474c4e527c878d2e2c459
2022-01-24 08:53:46 +00:00
08f843e562 ip6-nd: fix coverity warning
Restructure code to avoid NULL dereference.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: If3a4319f1b93af272b7b315a9b15ba4ee1f8e7ae
2022-01-24 08:52:31 +00:00
63c31e0a60 vppinfra: fix compilation on riscv
Type: fix
Change-Id: I2bc58a711c9429d7989bfd0bfccd289d43fc35d0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-24 08:50:09 +00:00
7e7b030c80 session: separate transports from apps in show cli
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If9d6153ddce836ec34842fb5e581b2f4565e33df
2022-01-22 13:30:49 -08:00
5384cca855 session: update time for list of subscribers
Instead of constantly scanning all transport vfts for update time
functions, build list at transport enable time.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id5c07cc03ee1fdd072ebbbd40119d1a440a5e3b1
2022-01-22 00:29:30 +00:00
77e69ae2d1 wireguard: add async mode for decryption packets
Originally wireguard doesn't support async mode for decryption packets.

This patch add async mode for decryption in wireguard.
In addition, it contains some performance improvement such as
prefetching packet header and reducing the number of current time
function calls.

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Ieba6ae0078f3ff140c05b517891afb57232b3b7d
2022-01-21 15:44:39 +00:00
492d7790ff wireguard: add async mode for encryption packets
Originally wireguard doesn't support async mode for encryption packets.

This patch add async mode for encryption in wireguard and also adds
support chacha20-poly1305 algorithm in cryptodev for async handler.
In addition it contains new command line to activate async mode for wireguard:
  set wireguard async mode on|off

and also add new command to check active mode for wireguard:
  show wireguard mode

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I141d48b42ee8dbff0112b8542ab5205268089da6
2022-01-21 14:26:53 +00:00
3b9c7ca0ba hsa: refactor test http server to use http proto
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie7c80d75ca511e1905fa73db48d329f7e1fa86ff
2022-01-20 22:58:25 +00:00
0cc76947a4 fib: missing include
Type: fix
Change-Id: Idefded3443b383ba916a66051b003aac106af8e8
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-20 18:46:09 +01:00
8ca08496a4 wireguard: add burst mode
Originally wireguard does packet by packet encryption and decryption.

This patch adds burst mode for encryption and decryption packets. In
addition, it contains some performance improvement such as prefetching
packet header and reducing the number of current time function calls.

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I04c7daa9b6dc56cd15c789661a64ec642b35aa3f
2022-01-20 14:32:27 +00:00
0e4e5a8222 dpdk: fix compilation for DPDK < 21.11
Type: fix

Change-Id: Ic5b74fb7a8e479e8cdccbb6a564ff3fdd299455c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-01-20 12:08:32 +00:00
0b65621d41 http: add http protocol plugin
Basic HTTP/1.1 server side implementation.

Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I06bddaf7f11e28db802b4cd7ef8160c78cb019b6
2022-01-20 00:39:21 -08:00
b85de19145 svm: update number of segments in svm_fifo_segments
In addition to returning the number of bytes also update the number of
segments to reflect the number used.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia87dc2aa62cea38b18dfa83df94dc2abe29d5121
2022-01-19 15:58:20 +00:00
95bbbe479e svm: fix return for partial segment enqueue
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9953d9bf04e708ac8ea475127e3d2f606cc1c8d9
2022-01-19 15:58:20 +00:00
017a676654 misc: Initial 22.06-rc0 commit
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I6b56d2cc785b505e77df0d24a1f441a4c09dc9a8
2022-01-19 13:35:09 +01:00
1512 changed files with 131567 additions and 63412 deletions

View File

@ -1,4 +1,4 @@
# Minimal clang-format version is 8
# Minimal clang-format version is 11
BasedOnStyle: GNU
UseTab: Always
@ -28,3 +28,7 @@ StatementMacros:
- 'VNET_DEVICE_CLASS_TX_FN'
- '__clib_section'
- '__clib_aligned'
WhitespaceSensitiveMacros:
- 'WARN_ON'
- 'WARN_OFF'

21
.github/workflows/close_prs.yml vendored Normal file
View File

@ -0,0 +1,21 @@
---
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
# Optional. Post a issue comment just before closing a pull request.
comment: "Thank you so much for your interest! VPP takes patches at https://gerrit.fd.io/
```
git clone https://gerrit.fd.io/r/vpp
```
Using [git review](https://www.mediawiki.org/wiki/Gerrit/git-review) to contribute patches is recommended"

16
.gitignore vendored
View File

@ -10,6 +10,7 @@
/build-root/path_setup
/build-root/deb/debian/vpp-plugins/
/build-root/deb/.pybuild/
/build-root/*.buildinfo
/build-root/*.deb
/build-root/*.rpm
/build-root/*.tar.xz
@ -17,17 +18,17 @@
/build-root/rpmbuild/
/build-root/test-doc/
/build-root/test-cov/
/build-root/test/
/test/run/
/test/build/
/test/coverage/
/test/venv/
/test/vapi_test/
/test/doc/build/
/build-config.mk
/build/external/*.tar.gz
/build/external/*.tar.xz
/build/external/vpp-*.deb
/build/external/vpp-*.changes
/build/external/vpp-*
/build/external/dpdk_mlx_default.sh
/build/external/downloads/
/path_setup
/tools/
@ -87,6 +88,7 @@ GTAGS
# language servers
compile_commands.json
.clangd
.cache
# indent backup files
*.BAK
@ -118,3 +120,11 @@ compile_commands.json
# debian packaging
.pc
# No test log files
**/test-run-*-*-*
# host stack test framework
/extras/hs-test/vpp-data
/extras/hs-test/hs-test
/extras/hs-test/http_server

View File

@ -2,3 +2,4 @@
host=gerrit.fd.io
port=29418
project=vpp
defaultbranch=stable/2302

View File

@ -41,7 +41,7 @@ F: src/vnet/bonding/
Sphinx Documents
I: docs
M: John DeNisco <jdenisco@cisco.com>
M: Ray Kinsella <raykinsella78@gmail.com>
M: Dave Wallace <dwallacelf@gmail.com>
F: docs/
Infrastructure Library
@ -85,7 +85,7 @@ F: src/vlibmemory/
VNET Bidirectional Forwarding Detection (BFD)
I: bfd
M: Klement Sekera <ksekera@cisco.com>
M: Klement Sekera <klement.sekera@gmail.com>
F: src/vnet/bfd/
VNET Classifier
@ -100,11 +100,16 @@ F: src/vnet/policer/
VNET Device Drivers
I: devices
Y: src/vnet/devices/af_packet/FEATURE.yaml
Y: src/vnet/devices/pipe/FEATURE.yaml
M: Damjan Marion <damarion@cisco.com>
F: src/vnet/devices/
AF PACKET Drivers
I: af_packet
Y: src/plugins/af_packet/FEATURE.yaml
M: Mohsin Kazmi <sykazmi@cisco.com>
F: src/plugins/af_packet
VNET TAP Drivers
I: tap
Y: src/vnet/devices/tap/FEATURE.yaml
@ -115,9 +120,9 @@ F: src/vnet/devices/tap/
VNET Vhost User Driver
I: vhost
Y: src/vnet/devices/virtio/FEATURE.yaml
Y: src/plugins/vhost/FEATURE.yaml
M: Steven Luong <sluong@cisco.com>
F: src/vnet/devices/virtio/vhost_user*
F: src/plugins/vhost
VNET Native Virtio Drivers
I: virtio
@ -180,6 +185,7 @@ F: src/vnet/pg/
VNET Segment Routing (IPv6 and MPLS)
I: sr
M: Pablo Camarillo <pcamaril@cisco.com>
M: Ahmed Abdelsalam <ahabdels@cisco.com>
F: src/vnet/srv6/
F: src/vnet/srmpls/
F: src/examples/srv6-sample-localsid/
@ -385,7 +391,7 @@ Plugin - NAT
I: nat
M: Ole Troan <ot@cisco.com>
M: Filip Varga <fivarga@cisco.com>
M: Klement Sekera <ksekera@cisco.com>
M: Klement Sekera <klement.sekera@gmail.com>
F: src/plugins/nat/
Plugin - PNAT Static match and rewrite engine
@ -425,6 +431,7 @@ F: src/plugins/flowprobe/
Plugin - http_static
I: http_static
M: Dave Barach <vpp@barachs.net>
M: Florin Coras <fcoras@cisco.com>
F: src/plugins/http_static/
Plugin - builtinurl
@ -464,7 +471,7 @@ F: src/plugins/lisp/
Plugin - Link Layer Discovery Protocol (LLDP)
I: lldp
M: Klement Sekera <ksekera@cisco.com>
M: Klement Sekera <klement.sekera@gmail.com>
F: src/plugins/lldp/
Plugin - memif device driver
@ -480,6 +487,7 @@ F: src/plugins/marvell/
Plugin - performance counter
I: perfmon
M: Damjan Marion <damarion@cisco.com>
M: Ray Kinsella <mdr@ashroe.eu>
F: src/plugins/perfmon/
Plugin - PPPoE
@ -563,9 +571,14 @@ M: Dave Barach <vpp@barachs.net>
M: Florin Coras <fcoras@cisco.com>
F: src/plugins/unittest/
Plugin - Intel DMA engines
I: dma_intel
M: Marvin Liu <yong.liu@intel.com>
F: src/plugins/dma_intel
Test Infrastructure
I: tests
M: Klement Sekera <ksekera@cisco.com>
M: Klement Sekera <klement.sekera@gmail.com>
M: Paul Vinciguerra <pvinci@vinciconsulting.com>
F: test/
@ -731,6 +744,11 @@ M: Artem Glazychev <artem.glazychev@xored.com>
M: Fan Zhang <roy.fan.zhang@intel.com>
F: src/plugins/wireguard
Packetforge
I: packetforge
M: Ting Xu <ting.xu@intel.com>
F: extras/packetforge
VPP Config Tooling
I: vpp_config
M: John DeNisco <jdenisco@cisco.com>
@ -773,6 +791,16 @@ I: hsi
M: Florin Coras <fcoras@cisco.com>
F: src/plugins/hsi/
Plugin - HTTP
I: http
M: Florin Coras <fcoras@cisco.com>
F: src/plugins/http
Plugin - Prom
I: prom
M: Florin Coras <fcoras@cisco.com>
F: src/plugins/prom
cJSON
I: cjson
M: Ole Troan <ot@cisco.com>
@ -794,6 +822,19 @@ I: rpm-packaging
M: Laszlo Kiraly <laszlo.kiraly@est.tech>
F: src/extras/rpm/opensuse
VPP StrongSwan Daemon
I: vpp-swan
M: Fan Zhang <roy.fan.zhang@intel.com>
M: Gabriel Oginski <gabrielx.oginski@intel.com>
F: extras/strongswan/vpp_sswan
Host stack test framework
I: hs-test
M: Florin Coras <fcoras@cisco.com>
M: Filip Tehlar <ftehlar@cisco.com>
M: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
F: extras/hs-test
THE REST
I: misc
M: vpp-dev Mailing List <vpp-dev@fd.io>

167
Makefile

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@ MAKE ?= make
MAKE_ARGS ?= -j
BUILD_DIR ?= $(CURDIR)/_build
INSTALL_DIR ?= $(CURDIR)/_install
PKG_VERSION ?= $(shell git describe --abbrev=0 | cut -d- -f1 | cut -dv -f2 | cut -d. -f1,2)
PKG_VERSION ?= $(shell git describe --abbrev=0 --match 'v[0-9]*' | cut -d- -f1 | cut -dv -f2 | cut -d. -f1,2)
PKG_SUFFIX ?= $(shell git log --oneline v$(PKG_VERSION)-rc0.. . | wc -l)
JOBS := $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo),\
$(shell grep -c ^processor /proc/cpuinfo), 2)
@ -36,22 +36,21 @@ endif
ARCH_X86_64=$(filter x86_64,$(shell uname -m))
include packages.mk
include packages/nasm.mk
include packages/ipsec-mb.mk
include packages/quicly.mk
include packages/dpdk.mk
include packages/rdma-core.mk
include packages/libbpf.mk
include packages/dpdk.mk
include packages/xdp-tools.mk
.PHONY: clean
clean:
@rm -rf $(B) $(I)
.PHONY: install
install: $(if $(ARCH_X86_64), nasm-install ipsec-mb-install) dpdk-install rdma-core-install quicly-install libbpf-install
install: $(if $(ARCH_X86_64), ipsec-mb-install) dpdk-install rdma-core-install quicly-install xdp-tools-install
.PHONY: config
config: $(if $(ARCH_X86_64), nasm-config ipsec-mb-config) dpdk-config rdma-core-config quicly-build
config: $(if $(ARCH_X86_64), ipsec-mb-config) dpdk-config rdma-core-config quicly-build
##############################################################################
# .deb packaging

View File

@ -1,6 +1,9 @@
#!/usr/bin/make -f
DH_VERBOSE = 1
DEB_BUILD_OPTIONS = noddebs
DEB_CFLAGS_MAINT_STRIP = -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -O2
DEB_LDFLAGS_MAINT_STRIP = -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects
DEB_CFLAGS_MAINT_APPEND = -O3
PKG=vpp-ext-deps
VERSION = $(shell dpkg-parsechangelog | sed -nr '/^Version:/s/Version: //p')
@ -25,3 +28,5 @@ override_dh_install:
make $(MAKE_ARGS) install
dh_install -p$(PKG) --autodest /opt
override_dh_shlibdeps:
dh_shlibdeps -l$(INSTALL_DIR)lib/

View File

@ -0,0 +1 @@
rdma=41.0 dpdk=22.07

View File

@ -146,5 +146,9 @@ $(B)/.$1.install.ok: $(B)/.$1.build.ok
.PHONY: $1-install
$1-install: $(B)/.$1.install.ok
.PHONY: $1-show-%
$1-show-%:
@echo $$($$*)
ALL_TARGETS += $1-install
endef

View File

@ -14,17 +14,16 @@
DPDK_PKTMBUF_HEADROOM ?= 128
DPDK_USE_LIBBSD ?= n
DPDK_DEBUG ?= n
DPDK_MLX4_PMD ?= n
DPDK_MLX5_PMD ?= n
DPDK_MLX5_COMMON_PMD ?= n
DPDK_TAP_PMD ?= n
DPDK_FAILSAFE_PMD ?= n
DPDK_MACHINE ?= default
DPDK_MLX_IBV_LINK ?= static
dpdk_version ?= 21.11
dpdk_version ?= 22.07
dpdk_base_url ?= http://fast.dpdk.org/rel
dpdk_tarball := dpdk-$(dpdk_version).tar.xz
dpdk_tarball_md5sum_22.07 := fb73b58b80b1349cd05fe9cf6984afd4
dpdk_tarball_md5sum_22.03 := a07ca8839f98062f46e1cc359735cce8
dpdk_tarball_md5sum_21.11 := 58660bbbe9e95abce86e47692b196555
dpdk_tarball_md5sum_21.08 := de33433a1806280996a0ecbe66e3642f
dpdk_tarball_md5sum_21.05 := a78bba290b11d9717d1272cc6bfaf7c3
@ -32,6 +31,11 @@ dpdk_tarball_md5sum := $(dpdk_tarball_md5sum_$(dpdk_version))
dpdk_url := $(dpdk_base_url)/$(dpdk_tarball)
dpdk_tarball_strip_dirs := 1
dpdk_depends := rdma-core $(if $(ARCH_X86_64), ipsec-mb)
DPDK_MLX_DEFAULT := $(shell if grep -q "rdma=$(rdma-core_version) dpdk=$(dpdk_version)" mlx_rdma_dpdk_matrix.txt; then echo 'y'; else echo 'n'; fi)
DPDK_MLX4_PMD ?= $(DPDK_MLX_DEFAULT)
DPDK_MLX5_PMD ?= $(DPDK_MLX_DEFAULT)
DPDK_MLX5_COMMON_PMD ?= $(DPDK_MLX_DEFAULT)
# Debug or release
DPDK_BUILD_TYPE:=release
@ -42,10 +46,12 @@ endif
DPDK_DRIVERS_DISABLED := baseband/\*, \
bus/dpaa, \
bus/ifpga, \
common/cnxk, \
compress/isal, \
compress/octeontx, \
compress/zlib, \
crypto/ccp, \
crypto/cnxk, \
crypto/dpaa_sec, \
crypto/openssl, \
crypto/aesni_mb, \
@ -55,9 +61,11 @@ DPDK_DRIVERS_DISABLED := baseband/\*, \
crypto/zuc, \
event/\*, \
mempool/dpaa, \
mempool/cnxk, \
net/af_packet, \
net/bnx2x, \
net/bonding, \
net/cnxk, \
net/ipn3ke, \
net/liquidio, \
net/pcap, \
@ -73,6 +81,7 @@ DPDK_LIBS_DISABLED := acl, \
bitratestats, \
bpf, \
cfgfile, \
cnxk, \
distributor, \
efd, \
fib, \
@ -166,6 +175,7 @@ PIP_DOWNLOAD_DIR = $(CURDIR)/downloads/
define dpdk_config_cmds
cd $(dpdk_build_dir) && \
echo "DPDK_MLX_DEFAULT=$(DPDK_MLX_DEFAULT)" > ../../../dpdk_mlx_default.sh && \
rm -rf ../dpdk-meson-venv && \
mkdir -p ../dpdk-meson-venv && \
python3 -m venv ../dpdk-meson-venv && \

View File

@ -11,17 +11,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ipsec-mb_version := 1.1
ipsec-mb_version := 1.3
ipsec-mb_tarball := v$(ipsec-mb_version).tar.gz
ipsec-mb_tarball_md5sum_0.54 := 258941f7ba90c275fcf9d19c622d2d21
ipsec-mb_tarball_md5sum_0.55 := deca674bca7ae2282890e1fa7f953609
ipsec-mb_tarball_md5sum_1.0 := 906e701937751e761671dc83a41cff65
ipsec-mb_tarball_md5sum_1.1 := 3916471d3713d27e42473cb6af9c65e5
ipsec-mb_tarball_md5sum_1.2 := f551d9c208893a436c1f5c146a615bd6
ipsec-mb_tarball_md5sum_1.3 := d8692db9efe32a263b61f12ac0dca950
ipsec-mb_tarball_md5sum := $(ipsec-mb_tarball_md5sum_$(ipsec-mb_version))
ipsec-mb_tarball_strip_dirs := 1
ipsec-mb_url := http://github.com/01org/intel-ipsec-mb/archive/$(ipsec-mb_tarball)
ipsec-mb_depends := nasm
ipsec-mb_url := http://github.com/intel/intel-ipsec-mb/archive/$(ipsec-mb_tarball)
define ipsec-mb_config_cmds
@true
@ -34,7 +35,6 @@ define ipsec-mb_build_cmds
SAFE_LOOKUP=n \
SAFE_DATA=n \
PREFIX=$(ipsec-mb_install_dir) \
NASM=$(ipsec-mb_install_dir)/bin/nasm \
EXTRA_CFLAGS="-g -msse4.2" > $(ipsec-mb_build_log)
endef

View File

@ -1,58 +0,0 @@
# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
LIBBPF_DEBUG?=n
libbpf_version := 0.5.0
libbpf_tarball := v$(libbpf_version).tar.gz
libbpf_tarball_md5sum_0.2 := cd0f82d76a9830c1e66b1a249393d5a8
libbpf_tarball_md5sum_0.5.0:= ba0a514d2775f033c24a6fec37e587bc
libbpf_tarball_md5sum := $(libbpf_tarball_md5sum_$(libbpf_version))
libbpf_tarball_strip_dirs := 1
libbpf_url := https://github.com/libbpf/libbpf/archive/$(libbpf_tarball)
LIBBPF_CFLAGS:=-g -Werror -Wall -fPIC -fvisibility=hidden
ifeq ($(LIBBPF_DEBUG),y)
LIBBPF_CFLAGS+= -O0
else
LIBBPF_CFLAGS+= -O2
endif
# check for libelf, zlib and kernel if_xdp.h presence
LIBBPF_DEPS_CHECK:="\#include <linux/if_xdp.h>\\n\#include <gelf.h>\\n\#include <zlib.h>\\nint main(void){return 0;}"
LIBBPF_DEPS_CHECK:=$(shell echo -e $(LIBBPF_DEPS_CHECK) | $(CC) -xc -lelf -lz -o /dev/null - > /dev/null 2>&1)
LIBBPF_DEPS_CHECK:=$(.SHELLSTATUS)
define libbpf_config_cmds
@true
endef
define libbpf_build_cmds__
BUILD_STATIC_ONLY=y OBJDIR='$(libbpf_build_dir)' PREFIX='' DESTDIR='$(libbpf_install_dir)' CFLAGS='$(LIBBPF_CFLAGS)' make -C '$(libbpf_src_dir)/src' $(1) > $(2)
endef
define libbpf_build_cmds
$(call libbpf_build_cmds__,,$(libbpf_build_log))
endef
define libbpf_install_cmds
$(call libbpf_build_cmds__,install,$(libbpf_install_log))
endef
ifneq ($(LIBBPF_DEPS_CHECK),0)
$(warning "Missing libbpf dependencies. libbpf will be skipped.")
libbpf-install:
@true
else
$(eval $(call package,libbpf))
endif

View File

@ -11,9 +11,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
quicly_version := 0.1.3-vpp
quicly_version := 0.1.4-vpp
quicly_tarball := quicly_$(quicly_version).tar.gz
quicly_tarball_md5sum := 195f156f311458f1bd4540765e62dd27
quicly_tarball_md5sum := 5419a0f340c5572bcf682c08acc84c77
quicly_tarball_strip_dirs := 1
quicly_url := https://github.com/vpp-quic/quicly/releases/download/v$(quicly_version)/quicly_$(quicly_version).tar.gz
@ -21,16 +21,17 @@ picotls_build_dir := $(B)/build-picotls
define quicly_build_cmds
@cd $(quicly_build_dir) && \
rm -f $(quicly_build_log) && \
$(CMAKE) -DWITH_DTRACE=OFF \
-DCMAKE_INSTALL_PREFIX:PATH=$(quicly_install_dir) \
$(quicly_src_dir) > $(quicly_build_log)
@$(MAKE) quicly $(MAKE_ARGS) -C $(quicly_build_dir) > $(quicly_build_log)
$(quicly_src_dir) >> $(quicly_build_log)
@$(MAKE) quicly $(MAKE_ARGS) -C $(quicly_build_dir) >> $(quicly_build_log)
@mkdir -p $(picotls_build_dir)
@cd $(picotls_build_dir) && \
$(CMAKE) -DWITH_DTRACE=OFF -DCMAKE_INSTALL_PREFIX:PATH=$(quicly_install_dir) \
$(quicly_src_dir)/deps/picotls > $(quicly_build_log)
@$(MAKE) picotls-core picotls-openssl $(MAKE_ARGS) -C $(picotls_build_dir) > $(quicly_build_log)
$(quicly_src_dir)/deps/picotls >> $(quicly_build_log)
@$(MAKE) picotls-core picotls-openssl $(MAKE_ARGS) -C $(picotls_build_dir) >> $(quicly_build_log)
endef
define quicly_config_cmds
@ -38,8 +39,9 @@ define quicly_config_cmds
endef
define quicly_install_cmds
@$(MAKE) $(MAKE_ARGS) -C $(quicly_build_dir) install > $(quicly_install_log)
@$(MAKE) $(MAKE_ARGS) -C $(picotls_build_dir) install > $(quicly_install_log)
@rm -f $(quicly_install_log)
@$(MAKE) $(MAKE_ARGS) -C $(quicly_build_dir) install >> $(quicly_install_log)
@$(MAKE) $(MAKE_ARGS) -C $(picotls_build_dir) install >> $(quicly_install_log)
endef

View File

@ -13,10 +13,10 @@
RDMA_CORE_DEBUG?=n
rdma-core_version := 38.0
rdma-core_version := 41.0
rdma-core_tarball := rdma-core-$(rdma-core_version).tar.gz
rdma-core_tarball_md5sum_35.0 := 85afb89ec536ef229c0fef6cb87e8665
rdma-core_tarball_md5sum_38.0 := 44e14dd392ac139a0d452148eb0a0514
rdma-core_tarball_md5sum_39.1 := 63ba4632fd01173a2331e5b990373330
rdma-core_tarball_md5sum_41.0 := 2250389cb61a7130133e6411fdeef2f9
rdma-core_tarball_md5sum := $(rdma-core_tarball_md5sum_$(rdma-core_version))
rdma-core_tarball_strip_dirs := 1
rdma-core_url := http://github.com/linux-rdma/rdma-core/releases/download/v$(rdma-core_version)/$(rdma-core_tarball)
@ -32,27 +32,16 @@ define rdma-core_config_cmds
-DENABLE_STATIC=1 -DENABLE_RESOLVE_NEIGH=0 -DNO_PYVERBS=1 -DENABLE_VALGRIND=0\
-DCMAKE_BUILD_TYPE=$(RDMA_BUILD_TYPE) -DCMAKE_INSTALL_PREFIX=$(rdma-core_install_dir) \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_C_FLAGS='-fPIC -fvisibility=hidden' > $(rdma-core_config_log)
-DCMAKE_INSTALL_RUNDIR:PATH=/run \
-DCMAKE_C_FLAGS='-fPIC' -DNO_MAN_PAGES=ON | tee $(rdma-core_config_log)
endef
define rdma-core_build_cmds
$(CMAKE) --build $(rdma-core_build_dir) -- libccan.a libibverbs.a librdma_util.a libmlx5.a libmlx4.a > $(rdma-core_build_log)
sed 's/^Libs.private:.*/Libs.private: -lmlx4 -lmlx5 -libverbs -lrdma_util -lccan -lpthread/' -i $(rdma-core_build_dir)/lib/pkgconfig/libibverbs.pc >> $(rdma-core_build_log)
$(CMAKE) --build $(rdma-core_build_dir) | tee $(rdma-core_build_log)
endef
define rdma-core_install_cmds
mkdir -p $(rdma-core_install_dir)/lib/pkgconfig
cp -avL $(rdma-core_build_dir)/include $(rdma-core_install_dir) > $(rdma-core_install_log)
cp -avL $(rdma-core_build_dir)/lib/pkgconfig/libibverbs.pc \
$(rdma-core_build_dir)/lib/pkgconfig/libmlx5.pc \
$(rdma-core_build_dir)/lib/pkgconfig/libmlx4.pc \
$(rdma-core_install_dir)/lib/pkgconfig >> $(rdma-core_install_log)
cp -avL $(rdma-core_build_dir)/lib/statics/libibverbs.a \
$(rdma-core_build_dir)/lib/statics/libmlx5.a \
$(rdma-core_build_dir)/lib/statics/libmlx4.a \
$(rdma-core_build_dir)/util/librdma_util.a \
$(rdma-core_build_dir)/ccan/libccan.a \
$(rdma-core_install_dir)/lib >> $(rdma-core_install_log)
$(CMAKE) --install $(rdma-core_build_dir) | tee $(rdma-core_install_log)
endef
$(eval $(call package,rdma-core))

38
build/external/packages/xdp-tools.mk vendored Normal file
View File

@ -0,0 +1,38 @@
# Copyright (c) 2023 Intel and/or its affiliates.
# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
xdp-tools_version := 1.2.9
xdp-tools_tarball := xdp-tools-$(xdp-tools_version).tar.gz
xdp-tools_tarball_md5sum_1.2.9:= 6e4a49ceea8354bb7bb3b55990e9aed7
xdp-tools_tarball_md5sum := $(xdp-tools_tarball_md5sum_$(xdp-tools_version))
xdp-tools_tarball_strip_dirs := 1
xdp-tools_url := https://github.com/xdp-project/xdp-tools/releases/download/v$(xdp-tools_version)/$(xdp-tools_tarball)
define xdp-tools_config_cmds
@true
endef
define xdp-tools_build_cmds
@cd ${xdp-tools_src_dir} && make V=1 BUILD_STATIC_ONLY=y > $(xdp-tools_build_log)
endef
define xdp-tools_install_cmds
@rm -f $(xdp-tools_install_log)
@cd ${xdp-tools_src_dir} && \
make -C lib/libbpf/src install V=1 BUILD_STATIC_ONLY=y PREFIX='' DESTDIR='$(xdp-tools_install_dir)' >> $(xdp-tools_install_log)
@cd ${xdp-tools_src_dir} && \
make libxdp_install V=1 BUILD_STATIC_ONLY=y PREFIX='' DESTDIR='$(xdp-tools_install_dir)' >> $(xdp-tools_install_log)
endef
$(eval $(call package,xdp-tools))

View File

@ -0,0 +1,137 @@
From f4192afd7712a8d6be1e80af7478a12caaaa8917 Mon Sep 17 00:00:00 2001
From: Matthew Smith <mgsmith@netgate.com>
Date: Fri, 25 Feb 2022 16:15:40 -0600
Subject: [PATCH] net/igc: Add device ID for i226v
Add the device ID 0x125C in order to enable the i226v.
Add phy ID for the i226 and allow that ID anywhere the phy ID for the
i225 was allowed.
---
drivers/net/igc/base/igc_api.c | 1 +
drivers/net/igc/base/igc_defines.h | 1 +
drivers/net/igc/base/igc_hw.h | 1 +
drivers/net/igc/base/igc_i225.c | 1 +
drivers/net/igc/base/igc_phy.c | 11 ++++++-----
drivers/net/igc/igc_ethdev.c | 1 +
6 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/net/igc/base/igc_api.c b/drivers/net/igc/base/igc_api.c
index 2f8c0753cb..da51ef2d59 100644
--- a/drivers/net/igc/base/igc_api.c
+++ b/drivers/net/igc/base/igc_api.c
@@ -888,6 +888,7 @@ s32 igc_set_mac_type(struct igc_hw *hw)
case IGC_DEV_ID_I225_I:
case IGC_DEV_ID_I220_V:
case IGC_DEV_ID_I225_BLANK_NVM:
+ case IGC_DEV_ID_I226_V:
mac->type = igc_i225;
break;
case IGC_DEV_ID_I350_VF:
diff --git a/drivers/net/igc/base/igc_defines.h b/drivers/net/igc/base/igc_defines.h
index 30a41300f5..767587a171 100644
--- a/drivers/net/igc/base/igc_defines.h
+++ b/drivers/net/igc/base/igc_defines.h
@@ -1351,6 +1351,7 @@
#define IGP04IGC_E_PHY_ID 0x02A80391
#define M88_VENDOR 0x0141
#define I225_I_PHY_ID 0x67C9DC00
+#define I226_I_PHY_ID 0x67C9DC10
/* M88E1000 Specific Registers */
#define M88IGC_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Reg */
diff --git a/drivers/net/igc/base/igc_hw.h b/drivers/net/igc/base/igc_hw.h
index be38fafa5f..686fb721af 100644
--- a/drivers/net/igc/base/igc_hw.h
+++ b/drivers/net/igc/base/igc_hw.h
@@ -164,6 +164,7 @@ struct igc_hw;
#define IGC_DEV_ID_I225_V 0x15F3
#define IGC_DEV_ID_I225_K 0x3100
#define IGC_DEV_ID_I225_I 0x15F8
+#define IGC_DEV_ID_I226_V 0x125C
#define IGC_DEV_ID_I220_V 0x15F7
#define IGC_DEV_ID_I225_BLANK_NVM 0x15FD
#define IGC_DEV_ID_I354_BACKPLANE_1GBPS 0x1F40
diff --git a/drivers/net/igc/base/igc_i225.c b/drivers/net/igc/base/igc_i225.c
index 060b2f8f93..8c078029f7 100644
--- a/drivers/net/igc/base/igc_i225.c
+++ b/drivers/net/igc/base/igc_i225.c
@@ -176,6 +176,7 @@ static s32 igc_init_phy_params_i225(struct igc_hw *hw)
/* Verify phy id and set remaining function pointers */
switch (phy->id) {
case I225_I_PHY_ID:
+ case I226_I_PHY_ID:
phy->type = igc_phy_i225;
phy->ops.set_d0_lplu_state = igc_set_d0_lplu_state_i225;
phy->ops.set_d3_lplu_state = igc_set_d3_lplu_state_i225;
diff --git a/drivers/net/igc/base/igc_phy.c b/drivers/net/igc/base/igc_phy.c
index 43bbe69bca..d46a6b3555 100644
--- a/drivers/net/igc/base/igc_phy.c
+++ b/drivers/net/igc/base/igc_phy.c
@@ -1474,8 +1474,7 @@ s32 igc_phy_setup_autoneg(struct igc_hw *hw)
return ret_val;
}
- if ((phy->autoneg_mask & ADVERTISE_2500_FULL) &&
- hw->phy.id == I225_I_PHY_ID) {
+ if (phy->autoneg_mask & ADVERTISE_2500_FULL) {
/* Read the MULTI GBT AN Control Register - reg 7.32 */
ret_val = phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK <<
MMD_DEVADDR_SHIFT) |
@@ -1615,8 +1614,7 @@ s32 igc_phy_setup_autoneg(struct igc_hw *hw)
ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL,
mii_1000t_ctrl_reg);
- if ((phy->autoneg_mask & ADVERTISE_2500_FULL) &&
- hw->phy.id == I225_I_PHY_ID)
+ if (phy->autoneg_mask & ADVERTISE_2500_FULL)
ret_val = phy->ops.write_reg(hw,
(STANDARD_AN_REG_MASK <<
MMD_DEVADDR_SHIFT) |
@@ -1882,6 +1880,7 @@ s32 igc_phy_force_speed_duplex_m88(struct igc_hw *hw)
/* fall-through */
case I225_I_PHY_ID:
/* fall-through */
+ case I226_I_PHY_ID:
reset_dsp = false;
break;
default:
@@ -1923,7 +1922,7 @@ s32 igc_phy_force_speed_duplex_m88(struct igc_hw *hw)
return IGC_SUCCESS;
if (hw->phy.id == I210_I_PHY_ID)
return IGC_SUCCESS;
- if (hw->phy.id == I225_I_PHY_ID)
+ if (hw->phy.type == igc_phy_i225)
return IGC_SUCCESS;
if (hw->phy.id == M88E1543_E_PHY_ID || hw->phy.id == M88E1512_E_PHY_ID)
return IGC_SUCCESS;
@@ -2480,6 +2479,7 @@ s32 igc_get_cable_length_m88_gen2(struct igc_hw *hw)
phy->cable_length = phy_data / (is_cm ? 100 : 1);
break;
case I225_I_PHY_ID:
+ case I226_I_PHY_ID:
if (ret_val)
return ret_val;
/* TODO - complete with Foxville data */
@@ -3064,6 +3064,7 @@ enum igc_phy_type igc_get_phy_type_from_id(u32 phy_id)
phy_type = igc_phy_i210;
break;
case I225_I_PHY_ID:
+ case I226_I_PHY_ID:
phy_type = igc_phy_i225;
break;
default:
diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c
index a1f1a9772b..0dd3a212d7 100644
--- a/drivers/net/igc/igc_ethdev.c
+++ b/drivers/net/igc/igc_ethdev.c
@@ -97,6 +97,7 @@ static const struct rte_pci_id pci_id_igc_map[] = {
{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_V) },
{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_I) },
{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_K) },
+ { RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I226_V) },
{ .vendor_id = 0, /* sentinel */ },
};
--
2.30.1 (Apple Git-130)

View File

@ -0,0 +1,76 @@
From 16449a64d38c7f4b880601ddf3d34087da5e8577 Mon Sep 17 00:00:00 2001
From: Xiaoming Jiang <jiangxiaoming@outlook.com>
Date: Thu, 9 Jun 2022 06:15:51 +0000
Subject: [PATCH 1/1] bus/vmbus: add support allow/block scan mode
---
drivers/bus/vmbus/vmbus_common.c | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c
index 3677273..47edacb 100644
--- a/drivers/bus/vmbus/vmbus_common.c
+++ b/drivers/bus/vmbus/vmbus_common.c
@@ -102,7 +102,12 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
VMBUS_LOG(INFO, "VMBUS device %s on NUMA socket %i",
guid, dev->device.numa_node);
- /* TODO add block/allow logic */
+ /* no initialization when marked as blocked, return without error */
+ if (dev->device.devargs != NULL &&
+ dev->device.devargs->policy == RTE_DEV_BLOCKED) {
+ RTE_LOG(INFO, EAL, " Device is blocked, not initializing\n");
+ return 1;
+ }
/* map resources for device */
ret = rte_vmbus_map_device(dev);
@@ -134,7 +139,7 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
/*
* If device class GUID matches, call the probe function of
- * register drivers for the vmbus device.
+ * registere drivers for the vmbus device.
* Return -1 if initialization failed,
* and 1 if no driver found for this device.
*/
@@ -163,6 +168,25 @@ vmbus_probe_all_drivers(struct rte_vmbus_device *dev)
return 1;
}
+static bool
+rte_vmbus_ignore_device(struct rte_vmbus_device *dev)
+{
+ struct rte_devargs *devargs = vmbus_devargs_lookup(dev);
+
+ switch (rte_vmbus_bus.bus.conf.scan_mode) {
+ case RTE_BUS_SCAN_ALLOWLIST:
+ if (devargs && devargs->policy == RTE_DEV_ALLOWED)
+ return false;
+ break;
+ case RTE_BUS_SCAN_UNDEFINED:
+ case RTE_BUS_SCAN_BLOCKLIST:
+ if (devargs == NULL || devargs->policy != RTE_DEV_BLOCKED)
+ return false;
+ break;
+ }
+ return true;
+}
+
/*
* Scan the vmbus, and call the devinit() function for
* all registered drivers that have a matching entry in its id_table
@@ -180,7 +204,9 @@ rte_vmbus_probe(void)
rte_uuid_unparse(dev->device_id, ubuf, sizeof(ubuf));
- /* TODO: add allowlist/blocklist */
+ if (rte_vmbus_ignore_device(dev)) {
+ continue;
+ }
if (vmbus_probe_all_drivers(dev) < 0) {
VMBUS_LOG(NOTICE,
--
2.32.0

View File

@ -0,0 +1,57 @@
From 013a095d6b348afddceaa5ea710ef6309566dc85 Mon Sep 17 00:00:00 2001
From: Kai Ji <kai.ji@intel.com>
Date: Fri, 25 Mar 2022 19:22:07 +0800
Subject: [PATCH] crypto/qat: fix of cipher offset and length assignment
This patch fix the cipher offset and length values when convert
mbuf to vector chain for QAT build op.
Fixes: a815a04cea05 ("crypto/qat: support symmetric build op request")
Signed-off-by: Kai Ji <kai.ji@intel.com>
---
drivers/crypto/qat/dev/qat_crypto_pmd_gens.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
index 50a9c5ad5b..dc473e0624 100644
--- a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
+++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
@@ -395,12 +395,12 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op,
ret = qat_cipher_is_len_in_bits(ctx, op);
switch (ret) {
case 1:
- cipher_len = op->sym->aead.data.length >> 3;
- cipher_ofs = op->sym->aead.data.offset >> 3;
+ cipher_len = op->sym->cipher.data.length >> 3;
+ cipher_ofs = op->sym->cipher.data.offset >> 3;
break;
case 0:
- cipher_len = op->sym->aead.data.length;
- cipher_ofs = op->sym->aead.data.offset;
+ cipher_len = op->sym->cipher.data.length;
+ cipher_ofs = op->sym->cipher.data.offset;
break;
default:
QAT_DP_LOG(ERR,
@@ -426,7 +426,6 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op,
return -EINVAL;
}
- min_ofs = cipher_ofs < auth_ofs ? cipher_ofs : auth_ofs;
max_len = RTE_MAX(cipher_ofs + cipher_len, auth_ofs + auth_len);
/* digest in buffer check. Needed only for wireless algos */
@@ -463,7 +462,8 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op,
ctx->digest_length);
}
- n_src = rte_crypto_mbuf_to_vec(op->sym->m_src, min_ofs, max_len,
+ /* Passing 0 as cipher & auth offsets are assigned into ofs later */
+ n_src = rte_crypto_mbuf_to_vec(op->sym->m_src, 0, max_len,
in_sgl->vec, QAT_SYM_SGL_MAX_NUMBER);
if (unlikely(n_src < 0 || n_src > op->sym->m_src->nb_segs)) {
op->status = RTE_CRYPTO_OP_STATUS_ERROR;
--
2.25.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,96 @@
From 794d99b8abeeb401a374489a9e3c629d023c271f Mon Sep 17 00:00:00 2001
From: Ting Xu <ting.xu@intel.com>
Date: Fri, 4 Mar 2022 07:26:28 +0000
Subject: [PATCH v2] net/ice: fix raw flow input pattern value change in FDIR
When parsing raw flow pattern in FDIR, the input parameter spec and
mask are used directly and the original value will be changed. It
will cause error if these values are used in other functions. In this
patch, temporary variables are created to store the spec and mask.
Fixes: 25be39cc1760 ("net/ice: enable protocol agnostic flow offloading in FDIR")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
---
drivers/net/ice/ice_fdir_filter.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 7954c6d8ea..5ff1afac90 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1868,10 +1868,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
break;
/* convert raw spec & mask from byte string to int */
- unsigned char *tmp_spec =
+ unsigned char *spec_pattern =
(uint8_t *)(uintptr_t)raw_spec->pattern;
- unsigned char *tmp_mask =
+ unsigned char *mask_pattern =
(uint8_t *)(uintptr_t)raw_mask->pattern;
+ uint8_t *tmp_spec, *tmp_mask;
uint16_t udp_port = 0;
uint16_t tmp_val = 0;
uint8_t pkt_len = 0;
@@ -1883,8 +1884,18 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
pkt_len)
return -rte_errno;
+ tmp_spec = rte_zmalloc(NULL, pkt_len / 2, 0);
+ if (!tmp_spec)
+ return -rte_errno;
+
+ tmp_mask = rte_zmalloc(NULL, pkt_len / 2, 0);
+ if (!tmp_mask) {
+ rte_free(tmp_spec);
+ return -rte_errno;
+ }
+
for (i = 0, j = 0; i < pkt_len; i += 2, j++) {
- tmp = tmp_spec[i];
+ tmp = spec_pattern[i];
if (tmp >= 'a' && tmp <= 'f')
tmp_val = tmp - 'a' + 10;
if (tmp >= 'A' && tmp <= 'F')
@@ -1893,7 +1904,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
tmp_val = tmp - '0';
tmp_val *= 16;
- tmp = tmp_spec[i + 1];
+ tmp = spec_pattern[i + 1];
if (tmp >= 'a' && tmp <= 'f')
tmp_spec[j] = tmp_val + tmp - 'a' + 10;
if (tmp >= 'A' && tmp <= 'F')
@@ -1901,7 +1912,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
if (tmp >= '0' && tmp <= '9')
tmp_spec[j] = tmp_val + tmp - '0';
- tmp = tmp_mask[i];
+ tmp = mask_pattern[i];
if (tmp >= 'a' && tmp <= 'f')
tmp_val = tmp - 'a' + 10;
if (tmp >= 'A' && tmp <= 'F')
@@ -1910,7 +1921,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
tmp_val = tmp - '0';
tmp_val *= 16;
- tmp = tmp_mask[i + 1];
+ tmp = mask_pattern[i + 1];
if (tmp >= 'a' && tmp <= 'f')
tmp_mask[j] = tmp_val + tmp - 'a' + 10;
if (tmp >= 'A' && tmp <= 'F')
@@ -1953,6 +1964,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
filter->parser_ena = true;
+ rte_free(tmp_spec);
+ rte_free(tmp_mask);
break;
}
--
2.17.1

View File

@ -1,13 +0,0 @@
diff --git a/Makefile b/Makefile
index 329da9f..c7fa8ad 100644
--- a/Makefile
+++ b/Makefile
@@ -51,7 +51,7 @@ YASM ?= yasm
NASM ?= nasm
# Detect NASM version (minimum version required: 2.14)
-NASM_VERSION = $(shell nasm -v | cut -d " " -f 3)
+NASM_VERSION = $(shell $(NASM) -v | cut -d " " -f 3)
NASM_MAJOR_REQ = 2
NASM_MINOR_REQ = 14

View File

@ -1,13 +0,0 @@
diff --git a/lib/Makefile b/lib/Makefile
index 3831172..9ce6f4c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -51,7 +51,7 @@ YASM ?= yasm
NASM ?= nasm
# Detect NASM version (minimum version required: 2.14)
-NASM_VERSION = $(shell nasm -v | cut -d " " -f 3)
+NASM_VERSION = $(shell $(NASM) -v | cut -d " " -f 3)
NASM_MAJOR_REQ = 2
NASM_MINOR_REQ = 14

View File

@ -0,0 +1,13 @@
diff --git a/lib/Makefile b/lib/Makefile
index 22890878..6ce90697 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -694,7 +694,7 @@ else
cp -f $(LIB).def $(LIB)_lnk.def
endif
-$(LIB_DIR)/$(LIBNAME): $(target_obj_files) $(LIB)_lnk.def
+$(LIB_DIR)/$(LIBNAME): $(target_obj_files)
ifeq ($(SHARED),y)
ifneq ($(MINGW),0)
$(CC) -shared $(LDFLAGS) -o $(LIBNAME) $^

View File

@ -0,0 +1,70 @@
From 6b941770f0114d42e87875562d5174bc70c5ac65 Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Tue, 6 Dec 2022 10:59:35 +0000
Subject: [PATCH] Fix for perf scaling on release 1.3
---
lib/include/error.h | 10 +++++++---
lib/include/error.inc | 3 +++
lib/x86_64/error.c | 2 +-
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/lib/include/error.h b/lib/include/error.h
index 73d44f51..778df4b1 100644
--- a/lib/include/error.h
+++ b/lib/include/error.h
@@ -32,7 +32,7 @@
* declare global variable to store
* process wide error status
*/
-extern int imb_errno;
+extern volatile int imb_errno;
/**
* @brief API to set error status
@@ -47,8 +47,12 @@ void imb_set_errno(IMB_MGR *mb_mgr, const int errnum)
if (mb_mgr != NULL)
mb_mgr->imb_errno = errnum;
- /* set global error status */
- imb_errno = errnum;
+ /*
+ * set global error status
+ * (only if different, to limit unneeded stores)
+ */
+ if (imb_errno != errnum)
+ imb_errno = errnum;
}
#endif /* ERROR_H */
diff --git a/lib/include/error.inc b/lib/include/error.inc
index 54df265f..5ea53a59 100644
--- a/lib/include/error.inc
+++ b/lib/include/error.inc
@@ -103,7 +103,10 @@ SET_ERRNO_TYPES \
;; Reset global imb_errno to 0
%macro IMB_ERR_CHECK_RESET 0
+ cmp dword [rel imb_errno], 0
+ jz %%do_not_reset
mov dword [rel imb_errno], 0
+%%do_not_reset:
%endmacro
;; Set GP reg and global imb_errno to 0
diff --git a/lib/x86_64/error.c b/lib/x86_64/error.c
index 19189093..24dcded3 100644
--- a/lib/x86_64/error.c
+++ b/lib/x86_64/error.c
@@ -39,7 +39,7 @@
#pragma warning(disable : 4996)
#endif
-IMB_DLL_LOCAL int imb_errno;
+IMB_DLL_LOCAL volatile int imb_errno;
IMB_DLL_LOCAL const int imb_errno_types[] = {
IMB_ERR_NULL_MBMGR,
IMB_ERR_JOB_NULL_SRC,
--
2.34.1

View File

@ -0,0 +1,30 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5142bac..7b95f74 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,6 +33,8 @@ ENDIF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_C_FLAGS "-std=c99 -Wall -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
SET(CMAKE_C_FLAGS_DEBUG "-O0")
SET(CMAKE_C_FLAGS_RELEASE "-O2")
+SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
+SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
INCLUDE_DIRECTORIES(
${OPENSSL_INCLUDE_DIR}
@@ -118,6 +120,16 @@ TARGET_LINK_LIBRARIES(examples-echo quicly ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS}
ADD_EXECUTABLE(udpfw t/udpfw.c)
+INSTALL (
+ DIRECTORY ${CMAKE_SOURCE_DIR}/include/
+ DESTINATION include
+ FILES_MATCHING PATTERN "*.h")
+
+INSTALL(TARGETS quicly
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+
ADD_CUSTOM_TARGET(check env BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} WITH_DTRACE=${WITH_DTRACE} prove --exec "sh -c" -v ${CMAKE_CURRENT_BINARY_DIR}/*.t t/*.t
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS cli test.t)

View File

@ -0,0 +1,30 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d1d6c09..90d7221 100644
--- a/deps/picotls/CMakeLists.txt
+++ b/deps/picotls/CMakeLists.txt
@@ -13,6 +13,9 @@ IF (WITH_DTRACE)
ENDIF ()
SET(CMAKE_C_FLAGS "-std=c99 -Wall -O2 -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
+SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
+SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
+
INCLUDE_DIRECTORIES(
deps/cifra/src/ext
deps/cifra/src
@@ -161,6 +164,15 @@ TARGET_LINK_LIBRARIES(ptlsbench ${PTLSBENCH_LIBS})
ADD_CUSTOM_TARGET(check env BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} prove --exec '' -v ${CMAKE_CURRENT_BINARY_DIR}/*.t t/*.t WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${TEST_EXES} cli)
+INSTALL (DIRECTORY ${CMAKE_SOURCE_DIR}/include/
+ DESTINATION include
+ FILES_MATCHING PATTERN "*.h")
+
+INSTALL(TARGETS picotls-core picotls-openssl
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+
IF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -pthread ${CMAKE_C_FLAGS}")
ELSEIF ("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")

View File

@ -0,0 +1,26 @@
From e83f80443a2f23a68037bf4c7ba16b3723d193a4 Mon Sep 17 00:00:00 2001
From: Yulong <yulong.pei@intel.com>
Date: Tue, 3 Jan 2023 14:16:17 +0000
Subject: [PATCH] libxdp: add fPIC with static lib build
Signed-off-by: Yulong <yulong.pei@intel.com>
---
lib/libxdp/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile
index 358b751..a9bb414 100644
--- a/lib/libxdp/Makefile
+++ b/lib/libxdp/Makefile
@@ -88,7 +88,7 @@ $(SHARED_OBJDIR):
$(Q)mkdir -p $(SHARED_OBJDIR)
$(STATIC_OBJDIR)/%.o: %.c $(EXTRA_LIB_DEPS) | $(STATIC_OBJDIR)
- $(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) -D LIBXDP_STATIC=1 -Wall -I../../headers -c $< -o $@
+ $(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -D LIBXDP_STATIC=1 -Wall -I../../headers -c $< -o $@
$(SHARED_OBJDIR)/%.o: %.c $(EXTRA_LIB_DEPS) | $(SHARED_OBJDIR)
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(SHARED_CFLAGS) -Wall -I../../headers -c $< -o $@
--
2.25.1

View File

@ -0,0 +1,32 @@
From 51ea3b590f5e0a6b34b5148af43996029fd60ac6 Mon Sep 17 00:00:00 2001
From: Yulong <yulong.pei@intel.com>
Date: Fri, 6 Jan 2023 07:46:10 +0000
Subject: [PATCH 2/2] libxdp: fix asm/types.h file not found issue
The file asm/types.h located in /usr/include/$(uname -m)-linux-gnu,
the path string already assigned to ARCH_INCLUDES when run xdp-tools
configure, so include ARCH_INCLUDES to CFLAGS and BPF_CFLAGS directly.
Signed-off-by: Yulong <yulong.pei@intel.com>
---
lib/defines.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/defines.mk b/lib/defines.mk
index f134c43..515411c 100644
--- a/lib/defines.mk
+++ b/lib/defines.mk
@@ -40,8 +40,8 @@ endif
DEFINES += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-CFLAGS += -std=gnu11 -Wextra -Werror $(DEFINES)
-BPF_CFLAGS += $(DEFINES) $(filter -ffile-prefix-map=%,$(CFLAGS))
+CFLAGS += -std=gnu11 -Wextra -Werror $(DEFINES) $(ARCH_INCLUDES)
+BPF_CFLAGS += $(DEFINES) $(filter -ffile-prefix-map=%,$(CFLAGS)) $(ARCH_INCLUDES)
CONFIGMK := $(LIB_DIR)/../config.mk
LIBMK := Makefile $(CONFIGMK) $(LIB_DIR)/defines.mk $(LIB_DIR)/common.mk $(LIB_DIR)/../version.mk
--
2.25.1

View File

@ -0,0 +1,26 @@
From 3033b9bdbcdb270f15373b27933d554f847e01d4 Mon Sep 17 00:00:00 2001
From: Yulong <yulong.pei@intel.com>
Date: Fri, 6 Jan 2023 14:31:24 +0000
Subject: [PATCH 3/3] libxdp: fix maybe-uninitialized compiler warning
Signed-off-by: Yulong <yulong.pei@intel.com>
---
lib/common.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/common.mk b/lib/common.mk
index 56c0406..f7a88a1 100644
--- a/lib/common.mk
+++ b/lib/common.mk
@@ -101,7 +101,7 @@ $(LIB_OBJS): %.o: %.c %.h $(LIB_H)
ALL_EXEC_TARGETS=$(USER_TARGETS) $(TEST_TARGETS)
$(ALL_EXEC_TARGETS): %: %.c $(OBJECT_LIBBPF) $(OBJECT_LIBXDP) $(LIBMK) $(LIB_OBJS) $(KERN_USER_H) $(EXTRA_DEPS) $(EXTRA_USER_DEPS)
- $(QUIET_CC)$(CC) -Wall $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $(LIB_OBJS) \
+ $(QUIET_CC)$(CC) -Wall -Wno-maybe-uninitialized $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $(LIB_OBJS) \
$< $(LDLIBS)
$(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EXTRA_DEPS) $(BPF_HEADERS) $(LIBMK)
--
2.25.1

Some files were not shown because too many files have changed in this diff Show More