vpp.git
2 years agovppinfra: initial RISC-V support 98/34298/3
Damjan Marion [Sun, 31 Oct 2021 18:04:33 +0000 (19:04 +0100)]
vppinfra: initial RISC-V support

Type: feature
Change-Id: I1314d60fc420366526efaddd1ed215cf5f8b75dd
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agointerface: avoid dependency on crc32 for eth handoff 14/34314/3
Florin Coras [Tue, 2 Nov 2021 17:32:19 +0000 (10:32 -0700)]
interface: avoid dependency on crc32 for eth handoff

Make sure the infra works on platforms without crc32, like risc-v

Type: fix

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

2 years agoip: fix build without vector unit 96/34296/3
Damjan Marion [Sun, 31 Oct 2021 18:56:44 +0000 (19:56 +0100)]
ip: fix build without vector unit

Change-Id: I102f84d6d72a7f17e62fb8c16a1d4a3234753476
Type: fix
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoclassify: fix build on systems without crc32f and vector unit 95/34295/2
Damjan Marion [Sun, 31 Oct 2021 18:53:27 +0000 (19:53 +0100)]
classify: fix build on systems without crc32f and vector unit

Change-Id: I4229239ed6b81c10362faa1aa9f658c3fccfd31b
Type: fix
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoflowprobe: missing header 94/34294/2
Damjan Marion [Sun, 31 Oct 2021 18:48:43 +0000 (19:48 +0100)]
flowprobe: missing header

Change-Id: I7a6df4317beed78e394dc4ba8edd350ca5b2bc80
Type: fix
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agobuild: clang-13 support 87/34287/3
Damjan Marion [Fri, 29 Oct 2021 20:08:39 +0000 (22:08 +0200)]
build: clang-13 support

Type: make
Change-Id: I20770650d7e0475ee7791da4d5df941792bf7741
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agol2: fix outside array bounds errors 92/34292/2
Damjan Marion [Sun, 31 Oct 2021 18:21:31 +0000 (19:21 +0100)]
l2: fix outside array bounds errors

Reported by gcc-11...

Type: fix
Change-Id: Ia00001a6334722a6ae9cc771e6861c1f709df286
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agolisp: fix outside array bounds 93/34293/2
Damjan Marion [Sun, 31 Oct 2021 18:26:58 +0000 (19:26 +0100)]
lisp: fix outside array bounds

Reported by gcc-11...

Type: fix
Change-Id: I30262f6496217335aa45cca2f541846a69bc15ee
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovppinfra: add CLIB_ASSUME() macro 63/34263/9
Damjan Marion [Wed, 27 Oct 2021 16:19:43 +0000 (18:19 +0200)]
vppinfra: add CLIB_ASSUME() macro

This macro privides a way to tell compiler that it is safe to assume
that specified expression is true so it can optimize code accordingly.

i.e.

    CLIB_ASSUME (n < 3);

    while (n)
    {
      /* ... */
    }

Will tell compiler that n is never going to be >= 3 so instead of
creating loop it will just unroll loop 2 times.

Type: improvement
Change-Id: I718a9b95ff7980d7ac68eb9a88357a4ab6eee74a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agotcp: fix uninitializad value 91/34291/3
Damjan Marion [Sun, 31 Oct 2021 18:13:24 +0000 (19:13 +0100)]
tcp: fix uninitializad value

May not be valid error but gcc-11 complains.

Type: fix
Change-Id: I207b8b4966c5eadd534495e29c873663249a377f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovppinfra: fix calljmp test 90/34290/2
Damjan Marion [Sun, 31 Oct 2021 18:06:20 +0000 (19:06 +0100)]
vppinfra: fix calljmp test

Change-Id: Id1b380880c6509d983727f6fb57e7db97e66655a
Type: fix
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agohash: check if crc32c is available 99/34299/2
Damjan Marion [Sun, 31 Oct 2021 19:18:13 +0000 (20:18 +0100)]
hash: check if crc32c is available

Type: fix
Change-Id: I2f87ed4b151ecd5034b69d6f060626be6fd74e85
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoipsec: silence gcc-11 parentheses warning 97/34297/1
Damjan Marion [Sun, 31 Oct 2021 19:02:19 +0000 (20:02 +0100)]
ipsec: silence gcc-11 parentheses warning

Type: fix
This reverts commit 5ecda99d673298e5bf3c906e9bf6682fdcb57d83.

Change-Id: I393c7d8a6b32aa4f178d6b6dac025038bbf10fe6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agointerface: handoff refactor and optimizations 69/34269/7
Florin Coras [Wed, 27 Oct 2021 22:17:47 +0000 (15:17 -0700)]
interface: handoff refactor and optimizations

- move existing ethernet hash functions to hash infra (no l4
awareness)
- refactor code to use hash infra and add apis to request l4 aware
hashing functions
- hashing functions per interface
- code cleanup

Type: improvement

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

2 years agobuild: add missing fib headers in packages 22/34122/2
Benoît Ganne [Mon, 18 Oct 2021 09:16:01 +0000 (11:16 +0200)]
build: add missing fib headers in packages

Type: fix
Fixes: d6953332db225d5355f50348ef3b09f0525d5282

Change-Id: Ib85fee40e71ebe5bc2b84c62e37298b5e390d520
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agonat: fix coverity warning 05/34205/2
Klement Sekera [Fri, 22 Oct 2021 10:52:34 +0000 (12:52 +0200)]
nat: fix coverity warning

Fix coverity warning by initialising proto variable to a dummy value.
This value is never used because consuming function uses this parameter
value only if is_addr_only flag is not set and this flag is always set
if proto value is not provided by user.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I041bc821a392f0746ef9f07f9b259d62884305b7

2 years agopolicer: fix coverity warning/NULL dereference 55/34255/2
Klement Sekera [Wed, 27 Oct 2021 08:56:38 +0000 (10:56 +0200)]
policer: fix coverity warning/NULL dereference

Add a NULL check in case of hash lookup failure to make coverity happy.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I3cfa5960458d3618f1277ba442b4ca5ca15064ea

2 years agodevices: default mode eth in the api 49/34249/4
Nathan Skrzypczak [Tue, 26 Oct 2021 14:11:38 +0000 (16:11 +0200)]
devices: default mode eth in the api

Type: fix

https://gerrit.fd.io/r/c/vpp/+/34027 added support
for l3 mode, but as the eth_mode constant was set
to 1 we did default to l3 mode in the api.

This reverts to the original logic.

Change-Id: If8b90b300d3868de5233dfa1f33ec975853cba11
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agointerface: refactor interface output node in different processing levels 06/34106/3
Mohsin Kazmi [Thu, 14 Oct 2021 12:21:16 +0000 (12:21 +0000)]
interface: refactor interface output node in different processing levels

Type: refactor

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

2 years agoip: improve csum fold on x86_64 75/34275/4
Damjan Marion [Thu, 28 Oct 2021 10:02:15 +0000 (12:02 +0200)]
ip: improve csum fold on x86_64

New code seems to be 1.5 clocks faster.

old:
mov    eax,edi
shr    rdi,0x20
add    rdi,rax
movzx  edx,di
shr    rdi,0x10
add    rdx,rdi
movzx  eax,dx
shr    rdx,0x10
add    rax,rdx
mov    rdx,rax
shr    rdx,0x10
add    eax,edx

new:
mov    rax,rdi
shr    rax,0x20
add    eax,edi
mov    edi,0x10
shrx   edi,eax,edi
adc    ax,di
adc    ax,0x0

Type: improvement
Change-Id: I3c565812c67ff4c3db197a9d4137a6c131b5b66c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovrrp: fix coverity warning/NULL dereference 59/34259/3
Klement Sekera [Wed, 27 Oct 2021 15:02:47 +0000 (17:02 +0200)]
vrrp: fix coverity warning/NULL dereference

Add error handling for unlikely case where getting IP address of an
interface fails.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ief8642af79fb1d25f061357cd716b93cfdf23fc8

2 years agotap: handle null namespace and bridge correctly 09/34209/2
Matthew Smith [Fri, 22 Oct 2021 14:53:44 +0000 (09:53 -0500)]
tap: handle null namespace and bridge correctly

Type: fix

In tap_create_if(), if args->host_namespace or args->host_bridge are
null because no values were set for those, the virtio_if_t entry in
virtio_main.interfaces ends up getting populated with values of "(nil)"
in net_ns or host_bridge, respectively.

Check whether args->host_namespace and args->host_bridge are null before
trying to set the corresponding fields on virtio_if_t.

Change-Id: I8e1e66a6d7b246e7c66fece406d116ffb1312c64
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2 years agovppinfra: A bitmap copy function 13/34213/2
Neale Ranns [Mon, 25 Oct 2021 09:06:48 +0000 (09:06 +0000)]
vppinfra: A bitmap copy function

Type: improvement

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

2 years agoperfmon: fix coverity warning 06/34206/2
Klement Sekera [Fri, 22 Oct 2021 11:05:48 +0000 (13:05 +0200)]
perfmon: fix coverity warning

Check that cpumask is initialised properly to avoid possible NULL
pointer dereference.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I8df5a718104fe703d6baf3f1294b4a6d2ca01619

2 years agoioam: fix coverity warning/NULL dereference 72/34272/2
Klement Sekera [Thu, 28 Oct 2021 08:16:09 +0000 (10:16 +0200)]
ioam: fix coverity warning/NULL dereference

Add a NULL check and missing array index to avoid multiple NULL
derefences.

Runnning:

set ioam ip6 sr-tunnel-select disable

on a fresh VPP no longer crashes.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ia85f92024f3b14ef1c4cdb9fcf794b962cad9422

2 years agodevices: fix coverity warning/don't leak fd 50/34250/2
Klement Sekera [Tue, 26 Oct 2021 14:19:45 +0000 (16:19 +0200)]
devices: fix coverity warning/don't leak fd

Move socket creation past code which returns from function to avoid
leaking the socket in case of an early error return.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I9e18bd32022441c17ca920d1c2458b058b76c3c0

2 years agotcp: fix use of invalid local sw_if_index 66/34266/2
Florin Coras [Wed, 27 Oct 2021 17:53:41 +0000 (10:53 -0700)]
tcp: fix use of invalid local sw_if_index

Type: fix

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

2 years agovppinfra: improve clib_array_mask_u32 60/34260/2
Damjan Marion [Wed, 27 Oct 2021 15:28:26 +0000 (17:28 +0200)]
vppinfra: improve clib_array_mask_u32

Type: improvement
Change-Id: Ibdb79a0a1c3ba56f9b2f0f2536aafcdeda5cb6d6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovppinfra: use bzhi in pow2_mask when available 61/34261/1
Damjan Marion [Wed, 27 Oct 2021 15:31:46 +0000 (17:31 +0200)]
vppinfra: use bzhi in pow2_mask when available

Saves one clock....

Type: improvement
Change-Id: I43da40fb4887b77ac851f759c50a7ca2814f8f40
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoapi: fix buffer overflow in vl_msg_replay_json 33/34033/3
Benoît Ganne [Mon, 11 Oct 2021 11:49:59 +0000 (13:49 +0200)]
api: fix buffer overflow in vl_msg_replay_json

cJSON_Parse() and vlib_cli_output() expect a NULL-terminated C-string.

Type: fix
Fixes: 36217e3ca8a1ca2e7a341b6b44ffc25e6497191c

Change-Id: Id9819314fcd332c6076d1330b3433885fff07e36
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agolibmemif: fix gcc strict-proto error 53/34253/3
Matthew Giassa [Tue, 26 Oct 2021 19:33:57 +0000 (19:33 +0000)]
libmemif: fix gcc strict-proto error

- Changing function prototypes for a couple libmemif functions so that
  gcc will successfully compile with the "-Wstrict-prototypes" flag
  enabled.
- Re-ran unit tests via "make test" locally on Ubuntu 20.04 LTS x64.
  One issue (likely unrelated to patch):
  * Testcase name: Bidirectional Forwarding Detection (BFD)
    ERROR: put session admin-up and admin-down
    [test_bfd.BFD4TestCase.test_admin_up_down]

Type: fix
Change-Id: Ibcb7210873d39aec9348fe8ac7eebc78d089d8e0
Signed-off-by: Matthew Giassa <mgiassa@cisco.com>
2 years agocrypto: add barrier in crypto key add 47/34247/2
Gabriel Oginski [Tue, 26 Oct 2021 06:43:33 +0000 (07:43 +0100)]
crypto: add barrier in crypto key add

Originally the pool of keys can be expand and cache with pointer for
key can be invalid.
For example in Wireguard during handshake process this pool can be
expand and pointer for these keys in cache can be invalid for workers
or can has incorrect value (poison memory).

The fixes add barrier if the pool needs be to expand to ensure that
cache in function will be valid and avoid situation when cache has
invalid pointer for these keys.

Type: fix

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Ida8f300213dfebb91ecaf1937fb08de81c20ba7b

2 years agoperfmon: properly unmap mmapped pages 45/34245/1
Klement Sekera [Tue, 26 Oct 2021 09:41:10 +0000 (11:41 +0200)]
perfmon: properly unmap mmapped pages

Add missing array index so that actual mmapped pages are unmpapped
instead of attempting to unmap array holding those pages.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ib8709cce1bcbfb505307c140266834b284af796c

2 years agotcp: fix: TCP timewait port reuse rfc compliance 19/34119/5
Michal Kalderon [Sun, 8 Aug 2021 11:30:39 +0000 (04:30 -0700)]
tcp: fix: TCP timewait port reuse rfc compliance

This patch provides a fix for early-kill of timewait sockets that is based on
rfc's 1122, 6191.

The following commits provided a solution for port re-use. However, they
are not fully compliant with rfc 1122 4.2.2.13 ( Closing a connection )
and rfc 6191 (Reducing the TIME-WAIT State Using TCP Timestamps)

commit b092b77cf238ba ("tcp: Enable TCP timewait port use") introduced
a significant improvement by enabling TCP timewait port re-use.

commit ee1cb469b2dd ("tcp: fix port reuse with multiple listeners") fixed
usage of the wrong value for connection_index when searching for a
listener, by storing the state in tcp.flags.

Implementation details:
When a SYN is received during time-wait state, the code
checks whether all the requirements for accepting the SYN packet are
met. If they aren't, the SYN can't be accepted and the packet is dropped,
otherwise, connection is deleted and a new connection with same port
is opened.

Type: fix
Signed-off-by: Ofer Heifetz <oferh@marvell.com>
Signed-off-by: Yuval Caduri <cyuval@marvell.com>
Signed-off-by: Michal Kalderon <mkalderon@marvell.com>
Change-Id: I38a33c6e321c760d45ebec9154399e1c90dd0250

2 years agobier: Disposition paths don't set the next-hop 36/34236/1
Neale Ranns [Mon, 25 Oct 2021 10:24:51 +0000 (10:24 +0000)]
bier: Disposition paths don't set the next-hop

Type: fix

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

2 years agoarp: fix for source address selection 12/34212/3
Ed Warnicke [Sat, 23 Oct 2021 00:51:22 +0000 (19:51 -0500)]
arp: fix for source address selection

Type: fix
Ticket: VPP-1970
Ticket: VPP-1992
Fixes: 9e17887db97bb9f6507270f9fa9923c10816e0df

https://gerrit.fd.io/r/c/vpp/+/33495/7 introduced a bug

where ND responses are inproperly dropped. This fixes that bug.

Signed-off-by: Ed Warnicke <hagbard@gmail.com>
Change-Id: Iec4b07646332ced292e2211408c4f7af3088ac28
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
2 years agovcl: fix cfg parser handling of empty lines 10/34210/3
Florin Coras [Fri, 22 Oct 2021 17:56:54 +0000 (10:56 -0700)]
vcl: fix cfg parser handling of empty lines

Type: fix

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

2 years agosession: fix minor issue 69/34169/2
Filip Tehlar [Wed, 20 Oct 2021 14:05:32 +0000 (14:05 +0000)]
session: fix minor issue

Type: fix
Change-Id: I2f7579980f081d3b0a8d19baade0a6599d55cf80
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2 years agodevices: add support for l3 af_packet interface 27/34027/5
Mohsin Kazmi [Fri, 8 Oct 2021 15:10:49 +0000 (15:10 +0000)]
devices: add support for l3 af_packet interface

Type: improvement

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

2 years agoipsec: add api test file 05/33305/9
Filip Tehlar [Sun, 25 Jul 2021 14:38:45 +0000 (14:38 +0000)]
ipsec: add api test file

Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ib3fe4f306f23541a01246b74ad0f1a7074fa03bb

2 years agofib: Don't back walk from a path-list when a child fist attaches. 00/34200/2
Neale Ranns [Thu, 21 Oct 2021 12:02:53 +0000 (12:02 +0000)]
fib: Don't back walk from a path-list when a child fist attaches.

Type: fix

If the walk is triggered when the child is added, then that child is visited in the walk. However, since it is just attahcing to the path-list it may not, or indeed cannot, have all the context it needs to successfully handle the walk.
In the case of MPLS tunnel, it does not have the path extensions ready, and cannot since the path extensions need to resolve on the path-list.

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

2 years agofib: respect mfib entry flags on create with paths 96/34096/3
Paul Atkins [Tue, 12 Oct 2021 13:32:11 +0000 (14:32 +0100)]
fib: respect mfib entry flags on create with paths

When an mfib entry was created with both paths and entry_flags then
the entry flags were being ignored. If there are no paths then the
flags were passed into mfib_table_entry_update, but in the case where
the entry didn't exist and there were paths and flags, the entry was
created within mfib_table_entry_paths_update() which used a default
of MFIB_ENTRY_FLAG_NONE.

Pass the flags through into the mfib_table_entry_paths_update fn. All
existing callers other than the create case will now pass in
MFIB_ENTRY_FLAG_NONE.

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

2 years agoip: Add ip46-local node for local swif[rx] 08/33708/10
Nathan Skrzypczak [Thu, 9 Sep 2021 16:31:36 +0000 (18:31 +0200)]
ip: Add ip46-local node for local swif[rx]

Type: improvement

This adds a new ip[46]-receive node, sibling
of ip[46]-local. Its goal is to set
vnet_buffer (b)->ip.rx_sw_if_index to the
sw_if_index of the local interface.

In dependant nodes further down the line (e.g.
hoststack) we then set sw_if_idx[rx] to this
value. So that we know which local interface
did receive the packet.

The TCP issue this fixes is that :

On accepts, we were setting tc->sw_if_index
to the source sw_if_index. We should use
the dest sw_if_index, so that packets
coming back on this connection have the
right source sw_if_index. And also setting
it in the tx-ed packet.

Change-Id: I569ed673e15c21e71f365c3ad45439b05bd14a9f
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agol2: add api test file 96/33296/8
Filip Tehlar [Sat, 24 Jul 2021 18:10:39 +0000 (18:10 +0000)]
l2: add api test file

Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ie79a2deac03c04c0697e482a649ff151142126ed

2 years agoip6: set local flag on outbound echo reply 40/34040/3
Matthew Smith [Mon, 11 Oct 2021 19:10:15 +0000 (14:10 -0500)]
ip6: set local flag on outbound echo reply

Type: fix

When VPP generates an ICMP echo reply in response to an incoming
echo request to a local address, set VNET_BUFFER_F_LOCALLY_ORIGINATED
on the buffer. It will prevent ip6-rewrite from decrementing the hop
limit.

Outbound IPv4 echo replies also get this flag set.

Change-Id: Iaa229294eb158edb58cf1bf1b7a90da281321406
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2 years agocnat: improve tests 74/34174/3
Nathan Skrzypczak [Wed, 20 Oct 2021 15:41:07 +0000 (17:41 +0200)]
cnat: improve tests

Type: improvement

This is an attempt to make the cnat tests more
readable by hiding the scapy packet generation
under a common context concept.

This in order to add tests covering a wider range
of scenarios. As of now, only VIP, snat & DHCP
being covered

Change-Id: Ia84868984506bbb652fe974e9a6f54f7a3cc0bd9
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agosession: add api test file 72/33272/7
Filip Tehlar [Mon, 18 Oct 2021 09:02:37 +0000 (09:02 +0000)]
session: add api test file

Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I6b89c4158d10d4928c8418312180dbeba7d70ab2

2 years agoip6: fix IPv6 address calculation error using "ip route add" CLI 22/33422/10
Jieqiang Wang [Tue, 3 Aug 2021 16:07:52 +0000 (16:07 +0000)]
ip6: fix IPv6 address calculation error using "ip route add" CLI

Using VPP CLI "ip route add" to add static IPv6 entries outputs wrong
results. Fix this error by correctly calculating IPv6 addresses with
different increased ranges and grouping ip4/ip6 prefix calculation
functionality into two functions.

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: If954876301ca2095f9331799a086f75db936f246

2 years agogso: add support for gso perf unittest 18/34118/3
Mohsin Kazmi [Fri, 15 Oct 2021 22:45:51 +0000 (22:45 +0000)]
gso: add support for gso perf unittest

Type: test

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

2 years agonat: enable skipped nat44-ed multi worker tests 91/33991/2
Filip Varga [Wed, 6 Oct 2021 18:10:51 +0000 (20:10 +0200)]
nat: enable skipped nat44-ed multi worker tests

Type: test

Change-Id: I185725c0f94084d08c8514642a84a04da62398e1
Signed-off-by: Filip Varga <fivarga@cisco.com>
2 years agonat: nat44-ei configuration improvements 16/33916/9
Filip Varga [Thu, 30 Sep 2021 11:35:59 +0000 (13:35 +0200)]
nat: nat44-ei configuration improvements

nat44-ed core configuration improvements & fixes [0-5] adjusted
for nat44-ei plugin.

Improvements:
 * repeating code converted to functions
 * simplified functions used for pool address, static mapping
and interface configuration.

Clean up:
 * remove obsolete code and logic persisted after plugin
separation from old SNAT plugin.

Fixes:
 * [0] return correct API behavior changed in [5]

Type: improvement

[0] https://gerrit.fd.io/r/c/vpp/+/33622
[1] https://gerrit.fd.io/r/c/vpp/+/33431
[2] https://gerrit.fd.io/r/c/vpp/+/33337
[3] https://gerrit.fd.io/r/c/vpp/+/33249
[4] https://gerrit.fd.io/r/c/vpp/+/32796
[5] https://gerrit.fd.io/r/c/vpp/+/32951

Signed-off-by: Filip Varga <fivarga@cisco.com>
Change-Id: Ie197faa576cb49acb3d218f14e00cb7d13ad9342

2 years agonat: NAT44-ED api fix and improvement 42/33742/7
Filip Varga [Fri, 17 Sep 2021 12:11:59 +0000 (14:11 +0200)]
nat: NAT44-ED api fix and improvement

This patch fixes issue with NAT_API_IS_TWICE_NAT and
NAT_API_IS_ADDR_ONLY flags. Because of control plane
code change - move from boolean parameters to flags
in https://gerrit.fd.io/r/c/vpp/+/32796 patch these
api flags weren't correctly set.

Type: fix

Change-Id: Ieec5fe6bdcca314da027f2d23e3a24f174391a6f
Signed-off-by: Filip Varga <fivarga@cisco.com>
2 years agobfd: fix bfd_key_id update 16/34116/2
Alexander Skorichenko [Fri, 15 Oct 2021 16:04:44 +0000 (16:04 +0000)]
bfd: fix bfd_key_id update

Type: fix

Currently, auth activation CLI command
"bfd upd session auth activate ... conf-key-id <cki> bfd-key-id <bki>"
allows to change both key-ids to new values at once.
But if only bfd-key-id should be corrected, e.g. as a result of mistyping,
we can't do that in a single operation, and have to deactivate auth first
and then reactivate it with a correctly entered pair of ids.

Currently, backend's bfd_auth_activate() function returns immediately,
with no action, if it finds that submitted conf-key-id matches the
current record. No check on bfd-key-id value is made.

With this fix, bfd_auth_activate() checks if session's bfd-key-id has to
be changed to a new value, and if so, it updates and logs appropriately.

Change-Id: I3b915a936cb1721707860bb503f70e7dd29e0ddd
Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
2 years agobfd: fix desired_min_tx_nsec update 05/34105/4
Alexander Skorichenko [Thu, 14 Oct 2021 10:09:02 +0000 (13:09 +0300)]
bfd: fix desired_min_tx_nsec update

Type: fix

Currently, the change in desired_min_tx value initiated locally
doesn't result in actual update of the transmission interval.

bfd_session_t structure has two fields for each of protocol's
local time parameters
        desired_min_tx, required_min_rx
In a case of a parameter update,
"config_" prefixed fields store new values sent to remote
        bs.config_desired_min_tx_nsec,
        bs.config_required_min_rx_nsec
Those prefixed "effective_", keep old values, still in charge,
until new ones are being negotiated between peers:
        bs.effective_desired_min_tx_nsec,
        bs.effective_required_min_rx_nsec

Currently, upon termination of the Poll Sequence (negotiation) only
        bfd_set_effective_required_min_rx()
is called to update effective RX value. TX value remains unchanged.

With this fix, add a call to
        bfd_set_effective_desired_min_tx()
to set new, acknowledged TX value in effect.

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
Change-Id: I80b6746533839c9572598f1ad9dabb33e621a525

2 years agoapi: remove legacy pd msg handlers 23/34123/2
Klement Sekera [Mon, 18 Oct 2021 10:28:48 +0000 (12:28 +0200)]
api: remove legacy pd msg handlers

While looking at a coverity warning it was discovered that it's caused
by return value modified by pd msg handlers. As these are legacy, it's
a good time to remove them and also fix the warning this way.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ic72ab8b2b7a2e55188d1c31cfd18a74b7cf82c43

2 years agointerface: add api test file 69/33269/9
Filip Tehlar [Fri, 23 Jul 2021 22:03:05 +0000 (22:03 +0000)]
interface: add api test file

Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ib07029204ecf12bf2adb5a39afa54bc98fb81f34

2 years agointerface: fix offload flag check 82/32482/9
Nathan Skrzypczak [Thu, 27 May 2021 17:34:59 +0000 (19:34 +0200)]
interface: fix offload flag check

We should compute offloads in interface_ouput.c
in the case when any of the UDP, TCP or IP
offload flags is not present in the interface
capabilities.

e.g. if the interface supports IP cksum offload
but not tcp/udp we should still compute cksums
here.

Type: fix

Change-Id: Ibaa3a56dbc92938dca45311c38f079d040052194
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agomemif: Enhance show memif descriptors to display region 15/34115/2
Steven Luong [Fri, 15 Oct 2021 15:35:56 +0000 (08:35 -0700)]
memif: Enhance show memif descriptors to display region

memif descriptors table may have more than one shared memory region.
To see whether a descriptor's memory address is valid or not, it
is beneficial to also display the descriptor's region. While at it,
fix the truncation problem for the offset field.

Type: improvement

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ia3b7062ac0323c39ade6f3a58333c6405889148f

2 years agoperfmon: topdown lvl 2 support on sapphire rapids 12/34112/3
Ray Kinsella [Fri, 15 Oct 2021 11:48:31 +0000 (12:48 +0100)]
perfmon: topdown lvl 2 support on sapphire rapids

Added topdown level  2 support on sapphire rapids,
including ability to indentify a sapphire rapids cpu.

Type: improvement

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

2 years agoperfmon: additional perf counters on icelake 11/34111/3
Ray Kinsella [Fri, 15 Oct 2021 09:13:17 +0000 (10:13 +0100)]
perfmon: additional perf counters on icelake

The Intel Icelake uArch supports measuring up to 12 counters,
comprised of 4 fixed and 8 general counters.

Type: improvement

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

2 years agovcl: narrow the scope of the restriction of vlsh_bit_val 02/34102/5
wanghanlin [Thu, 14 Oct 2021 03:10:26 +0000 (11:10 +0800)]
vcl: narrow the scope of the restriction of vlsh_bit_val

The restriction of vlsh_bit_val only effect select/pselect, so move the
check to select/pselect function.

Type: fix

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: I3585c83cfc2f0a2fd834450be650dccda67e3faa

2 years agopppoe: fix coverity warning 07/34107/2
Klement Sekera [Thu, 14 Oct 2021 13:41:42 +0000 (15:41 +0200)]
pppoe: fix coverity warning

Initialise variable used in tracing code in case of early error so that
tracing doesn't use this uninitialised variable.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I6b1cef07e1f126cee56e1116606869dd667274d2

2 years agonat: static mappings in flow hash 77/34077/5
Klement Sekera [Wed, 26 May 2021 11:02:35 +0000 (13:02 +0200)]
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: Idfde8efabc09971be38921d4b0ca5ccf4e9fe412

2 years agoip6-nd: fix coverity warning 01/34101/2
Klement Sekera [Wed, 13 Oct 2021 20:29:49 +0000 (22:29 +0200)]
ip6-nd: fix coverity warning

Add a missing return statement in case there are no parameters supplied
to 'set ip6 nd proxy' CLI to avoid calling code with uninitialised
parameters.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ie4fdb4df5d1af49471c421e5e7a6c2f885d2e8d2

2 years agotests: fix coverity warnings 99/34099/5
Klement Sekera [Wed, 13 Oct 2021 19:45:42 +0000 (21:45 +0200)]
tests: fix coverity warnings

Fix coverity warnings by initialising variables and removing dead code.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I0254b81020cdc3d7075df003309065438526918f

2 years agomisc: fix coverity warning in ila plugin 00/34100/3
Klement Sekera [Wed, 13 Oct 2021 20:06:50 +0000 (22:06 +0200)]
misc: fix coverity warning in ila plugin

Remove non-null check for a pointer which cannot be null to avoid dead
code warning.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I5ff40a4f80db7bb0dff9928c90ff757b763902fd

2 years agodocs: C & C++ apis examples 95/34095/2
Nathan Skrzypczak [Wed, 13 Oct 2021 10:40:42 +0000 (12:40 +0200)]
docs: C & C++ apis examples

Type: docs

Change-Id: I5b6c388332bdd3a29777d728c3357816c8411ea2
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agodocs: better docs, mv doxygen to sphinx 45/33545/25
Nathan Skrzypczak [Thu, 19 Aug 2021 09:38:06 +0000 (11:38 +0200)]
docs: better docs, mv doxygen to sphinx

This patch refactors the VPP sphinx docs
in order to make it easier to consume
for external readers as well as VPP developers.

It also makes sphinx the single source
of documentation, which simplifies maintenance
and operation.

Most important updates are:

- reformat the existing documentation as rst
- split RELEASE.md and move it into separate rst files
- remove section 'events'
- remove section 'archive'
- remove section 'related projects'
- remove section 'feature by release'
- remove section 'Various links'
- make (Configuration reference, CLI docs,
  developer docs) top level items in the list
- move 'Use Cases' as part of 'About VPP'
- move 'Troubleshooting' as part of 'Getting Started'
- move test framework docs into 'Developer Documentation'
- add a 'Contributing' section for gerrit,
  docs and other contributer related infos
- deprecate doxygen and test-docs targets
- redirect the "make doxygen" target to "make docs"

Type: refactor

Change-Id: I552a5645d5b7964d547f99b1336e2ac24e7c209f
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2 years agodocs: convert plugins doc md->rst 25/34025/4
Nathan Skrzypczak [Fri, 8 Oct 2021 12:05:35 +0000 (14:05 +0200)]
docs: convert plugins doc md->rst

Type: improvement

Change-Id: I7e821cce1feae229e1be4baeed249b9cca658135
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agonat: fix coverity warning 98/34098/1
Klement Sekera [Wed, 13 Oct 2021 19:18:59 +0000 (21:18 +0200)]
nat: fix coverity warning

Fix coverity warning by initialising proto variable to a dummy value.
This value is never used because consuming function uses this
parameter value only if is_addr_only flag is not set and this flag is
always set if proto value is not provided by user.

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I9b5e8c08346bea1e2b460bb09e962c4b8d3b6947

2 years agodocs: convert vpp doc md->rst 24/34024/3
Nathan Skrzypczak [Fri, 8 Oct 2021 12:01:27 +0000 (14:01 +0200)]
docs: convert vpp doc md->rst

Type: improvement

Change-Id: If453321785b04f9c16e8cea36fb1910efaeb2c59
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agodocs: convert extras doc md->rst 26/34026/3
Nathan Skrzypczak [Fri, 8 Oct 2021 12:05:58 +0000 (14:05 +0200)]
docs: convert extras doc md->rst

Type: improvement

Change-Id: Ie3b25a86b99098d2b3a21a11fc73234c8ed589d6
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agolibmemif: docs md->rst 54/34054/2
Nathan Skrzypczak [Tue, 12 Oct 2021 12:00:25 +0000 (14:00 +0200)]
libmemif: docs md->rst

Type: improvement

Change-Id: Ibebd2d47a4268189f11601d004073e4858548f25
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agolibmemif: update documentation 74/30574/7
Jakub Grajciar [Mon, 4 Jan 2021 10:36:44 +0000 (11:36 +0100)]
libmemif: update documentation

Type: refactor

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I0094ea8627cd8bcd5ea119c2fd48f077c8e2e4bb

2 years agosession: app name should format with %v 88/34088/2
Xiaoming Jiang [Wed, 13 Oct 2021 03:11:40 +0000 (03:11 +0000)]
session: app name should format with %v

Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: I2c77066cc9f1d3063373cc9559cc5b369906cc24

2 years agonat: fix static mapping segv 86/34086/3
Joshua Roys [Tue, 12 Oct 2021 13:25:47 +0000 (09:25 -0400)]
nat: fix static mapping segv

Adding a nat44 static mapping during startup on a DHCP interface leads
to a segv via this path:
- dhcp_client_acquire_address
- ip4_add_del_interface_address
- ip4_add_del_interface_address_internal
- nat44_ed_add_del_interface_address_cb
- nat44_ed_add_static_mapping
- ip4_interface_first_address

Type: fix

Signed-off-by: Joshua Roys <roysjosh@gmail.com>
Change-Id: I38dac8a096b052550f2b87b4e13a950d2cd868b0

2 years agodpdk: fix vmbus device name parsing 92/34092/2
Benoît Ganne [Wed, 13 Oct 2021 09:35:15 +0000 (11:35 +0200)]
dpdk: fix vmbus device name parsing

unformat_init_vector() expects a vector, not a NULL-terminated C-string.

Type: fix

Change-Id: I20a266243f63d94b0c6fe24e25ee8346c08c8ff2
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agovapi: fix vapi test coverity warning 84/34084/3
Florin Coras [Tue, 12 Oct 2021 20:55:19 +0000 (13:55 -0700)]
vapi: fix vapi test coverity warning

Type: fix

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

2 years agovppinfra: fix socket init netns coverity 80/34080/4
Florin Coras [Tue, 12 Oct 2021 15:52:12 +0000 (08:52 -0700)]
vppinfra: fix socket init netns coverity

Type: fix

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

2 years agovppinfra: fix format_table coverity warning 79/34079/4
Florin Coras [Tue, 12 Oct 2021 15:45:46 +0000 (08:45 -0700)]
vppinfra: fix format_table coverity warning

Type: fix

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

2 years agovlib: fix vmbus error log 93/34093/1
Benoît Ganne [Wed, 13 Oct 2021 09:37:04 +0000 (11:37 +0200)]
vlib: fix vmbus error log

struct dirent *e is freed when calling closedir(). Use ifname instead.

Type: fix

Change-Id: Icc9ca52c33ecc1dee7a9e28802149e4e3e4c8ac0
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agointerface: handle error during admin-up correctly 83/34083/2
Matthew Smith [Mon, 4 Oct 2021 20:19:44 +0000 (15:19 -0500)]
interface: handle error during admin-up correctly

Type: fix

In vnet_sw_interface_set_flags_helper(), the variable old_flags is set
to the original value of vnet_sw_interface_t.flags for an interface. If
an error occurs during the process of bringing an interface up, old_flags
is used to restore the original value.

Before the dev class or hw class admin_up_down_function can be called,
but after modifying vnet_sw_interface_t.flags to it's new value,
old_flags is set to the value of vnet_sw_interface_t.flags a second time.
This discards the original flags that were being preserved.

As a result, if an interface is being brought up and the dev class
or hw class function fails, at the end VPP believes that interface is up.
This can cause a crash if packets are routed through the interface
and some RX/TX initialization was not completed because of the error
while bringing the interface up.

Change-Id: Ica6b6bac13c24e88c4136bf084cd392e6217e7d9
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2 years agodhcp: fix coverity warning 85/34085/2
Florin Coras [Tue, 12 Oct 2021 21:02:05 +0000 (14:02 -0700)]
dhcp: fix coverity warning

Type: fix

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

2 years agovppinfra: use unaligned non-vector load/stores in x86 memcpy 55/34055/2
Damjan Marion [Tue, 12 Oct 2021 13:34:31 +0000 (15:34 +0200)]
vppinfra: use unaligned non-vector load/stores in x86 memcpy

Type: fix
Change-Id: I54ef23a52f05cc95210a736f84b927dd69b8a6f7
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agofib: fix the drop counter for ipv6 RPF failures 44/34044/4
Neale Ranns [Tue, 12 Oct 2021 07:49:37 +0000 (07:49 +0000)]
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

2 years agounittest: fix crypto key len coverity warning 81/34081/2
Florin Coras [Tue, 12 Oct 2021 16:03:18 +0000 (09:03 -0700)]
unittest: fix crypto key len coverity warning

Type: fix

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

2 years agoapi: cli coverity fixes 78/34078/4
Florin Coras [Tue, 12 Oct 2021 15:41:09 +0000 (08:41 -0700)]
api: cli coverity fixes

Type: fix

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

2 years agoipsec: Performance improvement of ipsec4_output_node using flow cache 94/31694/19
Govindarajan Mohandoss [Fri, 19 Mar 2021 19:20:49 +0000 (19:20 +0000)]
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

2 years agosession: set actual lcl ip on accepted ct 41/34041/4
Florin Coras [Tue, 12 Oct 2021 01:10:41 +0000 (18:10 -0700)]
session: set actual lcl ip on accepted ct

Type: improvement

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

2 years agomemif: fix the memif crash when slave disconnect 39/34039/2
Mohsin Kazmi [Mon, 11 Oct 2021 15:43:15 +0000 (15:43 +0000)]
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

2 years agoRevert "nat: static mappings in flow hash" 50/34050/1
Ole Troan [Tue, 12 Oct 2021 10:45:08 +0000 (12:45 +0200)]
Revert "nat: static mappings in flow hash"

This reverts commit 69b7599e4b061a8996205f0304232ede84cb70d4.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: If531b122ae5a9f91c2fe6eaa0da69922a91f16d3

2 years agonat: static mappings in flow hash 87/32087/22
Klement Sekera [Wed, 26 May 2021 11:02:35 +0000 (13:02 +0200)]
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

2 years agoapi: set missing handlers 38/34038/3
Filip Tehlar [Mon, 11 Oct 2021 15:22:38 +0000 (15:22 +0000)]
api: set missing handlers

Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I1fdefeaa4661c03e819b2f2f25762c633f9ab42c

2 years agovat: move memset after init 37/34037/1
Filip Tehlar [Mon, 11 Oct 2021 15:08:25 +0000 (15:08 +0000)]
vat: move memset after init

Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ia65fd2f99dfe6538411c247aeb9691c590c2e00b

2 years agol3xc: skip load balancing if not multipath 32/34032/1
Benoît Ganne [Fri, 8 Oct 2021 15:17:19 +0000 (17:17 +0200)]
l3xc: skip load balancing if not multipath

Type: improvement

Change-Id: I3d8e1c7a83530bbc4b1751358ad7d034476ff13f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2 years agoip: fix fib and mfib locks 49/33749/6
Nathan Skrzypczak [Fri, 17 Sep 2021 15:29:14 +0000 (17:29 +0200)]
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>
2 years agodocs: nitfixes in FEATURE.yaml 23/34023/2
Nathan Skrzypczak [Fri, 8 Oct 2021 13:13:07 +0000 (15:13 +0200)]
docs: nitfixes in FEATURE.yaml

Type: improvement

Change-Id: Iec585880085b12b08594a0640822cd831455d594
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agoaf_xdp: ensure at least one queue is created 32/33932/5
Joshua Roys [Fri, 1 Oct 2021 20:41:04 +0000 (16:41 -0400)]
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

2 years agotls: shutdown openssl context on app close 28/34028/2
Florin Coras [Fri, 8 Oct 2021 20:43:55 +0000 (13:43 -0700)]
tls: shutdown openssl context on app close

Type: improvement

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

2 years agovxlan-gpe: add udp-port configuration support 70/31170/9
Artem Glazychev [Fri, 28 May 2021 12:09:14 +0000 (19:09 +0700)]
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