vpp.git
2 years agodpdk: add qat gen4-b device support 58/34958/2
Fan Zhang [Tue, 18 Jan 2022 15:51:21 +0000 (15:51 +0000)]
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

2 years agodpdk: limit number of TX queues to max supported 35/34935/2
Damjan Marion [Tue, 18 Jan 2022 12:42:24 +0000 (13:42 +0100)]
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>
2 years agovlib: allow bigger scalar data size 57/34957/2
Damjan Marion [Tue, 18 Jan 2022 15:24:23 +0000 (16:24 +0100)]
vlib: allow bigger scalar data size

Type: improvement
Change-Id: I1031c6ce80d90814edda7b52b11039874b95714f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agomisc: fix coverity warnings 56/34956/2
Dave Barach [Tue, 18 Jan 2022 13:52:47 +0000 (08:52 -0500)]
misc: fix coverity warnings

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I8ea0193ebb2a721a0582451ffd64c4063ac6d233

2 years agolinux-cp: fix possible null deref 32/34932/2
Pim van Pelt [Tue, 18 Jan 2022 13:30:52 +0000 (13:30 +0000)]
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

2 years agovirtio: remove admin-up flag during interface creation 33/34933/2
Mohsin Kazmi [Tue, 18 Jan 2022 12:53:57 +0000 (13:53 +0100)]
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>
2 years agosrv6-mobile: Fix the coverity issue 31/34931/2
Tetsuya Murakami [Tue, 18 Jan 2022 11:43:07 +0000 (03:43 -0800)]
srv6-mobile: Fix the coverity issue

Type: fix

Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
Change-Id: I35c36401ce3ab59900be59a9abddba66f6399978

2 years agovnet: distinguish between max_frame_size and MTU 28/34928/4
Damjan Marion [Mon, 17 Jan 2022 13:49:17 +0000 (14:49 +0100)]
vnet: distinguish between max_frame_size and MTU

Type: improvement
Change-Id: I3659de6599f402c92e3855e3bf0e5e3388f2bea0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agoipsec: IPSec interface correct drop w/ no protection 69/34869/3
Neale Ranns [Mon, 10 Jan 2022 10:38:43 +0000 (10:38 +0000)]
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

2 years agointerface: improve MTU handling 43/34843/12
Damjan Marion [Thu, 6 Jan 2022 20:14:08 +0000 (21:14 +0100)]
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>
2 years agovnet: introduce vnet_error() 18/34918/2
Damjan Marion [Sun, 16 Jan 2022 21:47:55 +0000 (22:47 +0100)]
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>
2 years agovppinfra: bitops cleanup 16/34916/5
Damjan Marion [Wed, 12 Jan 2022 23:28:14 +0000 (00:28 +0100)]
vppinfra: bitops cleanup

Type: refactor
Change-Id: I7fa113e924640f9d798c1eb6ae64b9c0a9e2104c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agomactime: fix memory leak 17/34917/1
Dave Barach [Sat, 15 Jan 2022 16:30:45 +0000 (11:30 -0500)]
mactime: fix memory leak

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I1ef5cb250ac1e35b9a5003597eda3d54d2e5ca73

2 years agodpdk: refactor device setup 13/34813/12
Damjan Marion [Wed, 12 Jan 2022 23:28:14 +0000 (00:28 +0100)]
dpdk: refactor device setup

Type: improvement
Change-Id: I9772088bca176fd0fdb162677ec55c59aa8f3adf
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: fix burst function output 07/34907/1
Damjan Marion [Fri, 14 Jan 2022 10:57:40 +0000 (11:57 +0100)]
dpdk: fix burst function output

Type: fix
Fixes: 65105c95f
Change-Id: I8dee4b560a49891f954d7eb8e79ea535cedeaa88
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agocrypto-ipsecmb: bump to ipsecmb v1.1 05/34905/2
Marcel Cornu [Thu, 13 Jan 2022 23:48:54 +0000 (23:48 +0000)]
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

2 years agohsa: echo clients connect improvements 02/34902/3
Florin Coras [Thu, 13 Jan 2022 07:01:29 +0000 (23:01 -0800)]
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

2 years agohsa: cleanup echo client app 01/34901/2
Florin Coras [Thu, 13 Jan 2022 01:59:31 +0000 (17:59 -0800)]
hsa: cleanup echo client app

Type: refactor

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

2 years agohsa: allow large segments for echo apps 95/34895/3
Florin Coras [Wed, 12 Jan 2022 18:32:52 +0000 (10:32 -0800)]
hsa: allow large segments for echo apps

Type: improvement

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

2 years agodpdk: bump to DPDK v21.11 05/34705/11
Damjan Marion [Tue, 11 Jan 2022 22:21:08 +0000 (23:21 +0100)]
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>
2 years agodpdk: improve logging 94/34894/4
Damjan Marion [Wed, 12 Jan 2022 17:46:29 +0000 (18:46 +0100)]
dpdk: improve logging

Type: improvement
Change-Id: If61d7409ff14b9f771c1dc8ec9f35e179cea7a28
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: update packet offload flags 96/34896/1
Damjan Marion [Wed, 12 Jan 2022 18:17:26 +0000 (19:17 +0100)]
dpdk: update packet offload flags

Type: improvement
Change-Id: Ib2c55dd2a246a690b2089f5c0b88508f732281f2
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agosession: pass tx buffers in bulk to transports 38/31938/15
Florin Coras [Fri, 9 Apr 2021 02:10:07 +0000 (19:10 -0700)]
session: pass tx buffers in bulk to transports

Type: improvement

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

2 years agoperfmon: skipping bundle message 91/34891/2
Ray Kinsella [Wed, 12 Jan 2022 06:15:34 +0000 (06:15 +0000)]
perfmon: skipping bundle message

Change the skipping bundle message to debug

Type: refactor

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

2 years agodpdk: postpone updating runtime data 92/34892/1
Damjan Marion [Wed, 12 Jan 2022 13:09:01 +0000 (14:09 +0100)]
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>
2 years agodpdk: use blunt force to skip irrelevant and confusing logs 89/34889/2
Damjan Marion [Wed, 12 Jan 2022 10:13:24 +0000 (11:13 +0100)]
dpdk: use blunt force to skip irrelevant and confusing logs

Type: improvement
Change-Id: I2cd37f0c1a1ed33438bfa4b7590e5609e5094fc8
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: always display burst function name 88/34888/2
Damjan Marion [Wed, 12 Jan 2022 09:52:14 +0000 (10:52 +0100)]
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>
2 years agoip: coverity illegal access in ip6_ext_header_walk 82/34882/2
Ole Troan [Tue, 11 Jan 2022 15:08:23 +0000 (16:08 +0100)]
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>
2 years agodpdk-cryptodev: run dequeue again in case of interrupt mode being used 80/34780/4
Dastin Wilski [Tue, 21 Dec 2021 08:51:52 +0000 (08:51 +0000)]
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>
2 years agocrypto: omit loop iteration 85/34885/1
Dastin Wilski [Wed, 12 Jan 2022 08:28:45 +0000 (09:28 +0100)]
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

2 years agohsa: allow use of default port for vcl test apps 84/34884/2
Florin Coras [Tue, 11 Jan 2022 21:58:54 +0000 (13:58 -0800)]
hsa: allow use of default port for vcl test apps

Type: improvement

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

2 years agolinux-cp: Add VPP->Linux synchronization 09/33709/14
Pim van Pelt [Thu, 9 Sep 2021 17:53:09 +0000 (17:53 +0000)]
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>
2 years agotls: ssl close only after all data drained 75/34875/3
Florin Coras [Mon, 10 Jan 2022 17:15:41 +0000 (09:15 -0800)]
tls: ssl close only after all data drained

Type: fix

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

2 years agovlib: fix the total len not including first buffer formating 80/34880/2
Mohsin Kazmi [Tue, 11 Jan 2022 11:34:56 +0000 (11:34 +0000)]
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

2 years agodpdk: offloads cleanup 61/34861/10
Damjan Marion [Sun, 9 Jan 2022 13:05:27 +0000 (14:05 +0100)]
dpdk: offloads cleanup

Type: improvement
Change-Id: Ibf43aa483548e6055e4b851ad893371d7af3b018
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agomisc: fix the uninitialization error 74/34874/2
Mohsin Kazmi [Mon, 10 Jan 2022 15:32:35 +0000 (15:32 +0000)]
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

2 years agosession: increase postponed mq message min size 78/34878/5
Florin Coras [Mon, 10 Jan 2022 22:26:21 +0000 (14:26 -0800)]
session: increase postponed mq message min size

Reported by coverity

Type: fix

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

2 years agosession: fix segment manager format coverity warning 76/34876/3
Florin Coras [Mon, 10 Jan 2022 21:44:45 +0000 (13:44 -0800)]
session: fix segment manager format coverity warning

Type: fix

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

2 years agointerface: refactor interface capabilities code, part 2 29/34829/4
Damjan Marion [Mon, 10 Jan 2022 19:38:57 +0000 (19:38 +0000)]
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

2 years agovrrp: vrrp in unicast mode,interface not add virtual ip addresss 68/34768/2
jinsh [Sat, 18 Dec 2021 14:57:38 +0000 (22:57 +0800)]
vrrp: vrrp in unicast mode,interface not add virtual ip addresss

Type: fix

Signed-off-by: jinsh <jinsh11@chinatelecom.cn>
Change-Id: Id80601bc753c59c4ea95ff5f74f9b15c40c01e35

2 years agosession: allow pacer to send when bucket hits 0 65/34865/2
Florin Coras [Mon, 10 Jan 2022 03:03:09 +0000 (19:03 -0800)]
session: allow pacer to send when bucket hits 0

So after bucket reset session can send max burst of bytes.
Also, reset pacer bucket to 0 not min burst

Type: improvement

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

2 years agosession: deschedule sessions with no data to send 64/34864/2
Florin Coras [Mon, 10 Jan 2022 02:18:10 +0000 (18:18 -0800)]
session: deschedule sessions with no data to send

This ensures the scheduler always tracks sessions that are descheduled,
i.e., do not have events in the old io events list. When app retries to
send, clear descheduled flag and potentially the pacer.

Consequently, transports no longer need to reset the pacer when
sessions are rescheduled after a long app tx pause.

This also fixes a tcp bug whereby the pacer was reset too often when
snd_una was equal to snd_nxt as there was no way to distinguish betwen
app tx breaks and congestion.

Type: improvement

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

2 years agosession: fix pacer bucket update cast 63/34863/3
Florin Coras [Mon, 10 Jan 2022 01:20:28 +0000 (17:20 -0800)]
session: fix pacer bucket update cast

Make sure comparison is done between two i64 values.

Type: fix

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

2 years agodpdk: interface capabilities cleanup 58/34858/4
Damjan Marion [Sun, 9 Jan 2022 12:02:12 +0000 (13:02 +0100)]
dpdk: interface capabilities cleanup

Type: improvement
Change-Id: If5636d4376fb06da62f947c28b18c07b6ad21722
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: port type code cleanup 57/34857/4
Damjan Marion [Sun, 9 Jan 2022 12:13:13 +0000 (13:13 +0100)]
dpdk: port type code cleanup

Type: improvement
Change-Id: I4ead18dee249a27b4dbb8bbf53b6238d91042890
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovppinfra: Check for NULL vec before the backwards iteration 59/34859/2
Neale Ranns [Sun, 9 Jan 2022 13:24:47 +0000 (13:24 +0000)]
vppinfra: Check for NULL vec before the backwards iteration

Type: improvement

'vec_end(v) - 1' does not yield a good starting point. Check for NULL vec before the loop, so the user does not have to.

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

2 years agofib: multiple memory leaks upon deleting a VRF table 35/34735/5
Steven Luong [Wed, 15 Dec 2021 21:27:53 +0000 (13:27 -0800)]
fib: multiple memory leaks upon deleting a VRF table

fib_table->ft_locks
name string for parsing the ip table add|del name <tag> command
path list for ip4_specials in mfib
mfib->fib_entry_by_dst_address[0..32]
mfib entry path_ext, msrc->mfes_exts

Type: fix

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

2 years agodpdk: new mbuf flags in format function 54/34854/3
Damjan Marion [Sat, 8 Jan 2022 20:07:03 +0000 (21:07 +0100)]
dpdk: new mbuf flags in format function

Type: improvement
Change-Id: I9022e29ebc0edb7946d374d6c3c45ee6962d725f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: new flags format 37/34837/17
Damjan Marion [Wed, 5 Jan 2022 21:51:33 +0000 (22:51 +0100)]
dpdk: new flags format

introduced in DPDK 21.11

Type: improvement
Change-Id: I8c845949dd904a2bf8fa4a91e2f3ae5d704f2283
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agotcp: fix cubic cwnd accumulate use of bytes acked 53/34853/1
Florin Coras [Fri, 7 Jan 2022 23:06:42 +0000 (15:06 -0800)]
tcp: fix cubic cwnd accumulate use of bytes acked

Use what was provided instead of tc->bytes_acked

Type: fix

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

2 years agobonding: memory leak on parsing bad CLI command 46/34846/3
Steven Luong [Thu, 6 Jan 2022 21:02:00 +0000 (13:02 -0800)]
bonding: memory leak on parsing bad CLI command

When parsing bad "create bond" command, we should call unformat_free
prior to return

Type: fix
Fixes: 9cd2d7a5a4fafadb65d772c48109d55d1e19d425

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

2 years agovmxnet3: memory leak on parsing bad CLI command 47/34847/2
Steven Luong [Thu, 6 Jan 2022 23:15:11 +0000 (15:15 -0800)]
vmxnet3: memory leak on parsing bad CLI command

When parsing bad "create interface vmxnet3" command, we should call
unformat_free prior to return

Type: fix
Fixes: df7f8e8cffcc43531f7daeda44d436b60e538141

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

2 years agoethernet: new interface registration function 41/34841/4
Damjan Marion [Thu, 6 Jan 2022 19:36:14 +0000 (20:36 +0100)]
ethernet: new interface registration function

Prep for supporting multiple callbacks, optional args, etc.

Type: improvement
Change-Id: I96244c098712e8213374678623f12527b0e7f387
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: fix rx and tx descriptor config 50/34850/3
Florin Coras [Fri, 7 Jan 2022 01:51:17 +0000 (17:51 -0800)]
dpdk: fix rx and tx descriptor config

Type: fix

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

2 years agotcp: optimize newreno cong ack handler 49/34849/1
Florin Coras [Fri, 7 Jan 2022 01:47:14 +0000 (17:47 -0800)]
tcp: optimize newreno cong ack handler

Type: improvement

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

2 years agotcp: update snd_congestion only during congestion 42/34842/3
Florin Coras [Thu, 6 Jan 2022 19:58:24 +0000 (11:58 -0800)]
tcp: update snd_congestion only during congestion

If running without sacks, if snd_una does not cover snd_congestion fast
recovery can be missed but the two heuristics from RFC6582 should avoid
that.

Also snd_congestion was used as a means of inferring if the connection
recently exited congestion while setting the persist timer but that does
not always work correctly if not congested.

Type: fix

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

2 years agotcp: mark lost first sack hole on timeout 31/34831/5
Florin Coras [Wed, 5 Jan 2022 18:16:07 +0000 (10:16 -0800)]
tcp: mark lost first sack hole on timeout

Type: improvement

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

2 years agotcp: handle start tx event in cubic 30/34830/6
Florin Coras [Wed, 5 Jan 2022 17:48:36 +0000 (09:48 -0800)]
tcp: handle start tx event in cubic

If app was idle update start time of current congestion avoidance phase
unless tcp connection was not idle.

Type: improvement

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

2 years agotcp: always exit recovery if not in fastrecovery 40/34840/3
Florin Coras [Thu, 6 Jan 2022 03:54:45 +0000 (19:54 -0800)]
tcp: always exit recovery if not in fastrecovery

Stay in fast recovery only if it's already on.

Type: improvement

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

2 years agotcp: exit retransmit before processing feedback 36/34836/5
Florin Coras [Wed, 5 Jan 2022 20:55:35 +0000 (12:55 -0800)]
tcp: exit retransmit before processing feedback

Type: refactor

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

2 years agotcp: use bytes delivered to compute cwnd 28/34828/4
Florin Coras [Wed, 5 Jan 2022 16:47:11 +0000 (08:47 -0800)]
tcp: use bytes delivered to compute cwnd

Should estimated cwnd better with loss

Type: improvement

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

2 years agotcp: cast timer ticks to u32 14/34814/5
Florin Coras [Mon, 3 Jan 2022 18:34:52 +0000 (10:34 -0800)]
tcp: cast timer ticks to u32

tc->rto * TCP_TO_TIMER_TICK can return garbage if not cast to u32 and
that confuses clib_max

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
signed-off-by: Vipul Agrawal <Vipul.Agrawal@enea.com>
Change-Id: Ief4d29b9625e2ef2e75e0c7e3d731ab147465f6d

2 years agodpdk: cleanup MTU handling 39/34839/4
Damjan Marion [Wed, 5 Jan 2022 22:25:12 +0000 (23:25 +0100)]
dpdk: cleanup MTU handling

Type: improvement
Change-Id: I4b929693f3671be8ee63a58afcbac75a27d99d57
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: port type from speed_capa bitmap on Cisco VIC 38/34838/2
Damjan Marion [Wed, 5 Jan 2022 23:23:38 +0000 (00:23 +0100)]
dpdk: port type from speed_capa bitmap on Cisco VIC

enic driver now properly exposes speed_capa bitmap so this workaround
is not needed anymore.

Type: refactor
Change-Id: Ic754de0b9de32d488405ffcd8d62dd6aa035d2bc
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agotap: add num_tx_queues API 57/34757/4
Nathan Skrzypczak [Wed, 15 Dec 2021 17:45:59 +0000 (18:45 +0100)]
tap: add num_tx_queues API

This adds a create_tap_v3 api that has a num_tx_queues
parameter allowing to create more than num_workers queues,
following on multi TX support

Type: feature

Change-Id: Idce433147e8dd165f842241d6c76e041e1b1c9b8
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2 years agodpdk: remove unused defines 35/34835/2
Damjan Marion [Wed, 5 Jan 2022 20:30:54 +0000 (21:30 +0100)]
dpdk: remove unused defines

Type: refactor
Change-Id: I41d5d07eef670e89eba8fd816e123981940b5d79
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: no need to copy default tx conf 34/34834/2
Damjan Marion [Wed, 5 Jan 2022 20:26:51 +0000 (21:26 +0100)]
dpdk: no need to copy default tx conf

Type: improvement
Change-Id: Ifd5201c101da7f4fb63f9b64280a6ec35b2af6a0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: improve checksum computation 33/34833/8
Florin Coras [Wed, 5 Jan 2022 19:31:03 +0000 (11:31 -0800)]
dpdk: improve checksum computation

Type: improvement

Based on gerrit 26480 by chenmin.sun@intel.com

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

2 years agointerface: refactor interface capabilities code 26/34826/4
Damjan Marion [Wed, 5 Jan 2022 00:52:38 +0000 (01:52 +0100)]
interface: refactor interface capabilities code

Make it shorter to type, easier to debug, make adding callbacks in
future simpler.

Type: improvement
Change-Id: I6cdd6375e36da23bd452a7c7273ff42789e94433
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: move port config to single struct 27/34827/3
Damjan Marion [Wed, 5 Jan 2022 13:51:50 +0000 (14:51 +0100)]
dpdk: move port config to single struct

Type: refactor
Change-Id: I0bce385c7e391fa2b74646d001980610f80f7062
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovppinfra: few bitops inlines 25/34825/2
Damjan Marion [Wed, 5 Jan 2022 13:06:34 +0000 (14:06 +0100)]
vppinfra: few bitops inlines

Change-Id: I9aa01fafd5329a399aa9d72a6e2cc6c9d65dc85c
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: remove unused flag 23/34823/3
Damjan Marion [Wed, 5 Jan 2022 00:28:55 +0000 (01:28 +0100)]
dpdk: remove unused flag

Type: refactor
Change-Id: Iff96a79323d7d428a779e9736e07c1dc9dddb518
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agosrv6-mobile: Update GTP4/6.D function 12/34712/8
Tetsuya Murakami [Fri, 10 Dec 2021 16:11:07 +0000 (08:11 -0800)]
srv6-mobile: Update GTP4/6.D function

GTP4/6.D behavior is updated as shown below.
1. When receiving GTP-U message or IPv6 linklocal destination in inner IP, GTP packet is tnralated to SRv6.
2. When receiving T-PDU packet, OuterIP/UDP/GTP headers are stripped off and Inner IP is encapsulated into SRv6 based on L3VPN SRv6 manner.

Type: feature

Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
Change-Id: I6092c98ea80236d54017f84c5b35cca0b645f034
Signed-off-by: Tetsuya Murakami <tetsuya.mrk@gmail.com>
2 years agodpdk: keep buffer flags per-device 20/34820/2
Damjan Marion [Tue, 4 Jan 2022 19:07:32 +0000 (20:07 +0100)]
dpdk: keep buffer flags per-device

Type: improvement
Change-Id: Idb0b079df49c12643c9a93ee0effe011d3489068
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: remove unused logging class 19/34819/2
Damjan Marion [Tue, 4 Jan 2022 19:03:29 +0000 (20:03 +0100)]
dpdk: remove unused logging class

Type: refactor
Change-Id: I2de762953faa5056d5fefa678e4faafbe7710dc6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agodpdk: remove vlan-strip offload code 22/34822/2
Filip Varga [Fri, 12 Nov 2021 16:22:11 +0000 (17:22 +0100)]
dpdk: remove vlan-strip offload code

This code was actually never working. It was just used as workaround for
Cisco ENIC issue with tagged default vlan frames.
Today Cisco ENIC provides solution to this problem with devargs flags...

Change-Id: Ia8284274117cb200bf6c7f7911d945d5a093d878
Type: refactor
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agocrypto: encrypt/decrypt queues sw_scheduler 86/30386/12
Jakub Wysocki [Tue, 30 Nov 2021 10:53:03 +0000 (10:53 +0000)]
crypto: encrypt/decrypt queues sw_scheduler

Type: improvement

Previously multiple sw crypto scheduler queues per core design
caused unaverage frame processing rate for each async op ID –
the lower the op ID is the highly likely they are processed first.

For example, when a RX core is feeding both encryption and
decryption jobs of the same crypto algorithm to the queues at a
high rate, in the mean time the crypto cores have no enough
cycles to process all: the jobs in the decryption queue are less
likely being processed, causing packet drop.

To improve the situation this patch makes every core only owning
a two queues, one for encrypt operations and one for decrypt.
The queue is changed either after checking each core
or after founding a frame to process.
All crypto jobs with different algorithm are pushed to
thoses queues and are treated evenly.

In addition, the crypto async infra now uses unified dequeue handler,
one per engine. Only the active engine will be registered its
dequeue handler in crypto main.

Signed-off-by: DariuszX Kazimierski <dariuszx.kazimierski@intel.com>
Signed-off-by: PiotrX Kleski <piotrx.kleski@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Jakub Wysocki <jakubx.wysocki@intel.com>
Change-Id: I517ee8e31633980de5e0dd4b05e1d5db5dea760e

2 years agodpdk: remove "convenience" vars 21/34821/2
Damjan Marion [Tue, 4 Jan 2022 19:15:59 +0000 (20:15 +0100)]
dpdk: remove "convenience" vars

It is actually longer and slower...

Type: refactor
Change-Id: I0f126d4cdb13ecc60a2d370409f23820d7f7eb72
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agowireguard: fix 'wireguard add peer' cli behavior 33/34633/3
Miroslav Miklus [Wed, 1 Dec 2021 20:35:59 +0000 (21:35 +0100)]
wireguard: fix 'wireguard add peer' cli behavior

- change 'port' to 'dst-port' to make the input self-explanatory
- add empty spaces to short help

Type: fix

Signed-off-by: Miroslav Miklus <miroslav.miklus@pantheon.tech>
Change-Id: I74c783e6e8629e61b1c100e9355d09cf5e35a750

2 years agoipsec: allow registering random ports in tests 18/34818/3
Arthur de Kerhor [Tue, 4 Jan 2022 14:53:43 +0000 (15:53 +0100)]
ipsec: allow registering random ports in tests

We add the possibility to bind the destination UDP port of a Scapy SA
to the ESP layer in the IPsec tunnel protection tests, even if it is not
the default port for ESP (4500).

This allows to test IPSec tunnel protection with ports other than 4500
in the UDP header, without hardcoding them in the Scapy patch (ex: 4545)

Type: improvement

Change-Id: I1eea3d4660ed1b59d827250a419af6b7b41c4a72
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
2 years agonsim: cli improvements 16/34816/6
Florin Coras [Mon, 3 Jan 2022 22:32:26 +0000 (14:32 -0800)]
nsim: cli improvements

- improve format and unformat of bandwidth and delay
- integer packet size
- track worker wheel size as config

Type: improvement

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

2 years agonat: remove nat44-ed relation between SM and addr 85/34485/10
Filip Varga [Fri, 12 Nov 2021 16:22:11 +0000 (17:22 +0100)]
nat: remove nat44-ed relation between SM and addr

Change [1] put static mappings in flow hash. This change also broke
relationship between nat pool addresses and static mappings. Port and
address are no longer reserved in nat pool address records for a new
static mapping.

Because of this change both nat objects and their configuration can
function independently. This change also removed already broken logic of
having static-mapping-only configuration.

In this patch i have cleaned up and removed unnecessary logic for static
mapping configuration functions, address configuration functions,
interface configuraiton functions and all callback functions used for
resolving interface address bound records.

No more viable configuration option static-mapping-only is also removed
because there is no more option to run traffic through vpp for static
mappings without having flow hash table allocated. Instead user is now
able to create static mapping records without using nat pool addresses.

Fixed and improved management of required fib entries (ensuring VPP will
reply to ARP for all external addresses on outside interfaces) through
holding a refcount for their creation and removal.

[1] https://gerrit.fd.io/r/c/vpp/+/34077

Type: improvement

Change-Id: Ic16deefbede833d574c2a5972155c9afa5bc62ce
Signed-off-by: Filip Varga <fivarga@cisco.com>
2 years agonat: nat44-ed pool address allocation improvement 63/34363/11
Filip Varga [Mon, 4 Oct 2021 12:36:05 +0000 (14:36 +0200)]
nat: nat44-ed pool address allocation improvement

This patch improves algorithm responsible for choosing nat pool address
during dynamic session creation.

Patch synchronizes nat pool address attributes with vpp interfaces doing
so gives nat option to determine correct nat pool address  when creating
dynamic session.

Improvements:
    * match dst address subnet and src fib with nat pool address
    * for output-feature also fallback match of tx_sw_if_index with nat
      pool address

Type: improvement

Change-Id: I594638bc76fc1153f582add376838b4b72ff573a
Signed-off-by: Filip Varga <fivarga@cisco.com>
2 years agovrrp: fix support for VRs in different FIBs 15/34815/1
Matthew Smith [Tue, 21 Dec 2021 15:00:05 +0000 (09:00 -0600)]
vrrp: fix support for VRs in different FIBs

Type: fix
Fixes: 4b1b13315a3c

When adding or deleting a VR, multicast routes can be added or deleted.
When the first VR is added, a local (dpo-receive) route is added. The
route is deleted when the last VR is deleted.

Perform the check on whether to add or delete the route on a per-FIB
basis. Otherwise, if the route is only added after the first VR is added
without regards to the FIB being used and a second VR is added later on
an interface attached to a different FIB, the necessary route will not be
added to the FIB used by the second interface.

Change-Id: Ib30925ecf45c714cfe3ac6a223754bea918f10e3
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2 years agovppinfra: fix bitmap can't get correct next clear index 08/34808/3
jiangxiaoming [Thu, 30 Dec 2021 08:52:38 +0000 (08:52 +0000)]
vppinfra: fix bitmap can't get correct next clear index

when bitmap vec len is 1 and all the bits has been
occupied, clib_bitmap_next_clear(ai, 63) will
return result:65 which should be 64. It will lead to
missing iteration for pool_foreach.

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

2 years agofib: Refetech the adj after the walk in case the pool realloc'd 10/34810/2
Neale Ranns [Fri, 31 Dec 2021 09:18:31 +0000 (09:18 +0000)]
fib: Refetech the adj after the walk in case the pool realloc'd

Type: fix

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

2 years agomisc: Remove the unused GBP fields from the buffer meta-data 11/34811/2
Neale Ranns [Fri, 31 Dec 2021 10:37:45 +0000 (10:37 +0000)]
misc: Remove the unused GBP fields from the buffer meta-data

Type: refactor

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

2 years agovlib: remove external thread management support 05/34805/4
Damjan Marion [Tue, 28 Dec 2021 19:32:20 +0000 (20:32 +0100)]
vlib: remove external thread management support

Now DPDK have API to register external threads so we can remove this
mess...

Type: improvement
Change-Id: I71a21f0cd94bd668aa406710c75a0bcc63fdc840
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agosvm: merge want deq and leq threshold notifications 07/34807/5
Florin Coras [Wed, 29 Dec 2021 23:44:48 +0000 (15:44 -0800)]
svm: merge want deq and leq threshold notifications

Type: improvement

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

2 years agohttp_static: Fix timeout on large files 17/34617/6
Michal Kalderon [Wed, 24 Nov 2021 09:33:15 +0000 (01:33 -0800)]
http_static: Fix timeout on large files

When trying to read files that are larger than the fifo
a timeout was reached on client side leading to an abort of the request
and a retry (sending another GET command).

The svm fifo notification request was set to notify when the fifo is no
longer full, this lead to an inefficient loop of sending small amounts
of data each time with a large overhead of context switch and waiting
for the next notification, eventually leading to a timeout.

Modifying the trigger on the svm-fifo to be notified on a preset threshold
value enabled sending larger amounts of data between context switches and
sending large files more efficiently. This solved the timeout issue.

In addition, cap the max write from application to 4MB to avoid running
into a case of trying to allocate chunks that are too large.

Reproduce:
Server:
http static server www-root /var/www/data uri tcp://0.0.0.0/80 cache-size 5m fifo-size 300

Client:
wget http://11.0.0.2/file_of_size_32M

Type: fix
Change-Id: Idfceedffd935da9486cde820e9dca5dad69d9ca5
Signed-off-by: Yuval Caduri <cyuval@marvell.com>
Signed-off-by: Michal Kalderon <mkalderon@marvell.com>
2 years agosvm: Add support for thresh dequeue notification 94/34794/4
Michal Kalderon [Tue, 21 Dec 2021 12:41:53 +0000 (04:41 -0800)]
svm: Add support for thresh dequeue notification

Add the ability to set a threshold on the fifo that will
be used to notify caller when de-queue from the fifo reached
a value that is less than or equal to the threshold.

Type: feature

Change-Id: I70ba1a05f783ce5247409e9beebe4e336b7c1eb5
Signed-off-by: Michal Kalderon <mkalderon@marvell.com>
Signed-off-by: Yuval Caduri <cyuval@marvell.com>
2 years agotcp: set sw_if_index in tcp src-address cli 99/34799/2
Mercury [Fri, 24 Dec 2021 03:58:27 +0000 (11:58 +0800)]
tcp: set sw_if_index in tcp src-address cli

the receive dpo added by tcp src-address cli do not have a valid sw_if_index ,
ip4_local_check_src() and tcp_input_lookup_buffer() will set ~0 to vnet_buffer(b)->sw_if_index[VLIB_RX],
which will cause crash in tcp46_reset_inline,

Type: fix
Signed-off-by: Mercury <mercury124185@gmail.com>
Change-Id: Ie01c31f3575e14187c6380ebcfff96fcb6098cde

2 years agoip: remove archaic vector code from mtrie 97/34797/3
Damjan Marion [Thu, 23 Dec 2021 12:19:15 +0000 (13:19 +0100)]
ip: remove archaic vector code from mtrie

Type: improvement
Change-Id: Ib39478a2e6991d721c4ba3ea61c97bfb07238016
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovlib: introduce vlib frame aux data 98/34798/3
Damjan Marion [Thu, 23 Dec 2021 16:05:02 +0000 (17:05 +0100)]
vlib: introduce vlib frame aux data

Type: improvement
Change-Id: I53890a13210cfb0d2b2d9d8cfd9b15118d3bb273
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agotcp: fix endpoint lookup failed caused by key uninitialized 96/34796/2
Mercury [Thu, 23 Dec 2021 11:15:02 +0000 (19:15 +0800)]
tcp: fix endpoint lookup failed caused by key uninitialized

fix ipv4 key uninitialized in local_endpoints_table,
which will cause transport_endpoint_cleanup() failed
to lookup the endpoint and can not delete it,
as for ipv6, clib_memcpy_fast() will change all bytes of lcl_addr
and there maybe no need to initalize,

Type: fix
Signed-off-by: Mercury <mercury124185@gmail.com>
Change-Id: I56676493a393b1d64eaa438224e256094ca75d2f

2 years agosession svm: track fs and seg manager index in fs 92/34792/5
Florin Coras [Wed, 22 Dec 2021 20:54:17 +0000 (12:54 -0800)]
session svm: track fs and seg manager index in fs

Simplifies allocation of fifos as fifo segment and segment manager
indices can be set at alloc time.

Type: improvement

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

2 years agovppinfra: add format_u64_bitmap function 93/34793/1
Damjan Marion [Wed, 22 Dec 2021 20:58:54 +0000 (21:58 +0100)]
vppinfra: add format_u64_bitmap function

Sample output:

         60   56   52   48   44   40   36   32   28   24   20   16   12    8    4    0
0x0020 .... .... .... .... .... .... .... .... .... .... .... .... ..11 .... ...1 1... 0x0000000000003018
0x0018 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 111. .1.1 0xffffffffffffffe5
0x0010 .... .... .... .... .... .... ..1. ...1 .1.1 1... 11.. 1... .... .1.. 1111 ..11 0x0000002158c804f3
0x0008 .... .... .... .... .... .... .... .... .... .... .... .... .... .... ..1. 11.. 0x000000000000002c
0x0000 .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ...1 0x0000000000000001

Type: improvement
Change-Id: Ib99129866ad5a1d2d52be6855406e2829aa9ec3e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agosession: fix segment alloc/free worker race 22/34622/9
Florin Coras [Wed, 1 Dec 2021 04:21:57 +0000 (20:21 -0800)]
session: fix segment alloc/free worker race

Avoid scenarios where a worker allocates a segment but while it drops
the segment manager writer lock and acquires the reader lock another
worker uses the segment and frees it.

Type: fix

Thanks to wanghanlin@corp.netease.com for the report.

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

2 years agovppinfra: add bihash 12_4 template 90/34790/2
Damjan Marion [Wed, 22 Dec 2021 11:22:59 +0000 (12:22 +0100)]
vppinfra: add bihash 12_4 template

Type: feature
Change-Id: I8a6b2c7d7682a01c472d7375d444e8b43eb5db04
Signed-off-by: Damjan Marion <damarion@cisco.com>
2 years agovppinfra: fix map_lock issue 84/34784/2
liuyacan [Wed, 22 Dec 2021 08:41:21 +0000 (16:41 +0800)]
vppinfra: fix map_lock issue

The release of the map_lock is a bit too early, it needs to wrap
mprotect(), otherwise the access rights of hdr may be deprived of
other worker threads.

Type: fix

Signed-off-by: liuyacan <liuyacan@corp.netease.com>
Change-Id: I9cb89d49a097ec6d5ae9fd2af2bddf967ec946e9