Commit Graph

10273 Commits

Author SHA1 Message Date
d5a3380c65 misc: add ikev2 tests usecases
Type: test
Ticket: VPP-1893

Change-Id: Ib6ffd00e73f7110bf9e702f4a0fd5c68395d6786
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2021-03-04 14:57:54 +00:00
619fc7e3e8 ikev2: fix incorrect api message
Type: fix

Change-Id: I9b3f4531070786f583e18609dfae1d95487ce93c
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2021-03-04 14:22:10 +00:00
516b0adf6d cnat: Add calico/k8s src policy
This patch implements k8s-specific extensions
to the cnat plugin.

This could be done by exposing a richer semantic
on srcNAT policies, but this might be too complex
work at this point. Also k8s fits quite well as a
'cloud NAT' usecase.

Type: feature

Change-Id: I2266daf7b10a92e65f5ed430838a12ae826bd333
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-03-04 12:35:15 +00:00
3fd77f7dea cnat: Prepare extended snat policies
Type: refactor

Change-Id: I9ca3333274d6f32b6aff57f0fb3d2049c066337a
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-03-04 12:35:15 +00:00
8786a4cd4a cnat: Fix snat with dhcp
Type: fix

We didn't check that the srcEndpoint was resolved
when creating the session, we could end up sNATing
with 0.0.0.0 as src_addr

Change-Id: If8dfa577e659cfe90b148657a44c0390a7d383e9
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-03-04 12:35:15 +00:00
30ad571cc3 crypto: fix ops flags in crypto sw scheduler
The sw crypto scheduler converts crypto frames to individual crypto
operations. This is done by reusing per-thread vectors for crypto,
integrity and chained operations.
The crypto op flags must be reset to frame flags minus invalid values
depending of the operation.
The previous tentative also cleared the chained buffer flag, breaking
jumbo support.

Type: fix

Change-Id: Icce6887a9e0dae8c300c56e97b977e203e784713
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-03-04 11:08:36 +00:00
40ee2003bc crypto: add support for aes-ctr+sha-1 chains
Type: feature

Change-Id: I9d4f90bc701d2b9b903a018f8d27cec5e129d7be
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-03-04 11:02:09 +00:00
1334761e1e hsa: fix builtin echo apps with multiple workers
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9507b5a9755e938b4d1da657bed3a8681a056427
2021-03-04 10:59:11 +00:00
8d46219058 bonding: coverity woe in bond_dev_class fuction
Coverity complans the line
  h = hashes;
uses uninitialized variable if the prior ASSERT statement is hit.

ASSERT is compiled out coverity as well as in release image. So the
complain is legitimate. Change the ASSERT to drop the frame and log
an error instead.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ibf0c204fe3626afca69ea84484e606566cf3244c
2021-03-04 10:58:35 +00:00
b4704f2570 dpdk: fix include directories with system dpdk
Add the DPDK_INCLUDE_DIRS variable which is set by pkg_check_modules
to the include directories to allow use of system DPDK where the
headers aren't under standard include directories.

Type: fix
Fixes: f15a5791ba
Change-Id: Ifd4b4170572911b6e0580cdf114ad87cfa771931
Signed-off-by: Robert Shearman <robertshearman@gmail.com>
2021-03-04 10:56:18 +00:00
4d9f9a6b6b marvell: remove unused variable
Fix compile error in mrvl_pp2_delete_if caused by unused variable by
removing that variable.

Type: fix
Fixes: b85b0df2a0
Change-Id: I819bcfbfdbd0f85cc42be953be63ef124520852c
Signed-off-by: Robert Shearman <robertshearman@gmail.com>
2021-03-04 10:54:42 +00:00
cef0cc1a07 libmemif: verify length of transmitted buffers
In memif_tx_burst verify that total buffer size
(data_offset + data_len) does not exceed buffer
size. If not valid returns MEMIF_ERR_INVAL_ARG.

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Ifae8f92344a401febbc1efd22c301356ccf83d44
2021-03-04 10:52:59 +00:00
3d019a541c memif: Validate descriptors within process boudary
We hit a crash when the client sends us a bogus deescriptor which causes us
to access memory beyong the mapping. While the client clearly should not do
that, it is rather cheap for VPP to validate the descriptor instead of crash
and burn.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Id09035810939f5f98530f212f0b23e606132251d
2021-03-04 10:51:32 +00:00
1cebf98e1c dpdk: enable AVX-512 on ICL
Enable DPDK AVX-512 Vector PMDs on Intel Icelake

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Change-Id: Ie5d5bf54ccaa65c1d053d56a2f2973fe8625193b
2021-03-04 10:50:26 +00:00
f457a3886a build: add libmemif as part of build-coverity target
Change-Id: I81a3b5d0845724da40b483832a8eaed081e6e4ed
Type: improvement
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2021-03-04 10:49:18 +00:00
6c8533d4c1 dpdk: deprecate ipsec backend
Type: refactor

DPDK crypto devices are now accessible via the async infra, so
there is no need for the DPDK ipsec plugin.

In addition this patch fixes the problem that cryptodev backend
not working when master core and worker cores lies in different
numa nodes.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ie8516bea706248c7bc25abac53a9c656bb8247d9
2021-03-04 10:48:28 +00:00
3f79e27409 vppinfra: fix compiling error due to incompatible udphdr field names
Compiling VPP on CentOS 7 will fail shown as below. The root cause is
that uh_sport/uh_dport field names for struct udphdr are chosen only if
macro __FAVOR_BSD in /usr/include/netinet/udp.h is defined for glibc
version less than 2.19. Fix this issue by using source and dest field
names in struct udphdr for compatibility reasons.

FAILED: vppinfra/CMakeFiles/vppinfra.dir/unix-formats.c.o
ccache /opt/rh/devtoolset-9/root/bin/cc -Dvppinfra_EXPORTS -I/vpp/src -I. -Iinclude -Wno-address-of-packed-member -g -fPIC -Werror -Wall -march=corei7 -mtune=corei7-avx  -O2 -fstack-protector -D_FORTIFY_SOURCE=2 -fno-common  -flto -fno-fat-lto-objects -fPIC   -fvisibility=hidden -ffunction-sections -fdata-sections -MD -MT vppinfra/CMakeFiles/vppinfra.dir/unix-formats.c.o -MF vppinfra/CMakeFiles/vppinfra.dir/unix-formats.c.o.d -o vppinfra/CMakeFiles/vppinfra.dir/unix-formats.c.o   -c /vpp/src/vppinfra/unix-formats.c
/vpp/src/vppinfra/unix-formats.c: In function 'format_udp4_packet':
/vpp/src/vppinfra/unix-formats.c:319:19: error: 'struct udphdr' has no member named 'uh_sport'
  319 |   u16 source = udp->uh_sport;
      |                   ^~
/vpp/src/vppinfra/unix-formats.c:320:17: error: 'struct udphdr' has no member named 'uh_dport'
  320 |   u16 dest = udp->uh_dport;

Type: fix

Change-Id: Ifc99c7286ea3fac463096152267033ac0518c230
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>
2021-03-04 09:22:57 +00:00
57084e5408 libmemif: socket filename length 108
Dynamic size array was causing trouble in
strlcpy. LINUX allows for max 108 filename length,
so we can use that to make the array constant size.

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I76b1fc41f9d93cfbc9ad11bdca0c96a1fc261e84
2021-03-04 09:09:08 +00:00
0ac5782e60 udp: allocate rx lock only for non-connected
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib5395a51fbfb2123549f7c96534fa763b4669243
2021-03-03 18:52:31 +00:00
78289162ce misc: include debian/quilt packaging directory in .gitignore
Type: style

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I04e859bbba913acf32e14c4460bba45f5cb45ff6
2021-03-03 16:16:08 +00:00
ec2c4c494d api: fix crash when cf removed
cf may be removed when:
1. linux_epoll_input_inline process two EPOLLIN events, firstly a normal
message, secondly reading 0 bytes because of socket client crash, then
cf removed without clear message added to pending event data vectors
before
2. clib_file_write called

Type: fix

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: I4523e9bb322e98357575925f3113f710d70dd679
2021-03-03 15:02:26 +00:00
7abf16c1a2 nsh: Resolve SA errors in NSH plugin.
Type: fix

Change-Id: Ia923cd9302688496d28d2fd5658718b40b17cc1a
Signed-off-by: Vengada  Govindan <venggovi@cisco.com>
2021-03-03 11:12:25 +00:00
c3ba58cd14 dhcp: calls to vnet_feature_enable_disable needs to be protected
dhcp is makeing calls to vnet_feature_enable_disable without barrier sync
protection. This can cause data contention with the worker threads. Wrap
all calls to vnet_feature_enable_disable with barrier sync and barrier
release.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I74545b074599273429f47e3e726551156bc11bbc
2021-03-03 05:25:03 +00:00
a6406b9623 misc: update john lo email address in maintainers
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Ic880de0f895feb6eabaa2b4f9f19ccefc048d444
2021-03-02 17:23:56 +00:00
d7a32cb06a ikev2: fix auth
Old auth data is needed when generating new one.

Type: fix

Change-Id: I15c62346dbb7ece8facdc7a05f30afd1a15a5648
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2021-03-02 14:40:06 +00:00
5943e36b60 classify: fix crash if no pcap filter has been configured
If no pcap filters have ever been configured and we try to enable pcap
capture with a filter, cm->classify_table_index_by_sw_if_index is not
initialized yet.

Type: fix

Change-Id: I2f509c58f9984951b1ad81c1c8ed912cb594fce1
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-03-02 12:59:55 +00:00
8c45e51095 classify: fix multiple filters support
This fix the classify filter if we attach several different filters.
This also fix some issues with l3 and l4 parsing.

Type: fix

Change-Id: I9dc6c55049a3bbc0110d1097b40d9da27633626b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-03-02 10:38:24 +00:00
2c0b6b462b nat: avoid crash if plugin not enabled
Avoid crash if nat pool not allocated when issuing "show nat44 summary".

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I55661cf699bab04f4673e9d471fe12486e972067
2021-03-01 20:26:00 +01:00
dc243ee2bc nat: pick outside addr based on local addr
Use outside addresses more evenly by using local address to pick from
pool of addresses. This ensures stability from POV of remote host -
an internal host always gets translated using the same outside address,
so it doesn't appear to be "hopping". Also, this avoids all hosts
being translated using the first address, which helps avoid needless
recaptchas and the like.

Exact assignment depends on internal ordering of addresses - local address
is used to pick an offset into internal vector. If that address cannot be
used, a linear search is performed as a fallback mechanism to find a possible
translation.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I7ccb1da1dda5537f5d30d2f4cb48024f4b51c1a4
2021-03-01 13:03:20 +01:00
f1af21c9d7 session svm: segment manager and fifo segment leaks
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4e00dd7f8ce1e56092dde9a073decae62d5475de
2021-02-28 01:34:40 +00:00
3ec024c2d2 vlib: fix clear trace buffer race condition
Type: fix

Change-Id: I2384e052bee91a275c3b97a00542819b1d646c88
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-02-27 13:05:43 +00:00
7c7ed175eb vppinfra: mem leak in show memory main-heap
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I23d1dda86c781ac077dbee7cb0e1ddeaa328c660
2021-02-26 22:47:00 +00:00
30fdf39628 udp: avoid locking connected udp sessions on rx
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I52aa2322980b51cfc0b282fb37d7f63d30777dee
2021-02-26 21:58:12 +00:00
4f0ac7e833 cnat: coverity fix
Type: fix

Change-Id: I9d562abc8d8f59cfe73ddd4c03a25085f6ad1f84
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-02-26 19:55:08 +00:00
90ffe06c6b virtio: place the event fds on worker threads for pci device
Type: improvement

Change-Id: I8322bca1a9aa75c97c0fe2ff24b2f65fc43242ce
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-02-26 17:27:26 +00:00
9c499e3a68 svm: fix shared hdr migration
Avoid changing the header on attach as it may be in use. Instead, as for
chunks, allocate header to be collected on detach.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib316ecb5d61ae161032869b6f6a1863f1105a1d9
2021-02-26 15:51:00 +00:00
5599fc2dae nat: optimize flow matching in ED NAT
This saves 6 clocks in nat44-ed-in2out node. (112->106 per packet)

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I48e757e7f4b6b0d250a432a4659fe6955fc52a07
2021-02-26 13:15:32 +00:00
e7a80a98bc nat: NAT44ED fail if using old plugin option
Fail if obsolete flag is used.

Type: fix

Change-Id: Id7000de9c82fa2c22692104b2fc1d463e5961f39
Signed-off-by: Filip Varga <fivarga@cisco.com>
2021-02-26 13:15:05 +00:00
edb1716461 interface: Fix rxq deletion
Type: fix

Change-Id: Ie89663de42ec94823b32aa1edf94f2c03df06627
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-02-26 09:19:34 +00:00
455779f84e interface: fix sh int rx
Type: fix

Change-Id: Iebe2db66af1e769486a117d6284375ce5ffff0b4
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-02-26 09:16:01 +00:00
c5fe57dac1 ipsec: move the IPSec SA pool out of ipsec_main
Type: refactor

this allows the ipsec_sa_get funtion to be moved from ipsec.h to
ipsec_sa.h where it belongs.
Also use ipsec_sa_get throughout the code base.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I2dce726c4f7052b5507dd8dcfead0ed5604357df
2021-02-26 02:12:06 +00:00
cc9a1a0d39 cnat: add input feature node
This allows to configure nat on a per-interface basis. Special care must
be taken to ensure the configuration remains consistent.

Type: feature

Change-Id: I352b2dce182e09d30813ce958333bb1ff37d9b4e
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-02-26 01:55:07 +00:00
4d237874e5 cnat: Add maglev support
* Backend choice in translations is controlled
by lb_type switch allowing to enable Maglev.
* Size of pool is set with cnat { maglev-len 1009 }

Type: feature

Change-Id: I956e19d70bc9f3b997b4f8042831164e4b559d17
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-02-26 01:55:07 +00:00
27647a27c7 cnat: fixes & prepare maglev
Notable changes:
- ip[46]-cnat-snat is renamed to cnat-snat-ip[46]
- indent fixes
- common trace primitives
- bihash is now 40_56 with alias

Type: refactor

Change-Id: I0a82cfe3b40efd96473e51061d7135ffe412ddfc
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-02-26 01:55:07 +00:00
b80d67ca43 crypto: fix coverity issue 218445
Fixes coverity issue CID 218445 (#1 of 1): Logically dead code
(DEADCODE) dead_error_line: Execution cannot reach this statement:
return 4294967295U;.

Type: fix

Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: Ibf8ee0458320d20c3adca2efa2a4bfad7c190dbe
2021-02-26 01:51:37 +00:00
9a804df98b sr: Fix the coverity issue on srv6-mobile plugin
Type: fix

Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
Change-Id: I55e6d7dd193f83f70d27e27fe2e383939d677ef1
2021-02-25 10:47:58 -08:00
8c609af230 tests: Add tests for IPSec async mode using the crypto SW scheduler
Type: test

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Iabc8f2b09ee10a82aacebd36acfe8648cf69b7d7
2021-02-25 16:12:48 +00:00
2d49830c7d ipsec: ipsec.h tidy up
Type: refactor

- remove the extern declaration of the nodes. keep the use of them to
the files that declare them
- remove duplicate declaration of ipsec_set_async_mode
- remove unsued ipsec_add_feature

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I6ce7bb4517b508a8f02b11f3bc819e1c5d539c02
2021-02-25 14:23:27 +00:00
28a0b0197e ikev2: Use the IPSec functions for UDP port management
Type: refactor

IKEv2 registers the IPSec node as the port handler, so it can use the
IPSec functions to do that.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: If398dde0a8eb0407eba3ede62a3d5a8c12fe68a7
2021-02-25 10:07:08 +00:00
8b4d0dd5ba linux-cp: fix vector-used-a-C-string overflow
lip_host_name is a non-NULL terminated vector, not a NULL-terminated
C-string.

Type: fix

Change-Id: Ie5da59bc5680be72251904467d77b18263c882f8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-02-25 09:41:01 +00:00