11179 Commits

Author SHA1 Message Date
21b4e337b6 vppinfra: use unaligned non-vector load/stores in x86 memcpy
Type: fix
Change-Id: I54ef23a52f05cc95210a736f84b927dd69b8a6f7
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-10-12 19:48:02 +00:00
e8f57d593e fib: fix the drop counter for ipv6 RPF failures
Type: fix

the only change to the mfib forwarding node is to set the error code, the rest is checkstyle formatting.

The traces previously showed some bogus reason:

00:04:27:325550: ip6-mfib-forward-rpf
  entry 10 itf -1 flags
00:04:27:325551: ip6-drop
    fib:0 adj:10 flow:0
  UDP: fe80::b203:eaff:fe02:604 -> ff02::1:2
    tos 0x00, flow label 0x651ed, hop limit 1, payload length 64
  UDP: 546 -> 547
    length 64, checksum 0xec9a
00:04:27:325551: error-drop
  rx:GigabitEthernet6/0/0
00:04:27:325553: drop
  ip6-input: drops due to concurrent reassemblies limit

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I294684c36edc346b4ebdd83ba66888b3b2197704
2021-10-12 16:55:08 +00:00
74a25859bd unittest: fix crypto key len coverity warning
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id41e22345be3ec401813ba43ddc7d92666784eb4
2021-10-12 16:54:26 +00:00
f6e6da9247 api: cli coverity fixes
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I515be7ea213250fe89a2b2be06f3636fe8f493a8
2021-10-12 16:53:56 +00:00
6d7dfcbfa4 ipsec: Performance improvement of ipsec4_output_node using flow cache
Adding flow cache support to improve outbound IPv4/IPSec SPD lookup
performance. Details about flow cache:
  Mechanism:
  1. First packet of a flow will undergo linear search in SPD
     table. Once a policy match is found, a new entry will be added
     into the flow cache. From 2nd packet onwards, the policy lookup
     will happen in flow cache.
  2. The flow cache is implemented using bihash without collision
     handling. This will avoid the logic to age out or recycle the old
     flows in flow cache. Whenever a collision occurs, old entry will
     be overwritten by the new entry. Worst case is when all the 256
     packets in a batch result in collision and fall back to linear
     search. Average and best case will be O(1).
  3. The size of flow cache is fixed and decided based on the number
     of flows to be supported. The default is set to 1 million flows.
     This can be made as a configurable option as a next step.
  4. Whenever a SPD rule is added/deleted by the control plane, the
     flow cache entries will be completely deleted (reset) in the
     control plane. The assumption here is that SPD rule add/del is not
     a frequent operation from control plane. Flow cache reset is done,
     by putting the data plane in fall back mode, to bypass flow cache
     and do linear search till the SPD rule add/delete operation is
     complete. Once the rule is successfully added/deleted, the data
     plane will be allowed to make use of the flow cache. The flow
     cache will be reset only after flushing out the inflight packets
     from all the worker cores using
     vlib_worker_wait_one_loop().

  Details about bihash usage:
  1. A new bihash template (16_8) is added to support IPv4 5 tuple.
     BIHASH_KVP_PER_PAGE and BIHASH_KVP_AT_BUCKET_LEVEL are set
     to 1 in the new template. It means only one KVP is supported
     per bucket.
  2. Collision handling is avoided by calling
     BV (clib_bihash_add_or_overwrite_stale) function.
     Through the stale callback function pointer, the KVP entry
     will be overwritten during collision.
  3. Flow cache reset is done using
     BV (clib_bihash_foreach_key_value_pair) function.
     Through the callback function pointer, the KVP value is reset
     to ~0ULL.

  MRR performance numbers with 1 core, 1 ESP Tunnel, null-encrypt,
  64B for different SPD policy matching indices:

  SPD Policy index    : 1          10         100        1000
  Throughput          : MPPS/MPPS  MPPS/MPPS  MPPS/MPPS  KPPS/MPPS
  (Baseline/Optimized)
  ARM Neoverse N1     : 5.2/4.84   4.55/4.84  2.11/4.84  329.5/4.84
  ARM TX2             : 2.81/2.6   2.51/2.6   1.27/2.6   176.62/2.6
  INTEL SKX           : 4.93/4.48  4.29/4.46  2.05/4.48  336.79/4.47

  Next Steps:
  Following can be made as a configurable option through startup
  conf at IPSec level:
  1. Enable/Disable Flow cache.
  2. Bihash configuration like number of buckets and memory size.
  3. Dual/Quad loop unroll can be applied around bihash to further
     improve the performance.
  4. The same flow cache logic can be applied for IPv6 as well as in
     IPSec inbound direction. A deeper and wider flow cache using
     bihash_40_8 can replace existing bihash_16_8, to make it
     common for both IPv4 and IPv6 in both outbound and
     inbound directions.

Following changes are made based on the review comments:
1. ON/OFF flow cache through startup conf. Default: OFF
2. Flow cache stale entry detection using epoch counter.
3. Avoid host order endianness conversion during flow cache
   lookup.
4. Move IPSec startup conf to a common file.
5. Added SPD flow cache unit test case
6. Replaced bihash with vectors to implement flow cache.
7. ipsec_add_del_policy API is not mpsafe. Cleaned up
   inflight packets check in control plane.

Type: improvement
Signed-off-by: mgovind <govindarajan.Mohandoss@arm.com>
Signed-off-by: Zachary Leaf <zachary.leaf@arm.com>
Tested-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: I62b4d6625fbc6caf292427a5d2046aa5672b2006
2021-10-12 16:43:18 +00:00
d9e9870dd9 session: set actual lcl ip on accepted ct
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic2ba5fa234a394acb524b61573fc49f2d58c2dea
2021-10-12 14:38:43 +00:00
fcef34dd1c memif: fix the memif crash when slave disconnect
Type: fix

Fixes: 3effb4e63068 ("memif: integrate with new tx infra")

memif is recently integrated with new tx infra. But it
introduces a crash when slave disconnect from master but
interface is not deleted. Disconnect routine was missing
unregister of all tx queues. This patch fixes it.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I81c59cc1a03561248ec8595d5e3caa54f421833e
2021-10-12 13:09:32 +00:00
23a15b34e4 Revert "nat: static mappings in flow hash"
This reverts commit 69b7599e4b061a8996205f0304232ede84cb70d4.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: If531b122ae5a9f91c2fe6eaa0da69922a91f16d3
2021-10-12 12:45:56 +02:00
69b7599e4b nat: static mappings in flow hash
Put static mappings in flow hash, drop existing hash tables used for
static mappings. Drop refcount variables and use hash table as a single
point of truth. Allow creating a static mapping conflicting with dynamic
mapping, which will take precedence after dynamic mapping is freed, so
that the existing flow can finish transferring data.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ieeba691d83a83887d0a0baccd5f3832f66126096
2021-10-12 09:58:20 +00:00
5a884ecdd3 api: set missing handlers
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I1fdefeaa4661c03e819b2f2f25762c633f9ab42c
2021-10-11 20:16:58 +00:00
1fa06c9a06 vat: move memset after init
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ia65fd2f99dfe6538411c247aeb9691c590c2e00b
2021-10-11 15:08:25 +00:00
6958c23bd5 l3xc: skip load balancing if not multipath
Type: improvement

Change-Id: I3d8e1c7a83530bbc4b1751358ad7d034476ff13f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-11 14:14:26 +02:00
275bd79634 ip: fix fib and mfib locks
This patches fixes an issue that could cause
fib locks to underflow: if an API user deletes
a fib and quickly recreates it, the fib may not
have been actually deleted. As a result, the
lock would not be incremented on the create call
leading to the fib potentially disappearing
afterwards - or to the lock to underflow when
the fib is deleted again.

In order to keep the existing API semantics,
we use the locks with API and CLI source as flags.
This means we need to use a different counter
for the interface-related locks.

This also prevents an issue where an interface being
bound to a vrf via API and released via CLI could
mess up the lock counter.

Finally, this will help with cleaning up the
interface-related locks on interface deletion
in a later patch.

Type: fix

Change-Id: I93030a7660646d6dd179ddf27fe4e708aa11b90e
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2021-10-11 12:04:03 +00:00
bd23b405fb docs: nitfixes in FEATURE.yaml
Type: improvement

Change-Id: Iec585880085b12b08594a0640822cd831455d594
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-10-11 09:05:43 +00:00
5e5f800480 af_xdp: ensure at least one queue is created
Attempting to create an af_xdp interface with zerocopy where the
underlying driver didn't support it would lead to a crash due to
queue creation silently failing.

Type: fix

Signed-off-by: Joshua Roys <roysjosh@gmail.com>
Change-Id: Ifd9070b8c2b3023d71120c5cf20f7e89d04e4cb3
2021-10-11 07:37:52 +00:00
6fff5ef8a9 tls: shutdown openssl context on app close
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie0fde16fb4e41637169474628808fddf343884f3
2021-10-08 20:39:54 +00:00
ea96292985 vxlan-gpe: add udp-port configuration support
similar behavior as here: 839dcc0fb7313638d9b8f52a9db81350dddfe461

Type: improvement

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I1b0a8f8f3dab48839e27df7065cf5f786cf0b5e9
2021-10-08 11:38:56 +00:00
3f59c63960 ikev2: lazy initialization
- do not initialize resources if ikev2 is not used.
 - process IKE packets only if we have profile(s) configured

Type: improvement

Change-Id: I57c95a888532eafd70989096c0555ebb1d7bef25
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-08 11:18:23 +00:00
fa6e7aacfc build: fix centos rpm build
When build vpp-plugins rpm package, found

/home/vpp/build-root/rpmbuild/vpp-21.10/build-root/\
install-vpp-native/vpp/lib/vpp_plugins: No such file or directory

RPM build errors:
File not found: /home/vpp/build-root/rpmbuild/../usr/lib/vpp_plugins/*

After e3cf4d0 ("build: use GNUInstallDirs install destinations")
vpp_plugins on centos src path changed from lib to lib64
Update RPM spec file accordingly.

Type: fix
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I9c4d91f97f2faa474bce28893ab763b414f759b8
2021-10-08 11:15:51 +08:00
ac55a722d6 ipsec: fix protect update log if nexthop is NULL
If logging is on, it will try to print the address nh. Make sure it is
not NULL.

Type: fix

Change-Id: I81c0295865901406d86e0d822a103b4d5adffe47
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-07 16:28:38 +00:00
adf1497ee0 wireguard: peers dump fix
Type: fix

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I4450b8c8b50a3be8d6a399f6a58bc0e8eb500b28
2021-10-07 15:38:50 +00:00
9685624a50 vppinfra: asan: improve overflow semantic
Type: improvement

Change-Id: Ia63899b82e34f179f9efa921e4630b598f2a86cb
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-07 15:36:04 +00:00
9888fdad41 misc: MAINTAINERS fixes for lldp and lisp
They are now plugins

Type: docs
Change-Id: I37d0db10872218cb645feda83fc47b14a57ceada
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2021-10-07 15:35:12 +00:00
f50aab0184 build: fix ipsecmb version check
Type: fix

This patch fixes the chacha20-poly1305 support check in ipsecmb
engine build.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: PiotrX Kleski <piotrx.kleski@intel.com>
Change-Id: I74b52a27f78a0f6a65c867dbd44a44a8f4a2ed60
2021-10-07 15:34:48 +00:00
0c56217a30 udp: fix severity error info
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I415d68b39ecac546b531f6eb98bca51e7eb6f7f7
2021-10-07 15:34:31 +00:00
43289951b2 ip: fix path MTU node errors definition
The path mtu node uses errors defined by ip fragmentation.

Type: fix

Change-Id: I1f173955919a4f555ab0309cd8201ec342a0ae92
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-07 15:22:57 +00:00
c7cceeebb7 ikev2: do not require optional IDr on IKE AUTH
IDr is optional in IKE AUTH from the initiator. In that case, the
responder is free to use any matching profile and fills the
corresponding IDr in the response.
The initiator is then free to accept or reject it.

Type: improvement

Change-Id: I07a1c64a40ed22bd41767c259406238bbbab5cf4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-07 15:22:17 +00:00
b37342c5a7 ikev2: add logs in case of parsing errors
Type: improvement

Change-Id: Id0a6a9e68725ea7aa0b7da14cf54d14405a907fb
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-07 15:21:55 +00:00
9d22cb363e ikev2: do not send IDi on responder AUTH
The IDi is not mentioned in the RFC for the responder AUTH message, and
it confuses some IKE implementations.

Type: fix

Change-Id: I2bcefa1efd315412a6f5fa592668d4e0da510264
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-07 15:21:11 +00:00
9e17887db9 arp: source address selection
https://gerrit.fd.io/r/c/vpp/+/30197 introduced SAS and inadvertently
broke ping in a variety of situations:

https://jira.fd.io/browse/VPP-1992
https://jira.fd.io/browse/VPP-1970
https://lists.fd.io/g/vpp-dev/topic/84038840

all of which seem to be rooted in situations where there's literally
nothing smarter ping can do for source address selection than
to pick the first IP on the interface.  This can happen for:

1. P2P interfaces, see attempted fix: https://gerrit.fd.io/r/c/vpp/+/32801
2. Interfaces with /32 IP addresses intentionally assigned

After some discussion, this problem was partially fixed in
https://gerrit.fd.io/r/c/vpp/+/33449

Unforunately, while source selection was fixed in ping, it continued
to be broken in arp/nd.  This gerrit builds on
https://gerrit.fd.io/r/c/vpp/+/33449
and fixes arp/nd.

Type: fix
Ticket: VPP-1970
Ticket: VPP-1992
Fixes: e2fe097424fb169dfe01421ff17b8ccd0c26b4a6

Change-Id: Ief60c321676a15f4f30bf4cd84d50b2f1efec432
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
2021-10-07 13:57:45 +00:00
12ba95bff5 perfmon: Topdown Level 1 support on Snowridge
Enable Topdown Level 1 support on Snowridge,
enabled with standard CPU events on small core.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I58ad09383de7464265ac1b69e683f253591e3b5e
2021-10-07 13:23:06 +00:00
ce45b16156 perfmon: check bundle is supported
Add a check bundle is supported before futher activation.
Enable different bundles with same name, supported on different platforms.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I73e8bbd1e07c05ebccd9146d48a234eb598a2388
2021-10-07 13:23:06 +00:00
0d3914c026 perfmon: fix peusdo events
Fix peusdo events, missed populating "core" events with peusdo events.

Type: fix
Fixes: bf37bf6f7

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I569fa876f1b58540adac0b095be0ff4ade664dec
2021-10-07 13:23:06 +00:00
5b5b89a046 ip: check if interface has link-local address (addition)
previous - b31fbc47f5fcf8234c757558d7b0285348774086

Type: fix

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I7ea2d693d3ad5bf41ece066b3511fbfa156c1e4b
2021-10-06 21:34:31 +00:00
dd630d15d3 wireguard: add events for peer
we can receive events from peer about its state:
-WIREGUARD_PEER_STATUS_DEAD
-WIREGUARD_PEER_ESTABLISHED

Type: improvement
Change-Id: Ide83fbe2cfafa79ded5bcf3f6a884c26a7583db0
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
2021-10-06 21:32:33 +00:00
22efac3b53 session: fix severity info
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I6548274f8c0ae2a183b1d221cb195de445c2819f
2021-10-06 17:58:23 +00:00
7dd3b5b5e3 wireguard: add ipv6 support
Type: improvement
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: If1a7e82ce163c4c4acaa5acf45ad2b88371396f6
2021-10-06 17:57:46 +00:00
0c4931cb35 tcp: fix severity info
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibe39bc045c3b154209a83b59ef95a37c61b32c0c
2021-10-06 17:54:32 +00:00
5e6a1651c4 docs: more nitfixes
Type: fix

Change-Id: I41455e1cdc62e7c0baa148630b0701b042f3b156
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-10-06 15:04:00 +02:00
fd51e849bf build: fix lib dir in debian packaging
Type: fix
Change-Id: I64b0bbe5ba2317ab03b68f140df69a94a0dd7407
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-10-06 12:47:15 +00:00
2c77ae484c docs: vnet comment nitfixes
Type: improvement

Change-Id: Iac01d7830b53819ace8f199554be10ab89ecdb97
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-10-06 12:32:20 +00:00
ecd6b1a985 vlib: doc nitfixes
Type: improvement

Change-Id: I9e761f908d9d2becbc61eb0515dc6b7c1e1e036f
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-10-06 12:27:40 +00:00
6f38f1ca08 docs: extras/deprec nitfixes
Type: improvement

Change-Id: I39038072eff3c09536917a32984daebab69e6fe7
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-10-06 12:27:35 +00:00
abb2a42239 ip: add classifier-based ACLs support on ip punt
This feature allows one to add classifier-based ACLs on packets punted
from the ip infra, eg. to only whitelist specific sender(s).

Type: feature

Change-Id: Idab37b188583efbca980038875fc3e540cb2e880
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-06 11:58:43 +00:00
7b3a3df263 session: Add session_sapi_enable_disable
Type: feature

This adds an API message to do the switch
at runtime.

Change-Id: Ice6b69c57f0bfbf5668182e25593362ff4133615
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-10-05 19:13:13 +00:00
5546e43f79 build: don't hardcode triplet, allow specifying custom lib dir
Type: fix
Change-Id: I33f364fda88914f88f9b976cb83e6d3ff466f0bb
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
2021-10-05 16:44:32 +00:00
efd967faff tap: free the tap_fds vec on interface deletion
Type: fix

Tap fds are stored in vector array but deleting tap
was not freeing this vector.
This patch fixes it.

Change-Id: I5228e3b9f432c69cf2656b2ee7402360d775964b
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-10-05 11:52:10 +00:00
ede7143386 perfmon: bundles with multiple types
Allow perfmon bundles to support more than one bundle type, either node
or thread. Only used for topdown bundle for the moment.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: Iba3653a4deb39b0a8ee8ad448a7e8f954283ccd8
2021-10-05 10:44:39 +00:00
4189108e1d nat: NAT44 ED api fix and improvement
Backward compatibility fix returns erroneous behavior that lets user
add internally unused inside interface for the purpose
of complying with the old add/dump/details API behavior.
Change introduced in https://gerrit.fd.io/r/c/vpp/+/32951 removed
extra inside interface that wasn't required or any how used by the
output feature. This patch also changed outside interface flags to
inside & outside. This fix returns the old behavior by imitating
the old behavior through dummy registratoin data.

Added new API calls nat44_ed_add_del_output_interface
and nat44_ed_output_interface_get/details as a
replacement of old API's. New API introduces
simplified and cleaner way of configuring outside
feature without requirement of config flags.

Type: improvement
Signed-off-by: Filip Varga <fivarga@cisco.com>
Change-Id: I7a170f7325727c04da5e2e3ffbe3f02179531284
2021-10-05 07:36:14 +00:00
7318c420d1 interface: free the output_node_thread_runtimes
Type: fix

output_node_thread_runtimes was not freed when an interface
is deleted. This patch fixes it.

Change-Id: I763b0109be1904d43839528a346f3b9aa8927205
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-10-04 18:39:15 +00:00