vpp.git
2 years agolinux-cp: fix setting mtu on hardware interfaces 97/35897/2
Matthew Smith [Tue, 5 Apr 2022 18:20:07 +0000 (18:20 +0000)]
linux-cp: fix setting mtu on hardware interfaces

Type: fix
Fixes: 616447c39231

In lcp_router_link_mtu(), either vnet_hw_interface_set_mtu() or
vnet_sw_interface_set_mtu() is called, based on whether this appears to
be a physical interface. The test to determine whether this is true was
incorrect and probably never worked right so vnet_sw_interface_set_mtu()
was always being called. This causes some breakage with Recent changes
to code which manages interface MTUs. Fix the test so the right function
is called.

Change-Id: I1ecccbce37d5a1e53b2349ed40f3d0d27eb03569
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2 years agodpdk: add multi-txq support 71/35871/2
Mohsin Kazmi [Thu, 31 Mar 2022 21:59:15 +0000 (21:59 +0000)]
dpdk: add multi-txq support

Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I9f061a05d947bc2867e1b962bf0522ad344bcc1a

2 years agobuild: opensuse: remove nasm, change to clang 05/35905/2
Laszlo Kiraly [Wed, 6 Apr 2022 14:25:32 +0000 (16:25 +0200)]
build: opensuse: remove nasm, change to clang

Type: make

Signed-off-by: Laszlo Kiraly <laszlo.kiraly@est.tech>
Change-Id: I3951be5be95a7fb76f54c4ce0daab0748cb8419c

2 years agostats: fix vector overrun in expend check 17/35917/3
Dmitry Valter [Fri, 8 Apr 2022 10:08:32 +0000 (10:08 +0000)]
stats: fix vector overrun in expend check

Do not access allocated elements beyond the end of the vector. They are
allocated, but not yet valid both logically (they are at best NULLs) and
according to ASAN.

Type: fix
Change-Id: Iaf43767d6d3bd4c24c7c5a0ba9b3410bbeeb0556
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
2 years agovppinfra: introduce clib_perfmom 20/35920/2
Damjan Marion [Wed, 6 Apr 2022 19:16:37 +0000 (21:16 +0200)]
vppinfra: introduce clib_perfmom

Type: improvement
Change-Id: I85a90774eb313020435c9bc2297c1bdf23d52efc
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovppinfra: clib_interrupt_get_next reading unallocated memory 13/35913/2
Paul Atkins [Wed, 6 Apr 2022 13:51:21 +0000 (14:51 +0100)]
vppinfra: clib_interrupt_get_next reading unallocated memory

The clib interrupt structure has a couple of fields at the start of
the cacheline, and then in the next cacheline it has a bitmap, which
is then followed by an atomic bitmap.  The size of the bitmaps is
based on the number of interrupts, and when the memory is allocated
the number of interrupts needed is used to size the overall block of
memory. The interrupts typically map to pool entries, so if we want
to store 512 entries then we store them in indices 0..511. This
would then take 8 6 4bit words, so each bitmap would be this size
when the struct is allocated.

It is possible to walk over the end of the allocated data with certain
sizes, one of which is 512. The reason this happens with 512 is that
the check to see when to exit the loop is returning when offset is
greater than the value needed to fit all the values.  In this case
512 >> 6 = 8. If there had only been 511 entries then the size would
have been 511 >> 6 = 7, and so it would have fitted in the space.

Therefore modify the check to also check that we are not looking into
the memory beyond what we have allocated in the case where the
number of interrupt is one of the boundary values like 512.

Also add a similar check first time round the loop as it is
possible we could have ate same problem there too.

Add a new test file to verify the new code works. The old version
of the code made this test fail when run with the address
sanitizer. Without the sanitiser it tended to pass because the
following memory was typically set to 0 even though it was
uninitialised.

Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I2ec4afae43d296a5c30299bd7694c072ca76b9a4

2 years agovppinfra: add bright colors to format_table 18/35918/2
Damjan Marion [Fri, 8 Apr 2022 11:42:41 +0000 (13:42 +0200)]
vppinfra: add bright colors to format_table

Type: improvement
Change-Id: I21de21af6dea9e39df5e912e20e56d878a40659f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoapi: Do not assert of short message lengths 82/35782/2
Neale Ranns [Fri, 25 Mar 2022 08:34:53 +0000 (08:34 +0000)]
api: Do not assert of short message lengths

Type: improvement

Short message lengths are correctly handled by the code, asserting makes unit tests that verify this behaviour (e.g. test_ip_punt_api_validation) fail/crash with a debug image.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ib3a377e5d49fde0eee252b92f0e58a8a0d0d83ec

2 years agotls http: run config fns after init ones 07/35907/3
Florin Coras [Wed, 6 Apr 2022 22:10:13 +0000 (15:10 -0700)]
tls http: run config fns after init ones

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia4d8aaafeb3629f421601edffefe9c61c3e69dba

2 years agotls: fix session pool realloc on accept 08/35908/3
Florin Coras [Thu, 7 Apr 2022 02:05:05 +0000 (19:05 -0700)]
tls: fix session pool realloc on accept

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I68ada775810bb4a4f280962a979605b211562a52

2 years agodevices: add cli support for checksum and gso disable 92/35892/6
Mohsin Kazmi [Tue, 5 Apr 2022 12:43:13 +0000 (12:43 +0000)]
devices: add cli support for checksum and gso disable

Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I33a29cf11998736347eca5016eee112619d847c1

2 years agovppinfra: add vec_new_heap() 04/35904/2
Damjan Marion [Wed, 6 Apr 2022 10:31:15 +0000 (12:31 +0200)]
vppinfra: add vec_new_heap()

Type: improvement
Change-Id: Iab3d65b6276829ad1e522e66380d1797e37579b8
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodevices: add cli support to disable qdisc bypass 90/35890/4
Mohsin Kazmi [Tue, 5 Apr 2022 12:03:47 +0000 (12:03 +0000)]
devices: add cli support to disable qdisc bypass

Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ie5f2bdb8fb559680bab863a7c24a49360e005b58

2 years agostats: avoid linear search for empty entry 02/35902/4
Damjan Marion [Wed, 6 Apr 2022 10:06:41 +0000 (12:06 +0200)]
stats: avoid linear search for empty entry

Type: improvement
Change-Id: Ie4cdc6d8906da3d1cd18a8f1d7076283546d3003
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agointerface: unregister node counters on interface delete 00/35900/3
Damjan Marion [Wed, 6 Apr 2022 09:07:35 +0000 (11:07 +0200)]
interface: unregister node counters on interface delete

Type: fix
Change-Id: I2562ae5833b542c29bcd5025a9a6756e5de95a42
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovppinfra: add MAX macros for clib types 01/35901/1
Damjan Marion [Wed, 6 Apr 2022 10:01:47 +0000 (12:01 +0200)]
vppinfra: add MAX macros for clib types

Type: improvement
Change-Id: I1bca733d2a35733275efa46ee0a23bf572365c74
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovlib: clear frame flags on free 94/35894/3
Stanislav Zaikin [Thu, 31 Mar 2022 12:16:28 +0000 (14:16 +0200)]
vlib: clear frame flags on free

Type: fix

Change-Id: If4a7ac244832ef72d82c71b0277bc110b9500537
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
2 years agobuild: remove nasm 95/35895/2
Damjan Marion [Tue, 5 Apr 2022 17:26:51 +0000 (19:26 +0200)]
build: remove nasm

Type: make
Change-Id: I5ee34e9d7156ccdc7a8310e8332347d850459495
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agowireguard: prevent segfault on non-adj packets 96/35896/1
Jon Loeliger [Tue, 5 Apr 2022 19:05:38 +0000 (14:05 -0500)]
wireguard: prevent segfault on non-adj packets

An unexpected packet that shows up on a Wireguard interace
that happens not to have a forwarding peer will cause a
segfault trying to index the vector of peers by adjacency.
Rather than segfaulting, recognize a non-adjacent packet
and drop it instead.

This leaves open the question of what _should_ be
happening to, say, IPv6 multicast packets.

Signed-off-by: Jon Loeliger <jdl@netgate.com>
Type: fix
Fixes: edca1325cf296bd0f5ff422fc12de2ce7a7bad88
Change-Id: Ic0a29e6cf6fe812a4895ec11bedcca86c62e590b

2 years agodpdk: bump to DPDK v22.03 26/35826/3
Dastin Wilski [Wed, 30 Mar 2022 12:19:00 +0000 (14:19 +0200)]
dpdk: bump to DPDK v22.03

This patch bumps dpdk version from 21.11 to 22.03.

Type: feature
Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Change-Id: I152a7857378371d3fd26d7473421c2b3113cd3ee

2 years agodpdk: macros changes for dpdk 22.03 25/35825/3
Dastin Wilski [Wed, 30 Mar 2022 12:15:56 +0000 (14:15 +0200)]
dpdk: macros changes for dpdk 22.03

New dpdk version deprecates some macros used by VPP.
This patch changes them to 22.03 version.

Type: improvement
Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Change-Id: Ic362ed318dc1ad88bb682ef13fbd6159171fbaef

2 years agodpdk: compatibility layer for dpdk 22.03 bump 08/35808/8
Dastin Wilski [Wed, 30 Mar 2022 12:06:44 +0000 (14:06 +0200)]
dpdk: compatibility layer for dpdk 22.03 bump

New version of dpdk changes some macros names.
This patch ensures VPP will be compatible with older dpdk versions.

Type: improvement
Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Change-Id: I3d9736278e70064610a1dcad5f2d2f6eb26e0d4b

2 years agodpdk: fix max frame size 93/35293/5
Damjan Marion [Sun, 13 Feb 2022 19:08:30 +0000 (20:08 +0100)]
dpdk: fix max frame size

Type: fix
Change-Id: I70f9ec2eb6c9c1494a4ecd56e06898f6162a0e0e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agonat: nat44 cli bug fix 59/35859/3
Filip Varga [Thu, 31 Mar 2022 14:12:44 +0000 (16:12 +0200)]
nat: nat44 cli bug fix

Two similar CLI paths "nat44" and "nat44 add interface address"
caused unexpected behavior. If "nat44 add interface address"
command would fail the vlib cli processing function would
call "nat44" handler. This would also clean any previously
set errors from the first command and basically return
same error returned by "nat44" handler for every failed
command that starts with the same path string.

Fixes nat44-ed and nat44-ei plugin.

Change-Id: I1aac85c8ae2932da582a2b78243521d1bf8a0653
Ticket: VPP-2021
Type: fix
Signed-off-by: Filip Varga <fivarga@cisco.com>
2 years agovppinfra: refactor address sanitizer 86/35886/3
Damjan Marion [Tue, 5 Apr 2022 10:40:31 +0000 (12:40 +0200)]
vppinfra: refactor address sanitizer

Type: refactor
Change-Id: I5ca142ec1557d5b5c3806b43553ad9d3b5ea1112
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agotap: fix the coverity warning 87/35887/2
Mohsin Kazmi [Tue, 5 Apr 2022 11:12:33 +0000 (11:12 +0000)]
tap: fix the coverity warning

Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I609fb28e58286ff490d12384b03dd713830379b3

2 years agodevices: remove redundant code af-packet 89/35889/3
Mohsin Kazmi [Tue, 5 Apr 2022 11:28:29 +0000 (11:28 +0000)]
devices: remove redundant code af-packet

Type: refactor

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Id485f525057163582dc7a83f7dab7a8b2e759270

2 years agodevices: fix the received blocks counters 88/35888/2
Mohsin Kazmi [Tue, 5 Apr 2022 11:23:17 +0000 (11:23 +0000)]
devices: fix the received blocks counters

Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: If7d9c94dcdc32fa66763e18bd3be7d28b2d17946

2 years agocrypto-openssl: use getrandom to reseed openssl 16/35816/2
Benoît Ganne [Tue, 29 Mar 2022 15:29:49 +0000 (17:29 +0200)]
crypto-openssl: use getrandom to reseed openssl

Type: improvement

Change-Id: I84d594d8baaf18056580455f3b2790d0f31b7b0f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agordma: bump to rdma-core 39.1 22/35822/2
Benoît Ganne [Wed, 30 Mar 2022 08:57:17 +0000 (10:57 +0200)]
rdma: bump to rdma-core 39.1

Type: improvement

Change-Id: I638b67cddf2d1b573002b494a555c0b1ab94181f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agovppinfra: use AVX512 compare for equality testing 49/35749/3
Benoît Ganne [Mon, 21 Mar 2022 14:02:21 +0000 (15:02 +0100)]
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>
2 years agodevices: fix the coverity warnings for af-packet v3 85/35885/2
Mohsin Kazmi [Tue, 5 Apr 2022 10:46:39 +0000 (10:46 +0000)]
devices: fix the coverity warnings for af-packet v3

Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ie647fb280831af23925c4b5f659f1dade6d37eff

2 years agobuild: ./configure basic cross-compilation support 84/35884/1
Damjan Marion [Sun, 31 Oct 2021 18:47:23 +0000 (19:47 +0100)]
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>
2 years agovppinfra: make _vec_len() read-only 82/35882/2
Damjan Marion [Mon, 4 Apr 2022 20:40:45 +0000 (22:40 +0200)]
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>
2 years agoudp: use pool safe reallocs 17/35717/23
Florin Coras [Fri, 18 Mar 2022 19:50:03 +0000 (12:50 -0700)]
udp: use pool safe reallocs

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5bd0b300af07424d1ce4807fa0b17e375001f089

2 years agotcp: use safe realloc pool 53/35653/28
Florin Coras [Tue, 15 Mar 2022 23:27:43 +0000 (16:27 -0700)]
tcp: use safe realloc pool

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8ba93643236aaa50eeb4755b74821a8c4ca6179b

2 years agointerface api: restore order of context value 97/35697/4
Vratko Polak [Thu, 17 Mar 2022 17:57:40 +0000 (18:57 +0100)]
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>
2 years agotls: set client ckpair only for non-test ckp 80/35880/3
Florin Coras [Mon, 4 Apr 2022 20:37:10 +0000 (13:37 -0700)]
tls: set client ckpair only for non-test ckp

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7287e40ad95dfe061fd8a7b0e99921d5540e030d

2 years agotls: null terminate openssl chiphers 81/35881/3
Florin Coras [Mon, 4 Apr 2022 20:59:32 +0000 (13:59 -0700)]
tls: null terminate openssl chiphers

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5d4e68730a75337a2e532e72f366b62d6973235e

2 years agovlib: remove unused fields 79/35879/2
Damjan Marion [Mon, 4 Apr 2022 17:43:30 +0000 (19:43 +0200)]
vlib: remove unused fields

Type: refactor
Change-Id: I449fcea92a1c96dd7dd0bcad893060ad1c614351
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovlib: improve exec path search 78/35878/2
Damjan Marion [Mon, 4 Apr 2022 16:48:11 +0000 (18:48 +0200)]
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>
2 years agosession: use session layer rpc for evts sent to main 77/35877/4
Florin Coras [Mon, 4 Apr 2022 17:10:58 +0000 (10:10 -0700)]
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

2 years agovlib: fix memory leak in load_one_plugin 76/35876/1
Damjan Marion [Mon, 4 Apr 2022 16:04:28 +0000 (18:04 +0200)]
vlib: fix memory leak in load_one_plugin

Type: fix
Fixes: 500ba9f
Change-Id: I32872a084276d9b38ff07cdccccb746c0212777f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovppinfra: fix alloc and alignment in fifo 75/35875/1
Damjan Marion [Mon, 4 Apr 2022 14:49:16 +0000 (16:49 +0200)]
vppinfra: fix alloc and alignment in fifo

Type: fix
Change-Id: Ia9f715f6074c72ff581fba1740273cfebe48c0f1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodevices: add multi-queue support for af-packet 79/35779/5
Mohsin Kazmi [Fri, 25 Mar 2022 14:27:45 +0000 (14:27 +0000)]
devices: add multi-queue support for af-packet

Type: feature

Change-Id: I0f4e6517fcfa07ffb0aba89b159ac1337937a508
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2 years agointerface: read only one line in show hardware 38/35838/5
Vratko Polak [Thu, 31 Mar 2022 10:32:10 +0000 (12:32 +0200)]
interface: read only one line in show hardware

Type: fix

Change-Id: I442496585fc24b7458535ad1a1d8db525c258540
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2 years agosvm: Close client shm fd 55/35855/5
root [Fri, 1 Apr 2022 09:09:05 +0000 (09:09 +0000)]
svm: Close client shm fd

Type: fix

Signed-off-by: Emmanuel Scaria <emmanuelscaria11@gmail.com>
Change-Id: I41bb6e16735b77efa744b0368eed7dfa9583e960

2 years agovrrp: add stats support and update API 10/35810/4
Emanuele Di Pascale [Tue, 29 Mar 2022 10:29:23 +0000 (12:29 +0200)]
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

2 years agodpdk: fix vlan creation on ixgbe 27/35827/2
Alexander Chernavin [Wed, 30 Mar 2022 13:40:29 +0000 (13:40 +0000)]
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

2 years agodpdk: fix coverity issue 44/35844/4
Fan Zhang [Thu, 31 Mar 2022 12:50:21 +0000 (13:50 +0100)]
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

2 years agosession: leverage new pool functions in safe realloc 52/35852/5
Florin Coras [Thu, 31 Mar 2022 22:42:17 +0000 (15:42 -0700)]
session: leverage new pool functions in safe realloc

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2c264c31d2470b11b94d68411fa8266387319146

2 years agonat: VRF routing & FIB improvements 29/35429/10
Filip Varga [Wed, 23 Feb 2022 23:45:48 +0000 (15:45 -0800)]
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>
2 years agonat: nat44-ed cleanup & fixes 37/35337/9
Filip Varga [Tue, 15 Feb 2022 19:56:07 +0000 (11:56 -0800)]
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>
2 years agotls: enable host verification by hostname 81/35781/9
satna [Fri, 25 Mar 2022 08:16:02 +0000 (13:46 +0530)]
tls: enable host verification by hostname

Type: improvement

Signed-off-by: satna <satbeervarma9596@gmail.com>
Change-Id: I1b1db60fa1a0e47fce273bc07b01887813fd3c48

2 years agovppinfra: vectors with non-default heap 45/35845/4
Damjan Marion [Thu, 31 Mar 2022 13:12:20 +0000 (15:12 +0200)]
vppinfra: vectors with non-default heap

Type: improvement
Change-Id: Ic675ad4edbf27b7230fc2a77f00c90c46d6350c3
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovlib: add support for workers sync 33/35833/5
Florin Coras [Wed, 30 Mar 2022 20:50:19 +0000 (13:50 -0700)]
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

2 years agostats: use vlib_stats_validate in collector 50/35850/1
Damjan Marion [Thu, 31 Mar 2022 15:56:58 +0000 (17:56 +0200)]
stats: use vlib_stats_validate in collector

Type: refactor
Change-Id: Ib2bf9f11209eb310b289b3202b2beeccc3637df0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agostats: convert error counters to normal counters 40/35640/10
Damjan Marion [Mon, 14 Mar 2022 12:04:38 +0000 (13:04 +0100)]
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>
2 years agosession: fix coverity warning 48/35848/4
Florin Coras [Thu, 31 Mar 2022 14:57:47 +0000 (07:57 -0700)]
session: fix coverity warning

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6ddb172d7b4f0ba06b0117d71853a22702a3466b

2 years agovcl: fix api detach if attach failed 34/35834/5
Florin Coras [Wed, 30 Mar 2022 23:08:25 +0000 (16:08 -0700)]
vcl: fix api detach if attach failed

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idd1df83bb01951c2455b23c08e3cc1fcd9b91064

2 years agocrypto: drop the frame if there is no handler 42/35842/1
Dastin Wilski [Thu, 31 Mar 2022 09:55:09 +0000 (11:55 +0200)]
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

2 years agotls: support to reinitialise ca_chain wo restart 84/35484/9
Saravanan Murugesan [Mon, 28 Feb 2022 14:24:11 +0000 (19:54 +0530)]
tls: support to reinitialise ca_chain wo restart

Type: improvement

Signed-off-by: Saravanan Murugesan <sarmurug@cisco.com>
Change-Id: I90e90678ae6586019cc842f9d504d53991cfabe4

2 years agoip: Reference count the enabling the punt feature 83/35783/3
Neale Ranns [Fri, 25 Mar 2022 08:51:58 +0000 (08:51 +0000)]
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

2 years agovppinfra: vector allocator rework 18/35718/50
Damjan Marion [Fri, 18 Mar 2022 23:07:52 +0000 (00:07 +0100)]
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>
2 years agoudp: fix inner packet checksum calculation in udp-encap 37/35737/27
Mauro Sardara [Tue, 22 Mar 2022 17:53:46 +0000 (17:53 +0000)]
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>
2 years agohsa: refactor echo clients 17/35817/7
Florin Coras [Tue, 29 Mar 2022 21:47:29 +0000 (14:47 -0700)]
hsa: refactor echo clients

Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I30cc31c438d357d48576fba84e54809455960eaa

2 years agotls: Support for client certificate-key pair 13/35813/2
sarmurug [Tue, 29 Mar 2022 12:54:44 +0000 (18:24 +0530)]
tls:  Support for client certificate-key pair

Type: improvement

Signed-off-by: sarmurug <sarmurug@cisco.com>
Change-Id: Ibbfe827b9c4c603a6fe7cc49970a46bd683194ce

2 years agovlib: fix unaligned runtime_data 00/35800/4
Dmitry Valter [Tue, 29 Mar 2022 15:13:26 +0000 (15:13 +0000)]
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

2 years agodpdk: make log pipe non-blocking on both sides 15/35815/2
Damjan Marion [Tue, 29 Mar 2022 14:37:30 +0000 (16:37 +0200)]
dpdk: make log pipe non-blocking on both sides

Type: fix
Change-Id: I857403b9d93ee4c17f2dd5ac8e6dafd66260a252
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agolinux-cp: fix tap interface attrs in case the sw pool realloc'd 19/35719/3
Vladislav Grishenko [Sun, 20 Mar 2022 10:55:25 +0000 (15:55 +0500)]
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

2 years agovnet: set frame overhead at interface registration 73/35773/4
Matthew Smith [Wed, 23 Mar 2022 22:11:32 +0000 (22:11 +0000)]
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>
2 years agocrypto-openssl: fix seed calculation 06/35806/3
Damjan Marion [Tue, 29 Mar 2022 01:07:34 +0000 (03:07 +0200)]
crypto-openssl: fix seed calculation

Type: fix
Fixes: 91f17dc
Change-Id: I860b6d5d5e9cf47d84fde0a2c92be43125038694
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agolinux-cp: handle ipv4 routes when link goes down on subif 32/35532/6
Alexander Chernavin [Mon, 14 Feb 2022 12:59:28 +0000 (12:59 +0000)]
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

2 years agolinux-cp: add support for table flush if multiple interfaces 31/35531/6
Alexander Chernavin [Fri, 11 Feb 2022 15:25:40 +0000 (15:25 +0000)]
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

2 years agoperfmon: fix order in cmakelists.txt 40/35540/2
Ray Kinsella [Thu, 3 Mar 2022 16:40:30 +0000 (16:40 +0000)]
perfmon: fix order in cmakelists.txt

Fix ordering in CMakeLists.txt

Type: refactor

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I8e71e4fbc048a80c4b250c2a66cfd8a522bde5f4

2 years agoperfmon: fix non-NULL terminated C-string 39/34539/5
Benoît Ganne [Wed, 17 Nov 2021 16:55:50 +0000 (17:55 +0100)]
perfmon: fix non-NULL terminated C-string

format() expects a NULL-terminated C-string as format string.

Type: fix

Change-Id: Ib428cf2debbf98850eed512907175f8ae8ba3c04
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agolibmemif: refactor examples 73/30573/14
Jakub Grajciar [Mon, 4 Jan 2021 10:28:33 +0000 (11:28 +0100)]
libmemif: refactor examples

- icmp_responder: responds to ICMPv4 and ARP requests
- loopback: connects two interfaces and sends a
  verification packet from master memif to slave memif
  where it is looped back
- loopback (reverse path): reverses direction of packet
  in loopback application (slave memif to master memif)

Type: refactor

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ie90aaa3367269408efb6c5d538ad5aa827432238
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2 years agolinux-cp: Fix API response 79/35479/6
Pim van Pelt [Sun, 27 Feb 2022 23:15:22 +0000 (23:15 +0000)]
linux-cp: Fix API response

* Correct endianness issue
* lip_namespace is a vector not a string
* Provide null termination to avoid unpack() failures in the client

Responses in the python API now look like:
lcp_itf_pair_details(_0=328, context=3, phy_sw_if_index=1,
  host_sw_if_index=3, vif_index=19, host_if_name='ice0',
  host_if_type=<vl_api_lcp_itf_host_type_t.LCP_API_ITF_HOST_TAP: 0>,
  namespace='dataplane')
lcp_itf_pair_details(_0=328, context=3, phy_sw_if_index=2,
  host_sw_if_index=4, vif_index=20, host_if_name='ice1',
  host_if_type=<vl_api_lcp_itf_host_type_t.LCP_API_ITF_HOST_TAP: 0>,
  namespace='dataplane')
lcp_itf_pair_details(_0=328, context=3, phy_sw_if_index=5,
  host_sw_if_index=6, vif_index=21, host_if_name='ice0.1234',
  host_if_type=<vl_api_lcp_itf_host_type_t.LCP_API_ITF_HOST_TAP: 0>,
  namespace='dataplane')

Type: fix
Signed-off-by: Pim van Pelt <pim@ipng.nl>
Change-Id: If4bf06a8b70977676ec7f5b1413cee6cc9d1714a

2 years agocrypto-native: avoid overflow load on data 03/35803/1
Damjan Marion [Mon, 28 Mar 2022 13:22:00 +0000 (15:22 +0200)]
crypto-native: avoid overflow load on data

Type: improvement
Change-Id: I5317afa02fa1525a7d8df595b56eb6546ccded57
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovlib: use pthread_attr_setstack() to set thread stack 01/35801/2
Damjan Marion [Sun, 27 Mar 2022 23:47:33 +0000 (01:47 +0200)]
vlib: use pthread_attr_setstack() to set thread stack

Type: improvement
Change-Id: I4c7f2f63651df4362ce1e0e36d885fedf55595c6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovppinfra: avoid mem overflow in hash_memory() 93/35793/4
Damjan Marion [Fri, 25 Mar 2022 23:57:50 +0000 (00:57 +0100)]
vppinfra: avoid mem overflow in hash_memory()

Change-Id: Ic81aafd5f378de06e5ea8cdd6a59e07ff1a7afca
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoip: add barrier sync, ip4_ply_pool expand case 23/35723/4
Vladislav Grishenko [Wed, 12 Jan 2022 10:22:23 +0000 (15:22 +0500)]
ip: add barrier sync, ip4_ply_pool expand case

ply_create() is not thread safe when the ip4_ply_pool expands.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Ie11cc8b1ba587d5e9239a60f4e288492da61368e

2 years agotests: fix core file message 97/35797/3
Dmitry Valter [Sat, 26 Mar 2022 15:43:14 +0000 (15:43 +0000)]
tests: fix core file message

Prevent crashing on nonexistent VPP binary path class member when creating
testsuite core message.

Type: fix
Fixes: b23ffd7ef216463c35b75c831e6a27e58971f4ec
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: Ib9b3dc8c69317e6561e5404bbdcbf672e417cbcd

2 years agolinux-cp: fix name formatting 99/35799/2
Dmitry Valter [Sat, 26 Mar 2022 17:42:25 +0000 (17:42 +0000)]
linux-cp: fix name formatting

Format host interface name as vector rather than c-string.
Otherwise non-null-terminated vector overrun triggers ASAN.

Type: fix
Fixes: 1705a6baefe205bb6792b547c7376eee3f328a71
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: Ib204e57ee17c7ed3bfeb568dcdd834d7d7519102

2 years agosession: simplify safe pool realloc 95/35795/4
Florin Coras [Sat, 26 Mar 2022 08:25:02 +0000 (01:25 -0700)]
session: simplify safe pool realloc

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1c55c054fea6c6886d8287a9b6e264a308f89504

2 years agohsa: echo client connects as rpc 94/35794/3
Florin Coras [Sat, 26 Mar 2022 01:53:09 +0000 (18:53 -0700)]
hsa: echo client connects as rpc

Do connects in an session layer rpc instead of doing cli process sleeps.
Performance with 4 workers goes from ~120k/180k first run/warmed up to
~135k/240k

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id184913e9898f8db099e29a605f3a9b1fc67be63

2 years agobuild: update .clang-format 91/35791/2
Damjan Marion [Fri, 25 Mar 2022 16:24:26 +0000 (17:24 +0100)]
build: update .clang-format

Type: make
Change-Id: Iedf7af3f070cc3875f44adba38523b72f5e5ab43
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agocrypto-native: avoid mem overflow when loading IV 92/35792/1
Damjan Marion [Fri, 25 Mar 2022 16:41:16 +0000 (17:41 +0100)]
crypto-native: avoid mem overflow when loading IV

Type: improvement
Change-Id: I946d91e67c332ecac0b09d50980529b9d4e74f9c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovppinfra: add vec128_t, vec256_t and vec512_t types 89/35789/2
Damjan Marion [Fri, 25 Mar 2022 16:13:59 +0000 (17:13 +0100)]
vppinfra: add vec128_t, vec256_t and vec512_t types

Convenient for type conversion

Type: improvement
Change-Id: I35a770e06e6318fb4249b70021ed6f6c93b07162
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agol2: avoid overflow read of mac address 87/35787/2
Damjan Marion [Fri, 25 Mar 2022 15:20:16 +0000 (16:20 +0100)]
l2: avoid overflow read of mac address

Type: improvement
Change-Id: I99d2c69ede39b3ba5604e1811ce12209c47f5caf
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodocs: Add getting started with GoVPP 18/35618/6
Nathan Skrzypczak [Thu, 10 Mar 2022 11:42:01 +0000 (12:42 +0100)]
docs: Add getting started with GoVPP

Type: docs

Change-Id: I8e739ccf78b8dadf81cf4a4c32407355b2576942
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agodocs: Fix macos clang-format docs 55/35755/2
Nathan Skrzypczak [Wed, 23 Mar 2022 17:32:52 +0000 (18:32 +0100)]
docs: Fix macos clang-format docs

Type: docs

Change-Id: Iaa2f5e2bb92342c1612cb3addbb9bfdc26623d99
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agolinux-cp: handle ipv4 routes when link goes down 30/35530/5
Alexander Chernavin [Wed, 2 Mar 2022 16:12:49 +0000 (16:12 +0000)]
linux-cp: handle ipv4 routes when link goes down

Type: improvement

Currently, when the link goes down on an interface, routes that resolve
through that interface and created with Nexthop API are removed by the
kernel. However, IPv4 routes remain in the FIB because the kernel
doesn't send any notifications about that.

And for the plugin working with user-space applications that create
routes in the kernel using Nexthop API there should be a mechanism to
synchronize the FIB and the kernel in this case.

With this change, add two new startup configuration options to the
plugin to be able to control what should happen with static and dynamic
routes managed by the plugin on link down:
  - del-static-on-link-down (disabled by default, delete routes created
    with the linux-cp static FIB source on link down),
  - del-dynamic-on-link-down (disabled by default, delete routes created
    with the linux-cp dynamic FIB source on link down).

Then, monitor link state changes on interfaces for which a linux-cp pair
exists. If the link goes down on one of the interfaces, process routes
that resolve through that interface according to the new configurations.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I0fbaeeca3f3d1fcd22e8eebb08a0a4a3d0dfe5b8

2 years agobuild: print compiler version 76/35776/2
Damjan Marion [Thu, 24 Mar 2022 23:05:53 +0000 (00:05 +0100)]
build: print compiler version

Type: make
Change-Id: I1bad5f84797a1bfeb41420f408540604d461f440
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agofib: fix ip6-ll fib selection for non-ethernet interfaces 27/35727/5
Vladislav Grishenko [Fri, 19 Nov 2021 17:53:41 +0000 (22:53 +0500)]
fib: fix ip6-ll fib selection for non-ethernet interfaces

Fixes case when packet to link-local address is received over
gre/mpls or other non-ethernet interface and ip6-ll fib for it
is undefined.
If by a chance ip6-ll fib index is valid, packet will be passed
to some ip6 fib with possibilities to be sent out over unrelated
interface or be looped again into ip6-link-local dpo till oom
and crash.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Ie985f0373ea45e2926db7fb0a1ff951eca0e38f6

2 years agodevices: fix high vector rate per dispatch 78/35778/2
Mohsin Kazmi [Fri, 25 Mar 2022 00:33:27 +0000 (00:33 +0000)]
devices: fix high vector rate per dispatch

Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ibd23648483b38696271154237e81081480bb16e0

2 years agosession: reorganize local port allocation 77/35777/2
Florin Coras [Fri, 25 Mar 2022 00:02:08 +0000 (17:02 -0700)]
session: reorganize local port allocation

Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5bbf8d584efdec57908c61f8626bcc81590401b3

2 years agomisc: update my email-address 75/35775/1
Klement Sekera [Thu, 24 Mar 2022 17:01:16 +0000 (18:01 +0100)]
misc: update my email-address

Type: fix
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I756bff7ecedf36cc685a20ba63c9d5229fc2ff32

2 years agobfd: use local error index when incrementing node counters 71/35771/2
Paul Atkins [Thu, 24 Mar 2022 11:26:16 +0000 (11:26 +0000)]
bfd: use local error index when incrementing node counters

When incrementing node counters with vlib_node_increment_counter
the local error index should be passed in. vlib_node_increment_counter
adds the local index to the nodes base index to get the counter to
write to. If we pass in the global counter index, the offset gets
added again in the fn, and we then potentially write into memory that
is not part of the counter vector.

Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I43be33a51bcb52d520495d326b971c1d848d96b5

2 years agosession: safe reallocs for transport endpoint pool 60/35760/5
Florin Coras [Wed, 23 Mar 2022 23:35:05 +0000 (16:35 -0700)]
session: safe reallocs for transport endpoint pool

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6c86d0691bd0594d8b2c05d83d004be1aa8c5e21