Compare commits

...

234 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
518 changed files with 31404 additions and 4191 deletions

6
.gitignore vendored
View File

@ -18,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,6 +41,7 @@ F: src/vnet/bonding/
Sphinx Documents
I: docs
M: John DeNisco <jdenisco@cisco.com>
M: Dave Wallace <dwallacelf@gmail.com>
F: docs/
Infrastructure Library
@ -179,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/
@ -564,6 +566,11 @@ 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 <klement.sekera@gmail.com>
@ -732,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>
@ -805,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>

View File

@ -70,7 +70,7 @@ DEB_DEPENDS += python3-all python3-setuptools check
DEB_DEPENDS += libffi-dev python3-ply
DEB_DEPENDS += cmake ninja-build uuid-dev python3-jsonschema python3-yaml
DEB_DEPENDS += python3-venv # ensurepip
DEB_DEPENDS += python3-dev # needed for python3 -m pip install psutil
DEB_DEPENDS += python3-dev python3-pip
DEB_DEPENDS += libnl-3-dev libnl-route-3-dev libmnl-dev
# DEB_DEPENDS += enchant # for docs
DEB_DEPENDS += python3-virtualenv
@ -81,7 +81,14 @@ DEB_DEPENDS += nasm
LIBFFI=libffi6 # works on all but 20.04 and debian-testing
ifeq ($(OS_VERSION_ID),20.04)
ifeq ($(OS_VERSION_ID),22.04)
DEB_DEPENDS += python3-virtualenv
DEB_DEPENDS += libssl-dev
DEB_DEPENDS += libelf-dev # for libbpf (af_xdp)
DEB_DEPENDS += clang clang-format-11
LIBFFI=libffi7
DEB_DEPENDS += enchant-2 # for docs
else ifeq ($(OS_VERSION_ID),20.04)
DEB_DEPENDS += python3-virtualenv
DEB_DEPENDS += libssl-dev
DEB_DEPENDS += libelf-dev # for libbpf (af_xdp)
@ -157,25 +164,18 @@ RPM_DEPENDS_DEBUG += yum-plugin-auto-update-debug-info
RPM_SUSE_BUILDTOOLS_DEPS = autoconf automake ccache check-devel chrpath
RPM_SUSE_BUILDTOOLS_DEPS += clang cmake indent libtool make ninja python3-ply
RPM_SUSE_DEVEL_DEPS = glibc-devel-static libnuma-devel libelf-devel nasm
RPM_SUSE_DEVEL_DEPS += libopenssl-devel openssl-devel libuuid-devel
RPM_SUSE_DEVEL_DEPS = glibc-devel-static libnuma-devel libelf-devel
RPM_SUSE_DEVEL_DEPS += libopenssl-devel libuuid-devel lsb-release
RPM_SUSE_DEVEL_DEPS += curl libstdc++-devel bison gcc-c++ zlib-devel
RPM_SUSE_PYTHON_DEPS = python-devel python3-devel python-pip python3-pip
RPM_SUSE_PYTHON_DEPS += python-rpm-macros python3-rpm-macros
RPM_SUSE_PYTHON_DEPS = python3-devel python3-pip python3-rpm-macros
RPM_SUSE_PLATFORM_DEPS = distribution-release shadow rpm-build
RPM_SUSE_PLATFORM_DEPS = shadow rpm-build
ifeq ($(OS_ID),opensuse-leap)
ifeq ($(OS_VERSION_ID),15.3)
RPM_SUSE_DEVEL_DEPS += curl libstdc++-devel bison gcc-c++ zlib-devel xmlto
RPM_SUSE_DEVEL_DEPS += lsb-release
RPM_SUSE_DEVEL_DEPS += asciidoc git
RPM_SUSE_PYTHON_DEPS += python3 python2-ply
endif
ifeq ($(OS_VERSION_ID),15.0)
RPM_SUSE_DEVEL_DEPS += gcc git curl
RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
endif
RPM_SUSE_DEVEL_DEPS += xmlto openssl-devel asciidoc git nasm
RPM_SUSE_PYTHON_DEPS += python3 python3-ply python3-virtualenv
RPM_SUSE_PLATFORM_DEPS += distribution-release
endif
RPM_SUSE_DEPENDS += $(RPM_SUSE_BUILDTOOLS_DEPS) $(RPM_SUSE_DEVEL_DEPS) $(RPM_SUSE_PYTHON_DEPS) $(RPM_SUSE_PLATFORM_DEPS)
@ -186,7 +186,7 @@ endif
ifeq ($(findstring y,$(UNATTENDED)),y)
CONFIRM=-y
FORCE=--force-yes
FORCE=--allow-downgrades --allow-remove-essential --allow-change-held-packages
endif
TARGETS = vpp
@ -333,7 +333,7 @@ else ifeq ($(OS_ID),fedora)
@sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)
@sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs zlib
endif
else ifeq ($(filter opensuse-leap,$(OS_ID)),$(OS_ID))
else ifeq ($(filter opensuse-leap-15.3 opensuse-leap-15.4 ,$(OS_ID)-$(OS_VERSION_ID)),$(OS_ID)-$(OS_VERSION_ID))
@sudo -E zypper refresh
@sudo -E zypper install -y $(RPM_SUSE_DEPENDS)
else
@ -679,7 +679,7 @@ checkstyle-python:
@make -C test checkstyle-python-all
.PHONY: checkstyle-all
checkstyle-all: checkstyle-commit checkstyle checkstyle-python
checkstyle-all: checkstyle-commit checkstyle checkstyle-python docs-spell
.PHONY: fixstyle
fixstyle:
@ -760,3 +760,7 @@ ifeq ($(OS_ID)-$(OS_VERSION_ID),$(MAKE_VERIFY_GATE_OS))
else
$(call banner,"Skipping tests. Tests under 'make verify' supported on $(MAKE_VERIFY_GATE_OS)")
endif
.PHONY: check-dpdk-mlx
check-dpdk-mlx:
@[ $$(make -sC build/external dpdk-show-DPDK_MLX_DEFAULT) = y ]

View File

@ -38,8 +38,8 @@ ARCH_X86_64=$(filter x86_64,$(shell uname -m))
include packages.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

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,15 @@
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 ?= 22.03
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
@ -33,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
@ -43,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, \
@ -56,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, \
@ -74,6 +81,7 @@ DPDK_LIBS_DISABLED := acl, \
bitratestats, \
bpf, \
cfgfile, \
cnxk, \
distributor, \
efd, \
fib, \
@ -167,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

@ -13,10 +13,10 @@
RDMA_CORE_DEBUG?=n
rdma-core_version := 39.1
rdma-core_version := 41.0
rdma-core_tarball := rdma-core-$(rdma-core_version).tar.gz
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,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

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,9 @@ Release notes
.. toctree::
:maxdepth: 2
v22.10.1
v22.10
v22.06.1
v22.06
v22.02
v21.10.1
v21.10
past

View File

@ -6,6 +6,8 @@ Past releases
.. toctree::
:maxdepth: 1
v21.10.1
v21.10
v21.06
v21.01
v20.09
@ -37,4 +39,3 @@ Past releases
v17.01
v16.09
v16.06

View File

@ -0,0 +1,12 @@
Release notes for VPP 22.06.1
=============================
This is bug fix release.
Of particular importance, this release contains the fix for
`JIRA VPP-2307: CVE-2022-46397 FD.io VPP (Vector Packet Processor) IPSec generates a predictable IV in AES-CBC mode <https://jira.fd.io/browse/VPP-2037>`__
For the full list of fixed issues please refer to:
- fd.io `JIRA <https://jira.fd.io>`__
- git `commit log <https://git.fd.io/vpp/log/?h=stable/2206>`__

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
Release notes for VPP 22.10.1
=============================
This is bug fix release.
Of particular importance, this release contains the fix for
`JIRA VPP-2307: CVE-2022-46397 FD.io VPP (Vector Packet Processor) IPSec generates a predictable IV in AES-CBC mode <https://jira.fd.io/browse/VPP-2037>`__
For the full list of fixed issues please refer to:
- fd.io `JIRA <https://jira.fd.io>`__
- git `commit log <https://git.fd.io/vpp/log/?h=stable/2210>`__

File diff suppressed because it is too large Load Diff

View File

@ -3,11 +3,95 @@
.. toctree::
Building VPP
============
=====================
To get started developing with VPP, you need to get the required VPP sources and then build the packages.
For more detailed information on the build system please refer to :ref:`buildsystem`.
.. _makesureinstalled:
VPP for Ubuntu: Environment Setup
-------------------------------------------
If you are not downloading VPP on Ubuntu with WSL (Windows Subsystem for Linux), please disregard this section
and jump to 'Get the VPP Sources'.
Before starting on VPP for Ubuntu, make sure WSL2 and Ubuntu are installed.
To install WSL2 and Ubuntu, run Windows PowerShell as an administrator and enter this in the terminal:
.. code-block:: console
$ wsl --install
Next, go to the 'resolv.conf' file in Ubuntu's '/etc' folder.
It should have been automatically generated when Ubuntu was installed; if it doesn't exist, create it.
Please use 'sudo' to avoid "File resolv.conf is unwritable" errors.
.. code-block:: console
$ cd /etc
$ sudo nano resolv.conf
In the file, add the following content in place of the current 'nameserver X.X.X.X' line:
.. code-block:: console
nameserver 8.8.8.8
This replaces the DNS nameserver on your machine with the Google DNS service,
resolving any DNS Internet connection issues.
Note: by default, the 'resolv.conf' file regenerates every time you restart Ubuntu, so your changes won't be saved.
To keep your changes, run the following command to make 'resolv.conf' immutable:
.. code-block:: console
$ sudo chattr +i /etc/resolv.conf
Now copy the following lines from 'resolv.conf':
.. code-block:: console
[network]
generateResolvConf = false
Then, go to the 'wsl.conf' file in '/etc' and paste the lines there.
Please use 'sudo' here as well to avoid "File wsl.conf is unwritable" errors.
.. code-block:: console
$ sudo nano wsl.conf
In order to test your DNS server connection, please ping 8.8.8.8 on the terminal:
.. code-block:: console
$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=9.58 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=45.8 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=116 time=9.62 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=116 time=11.4 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=116 time=12.2 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=116 time=8.69 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=116 time=52.4 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=116 time=11.0 ms
...
While still in /etc, run the following commands:
.. code-block:: console
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo apt-get install --reinstall ca-certificates
$ sudo update-ca-certificates
Finally, head back to your home directory and jump to 'Get the VPP Sources'.
.. _setupproxies:
Set up Proxies
@ -45,6 +129,13 @@ installed, by entering the following commands:
There should be no output, or no packages shown after the above commands are run.
Please make sure **make** is installed before running the next command.
If it is not installed, run the following command first:
.. code-block:: console
$ sudo apt install make
Run the following **make** command to install the dependencies for FD.io VPP.
If the download hangs at any point, then you may need to
@ -119,9 +210,19 @@ Use the following **make** command below to build the release version of FD.io V
$ make build-release
Installing External Dependencies
-------------------------------------------
At this point, there are still some VPP external dependencies left to install. They could be installed
using 'make-build', but this only installs them locally in the VPP tree, not in the operating system.
In order to fix this and save time, run the following command:
.. code-block:: console
$ make install-ext-deps
-------------------------------------------
Building Necessary Packages
--------------------------------------------
-------------------------------------------
The package that needs to be built depends on the type system VPP will be running on:

View File

@ -33,6 +33,13 @@ _________________________
With the following commands you can run VPP and then be dropped into the GDB prompt.
Before running either command, please make sure that the 'gdb' package is installed.
If it's not installed, run the following command first:
.. code-block:: console
$ sudo apt install gdb
Running the release image:
.. code-block:: console
@ -46,3 +53,4 @@ Running the debug image:
# make debug
(gdb)

View File

@ -25,6 +25,7 @@ For more on plugins please refer to :ref:`add_plugin`.
lldp
nat64
nat44_ei_ha
nat44_ed_doc
pnat
lb
lacp

View File

@ -0,0 +1 @@
../../../src/plugins/nat/nat44-ed/nat44_ed_doc.rst

View File

@ -10,16 +10,16 @@ Downloading and Installing VPP
If you want to use VPP it can be convenient to install the binaries from
existing packages. This guide describes how to pull, install and run the VPP packages.
This section provides directions on how to Install VPP binaries on
Ubuntu, and Centos platforms.
FD.io VPP is installed using Package Cloud. For a complete set of
instructions on how to install VPP with package cloud please refer
to `Package Cloud <https://packagecloud.io/fdio/release>`_.
FD.io VPP packages are stored in Packagecloud.io package repositories. There is
a package repository for the latest VPP release packages as well as a package
repository associated with each branch in the VPP git repository. The VPP merge
jobs which run on Jenkins (https://jenkins.fd.io) for each actively supported
git branch uploads packages to packagecloud that are built from the vpp code in
the branch.
Installing on Ubuntu
---------------------------------
Installing on Ubuntu / Debian OS Distros
----------------------------------------
The following are instructions on how to install VPP on Ubuntu.

View File

@ -8,53 +8,58 @@ Ubuntu - Setup the FD.io Repository
Choose one of the following releases to install.
Update the OS
-----------------------
-------------
It is a good idea to first update and upgrade the OS before starting; run the
following command to update the OS:
following commands to upgrade the OS and install the curl package to download
the setup script from packagecloud.io:
.. code-block:: console
apt-get update
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get install curl
Configure Apt Using the Packagecloud Setup Script
-------------------------------------------------
Point to the Repository
-----------------------------------
FD.io Packagecloud Repositories provides pop-up menu that provides the
ability to copy a one-line bash command to fetch the packagecloud setup script.
In general, start at the FD.io packagecloud URL:
https://packagecloud.io/fdio
Then choose the desired repository link (e.g. 'release') and select the "Debian"
package icon in the section named "Quick install instructions". When the pop-up
dialog appears, select the "Copy" button to copy the command to run the setup
script and paste it into a terminal on your server.
Create a file **/etc/apt/sources.list.d/99fd.io.list** with contents that point to
the version needed. The contents needed are shown below.
.. _install_vpp:
VPP latest Release
VPP Release Repo
^^^^^^^^^^^^^^^^^^^
Create the file **/etc/apt/sources.list.d/99fd.io.list** that contain the following contents:
The URL to install the latest VPP release is
.. code-block:: console
https://packagecloud.io/fdio/release
deb [trusted=yes] https://packagecloud.io/fdio/release/ubuntu bionic main
Get the key:
VPP master Branch Repo
^^^^^^^^^^^^^^^^^^^^^^
The URL to install the latest VPP release is
.. code-block:: console
https://packagecloud.io/fdio/release
curl -L https://packagecloud.io/fdio/release/gpgkey | sudo apt-key add -
VPP master Branch
^^^^^^^^^^^^^^^^^^^^
VPP stable release Branch Repo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Create the file **/etc/apt/sources.list.d/99fd.io.list** that contain the following contents:
Stable release branches are named "stable/YYMM" (e.g. stable/2206) and the associated
packagecloud repositories are named "YYMM" (e.g 2206). For example, the URL to
the VPP 22.06 stable release branch package repository is:
.. code-block:: console
deb [trusted=yes] https://packagecloud.io/fdio/master/ubuntu bionic main
Get the key:
.. code-block:: console
curl -L https://packagecloud.io/fdio/master/gpgkey | sudo apt-key add -
https://packagecloud.io/fdio/2206
Install the Mandatory Packages
@ -86,3 +91,14 @@ Uninstall the packages by running the following command:
.. code-block:: console
sudo apt-get remove --purge "vpp*"
Remove FD.io Apt source lists
=============================
Remove FD.io Apt source list files created by the packagecloud apt setup script
by running the following command:
.. code-block:: console
sudo rm /etc/apt/sources.list.d/fdio*.list

View File

@ -16,17 +16,17 @@ Skills to be Learned
VPP commands learned in this exercise
--------------------------------------
#. `create host-interface <https://docs.fd.io/vpp/17.04/clicmd_src_vnet_devices_af_packet.html#clicmd_create_host-interface>`_
#. `set int state <https://docs.fd.io/vpp/17.04/clicmd_src_vnet.html#clicmd_set_interface_state>`_
#. `set int ip address <https://docs.fd.io/vpp/17.04/clicmd_src_vnet_ip.html#clicmd_set_interface_ip_address>`_
#. `show hardware <https://docs.fd.io/vpp/17.04/clicmd_src_vnet.html#clicmd_show_hardware-interfaces>`_
#. `show int <https://docs.fd.io/vpp/17.04/clicmd_src_vnet.html#clicmd_show_interfaces>`_
#. `show int addr <https://docs.fd.io/vpp/17.04/clicmd_src_vnet.html#clicmd_show_interfaces>`_
#. `trace add <https://docs.fd.io/vpp/17.04/clicmd_src_vlib.html#clicmd_trace_add>`_
#. `clear trace <https://docs.fd.io/vpp/17.04/clicmd_src_vlib.html#clicmd_clear_trace>`_
#. `ping <https://docs.fd.io/vpp/17.04/clicmd_src_vnet_ip.html#clicmd_ping>`_
#. `show ip neighbors <https://docs.fd.io/vpp/21.06/db/dba/clicmd_src_vnet_ip-neighbor.html#clicmd_show_ip_neighbors>`_
#. `show ip fib <https://docs.fd.io/vpp/17.04/clicmd_src_vnet_fib.html#clicmd_show_ip_fib>`_
#. `create host-interface <https://docs.fd.io/vpp/22.06/cli-reference/clis/clicmd_src_vnet_devices_af_packet.html#create-host-interface>`_
#. `set int state <https://docs.fd.io/vpp/22.06/cli-reference/clis/clicmd_src_vnet.html#set-interface-state>`_
#. `set int ip address <https://docs.fd.io/vpp/22.06/cli-reference/clis/clicmd_src_vnet_ip.html#set-interface-ip-address>`_
#. `show hardware <https://docs.fd.io/vpp/22.06/cli-reference/clis/clicmd_src_vnet.html#show-hardware-interfaces>`_
#. `show int <https://docs.fd.io/vpp/22.06/cli-reference/clis/clicmd_src_vnet.html#show-interface>`_
#. `show int addr <https://docs.fd.io/vpp/22.06/cli-reference/clis/clicmd_src_vnet.html#show-interface>`_
#. `trace add <https://docs.fd.io/vpp/22.06/cli-reference/clis/clicmd_src_vlib.html#trace-add>`_
#. `clear trace <https://docs.fd.io/vpp/22.06/cli-reference/clis/clicmd_src_vlib.html#clear-trace>`_
#. `ping <https://docs.fd.io/vpp/22.06/cli-reference/clis/clicmd_src_plugins_ping.html>`_
#. `show ip neighbors <https://docs.fd.io/vpp/22.06/cli-reference/clis/clicmd_src_vnet_ip-neighbor.html#show-ip-neighbors>`_
#. `show ip fib <https://docs.fd.io/vpp/22.06/cli-reference/clis/clicmd_src_vnet_fib.html#show-ip-fib>`_
Topology
---------

View File

@ -26,7 +26,7 @@ To dump memory traces for analysis:
.. code-block:: console
$ vppctl show memory-trace on main-heap
$ vppctl show memory main-heap verbose
Thread 0 vpp_main
base 0x7fffb6422000, size 1g, locked, unmap-on-destroy, name 'main heap'
page stats: page-size 4K, total 262144, mapped 30343, not-mapped 231801

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@ back-and-forth (i.e. ICMP echo/ping requests and HTTP GET requests).
The intent of this example is to provide a relatively simple example of
connecting containers via VPP and allowing others to use it as a springboard of
sorts for their own projects and examples. Besides Docker and a handful of
common Linux command-line utlities, not much else is required to build this
common Linux command-line utilities, not much else is required to build this
example (due to most of the dependencies being lumped inside the containers
themselves).
@ -60,7 +60,7 @@ project.
other scripts in this project. Intended to be sourced (i.e. not intended to
be run directly). Some of the helper functions are used at run-time within
the containers, while others are intended to be run in the default namespace
on the host operating system to help with run-time configuration/bringup of
on the host operating system to help with run-time configuration/bring up of
the testbench.
* ``Dockerfile.vpp_testbench``: used to build the various Docker images used in
this project (i.e. so VPP, our test tools, etc.; are all encapsulated within
@ -81,7 +81,7 @@ Getting Started
^^^^^^^^^^^^^^^
First, we'll assume you are running on a Ubuntu 20.04 x86_64 setup (either on a
bare metal host or in a virtual machine), and have acquirec a copy of the
bare metal host or in a virtual machine), and have acquired a copy of the
project files (either by cloning the VPP git repository, or duplicating them
from :ref:`sec_file_listings_vpp_testbench`). Now, just run ``make``. The
process should take a few minutes as it pulls the baseline Ubuntu Docker image,
@ -96,11 +96,11 @@ can be cleaned-up via ``make stop``, and the whole process of starting,
testing, stopping, etc.; can be repeated as needed.
In addition to starting up the containers, ``make start`` will establish
variaous types of links/connections between the two containers, making use of
various types of links/connections between the two containers, making use of
both the Linux network stack, as well as VPP, to handle the "plumbing"
involved. This is to allow various types of connections between the two
containers, and to allow the reader to experiment with them (i.e. using
``vppctl`` to congfigure or trace packets going over VPP-managed links, use
``vppctl`` to configure or trace packets going over VPP-managed links, use
traditional Linux command line utilities like ``tcpdump``, ``iproute2``,
``ping``, etc.; to accomplish similar tasks over links managed purely by the
Linux network stack, etc.). Later labs will also encourage readers to compare
@ -177,4 +177,3 @@ entrypoint_server.sh
:caption: entrypoint_server.sh
:language: shell
:linenos:

View File

@ -771,15 +771,13 @@ gbb_endpoint_fwd_recalc (gbp_endpoint_t * ge)
gbp_endpoint_add_itf (gbp_itf_get_sw_if_index (gef->gef_itf),
gei);
if (FIB_PROTOCOL_IP4 == pfx->fp_proto)
ip4_neighbor_advertise (vlib_get_main (),
vnet_get_main (),
gg->gg_uplink_sw_if_index,
&pfx->fp_addr.ip4);
ip4_neighbor_advertise (
vlib_get_main (), vnet_get_main (), gg->gg_uplink_sw_if_index,
vlib_get_thread_index (), &pfx->fp_addr.ip4);
else
ip6_neighbor_advertise (vlib_get_main (),
vnet_get_main (),
gg->gg_uplink_sw_if_index,
&pfx->fp_addr.ip6);
ip6_neighbor_advertise (
vlib_get_main (), vnet_get_main (), gg->gg_uplink_sw_if_index,
vlib_get_thread_index (), &pfx->fp_addr.ip6);
}
}
}

View File

@ -1162,6 +1162,31 @@ class TestGBP(VppTestCase):
lf = VppL2FibEntry(self, epg_nat.bd.bd, ep.mac, ep.recirc.recirc, bvi_mac=0)
lf.add_vpp_config()
self.assert_equal(
self.statistics["/net/arp/tx/gratuitous"][
:, epgs[0].uplink.sw_if_index
].sum(),
2,
)
self.assert_equal(
self.statistics["/net/arp/tx/gratuitous"][
:, epgs[1].uplink.sw_if_index
].sum(),
1,
)
self.assert_equal(
self.statistics["/net/ip6-nd/tx/gratuitous"][
:, epgs[0].uplink.sw_if_index
].sum(),
2,
)
self.assert_equal(
self.statistics["/net/ip6-nd/tx/gratuitous"][
:, epgs[1].uplink.sw_if_index
].sum(),
1,
)
#
# ARP packets for unknown IP are sent to the EPG uplink
#

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