12092 Commits

Author SHA1 Message Date
Mohsin Kazmi
0c740a6d8a tap: fix the coverity warning
Type: fix

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

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

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

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

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

Type: improvement

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

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

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

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

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

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

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

Type: fix
Fixes: 0d05c0d214ffd326e531bea58f3c971bb9a58252

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

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

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

$ bin/vpp unix interactive

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

Type: fix

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

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

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

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

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

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

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

With this fix, disable VLAN programming for IXGBE.

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

This patch fixes the following DPDK plugin issue:

CID 253333:  Control flow issues  (DEADCODE)

The change also includes some cosmetic changes for error
handling.

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

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

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

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

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

Ticket: VPP-2009
Type: improvement

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

Removed obsolete/unused nodes, functions, variables.

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

Moved all formatting functions to _format.c file.

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

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

Type: improvement

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

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

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

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

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

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

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

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

Ticket: VPP-2020
Type: fix

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Type: refactor

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I8e71e4fbc048a80c4b250c2a66cfd8a522bde5f4
2022-03-29 10:10:48 +00:00