11137 Commits

Author SHA1 Message Date
Nathan Skrzypczak
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
Benoît Ganne
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
Nathan Skrzypczak
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
Damjan Marion
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
Mohsin Kazmi
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
Ray Kinsella
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
Filip Varga
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
Mohsin Kazmi
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
Mohsin Kazmi
482394428b interface: remove the redundant vec_free on rx_queue_indices
Type: fix

vnet_delete_hw_interface() calls vec_free on rx_queue_indices.
function vnet_hw_if_unregister_all_rx_queues() is used to free
rx_queue_indices which is also called by vnet_delete_hw_interface().
So, second vec_free is redundant.

Change-Id: Ibda4be38fd122d33532bb384c97b0b9e5f441134
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-10-04 18:39:15 +00:00
Nick Brown
ee1ca438b3 build: Allow ipsec-mb plugin to build with libipsec_mb 0.55
The 0.55 version of libipsec_mb does not support the chacha functions
used in the plugin.

The missing symobls are:
ipsecmb_ops_chacha_poly
ipsecmb_ops_chacha_poly_chained
IMB_CIPHER_DIRECTION

Check for ipsecmb_ops_chacha_poly() and conditionalise the chacha code
in the plugin on this.

ipsec_mb 0.55 is the version currently found in Debian Stable (bullseye)

Type: make
Signed-off-by: Nick Brown <nickbroon@gmail.com>
Change-Id: I88c962ac4f99a58b5cd61fb9b75f692e27d4ec30
2021-10-04 18:31:46 +00:00
Mohsin Kazmi
3effb4e630 memif: integrate with new tx infra
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I7c2b9891e269f23c3aa2a0abfee3cf0a0f1e2135
2021-10-04 18:27:58 +00:00
Florin Coras
41bc861509 vcl: remove unsed configs
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If755cf38e6b30e8757f2c6fb4cf5e6642fa87e52
2021-10-04 18:26:06 +00:00
Filip Tehlar
4223ff14b2 hsa: do not drop the barrier when creating echo server
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I25d3ac72360bea130f567095b486d8e295d2f2f7
2021-10-04 18:09:47 +00:00
Artem Glazychev
9e24f7eb91 wireguard: use the same udp-port for multi-tunnel
now we can reuse udp-port for many wireguard interfaces

Type: improvement
Change-Id: I14b5a9dbe917d83300ccb4d6907743d88355e5c5
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
2021-10-04 16:21:34 +00:00
Jieqiang Wang
039f289e51 vppinfra: fix potential memory access error in _pool_init_fixed
_pool_init_fixed uses mmap to initialize a fixed-size and preallocated
pool, whose size is the sum of vector_size and free_index_size with
alignment to the CLIB_CACHE_LINE_BYTES and page size. In this way
vector_size equals to pool_header_t + vec_header_t + elt_size * max_elts
so moving to the end of the pool space should be pool_header_t pointer +
vector_size, instead of vec_header_t pointer + vector_size.

Simple code to reproduce this error:

u64 *pool;
pool_init_fixed(pool, 2042);

Improve unit test to cover this case

Type: fix

Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Reviewed-by: Lijian Zhang <lijian.zhang@arm.com>
Reviewed-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: If088ef89b3dcb2d874ee837ae9da60983b14615c
Signed-off-by: Dave Barach <dave@barachs.net>
2021-10-04 10:30:54 -04:00
Mohsin Kazmi
2c0dc3e586 virtio: remove control queue support from virtio_show() for tap/tun
Type: fix

Tap/Tun interfaces do not have control queue.
This patch removes the support of control queue
from virtio_show() which is used by show tap/tun cli.

Change-Id: Ib89144ad488ed548fb1ce50ee232a1b8659ccf29
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-10-04 12:56:24 +00:00
Benoît Ganne
a0f3f8cb7c fib: fix unitialized padding in fib_api_next_hop_decode
If the type is IPv4, makes sure the padding bytes are set to 0 as this
is used by ip46_address_is_ip4() to detect the type.

Type: fix

Change-Id: I6a81fa05a6b227086853901bf3dcdc66e6d04d2c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-04 12:48:40 +00:00
Benoît Ganne
7c7b505461 ip: fix punt for ipv6
Type: fix

Change-Id: I583c30e9b63c0b0b6cd5fef0b2cb9ed7ec9856e2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-10-04 12:16:20 +02:00
Ray Kinsella
bf37bf6f79 perfmon: topdown events as peusdo events
Topdown events are peusdo events exposed by linux,
and are only present on Intel platforms.
Change to clarifies this.

Type: fix

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I6a3dcea5f43f53dbb96475329baf5e596a24d54f
2021-10-04 09:14:24 +00:00
Nathan Skrzypczak
d0ea764a5d docs: plugin comment nitfixes
Type: improvement

Change-Id: Ib7e2f5f314144064de7b6be0fade3db2f9c943fe
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-10-04 08:26:43 +00:00
Mohsin Kazmi
ddb192951c interface: remove the input_node_thread_index_by_queue
Type: fix

input_node_thread_index_by_queue is not being used anymore.

Change-Id: I0141fa0d024affb39771acf7516e064c5c8acfe9
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-10-04 07:41:52 +00:00
Sivaprasad Tummala
aca308d8f9 hsa: proxy app worker thread deadlock
proxy main lock not released in certain cases and resulting in deadlock.

Type: fix

Signed-off-by: Sivaprasad Tummala <Sivaprasad.Tummala@intel.com>
Change-Id: Ib869f459b447189bb921c05fd260f3691c2ac787
2021-10-03 20:38:05 +00:00
Neale Ranns
9bd92abc7c mpls: Save the L3 header offset in the meta-data before label imposition
Type: improvement

Subsequent features in the data-path can thus easily find the l3 header
without parsing the label stack.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I26f7d4bbe9186aeb8654706579c72424e8ecca2c
2021-10-03 16:18:06 +00:00
Mohsin Kazmi
f5462369f3 devices: add support for pseudo header checksum
Type: improvement

Linux uses pseudo header checksum when checksum of l4 is offloaded.
This patch adds similar support in virtual interfaces.

Change-Id: I6a94d1104e59356f95057e7c122e3be9cd8659a3
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-10-01 10:04:24 +00:00
Artem Glazychev
de3caf37c6 wireguard: move adjacency processing from wireguard_peer to wireguard_interface
now we should add routes manually

Type: improvement
Change-Id: I877511a18854efdfad02939267d38a216b2ccec3
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
2021-09-30 14:15:58 +00:00
Nathan Skrzypczak
da33105973 fib: doc nitfixes
Type: improvement

Change-Id: I29346c849a5e1ff3c2ea399671f9f50d075e9f18
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-30 13:31:38 +00:00
Nick Brown
679211766b build: consistent use of CMAKE_INSTALL_LIBDIR
Set the RPATH to based on CMAKE_INSTALL_LIBDIR so that libraries are
correctly found.

Type: make
Change-Id: I82d649345edea2c5d3f6b3f43e3e5869b9e580a7
Signed-off-by: Nick Brown <nickbroon@gmail.com>
2021-09-30 10:12:47 +00:00
Nathan Skrzypczak
33b3092d70 nat: doc nitfixes
Type: improvement

Change-Id: I9a4303030b9657c28bbd73168def72c7daa13483
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-30 08:40:37 +00:00
Filip Tehlar
d6f22aa986 vat2: do not require _crc field in API messages
Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Icc2ce594225c3197c9e5be8faa3dc2ee5b0a553e
2021-09-30 08:28:55 +00:00
Andrew Yourtchenko
cdd9a703b1 misc: package the devtool plugins
a274c3a2ed8c4f1f38cb6f126326b4e6798869d2 has split the devtool plugins into a separate component,
which caused them not to be packaged as part of the existing .deb, however this can still be useful
to have them.

This commit adds the new deb vpp-plugin-devtools which contains that component.

Change-Id: I3cf44493745c3d4951ffd2194c6ae539e8ad5926
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2021-09-30 07:23:33 +00:00
Alexander Chernavin
c7164827a9 nat: nat44-ed add session timing out indicator in api (2)
Type: improvement

Currently, NAT44-ED users sessions details are returned for both active
and timed out NAT sessions. It may confuse users that expect to see only
active sessions in the response and make them think that timeouts for
NAT sessions do not work.

With this change, introduce an indicator of timing out for NAT sessions
returned in NAT44-ED user session details.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ib4d689f77cec4b0b0cc8484019e13733cc8bdc0d
2021-09-29 21:21:14 +00:00
Filip Tehlar
a5504a47cf ikev2: build only when deps requirements are met
Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I89bcc1ba804ded676b194dbda52704cd0c54a67e
2021-09-29 14:44:03 +00:00
Matthew Smith
c773a7d5c8 classify: fix message IDs on API replies
Type: fix

When the API cleanup of classify messages was done, the code was not
updated to add the message enums to REPLY_MSG_ID_BASE. So the wrong
message IDs are being sent back in replies to classify API requests.

Add REPLY_MSG_ID_BASE when populated vl_msg_id on a reply.

Change-Id: Ic7c828f14d42a346fc58fc9ff062b954f494cdbd
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2021-09-29 14:42:47 +00:00
Neale Ranns
e11203e5b8 ipsec: Record the number of packets lost from an SA
Type: feature

Gaps in the sequence numbers received on an SA indicate packets that were lost.
Gaps are identified using the anti-replay window that records the sequences seen.

Publish the number of lost packets in the stats segment at /net/ipsec/sa/lost

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I8af1c09b7b25a705e18bf82e1623b3ce19e5a74d
2021-09-29 14:27:48 +00:00
Nathan Skrzypczak
979545e795 tap: Fix tap create with ns
This fixes the interface creation passing
a netns. [0] made the renaming of the new
tuntap interface before switching netns
Thus, preventing creating an interface in
another netns if one exists in VPP's netns
with the same name.
This also fixes restore netns on errors

Type: fix

[0] https://gerrit.fd.io/r/c/vpp/+/33696

Change-Id: I5c83bb37d664057bcf231cd0c636f0e51aa542ad
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-29 14:01:29 +00:00
Nathan Skrzypczak
814eee55fa libmemif: Fix abstract sockets
This fixes size computation when using
abstract sockets with libmemif

Type: fix

Change-Id: I3a686e4ff2132b9fb295bbe30633958dcfec672b
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-29 14:49:45 +02:00
Stanislav Zaikin
754cffbe16 fib: add barrier lock for fib_urpf_list_pool and fib_entry_pool
Pools fib_urpf_list_pool and fib_entry_pool can grow while ip6_urpf_loose_check/fib_entry_get_flags_for_source are being executed. That may result as a crash in mt environment.

Type: fix

Change-Id: I44ca2cb70255e7aaf2e1f7a7d2eecd25cbdd0aaa
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
2021-09-29 07:29:07 +00:00
Filip Tehlar
36217e3ca8 api: API trace improvements
Type: improvement

 * add support for JSON format in API trace
 * add ability to replay JSON API trace in both VPP and VAT2
 * use CRC for backward compatibility check during JSON API replay
 * fix API trace CLI (and remove duplicits)
 * remove custom dump
 * remove vppapitrace.py
 * update docs accordingly

Change-Id: I5294f68bebe6cbe738630f457f3a87720e06486b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Signed-off-by: Ole Troan <ot@cisco.com>
2021-09-28 16:06:19 +00:00
Ole Troan
3459ece6da misc: vpe.api messages dynamically allocated
This is the last in the series of moving API messages from vpp/api/vpe.api to vlibmemory/memclnt.api.
This patch makes the remaining vpe.api messages dynamic, to help VAT2 binary-api command.
Moves the VAT test code to a separate file and removes the now unnused API meta files.

Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I01dd78eaff1d3715dff17d2643bf0f7f0089935b
Signed-off-by: Ole Troan <ot@cisco.com>
2021-09-28 15:17:37 +00:00
Nathan Skrzypczak
7d0e30bc64 devices: Add queues params in create_if
Type: feature

Change-Id: I027ff2c5c905a7ccebd3705a58e35218a94f4880
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-28 14:44:46 +00:00
arikachen
1ae9819908 af_xdp: fix init lock for shared txq
Type: fix

Signed-off-by: arikachen <eaglesora@gmail.com>
Change-Id: Idb5e66d7a2a7ccb6fb5155341df54586186eb11f
2021-09-28 13:49:55 +00:00
Július Milan
11c7cdd590 nat: NAT44 ED & EI session filtering CLI
Improving session filtering capabilities of
show nat44 sessions CLI command for EI and ED NAT
plugins. Adding filtering options: saddr, sport,
daddr, dport, proto for both i2o and o2i flows.

Type: improvement

Change-Id: I70bc94a2e922cddf9451eb7dcbf4a7be21ebf0df
Signed-off-by: Filip Varga <fivarga@cisco.com>
2021-09-28 13:38:36 +00:00
Alexander Chernavin
2430bad895 stats: add name vectors to prometheus exporter output
Type: improvement

Counters are labeled with interface indices in the Prometheus exporter
output. For example:

  # TYPE _if_drops counter
  _if_drops{thread="0",interface="0"} 0
  _if_drops{thread="0",interface="1"} 0
  _if_drops{thread="0",interface="2"} 2112
  [..]

Currently, it's unable to map interface indices to the interface names
using only output provided by the Prometheus exporter. However, this
mapping is present in the vpp_get_stats output:

  # vpp_get_stats dump /if/names
  [0]: local0 /if/names
  [1]: GigabitEthernet0/8/0 /if/names
  [2]: GigabitEthernet0/9/0 /if/names
  [..]

With this change, add name vectors to Prometheus exporter output as info
metrics. Thus exposing interfaces and their indices:

  # TYPE _if_names_info gauge
  _if_names_info{index="0",name="local0"} 1
  _if_names_info{index="1",name="GigabitEthernet0/8/0"} 1
  _if_names_info{index="2",name="GigabitEthernet0/9/0"} 1
  [..]

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Iff86c4d6fea8805e71fb04fccf278bae855e88d1
2021-09-28 13:01:32 +00:00
arikachen
ca92091f95 af_xdp: fix free mem in tx while no free slot
Type: fix

Signed-off-by: arikachen <eaglesora@gmail.com>
Change-Id: Id305b9d311b2d0d11583db1a14a45d9187a1e628
2021-09-28 12:59:24 +00:00
Nick Brown
d67ad46903 build: complete python3 support, no hardcode path
find_package(Python3) will not set variables that are later used, so set
those needed. Perhaps the python2 support, which is EOL, could be
dropped?

Use DESTDIR, instead of hardcoding the path. This allows system
packaging, or local installs, to work properly.

Type: make
Signed-off-by: Nick Brown <nickbroon@gmail.com>
Change-Id: I045516c61473c612ab70858cd9b58c4e2838b347
2021-09-28 11:11:55 +00:00
Filip Tehlar
850024bb84 sr: add API test files
Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Iefc88107ae96915570ae425a527c3969f7ce7b1d
2021-09-28 10:01:49 +00:00
Benoît Ganne
a427690b80 ikev2: support variable-length nonces
IKEv2 nonces can be 16 to 256 bytes.

Type: fix

Change-Id: Ib332028594355c9e5b462bddb7e4dffbcdc9a927
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-09-27 14:39:15 +00:00
Dmitry Valter
41d7d0569b tests: don't install vapi_c{,pp}_test
Don't install vapi_c{,pp}_test. It confuses dpkg-shlibdeps to think we
need libsubunit as shared lib dependency

Type: fix
Fixes: a2d6d352c6926d2f8d4e50aeb1ec59802f32b37b
Signed-off-by: d-valter@yandex-team.ru
Change-Id: Ifb702a61be32b37e79b48780cc61cb0838e87153
2021-09-27 14:38:47 +00:00
Jakub Grajciar
134f1e0225 libmemif: refactor connection establishment
per_thread_ namespace fuctionality replaced by memif socket.
Interfaces are grouped by memif socket which holds interface database.
Each thread can create it's unique memif socket. The path name
can be equal across threads so that the app only uses one
UNIX socket. In case of listener socket, listener fd
can be obtained and set using APIs.

This change allows:
  - No lookup on file descriptor events
    - improves interrupt handling
  - Loopback support (connect two interfaces in one app)
    - usefull for debugging and testing
  - Improves code readability by providing control channel
    abstraction for each interface and listener sockets

Type: refactor

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I1b8261042431c0376646ab4c4c831f6e59dd3eed
2021-09-27 14:35:45 +00:00
Jakub Grajciar
45cf1fc3f5 libmemif: remove per_thread_ namespace
Type: refactor

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ib5a88132ad28860553fc82f5aaaf84e0a1b8e8bf
2021-09-27 14:35:45 +00:00