Compare commits

...

720 Commits

Author SHA1 Message Date
1b93285ce0 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:22:28 +00:00
57302fe52f misc: VPP 22.10.1 Release Notes
Type: docs
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I70374ea376c895d92d5789debf4b437113e3d884
2023-02-10 19:20:28 -05:00
6d93d060a8 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:23:56 -05:00
474f0ba2ab 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-03 21:04:11 -05:00
b89dcf8241 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
(cherry picked from commit 413447451e)
2022-12-21 19:55:00 +00:00
4b6fb593fb 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
(cherry picked from commit 8c626b41ea)
2022-12-20 12:09:26 +00:00
267175fd04 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
(cherry picked from commit fe2d23f916)
2022-11-21 01:02:29 +00:00
07e0c05e69 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>
2022-10-26 12:53:34 +00:00
ad569da163 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
(cherry picked from commit c9d916c7cc)
2022-10-25 02:07:51 +00:00
92ab02e8c0 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
(cherry picked from commit 938bff8084)
2022-10-24 16:19:59 +00:00
f06253edb0 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
(cherry picked from commit 0d36720f8d)
2022-10-24 13:21:54 +00:00
e3618c1960 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>
(cherry picked from commit 65bff88c36)
2022-10-20 22:13:34 +00:00
b807f08d87 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>
(cherry picked from commit fecb2524ab)
2022-10-18 15:41:42 +00:00
225d15cae9 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
(cherry picked from commit 4e88e041ad)
2022-10-18 06:26:30 +00:00
994d86f70e 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
(cherry picked from commit 80c0ae2437)
2022-10-17 05:44:34 +00:00
13c7e8f7a1 docs: fix memory traces command
Type: fix

Change-Id: I8fc949da209a5067c702952fbd0e6ce77b921d02
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 70892fcada)
2022-10-13 18:19:15 +00:00
61bae8a54d 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
(cherry picked from commit 14b118b4c7)
2022-10-07 18:54:15 +00:00
582c81e686 rdma: unhackish build of rdma-core
Change-Id: I2040b560b2a00f8bd176ae6ad46035678a2b249e
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
(cherry picked from commit 45e4e9444d)
2022-10-05 02:19:30 +00:00
9aae8a4a9e 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>
(cherry picked from commit 4e939ced65)
2022-10-05 00:58:06 +00:00
569763f948 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
(cherry picked from commit ab15770ec6)
2022-09-27 06:09:28 +00:00
f845abb5dd misc: Initial changes for stable/2210 branch
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I5b0e4a503867d339b901ef1a5a9ebc938bcd068b
2022-09-21 13:00:17 +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
1289 changed files with 115313 additions and 57176 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"

7
.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/

View File

@ -2,3 +2,4 @@
host=gerrit.fd.io
port=29418
project=vpp
defaultbranch=stable/2210

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
@ -180,6 +180,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 +386,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 +426,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 +466,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 +482,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 +566,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 +739,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 +786,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 +817,12 @@ 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
THE REST
I: misc
M: vpp-dev Mailing List <vpp-dev@fd.io>

158
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,11 +36,10 @@ 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/dpdk.mk
include packages/libbpf.mk
.PHONY: clean
@ -48,10 +47,10 @@ 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 libbpf-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,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ipsec-mb_version := 1.1
ipsec-mb_version := 1.2
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 := $(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
define ipsec-mb_config_cmds
@true
@ -34,7 +34,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

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

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) $^

57
configure vendored
View File

@ -8,8 +8,12 @@ set -o pipefail -o errtrace -o nounset -o errexit
build_dir=.
install_dir=/usr/local
build_type=release
prefix_path=/opt/vpp/external/$(uname -m)/
src_dir="$(dirname "$(readlink -f "$0")")"
host_arch=$(uname -m)
arch=${host_arch}
native_only=no
wipe=no
args=()
help()
{
@ -20,9 +24,11 @@ USAGE: ${0} [options]
OPTIONS:
--help, -h This help
--arch, -a Cross-compile for specified target architecture (aarch64, riscv64, i386, ...)
--build-dir, -b Build directory
--install-dir, -i Install directory
--build-type, -t Build type (release, debug, ...)
--native-only, -n Only compile for Native CPU (no multiarch)
--wipe, -w Wipe whole repo (except startup.* files)
__EOF__
}
@ -42,6 +48,15 @@ while (( "$#" )); do
exit 1
fi
;;
-a|--arch)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
arch=$2
shift 2
else
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
-i|--install-dir)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
install_dir=$2
@ -60,9 +75,13 @@ while (( "$#" )); do
exit 1
fi
;;
-n|--native-only)
native_only=yes
shift 1
;;
-w|--wipe)
git clean -fdx --exclude=startup.\*
exit 1
wipe=yes
shift 1
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
@ -75,16 +94,30 @@ while (( "$#" )); do
esac
done
cmake \
-G Ninja \
-S ${src_dir}/src \
-B ${build_dir} \
-DCMAKE_PREFIX_PATH=${prefix_path} \
-DCMAKE_INSTALL_PREFIX=${install_dir} \
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \
-DCMAKE_BUILD_TYPE:STRING=${build_type}
if [ "${arch}" != "${host_arch}" ] ; then
args+=("-DCMAKE_SYSTEM_NAME=Linux")
args+=("-DCMAKE_SYSTEM_PROCESSOR=${arch}")
args+=("-DCMAKE_C_COMPILER=clang")
args+=("-DCMAKE_C_COMPILER_TARGET=${arch}-linux-gnu")
args+=("-DCMAKE_ASM_COMPILER_TARGET=${arch}-linux-gnu")
args+=("-DCMAKE_FIND_ROOT_PATH=/usr/${arch}-linux-gnu")
args+=("-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER")
args+=("-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH")
args+=("-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH")
args+=("-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY")
fi
cat << __EOF__
args+=("-DCMAKE_PREFIX_PATH=/opt/vpp/external/${arch}")
args+=("-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON")
args+=("-DCMAKE_INSTALL_PREFIX=${install_dir}")
args+=("-DCMAKE_BUILD_TYPE:STRING=${build_type}")
[ "${native_only}" == "yes" ] && args+=("-DVPP_BUILD_NATIVE_ONLY:BOOL=ON")
[ "${wipe}" == "yes" ] && git clean -fdx --exclude=startup.\*
cmake ${args[@]} -G Ninja -S ${src_dir}/src -B ${build_dir}
cat << __EOF__
Useful build commands:

View File

@ -21,7 +21,6 @@ WS_ROOT ?= $(CURDIR)/..
BR ?= $(WS_ROOT)/build-root
DOCS_DIR ?= $(WS_ROOT)/docs
VENV_DIR ?= $(DOCS_DIR)/venv
SPHINX_SCRIPTS_DIR ?= $(WS_ROOT)/docs/scripts
# Work out the OS if we haven't already
@ -40,11 +39,11 @@ endif
SPHINXOPTS = --keep-going -n -W
SPHINXBUILD = sphinx-build
SPHINXPROJ = fdio-vpp
SOURCEDIR = .
BUILDDIR = ${BR}/docs
BUILDDIR_SRC = ${BUILDDIR}/src
BUILDDIR_OUT = ${BUILDDIR}/html
SCRIPTS_DIR = _scripts
VENV_DIR ?= $(BUILDDIR)/venv
# Put it first so that "make" without argument is like "make help".
@ -55,30 +54,6 @@ help:
$(SPHINXBUILD) --help ;\
)
.PHONY: checkdeps
checkdeps:
@echo "Checking whether dependencies for Docs are installed..."
ifeq ($(OS_ID),ubuntu)
@set -e; inst=; \
for i in $(DOC_DEB_DEPENDS); do \
dpkg-query --show $$i >/dev/null 2>&1 || inst="$$inst $$i"; \
done; \
if [ "$$inst" ]; then \
sudo apt-get update; \
sudo apt-get $(CONFIRM) $(FORCE) install $$inst; \
fi
else ifneq ("$(wildcard /etc/redhat-release)","")
@sudo yum install $(CONFIRM) $(DOC_RPM_DEPENDS)
endif
.PHONY: spell
spell: clean checkdeps venv ${BUILDDIR_SRC}
@( \
. ${VENV_DIR}/bin/activate; \
make -C ${SCRIPTS_DIR} generate && \
$(SPHINXBUILD) -b spelling $(SPHINXOPTS) $(BUILDDIR_SRC) $(BUILDDIR_OUT); \
)
.PHONY: venv
venv:
@( \
@ -91,22 +66,30 @@ venv:
fi; \
)
${BUILDDIR_SRC}:
@mkdir -p ${BUILDDIR_SRC}
@cp -r $(SOURCEDIR) ${BUILDDIR_SRC}
@cd ${BUILDDIR_SRC} && find . -type l -exec cp --remove-destination -L ${DOCS_DIR}/{} {} \;
.PHONY: spell
spell: venv
@( \
. ${VENV_DIR}/bin/activate; \
make -C ${SCRIPTS_DIR} generate && \
$(SPHINXBUILD) -b spelling $(SPHINXOPTS) $(BUILDDIR_SRC) $(BUILDDIR_OUT); \
)
.PHONY: rebuild-spell
rebuild-spell: clean spell
.PHONY: docs
docs: clean venv ${BUILDDIR_SRC}
docs: venv
@( \
. ${VENV_DIR}/bin/activate; \
make -C ${SCRIPTS_DIR} generate && \
$(SPHINXBUILD) $(SPHINXOPTS) -b html $(BUILDDIR_SRC) $(BUILDDIR_OUT); \
)
.PHONY: rebuild
rebuild: clean docs
.PHONY: clean
clean:
@rm -rf $(BUILDDIR) ${VENV_DIR}
@make -C ${SCRIPTS_DIR} clean
.PHONY: build

View File

@ -21,8 +21,11 @@
all: siphon
# These should be passed in by the root Makefile
WS_ROOT ?= $(CURDIR)/../..
BR ?= $(WS_ROOT)/build-root
WS_ROOT ?= $(CURDIR)/../..
BR ?= $(WS_ROOT)/build-root
BUILDDIR ?= ${BR}/docs
BUILDDIR_SRC ?= ${BUILDDIR}/src
DOCS_DIR ?= ${WS_ROOT}/docs
# Tag used in github repository path.
# Change this when genearting for a release
@ -34,12 +37,11 @@ REPOSITORY_URL ?= https://github.com/FDio/vpp/blob/$(VPP_TAG)/
SCRIPTS_DIR ?= $(WS_ROOT)/docs/_scripts
# docs root directory
DOCS_DIR ?= ${BR}/docs/src
FEATURE_LIST_FILE = ${DOCS_DIR}/aboutvpp/featurelist.md
FEATURE_LIST_FILE = ${BUILDDIR_SRC}/aboutvpp/featurelist.md
# Siphoned fragements are processed into here
DOCS_GENERATED_DIR ?= $(DOCS_DIR)/_generated
DOCS_GENERATED_DIR ?= $(BUILDDIR_SRC)/_generated
# Siphoned fragments end up in here
SIPHON_INPUT_DIR ?= $(DOCS_GENERATED_DIR)/fragments
@ -118,8 +120,7 @@ SIPHON_DOCS = $(addprefix $(DOCS_GENERATED_DIR)/,$(addsuffix .rst,$(SIPHONS)))
BUILT_ON = $(shell date '+%d %B %Y')
VPP_VERSION = $(shell ${WS_ROOT}/src/scripts/version)
.PHONY: featurelist
featurelist:
$(DOCS_GENERATED_DIR)/.featurelist.done:
@( \
cd $(WS_ROOT) && \
find . -name FEATURE.yaml | \
@ -128,19 +129,19 @@ featurelist:
--repolink $(REPOSITORY_URL) > \
$(FEATURE_LIST_FILE) ; \
)
@touch $(DOCS_GENERATED_DIR)/.featurelist.done
.PHONY: includes-render
includes-render:
$(DOCS_GENERATED_DIR)/.includes-render.done:
@mkdir -p "$(DYNAMIC_RENDER_DIR)"
@python3 $(SCRIPTS_DIR)/includes_renderer.py ${WS_ROOT} ${DYNAMIC_RENDER_DIR}
@touch $(DOCS_GENERATED_DIR)/.includes-render.done
.PHONY: template-index
template-index:
@sed -ie "s/__VPP_VERSION__/${VPP_VERSION}/g" ${DOCS_DIR}/index.rst
@sed -ie "s/__BUILT_ON__/${BUILT_ON}/g" ${DOCS_DIR}/index.rst
$(DOCS_GENERATED_DIR)/.template-index.done:
@sed -ie "s/__VPP_VERSION__/${VPP_VERSION}/g" ${BUILDDIR_SRC}/index.rst
@sed -ie "s/__BUILT_ON__/${BUILT_ON}/g" ${BUILDDIR_SRC}/index.rst
@( \
for f in $$(grep -l -R __REPOSITORY_URL__ ${DOCS_DIR} | grep -e '\.rst$$' -e '\.md$$' ) ;\
for f in $$(grep -l -R __REPOSITORY_URL__ ${BUILDDIR_SRC} | grep -e '\.rst$$' -e '\.md$$' ) ;\
do \
if [ ! -z $${f} ]; then \
echo "TEMPLATING $${f}" ;\
@ -148,6 +149,7 @@ template-index:
fi ;\
done ; \
)
@touch $(DOCS_GENERATED_DIR)/.template-index.done
.NOTPARALLEL: $(SIPHON_FILES)
$(SIPHON_FILES): $(SCRIPTS_DIR)/siphon-generate \
@ -207,15 +209,45 @@ $(eval $(call siphon-process,rst,markdown))
# This target can be used just to generate the siphoned things
.PHONY: siphon
siphon: $(SIPHON_DOCS)
@cp $(DOCS_GENERATED_DIR)/clicmd.rst $(DOCS_DIR)/cli-reference/index.rst
@cp -r $(DOCS_GENERATED_DIR)/clicmd.rst.dir $(DOCS_DIR)/cli-reference/clis
$(DOCS_GENERATED_DIR)/.siphon.done: $(SIPHON_DOCS)
@cp $(DOCS_GENERATED_DIR)/clicmd.rst $(BUILDDIR_SRC)/cli-reference/index.rst
@mkdir -p $(BUILDDIR_SRC)/cli-reference/clis
@cp -r $(DOCS_GENERATED_DIR)/clicmd.rst.dir/* $(BUILDDIR_SRC)/cli-reference/clis
@touch $(DOCS_GENERATED_DIR)/.siphon.done
.PHONY: clean-siphons
clean-siphons:
@( \
echo "find $(SIPHON_INPUT) -newer $(DOCS_GENERATED_DIR)/.siphon.done" ; \
cd $(WS_ROOT); \
if [ -f $(DOCS_GENERATED_DIR)/.siphon.done ] && \
[ $$(find $(SIPHON_INPUT) -type f -newer $(DOCS_GENERATED_DIR)/.siphon.done \
-not -name '*.md' \
-not -name '*.rst' | wc -l) -gt 0 ]; then \
rm -r $(DOCS_GENERATED_DIR); \
echo "removing... $(DOCS_GENERATED_DIR)"; \
fi; \
)
${BUILDDIR}/.docsrc.sync.ok:
@echo "Copying docs files..."
@cp -r $(DOCS_DIR) ${BUILDDIR_SRC}
@cd ${BUILDDIR_SRC} && find . -type l -exec cp --remove-destination -L ${DOCS_DIR}/{} {} \;
@touch $(BUILDDIR)/.docsrc.sync.ok
.PHONY: copy-src
copy-src: ${BUILDDIR}/.docsrc.sync.ok
@echo "Syncing changed files..."
@cd $(DOCS_DIR) && find . -type f -not -path '*/_scripts/*' -newer $(BUILDDIR)/.docsrc.sync.ok -exec cp {} ${BUILDDIR_SRC}/{} \;
@cd ${DOCS_DIR} && find . -type l -not -path '*/_scripts/*' -newer $(BUILDDIR)/.docsrc.sync.ok -exec cp --remove-destination -L ${DOCS_DIR}/{} ${BUILDDIR_SRC}/{} \;
@cd ${DOCS_DIR} && find -L . -type f -not -path '*/_scripts/*' -newer $(BUILDDIR)/.docsrc.sync.ok -exec cp --remove-destination -L ${DOCS_DIR}/{} ${BUILDDIR_SRC}/{} \;
@touch $(BUILDDIR)/.docsrc.sync.ok
.PHONY: generate
generate: siphon includes-render template-index featurelist
generate: copy-src clean-siphons $(DOCS_GENERATED_DIR)/.siphon.done $(DOCS_GENERATED_DIR)/.includes-render.done $(DOCS_GENERATED_DIR)/.template-index.done $(DOCS_GENERATED_DIR)/.featurelist.done
.PHONY: clean
clean:
@rm -rf $(BR)/.siphon.dep
@rm -rf $(BUILDDIR)
@rm -rf $(SCRIPTS_DIR)/siphon/__pycache__

View File

@ -24,9 +24,10 @@ if len(sys.argv) < 2:
patterns = [
# Search for "define" blocks and treat them as structs
(re.compile(r"^.*(manual_.[^\s]+\s+)?define\s+(?P<name>[^\s]+)"),
r"typedef struct vl_api_\g<name>_t"),
(
re.compile(r"^.*(manual_.[^\s]+\s+)?define\s+(?P<name>[^\s]+)"),
r"typedef struct vl_api_\g<name>_t",
),
# For every "brief" statement at the start of a comment block, add an
# xref with whatever is on the same line. This gives us an index page
# with all the API methods in one place.
@ -36,14 +37,13 @@ patterns = [
# r'/** @xrefitem api "" "VPP API" \g<c> \g<b> \g<c>'), # capture inline comment close
# (re.compile(r"/\*\*\s*(?P<b>[\\@]brief)\s+(?P<c>.+)$"),
# r'/** @xrefitem api "" "VPP API" \g<c> \g<b> \g<c>'),
# Since structs don't have params, replace @param with @tparam
( re.compile("[\\@]param\\b"), "@tparam"),
(re.compile("[\\@]param\\b"), "@tparam"),
]
with open(sys.argv[1]) as fd:
for line in fd:
str = line[:-1] # strip \n
str = line[:-1] # strip \n
for p in patterns:
str = p[0].sub(p[1], str)
sys.stdout.write(str+"\n")
sys.stdout.write(str + "\n")

View File

@ -23,51 +23,82 @@ if len(sys.argv) < 2:
replace_patterns = [
# Search for VLIB_CLI_COMMAND, extract its parameters and add a docblock for it
( re.compile("(?P<m>VLIB_CLI_COMMAND)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ vlib_cli_command_t \g<name>"),
( re.compile("(?P<m>VLIB_CLI_COMMAND)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<qual>[^)]*)[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ \g<qual> vlib_cli_command_t \g<name>"),
(
re.compile("(?P<m>VLIB_CLI_COMMAND)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ vlib_cli_command_t \g<name>",
),
(
re.compile(
"(?P<m>VLIB_CLI_COMMAND)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<qual>[^)]*)[)]"
),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ \g<qual> vlib_cli_command_t \g<name>",
),
# Search for VLIB_REGISTER_NODE, extract its parameters and add a docblock for it
( re.compile("(?P<m>VLIB_REGISTER_NODE)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ vlib_node_registration_t \g<name>"),
( re.compile("(?P<m>VLIB_REGISTER_NODE)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<qual>[^)]*)[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ \g<qual> vlib_node_registration_t \g<name>"),
(
re.compile("(?P<m>VLIB_REGISTER_NODE)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ vlib_node_registration_t \g<name>",
),
(
re.compile(
"(?P<m>VLIB_REGISTER_NODE)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<qual>[^)]*)[)]"
),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ \g<qual> vlib_node_registration_t \g<name>",
),
# Search for VLIB_INIT_FUNCTION, extract its parameter and add a docblock for it
( re.compile("(?P<m>VLIB_INIT_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ vlib_init_function_t * _vlib_init_function_\g<name>"),
( re.compile("(?P<m>VLIB_DECLARE_INIT_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ vlib_init_function_t * _vlib_init_function_\g<name>"),
(
re.compile("(?P<m>VLIB_INIT_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ vlib_init_function_t * _vlib_init_function_\g<name>",
),
(
re.compile("(?P<m>VLIB_DECLARE_INIT_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ vlib_init_function_t * _vlib_init_function_\g<name>",
),
# Search for VLIB_LOOP_ENTER_FUNCTION, extract the parameters and add a docblock for it
( re.compile("(?P<m>VLIB_MAIN_LOOP_ENTER_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)(,[^)]*)?[)]"),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ _vlib_main_loop_enter_\g<name>"),
( re.compile("(?P<m>VLIB_MAIN_LOOP_EXIT_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)(,[^)]*)?[)]"),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ _vlib_main_loop_exit_\g<name>"),
(
re.compile(
"(?P<m>VLIB_MAIN_LOOP_ENTER_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)(,[^)]*)?[)]"
),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ _vlib_main_loop_enter_\g<name>",
),
(
re.compile(
"(?P<m>VLIB_MAIN_LOOP_EXIT_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)(,[^)]*)?[)]"
),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ _vlib_main_loop_exit_\g<name>",
),
# Search for VLIB_CONFIG_FUNCTION, extract the parameters and add a docblock for it
( re.compile("(?P<m>VLIB_CONFIG_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<n>\"[^\"]+\")(,[^)]*)?[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>, \g<n>) */ vlib_config_function_runtime_t _vlib_config_function_\g<name>"),
( re.compile("(?P<m>VLIB_EARLY_CONFIG_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<n>\"[^\"]+\")(,[^)]*)?[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>, \g<n>) */ vlib_config_function_runtime_t _vlib_config_function_\g<name>"),
(
re.compile(
'(?P<m>VLIB_CONFIG_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<n>"[^"]+")(,[^)]*)?[)]'
),
r"/** @brief (@em constructor) \g<m> (\g<name>, \g<n>) */ vlib_config_function_runtime_t _vlib_config_function_\g<name>",
),
(
re.compile(
'(?P<m>VLIB_EARLY_CONFIG_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<n>"[^"]+")(,[^)]*)?[)]'
),
r"/** @brief (@em constructor) \g<m> (\g<name>, \g<n>) */ vlib_config_function_runtime_t _vlib_config_function_\g<name>",
),
# Search for "format_thing" and "unformat_thing" when used as a function pointer and add parens
( re.compile("(?P<pre>(^|,)\s*)(?P<name>(un)?format_[a-zA-Z0-9_]+)(?P<post>\s*(,|$))"),
r"\g<pre>\g<name>()\g<post>" ),
(
re.compile(
"(?P<pre>(^|,)\s*)(?P<name>(un)?format_[a-zA-Z0-9_]+)(?P<post>\s*(,|$))"
),
r"\g<pre>\g<name>()\g<post>",
),
# Search for CLIB_PAD_FROM_TO(...); and replace with padding
# #define CLIB_PAD_FROM_TO(from,to) u8 pad_##from[(to) - (from)]
( re.compile("(?P<m>CLIB_PAD_FROM_TO)\s*[(](?P<from>[^,]+),\s*(?P<to>[^)]+)[)]"),
r"/** Padding. */ u8 pad_\g<from>[(\g<to>) - (\g<from>)]" ),
(
re.compile("(?P<m>CLIB_PAD_FROM_TO)\s*[(](?P<from>[^,]+),\s*(?P<to>[^)]+)[)]"),
r"/** Padding. */ u8 pad_\g<from>[(\g<to>) - (\g<from>)]",
),
]
filename = sys.argv[1]
cwd = os.getcwd()
if filename[0:len(cwd)] == cwd:
filename = filename[len(cwd):]
if filename[0 : len(cwd)] == cwd:
filename = filename[len(cwd) :]
if filename[0] == "/":
filename = filename[1:]
@ -76,12 +107,12 @@ with open(filename) as fd:
for line in fd:
line_num += 1
str = line[:-1] # filter \n
str = line[:-1] # filter \n
# Look for search/replace patterns
for p in replace_patterns:
str = p[0].sub(p[1], str)
sys.stdout.write(str+"\n")
sys.stdout.write(str + "\n")
# All done

View File

@ -26,17 +26,19 @@ if len(sys.argv) < 2:
replace_patterns = [
# Search for CLIB_PAD_FROM_TO(...); and replace with padding
# #define CLIB_PAD_FROM_TO(from,to) u8 pad_##from[(to) - (from)]
(re.compile(r"(?P<m>CLIB_PAD_FROM_TO)\s*[(](?P<from>[^,]+),"
r"\s*(?P<to>[^)]+)[)]"),
r"/** Padding. */ u8 pad_\g<from>[(\g<to>) - (\g<from>)]"),
(
re.compile(
r"(?P<m>CLIB_PAD_FROM_TO)\s*[(](?P<from>[^,]+)," r"\s*(?P<to>[^)]+)[)]"
),
r"/** Padding. */ u8 pad_\g<from>[(\g<to>) - (\g<from>)]",
),
]
filename = sys.argv[1]
cwd = os.getcwd()
if filename[0:len(cwd)] == cwd:
filename = filename[len(cwd):]
if filename[0 : len(cwd)] == cwd:
filename = filename[len(cwd) :]
if filename[0] == "/":
filename = filename[1:]
@ -51,6 +53,6 @@ with open(filename) as fd:
for p in replace_patterns:
str = p[0].sub(p[1], str)
sys.stdout.write(str+"\n")
sys.stdout.write(str + "\n")
# All done

View File

@ -33,15 +33,14 @@ class ContentRenderer:
class PluginRenderer(ContentRenderer):
def _render_entry(self, output_file, entry):
description = "<no-description-found>"
# we use glob because a plugin can (ioam for now)
# define the plugin definition in
# a further subdirectory.
path = os.path.join(self.plugin_dir(), entry.name, '**')
path = os.path.join(self.plugin_dir(), entry.name, "**")
for f in glob.iglob(path, recursive=True):
if not f.endswith('.c'):
if not f.endswith(".c"):
continue
with open(f, "r", encoding="utf-8") as src:
for match in self.regex.finditer(src.read()):
@ -56,7 +55,7 @@ class PluginRenderer(ContentRenderer):
with open(fname, "w") as output_file:
with os.scandir(self.plugin_dir()) as pdir:
for entry in sorted(pdir, key=lambda entry: entry.name):
if not entry.name.startswith('.') and entry.is_dir():
if not entry.name.startswith(".") and entry.is_dir():
self._render_entry(output_file, entry)

View File

@ -24,7 +24,7 @@ import os
import siphon
DEFAULT_LOGFILE = None
DEFAULT_LOGLEVEL = "info"
DEFAULT_LOGLEVEL = "warning"
DEFAULT_OUTPUT = "build-root/docs/siphons"
DEFAULT_PREFIX = os.getcwd()

View File

@ -25,7 +25,7 @@ import sys
import siphon
DEFAULT_LOGFILE = None
DEFAULT_LOGLEVEL = "info"
DEFAULT_LOGLEVEL = "warning"
DEFAULT_SIPHON = "clicmd"
DEFAULT_FORMAT = "markdown"
DEFAULT_OUTPUT = None

Some files were not shown because too many files have changed in this diff Show More