11599 Commits

Author SHA1 Message Date
Artem Glazychev
83945776cb vnet: add set_max_frame_size callbacks for several interfaces
This is required after distinguishing between max_frame_size and MTU

Type: fix
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: Ie642bee4e30ca76903bb8be5eeb6914c2c09bf35
(cherry picked from commit 66593a6a63fe30ed4b8bed96844244d78274e8f2)
2022-02-22 16:50:14 +00:00
Florin Coras
201830e1b9 lisp: fix ip and udp checksum computation
Type: fix
Fixes: 6fdcc3d

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I820c505482801ff2ab8dac41a0016bb3a741a4ee
(cherry picked from commit d85fe1a2164daf3cb23f48e6b9fd1ec2d97c87bc)
2022-02-22 16:21:52 +00:00
Ed Warnicke
47617a98c8
vxlan: crash on assigning IP address to interface
Revert "vxlan: crash on configuring vxlan tunnel on l3 mode"

This reverts commit b8de7d43e4955bb4025cd0e0e7390279841b6d7d.

Reason for revert: VPP-2014

Type: fix
Fixes: b8de7d43e4955bb4025cd0e0e7390279841b6d7d

Change-Id: Ic4d10f28985ee10e0550a1bbfd465ada915e4aa6
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
2022-02-18 19:52:06 +00:00
akolechk
53ecd05962 dpdk: enable scatter on Rx for net/ena
Type: fix

Since commit e2a6d08bef
DPDK started advertising scattered Rx feature for elastic network adapters. Thus, dpdk
plugin doesn't have to disable it for ENA by default anymore

Signed-off-by: akolechk <akolechk@cisco.com>
Change-Id: I2d4f429be992e3c4edcc0c3adf8c55f3d5381631
2022-02-17 12:34:17 +00:00
Paul Atkins
7b35695c23 ipfix-export: pass ipv4 addr to format fn for show
When the ipfix address was changed to be an ip_address instead of
an ip4_address the output when creating an exporter via the cli
should have been modified to take the address of the v4 part of
the addr.

Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I141456cd9092c861a4c4aefba4035dbde23efcd6
(cherry picked from commit bf9918a7e0c6bf116b90780cbc2c111ca7995399)
2022-02-16 11:30:34 +00:00
Gabriel Oginski
9d2db2eb2e wireguard: fix passing argument
Fixed coverity-issue CID 248456.
Originally passing argument of type "uint64_t *" to function:
"memcopy_s_inline".
This patch fixes the problem by changing type of passing argument and
make a portable assumption.

Type: fix

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I17e4583a05ea1263e4d8a4acc9949454e5fd92c0
(cherry picked from commit ffd9057493ba75d157d8fd316f4978b64a6efb30)
v22.02-rc2
2022-01-25 11:36:28 +00:00
Gabriel Oginski
e3d36d18c1 dpdk-cryptodev: add support chacha20-poly1305
Originally cryptodev doesn't support chacha20-poly1305 with aad length
0.

This patch add support in cryptodev for chacha20-poly1305 with aad
length 0. This length is using in Wireguard.

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I0608920bb557d7d071e7f9f37c80cf50bad81dcc
2022-01-25 11:32:52 +01:00
Gabriel Oginski
0fb3a93a03 wireguard: add async mode for decryption packets
Originally wireguard doesn't support async mode for decryption packets.

This patch add async mode for decryption in wireguard.
In addition, it contains some performance improvement such as
prefetching packet header and reducing the number of current time
function calls.

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Ieba6ae0078f3ff140c05b517891afb57232b3b7d
(cherry picked from commit 77e69ae2d172dce74f4da4cae52bb63e28daa3ae)
2022-01-25 11:25:16 +01:00
Gabriel Oginski
65c070f9da wireguard: add async mode for encryption packets
Originally wireguard doesn't support async mode for encryption packets.

This patch add async mode for encryption in wireguard and also adds
support chacha20-poly1305 algorithm in cryptodev for async handler.
In addition it contains new command line to activate async mode for wireguard:
  set wireguard async mode on|off

and also add new command to check active mode for wireguard:
  show wireguard mode

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I141d48b42ee8dbff0112b8542ab5205268089da6
(cherry picked from commit 492d7790ff26c569bee81617c662363652891140)
2022-01-25 11:04:23 +01:00
Gabriel Oginski
ab2478ceed wireguard: add burst mode
Originally wireguard does packet by packet encryption and decryption.

This patch adds burst mode for encryption and decryption packets. In
addition, it contains some performance improvement such as prefetching
packet header and reducing the number of current time function calls.

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I04c7daa9b6dc56cd15c789661a64ec642b35aa3f
(cherry picked from commit 8ca08496a43e8d98fe2d4130d760c6fb600d0a93)
2022-01-24 10:01:42 +00:00
Andrew Yourtchenko
93e5bea2d3 misc: Initial changes for stable/2202 branch
Change-Id: I23e72a788d6f382601945986c8cb8cfc3bb9da8e
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
v22.02-rc1
2022-01-19 13:48:39 +01:00
Fan Zhang
1c4415bfa5 dpdk: add qat gen4-b device support
Type: feature

This patch adds the GEN4-b support to DPDK Cryptodev PMD and
fixes a problem on its raw api AEAD enqueue.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: I3a1a9b0ae51a5725ce9d5265a059e26ceb16c49e
2022-01-18 18:36:31 +00:00
Damjan Marion
c2a6bf0c50 dpdk: limit number of TX queues to max supported
Also improve logging....

Type: fix
Change-Id: I3d3aee52cd45e59ecd6ce13bd516c66559638fec
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-18 18:34:28 +00:00
Damjan Marion
198ddad7fa vlib: allow bigger scalar data size
Type: improvement
Change-Id: I1031c6ce80d90814edda7b52b11039874b95714f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-18 18:31:14 +00:00
Dave Barach
9e0f9e235a misc: fix coverity warnings
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I8ea0193ebb2a721a0582451ffd64c4063ac6d233
2022-01-18 15:28:28 +00:00
Pim van Pelt
4dc1149cc4 linux-cp: fix possible null deref
Found by coverity as defect id 243763

Signed-off-by: Pim van Pelt <pim@ipng.nl>
Type: fix
Change-Id: Idbada5528a1f2625f6498072d538edf306268b6d
2022-01-18 14:33:15 +00:00
Mohsin Kazmi
5bb4cd1bea virtio: remove admin-up flag during interface creation
Type: fix

During the interface creation time, (by default) admin-up
flag is locally set for tap and virtio interfaces.
While, in VPP the state of these interfaces are still
admin-down. User needs to explicitly call
'set interface state <interface-name> up' to admin-up the
newly created tap or virtio interface(s) in VPP. So, this
behavior is inconsistent.

This patch fixes the issue to have consistent behavior
for given interface between local and global administration
state.

Change-Id: Ifd8904a09fbdbe7b386874ac3231dc0527064518
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2022-01-18 14:29:06 +00:00
Tetsuya Murakami
646c6e0925 srv6-mobile: Fix the coverity issue
Type: fix

Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
Change-Id: I35c36401ce3ab59900be59a9abddba66f6399978
2022-01-18 13:52:59 +00:00
Damjan Marion
1cd0e5dd53 vnet: distinguish between max_frame_size and MTU
Type: improvement
Change-Id: I3659de6599f402c92e3855e3bf0e5e3388f2bea0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-18 13:20:21 +00:00
Neale Ranns
49378f206b ipsec: IPSec interface correct drop w/ no protection
Type: improvement

When an IPSec interface is first constructed, the end node of the feature arc is not changed, which means it is interface-output.
This means that traffic directed into adjacencies on the link, that do not have protection (w/ an SA), drop like this:

...
00:00:01:111710: ip4-midchain
  tx_sw_if_index 4 dpo-idx 24 : ipv4 via 0.0.0.0 ipsec0: mtu:9000 next:6 flags:[]
  stacked-on:
    [@1]: dpo-drop ip4 flow hash: 0x00000000
  00000000: 4500005c000100003f01cb8cac100202010101010800ecf40000000058585858
  00000020: 58585858585858585858585858585858585858585858585858585858
00:00:01:111829: local0-output
  ipsec0
  00000000: 4500005c000100003f01cb8cac100202010101010800ecf40000000058585858
  00000020: 5858585858585858585858585858585858585858585858585858585858585858
  00000040: 58585858585858585858585858585858585858585858585858585858c2cf08c0
  00000060: 2a2c103cd0126bd8b03c4ec20ce2bd02dd77b3e3a4f49664
00:00:01:112017: error-drop
  rx:pg1
00:00:01:112034: drop
  local0-output: interface is down

although that's a drop, no packets should go to local0, and we want all IPvX packets to go through ipX-drop.

This change sets the interface's end-arc node to the appropriate drop node when the interface is created, and when the last protection is removed.
The resulting drop is:

...
00:00:01:111504: ip4-midchain
  tx_sw_if_index 4 dpo-idx 24 : ipv4 via 0.0.0.0 ipsec0: mtu:9000 next:0 flags:[]
  stacked-on:
    [@1]: dpo-drop ip4 flow hash: 0x00000000
  00000000: 4500005c000100003f01cb8cac100202010101010800ecf40000000058585858
  00000020: 58585858585858585858585858585858585858585858585858585858
00:00:01:111533: ip4-drop
    ICMP: 172.16.2.2 -> 1.1.1.1
      tos 0x00, ttl 63, length 92, checksum 0xcb8c dscp CS0 ecn NON_ECN
      fragment id 0x0001
    ICMP echo_request checksum 0xecf4 id 0
00:00:01:111620: error-drop
  rx:pg1
00:00:01:111640: drop
  null-node: blackholed packets

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I7e7de23c541d9f1210a05e6984a688f1f821a155
2022-01-17 19:55:13 +00:00
Damjan Marion
88a9c0e02a interface: improve MTU handling
- per hw-interface-class handlers
 - ethernet set_mtu callback
 - driver can now refuse MTU change

Type: improvement
Change-Id: I3d37c9129930ebec7bb70caf4263025413873048
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-17 12:41:24 +01:00
Damjan Marion
81bb6fc611 vnet: introduce vnet_error()
Decouples vnet return values from API return codes.

New vnet_error() creates vnet_error_t whicgh contains both vnet function
return value and return string.

vnet_api_error() converts vlib_error_t constructed with vnet_error() to
API return value.

Type: improvement
Change-Id: I17042954d48c010150fc1dfc5fce9330e8149e87
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-17 10:47:26 +01:00
Damjan Marion
7b90f669d8 vppinfra: bitops cleanup
Type: refactor
Change-Id: I7fa113e924640f9d798c1eb6ae64b9c0a9e2104c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-16 18:54:52 +00:00
Dave Barach
5233d4619c mactime: fix memory leak
Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I1ef5cb250ac1e35b9a5003597eda3d54d2e5ca73
2022-01-15 11:35:17 -05:00
Damjan Marion
549838c81b dpdk: refactor device setup
Type: improvement
Change-Id: I9772088bca176fd0fdb162677ec55c59aa8f3adf
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-14 18:37:55 +01:00
Damjan Marion
f8dd9d8af1 dpdk: fix burst function output
Type: fix
Fixes: 65105c95f
Change-Id: I8dee4b560a49891f954d7eb8e79ea535cedeaa88
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-14 11:58:33 +01:00
Marcel Cornu
e15245d79d crypto-ipsecmb: bump to ipsecmb v1.1
Type: feature

This patch bumps ipsecmb library version from 1.0 to 1.1

Signed-off-by: Marcel Cornu <marcel.d.cornu@intel.com>
Change-Id: I9851fef2944a6e213d97039bb6dd48cc0df1e4b4
2022-01-14 09:25:31 +00:00
Florin Coras
85299b1bb6 hsa: echo clients connect improvements
Do burst of connects with barrier held.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7e6dcf097022b56d6880de0cba7b8492a938077b
2022-01-12 23:30:38 -08:00
Florin Coras
0c8375de83 hsa: cleanup echo client app
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iada49493635a9c3db8b725ca367d0d4ca5007357
2022-01-12 21:11:22 -08:00
Florin Coras
07bd9b1471 hsa: allow large segments for echo apps
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4e60d83644878f7d267582c2497d785e0f6facc1
2022-01-12 23:33:53 +00:00
Damjan Marion
6c75cd2242 dpdk: bump to DPDK v21.11
Type: feature

This patch bumps dpdk version from 21.08 to 21.11

Change-Id: Id37fdba75f1ea4f4eac3c92226f3b1c539e1daca
Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-12 19:52:05 +01:00
Damjan Marion
65105c95fe dpdk: improve logging
Type: improvement
Change-Id: If61d7409ff14b9f771c1dc8ec9f35e179cea7a28
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-12 19:49:50 +01:00
Damjan Marion
7e9c77885e dpdk: update packet offload flags
Type: improvement
Change-Id: Ib2c55dd2a246a690b2089f5c0b88508f732281f2
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-12 19:35:17 +01:00
Florin Coras
f66cc80b94 session: pass tx buffers in bulk to transports
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1025cccd784f80b557847f69c3ea1ada5c9de60d
2022-01-12 08:42:32 -08:00
Ray Kinsella
b2bf388b81 perfmon: skipping bundle message
Change the skipping bundle message to debug

Type: refactor

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I942ff72bd9c26ccad923442fdedddf22ba75e117
2022-01-12 15:53:25 +00:00
Damjan Marion
b385b95c10 dpdk: postpone updating runtime data
This prevents crash due to worker tread accessing device data
while device vector is growing.

Type: fix
Change-Id: I5cf9f53ddbe97fe52db8fd431ea7c0e480f3d4bc
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-12 14:14:55 +01:00
Damjan Marion
f715b33f10 dpdk: use blunt force to skip irrelevant and confusing logs
Type: improvement
Change-Id: I2cd37f0c1a1ed33438bfa4b7590e5609e5094fc8
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-12 11:02:14 +00:00
Damjan Marion
4429d5e3e1 dpdk: always display burst function name
Also change the way how we dig function pointer so it works with dpdk
21.11+

Type: improvement
Change-Id: I38d5909eea9c2893651710bd45057b1635aa7b37
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-12 10:47:03 +00:00
Ole Troan
de3648db09 ip: coverity illegal access in ip6_ext_header_walk
*** CID 243670:  Memory - illegal accesses  (OVERRUN)
/src/vnet/ip/ip6_packet.h: 713 in ip6_ext_header_walk()
CID 243670:  Memory - illegal accesses  (OVERRUN)
Overrunning array "res->eh" of 4 4-byte elements at
element index 5 (byte offset 23) using index "i" (which evaluates to 5).

Type: fix
Fixes: 03092c1
Change-Id: I27e0435cf10534f3b41e11bf7a5629b5428b0651
Signed-off-by: Ole Troan <ot@cisco.com>
2022-01-12 09:57:43 +00:00
Dastin Wilski
e60f2f678d dpdk-cryptodev: run dequeue again in case of interrupt mode being used
Type: fix

Change-Id: I7aa172e58c970c4971db6ef2ff5b199b7f3c0b99
Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
2022-01-12 09:45:00 +00:00
Dastin Wilski
440bf5f8c8 crypto: omit loop iteration
This fix adds check that will omit loop iteration
in case dequeue handler is zero.

Type: fix

Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Change-Id: I7526e3fe7d8c8da9662b4e9204efd5e2d8be1908
2022-01-12 09:28:45 +01:00
Florin Coras
406669e7cd hsa: allow use of default port for vcl test apps
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I30ec7af3baf56d74a5050ea9335053e6e12de630
2022-01-11 22:54:15 +00:00
Pim van Pelt
1705a6baef linux-cp: Add VPP->Linux synchronization
Part 1 -- notes in https://ipng.ch/s/articles/2021/08/13/vpp-2.html
Add the ability for VPP to copy out (sync) its state from the dataplane
to Linux Interface Pairs, when they exist. Gated by a configuration
flag (linux-cp { lcp-sync }), and by a CLI option to toggle on/off,
synchronize the following events:

- Interface state changes
- Interface MTU changes
- Interface IPv4/IPv6 address add/deletion

In VPP, subints can have any link state and MTU, orthogonal to their
phy. In Linux, setting admin-down on a phy forces its children to be
down as well. Also, in Linux, MTU of children must not exceed that of
the phy. Add a state synchronizer which walks over phy+subints to
ensure Linux and VPP end up in the same consistent state.

Part 2 -- notes in https://ipng.ch/s/articles/2021/08/15/vpp-3.html
Add the ability for VPP to autocreate sub-interfaces of existing Linux
Interface pairs. Gated by a configuration flag
(linux-cp { lcp-auto-subint }), and by a CLI option to toggle on/off,
synchronize the following event:

- Sub-interface creation (dot1q, dot1ad, QinQ and QinAD)

A few other changes:
- Add two functions into netlink.[ch] to delete ip4 and ip6 addresses.
- Remove a spurious logline (printing MTU) in netlink.c.
- Resolve a TODO around vnet_sw_interface_supports_addressing()

Type: improvement
Signed-off-by: Pim van Pelt <pim@ipng.nl>
Change-Id: I34fc070e80af4013be58d7a8cbf64296cc760e4e
Signed-off-by: Pim van Pelt <pim@ipng.nl>
2022-01-11 19:31:25 +00:00
Florin Coras
0cef5f5d71 tls: ssl close only after all data drained
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia77b26db61b6f58b4ff659f09192b4ea93ed50b4
2022-01-11 17:05:18 +00:00
Mohsin Kazmi
30d46e7455 vlib: fix the total len not including first buffer formating
Type: fix

total len not including first buffer is in vlib_buffer_t second cacheline.
It is not reset after the buffer has been consumed. It leads to printing
garbage in packet trace for subsequent use of this buffer. This patch
fixes the issue to only print when VLIB_BUFFER_NEXT_PRESENT flag is set.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ied72308bdb907a5e1ca16d181f2add062807e968
2022-01-11 12:47:52 +00:00
Damjan Marion
ce4083ce48 dpdk: offloads cleanup
Type: improvement
Change-Id: Ibf43aa483548e6055e4b851ad893371d7af3b018
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-11 11:42:59 +00:00
Mohsin Kazmi
3b7ef512f1 misc: fix the uninitialization error
Type: fix

| src/vppinfra/vector/toeplitz.c:69:9: error: ‘kv’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
| src/vppinfra/memcpy_x86_64.h:45:17: error: ‘*((void *)&key+16)’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
|    *(u8x16u *) d = *(u8x16u *) s;
|    ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
| src/vnet/gre/interface.c:356:20: note: ‘*((void *)&key+16)’ was declared here

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I71614da2821ebda5200a0cb9437a7aad0c42fbb2
2022-01-11 11:32:34 +00:00
Florin Coras
6ac74e44e5 session: increase postponed mq message min size
Reported by coverity

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib1db0d120321b061f4c2c20117acdfb6e7dc0626
2022-01-11 00:19:00 +00:00
Florin Coras
36eaaf3625 session: fix segment manager format coverity warning
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia32536a76aa3f92f80ee2cd027a9a010c19b861a
2022-01-10 21:36:39 +00:00
Damjan Marion
c48ec5d568 interface: refactor interface capabilities code, part 2
Type: improvement

Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ie595e69af8657b0ee18a84ac71c5d433108d9ef8
2022-01-10 20:51:52 +00:00