13085 Commits

Author SHA1 Message Date
Maxime Peim
f902ba534a ipsec: fix sa bind cli
Small mistake was made, reported by coverty scan.

Type: fix
Change-Id: I98ca16c0275a94b2def99831f9353d4ff3fe93a9
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2023-07-27 16:32:27 +00:00
Denys Haryachyy
2652867480 ikev2: cleanup stuck sessions
The following issues are fixed:
* in responder code: do lookup again as the old pointer could be
  invalidated during the cleanup operation
* in initiar code: do the cleanup of session if there're no child SAs or
  if there's no response from the responder during initial request (this
  can easily happen if the response packet was lost/dropped/etc)
* print the state of ikev2 profile (for easier tshooting)

Type: fix

Change-Id: I853d9851c0cf131696585e3c98fa97e66789badd
Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
2023-07-27 07:45:01 +00:00
Florin Coras
0eff4e722c vcl: allow rx of zero length dgrams
Type: fix

Change-Id: I438ef488357456e9415e51a17355e9eba8518808
Signed-off-by: Florin Coras <fcoras@cisco.com>
2023-07-26 11:28:03 -07:00
Vratko Polak
e9ea7d5216 vlib: rename vnet_log_get_class_data
It is a function in vlib, so no reason to mention vnet.

Type: fix
Fixes: bf179a91d8d224c64d08643a2bb52580f68ce96b

Change-Id: Ic5f601d94d88b667f7ce44a017a0e1d5b4db5da1
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-07-26 13:48:20 +02:00
Steven Luong
116392b174 stats: remove extra format line
The extra format line was added for no reason from patch ff27c9f8e.

Type: fix
Fixes: ff27c9f8e

Change-Id: Ib25149cc8a17c29d0c8a0dbc06f0ea12ca4f328c
Signed-off-by: Steven Luong <sluong@cisco.com>
2023-07-26 01:57:13 +00:00
Filip Tehlar
0028e6f316 session: use session error type instead of vnet error
Type: improvement

Change-Id: Ie0bad9e03ac2e29da23af01ee7f63cb44489ad9c
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-07-26 01:09:17 +00:00
Damjan Marion
cc8249c5fd vlib: interrupt mode support for pre-input nodes
Type: improvement
Change-Id: Ic6e60597d2be63e3a0ae4399a81dbbd72392f30d
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-07-25 20:10:29 +00:00
Maxime Peim
3f40755749 classify: add bpf support to pcap classifier
Type: feature
Change-Id: I28fb38e49c89f4c4d4cc58c1a5c0aa8502678472
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2023-07-25 10:06:16 +00:00
Tianyu Li
4ab1aa3145 dpdk: fix signed single bit field
clang-16 complains about signed one-bit bitfield value changes
from 1 to -1. Use unsigned type instead.

Type: fix
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I84f8cf314d36183a5e6f544cd756c01d1d10a1a5
2023-07-25 08:13:26 +00:00
Gabriel Oginski
c3f505fe7b vpp-swan: fix handler API messages
In the current implementation there is a bug related to the incorrect
message handling due to the wrong id.

The fix changes logic responsible for handling incoming API messages
by correcting their ids.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Iea29506053c9fd2e1d01bce83e7f4a6e1de39321
2023-07-24 08:15:21 +00:00
qinyang
af9b7156c8 vcl: ldp support SO_ORIGINAL_DST
Type: improvement

Support SO_ORIGINAL_DST socket option to get original dst_ip4 and dst_port if nat44 rule enabled.

Change-Id: If00e00d03e48f3b78a23a68f1b078954d79dd0f7
Signed-off-by: qinyang <qiny@yusur.tech>
2023-07-21 16:27:14 +00:00
Naveen Joy
ae916b3904 tests: Add checksum offload interface tests
Type: test

Change-Id: I6edc8858b802d3d32159d71c1e867a06cc1025d5
Signed-off-by: Naveen Joy <najoy@cisco.com>
2023-07-21 13:00:05 +00:00
Piotr Bronowski
3a6bc6f127 ipsec: fix logic in ext_hdr_is_pre_esp
When _VEC128 instructions are not enabled logic is buggy.
The function always returned 1.

Type: fix

Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I603200637e8d65813f4e49ef15d798e74b79b9cf
2023-07-21 00:28:05 +00:00
Steven Luong
2da272e3da vcl: zero out cmsg for recvmsg API
When msg->msg_controllen is set in recvmsg, the caller wants to receive
additional information about the messages. However, they might not
always be available. In that case, we should clear cmsg since
the caller uses CMSG_NXTHDR which might access uninitialized fields in
cmsg.

Type: fix

Change-Id: Ifdf9634bfcb1427f7ae3812014a46bfd7f4bc473
Signed-off-by: Steven Luong <sluong@cisco.com>
2023-07-19 06:37:29 +00:00
Gabriel Oginski
0e1fe7ba86 vpp-swan: change flow in function for add route
This patch addresses the issue when the list of available interfaces
is not up to date. Due to this issue adding a new route fails
and finally the connection is not established.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I3a63c0dd99ebc28ea149b4b23867440937682761
2023-07-19 02:38:00 +00:00
Gabriel Oginski
efd2350d65 vpp-swan: fix incorrect msg ID in register_event
This patch addresses the issue where the message ID registration
in the register_event function is incorrect. Due to this incorrect
registration, the lookup for the corresponding callback on received
messages fails, eventually leading to a segmentation fault
and double-free memory space.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: If95182f972f64adb44d514e18c831cc9627d8f0f
2023-07-19 02:32:11 +00:00
Gabriel Oginski
73d82d1273 vpp-swan: fix function to get sw_if_index
In the current implementation there is a bug in the function
responsible for getting software interface index by the name of the
interface. Incorrect function is used to send the API message, also
the handler with replied message is incorrect.

The fix changes function to send dump message and also adds handler
with replied message in the correct way.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Id1a3ba2ce7e92d216907f344431b9e2acb1d5572
2023-07-19 02:31:21 +00:00
Dave Wallace
f72a32a1e4 docs: add api change process from wiki
- Move the VPP API Change Process documentation
  from the wiki page into the in-tree VPP docs

Type: docs

Change-Id: I42f661618b8632230bebe3aa8fbad455b9a05d01
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-07-17 14:55:06 +00:00
Matthew Smith
e870d5b6ac ipip: populate mode in tunnel details
Type: improvement

There is a mode field in ipip_tunnel_details. The handler for the dump
API does not do anything to populate it so it always contains 0
(TUNNEL_API_MODE_P2P). This is correct for p2p tunnels but is wrong for
multipoint tunnels.

Populate the field with the correct mode.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I6c1288a0d3929db0f67100748b5760c36b594f97
2023-07-14 17:42:26 +00:00
Florin Coras
5464134288 hsa: fix echo client init
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ieb2d1e6e0949844a70c81b218ca7dc83690776ca
2023-07-13 10:43:19 +00:00
Nobuhiro MIKI
95c2da7c25 lb: Fix src_ip_sticky evaluation bug in per-port-vip case.
Before this fix, the src_ip_sticky flag was passed as an argument to
the lb_node_get_hash function, which computes a hash value for a packet.
However, in per-port-vip case, the value of src_ip_sticky flag may be
different for each port number. As a result, the value is the same for
all port numbers, even though it is a per-port-vip case.

This commit fixes the src_ip_sticky evaluation by delaying it until the
packet is received, so that the correct value is obtained. Also, the
unit test case has been enhanced for this bug fix.

The steps to reproduce this bug are described below:
https://lists.fd.io/g/vpp-dev/message/23248

Type: fix
Fixes: 613e6dc0bf92 ("lb: add source ip based sticky load balancing")
Change-Id: I483492b214a1768e7a21fd86edd5151b3c46528b
Signed-off-by: Nobuhiro MIKI <nmiki@yahoo-corp.jp>
2023-07-13 08:10:26 +00:00
Alexander Chernavin
df4d342d76 linux-cp: fix crash on processing dump of routes
nl_route_add() recently started to use its optional argument to check
whether replace flag is set for the message. When notification messages
are processed, the argument is a pointer to the corresponding message
info. However, when dump replies are processed, the argument is a null
pointer. This leads to null pointer dereference and crash when dump of
routes is processed.

With this fix, check for replace flag only if message info was passed
to nl_route_add(). Otherwise, assume the flag is not set. Dump replies
do not have it set.

Type: fix
Change-Id: Icb04a1146e09cc965b623018c28f91b347be0eab
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-07-12 17:03:49 +00:00
Damjan Marion
cf1880284c avf: remove barrier
Type: improvement

Change-Id: I95023d2e6034b77952e0423d0430b433ea0dab15
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-07-11 20:37:23 +00:00
Adrian Pistol
44b3abe86a linux-cp: Basic MPLS support.
1) Imports ENCAP_MPLS labels from IPv4/IPv6 routes.
Note that this requires libnl 3.6.0 or newer.

In previous patches, the fib_path_ext_t had a path ID of -1.
After a long investigation, it turned out to be caused by route weight
being set to 0. There is a comment explaining more details.

2) Handles MPLS routes.
MPLS routes were wrongly added as IPv4 routes before.

POP and SWAP are now both supported.
All the routes are installed as NON-EOS and EOS routes,
as the Linux kernel does not differentiate.

EOS POP used in PHP uses the next-hop address family
to determine the resulting address family.

This patch is sufficient for P setups.
PE setups with implicit null should also function okay, as long as a
seperate label gets programmed per address family.

PE setups with explicit null will also forward packets,
but punting is a bit odd and needs MPLS input enabled on the LCP host
device.

3) Propagate MPLS input state to LCP Pair and Linux.
Since the Linux kernel uses the MPLS routes itself,
the LCP pair tap needs MPLS enabled to allow host originated packets.

This also syncs the Linux `net.mpls.conf.<host_if>.input` sysctl to
allow punted packets to have MPLS labels, mostly explicit nulls.

In addition, a special feature is enabled to cross connect MPLS packets
coming from Linux directly to interface-output untouched.

Make sure to enable MPLS/add a table in VPP first and load the
MPLS kernel modules!!

Type: feature
Change-Id: Ie4184bb4cc96905bf8b483a27e7ca6d251697374
Signed-off-by: Adrian Pistol <vifino@posteo.net>
Signed-off-by: Pim van Pelt <pim@ipng.nl>
2023-07-11 17:09:25 +00:00
Steven Luong
ff27c9f8ec stats: fix duplicate /if/names entry
stats entries /if/names are never deleted as it is a vector of the
sw_if_index value. When the interface is deleted and then created again
later, and if the new interface takes a different sw_if_index, we may
end up with duplicate entries for the same interface name. For example,
the following configuration sequence causes problem

create loopback interface
create loopback interface
delete loopback interface intfc loop0
delete loopback interface intfc loop1
create loopback interface

vpp_get_stats dump /if/names
[0]: local0 /if/names
[1]: loop0 /if/names
[2]: loop0 /if/names

The fix is to set the delete /if/names entry to deleted when the interface is deleted.

Type: fix

Change-Id: I7d811b12d56e3cf8c7deffe14736ea0f24814d02
Signed-off-by: Steven Luong <sluong@cisco.com>
2023-07-07 16:55:31 +00:00
Tianyu Li
becfab0f17 api: fix signed single bit field
clang-16 complains about signed one-bit bitfield value
changes from 1 to -1. Use unsigned type instead.

Type: fix
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: Iab006c036d4068af2fe3caaefc871a95b26cc578
2023-07-07 18:06:15 +08:00
Ondrej Fabry
fa6d21b4ff api: lcp - Mark old message versions as deprecated
List of changed messages:
- lcp_itf_pair_add_del
- lcp_itf_pair_add_del_reply
- lcp_itf_pair_add_del_v2
- lcp_itf_pair_add_del_v2_reply

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: Ic20a852dd1fb27858c8776095f9c98757b89bfe8
2023-07-06 18:44:01 +00:00
Ondrej Fabry
755e3aa54f api: ip - Mark old message versions as deprecated
List of changed messages:
- ip_punt_redirect_dump
- ip_punt_redirect_details

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: Icf91f760b9bd328110b0f9fc2e421bb954033d21
2023-07-06 18:30:57 +00:00
Ondrej Fabry
cfd8e4ec88 api: memif - Mark old message versions as deprecated
List of changed messages:
- memif_socket_filename_add_del
- memif_socket_filename_add_del_reply
- memif_create
- memif_create_reply

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: Id334990584b64a0efa3c28a3d8b6b641adab8c09
2023-07-06 18:30:11 +00:00
Ondrej Fabry
7108cb15ca api: memclnt - Mark old message versions as deprecated
List of changed messages:
- memclnt_create
- memclnt_create_reply

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I0031cc2f1604ca4c34574c8e1ee28e358c2bbe5d
2023-07-06 18:29:34 +00:00
Ondrej Fabry
be56761663 api: pg - Mark old message versions as deprecated
List of changed messages:
- pg_create_interface
- pg_create_interface_reply

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I574927f0820c54d748f27fd96a45afec5243b645
2023-07-06 18:28:21 +00:00
Ondrej Fabry
5c476e7ac3 api: sr - Mark old message versions as deprecated
List of changed messages:
- sr_policies_dump

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I16ae1bed83ad8c73e3254b6d195251702de84f97
2023-07-06 18:27:57 +00:00
Ondrej Fabry
63305843e2 api: ipsec - Mark old message versions as deprecated
List of changed messages:
- ipsec_sad_entry_add_del_v2
- ipsec_sad_entry_add_del_v2_reply
- ipsec_sa_v2_dump
- ipsec_sa_v2_details

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I8fd6906e9684ef7ebc0688dc8b0637ae2dc8d0a2
2023-07-06 18:26:32 +00:00
Laszlo Kiraly
6b4aa2b7f4 build: generate debug info rpm packages for opensuse
Enabling debug info RPM creation in spec file.

Type: fix

Signed-off-by: Laszlo Kiraly <laszlo.kiraly@est.tech>
Change-Id: Id284b135ec4125905145f7902a6e1cf42ba65aa4
2023-07-06 14:46:41 +00:00
Laszlo Kiraly
3ff76761f4 build: add missing dependences for opensuse
VPP build failed when build xdp-tool on opensuse
Add the missing libraries and headers.

Type: fix

Signed-off-by: Laszlo Kiraly <laszlo.kiraly@est.tech>
Change-Id: I8c3f28ac6e88cd61a1bf0a823ffa1d5f3097be40
2023-07-06 11:36:42 +02:00
Piotr Bronowski
ea7111ed40 dpdk-cryptodev: introduce sw_ring to the crypto op data path
This patch introduces sw_ring to the crypto op data path implementation,
so that raw data path and crypto op data path use same mechanism of processing
async frames. Crypto op ring has been removed from the implementation.

Type: improvement
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: Id823f80a88cfa0ff40252616a36de8bb044c7f45
2023-07-06 07:55:04 +00:00
Ting Xu
61762c7aac packetforge: fix has_key invalid in python3
Python Dict attribute "has_key" was removed in Python3. Use "in"
operation instead.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I7b63b0689e9970ca798921368c5616875f7d5682
2023-07-04 06:45:17 +00:00
Benoît Ganne
8aa47b7a76 docs: fix packages path in tutorial
Type: fix

Change-Id: I84bbb28490d9c66c5bf55839ab75b3aec1bf5854
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-06-30 20:45:46 +00:00
Mohammed Hawari
ccd3070958 bpf_trace_filter: plugin for BPF Trace Filtering
Change-Id: I342de0a375b783725aa2b621c1c70bc8bf646450
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: improvement
2023-06-30 11:53:06 +00:00
Mohammed Hawari
52fa5f21b9 vlib: introduce trace filter functions
Change-Id: I7a988fafe98599e4fcf7cdaa307a69b9d76650f0
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: improvement
2023-06-30 11:35:44 +00:00
Piotr Bronowski
60527bd6df dpdk-cryptodev: sync mbuf length with corresponding vlib buffer
When vlib buffer is processed on vnet side its length is corrected by
cipher padding and icv_sz. These changes need to be reflected in
the mbuf internals.

Type: fix
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I0aa03f67f556dfc8f9a577ca1967210527221e02
2023-06-29 08:20:38 +00:00
Alexander Chernavin
e1cc875360 ip-neighbor: add api for getting neighbor db config
There is an API call to change neighbor database configuration (i.e.
limit on peer number, aging, and recycling). With this change, make
getting current values of these settings available via the API.

Type: improvement

Change-Id: Ie9394e086b68cf9b28ad98dea162f203f8043cbb
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-06-29 05:11:10 +00:00
Florin Coras
c8767c42aa session udp: add len check for tx dgrams
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I35391fb8c39defbe0e57a241a357c3c98e8cef54
2023-06-27 20:34:21 -07:00
Filip Tehlar
31eaea9eef hs-test: add nginx+quic test
Type: test

Change-Id: I15e4f2fb84cb4f34b6fea95978db000854a63e78
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-06-27 15:58:47 +00:00
Ondrej Fabry
fe965a3a17 api: af_packet - Mark old message versions as deprecated
List of changed messages:
- af_packet_create
- af_packet_create_reply
- af_packet_create_v2
- af_packet_create_v2_reply

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: Ia065c3bbc2c7923de64f47417099aea1aa1216b1
2023-06-27 14:47:50 +00:00
Ondrej Fabry
74d9f0ae3b api: tapv2 - Mark old message versions as deprecated
List of changed messages:
- tap_create_v2
- tap_create_v2_reply

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I7b1b22cc4a0e31f5c19fe48e7a0f30631576f9df
2023-06-27 14:47:14 +00:00
Ondrej Fabry
9ebd2b92e3 api: vxlan - Mark old message versions as deprecated
List of changed messages:
- vxlan_add_del_tunnel
- vxlan_add_del_tunnel_v2
- vxlan_add_del_tunnel_reply
- vxlan_add_del_tunnel_v2_reply
- vxlan_tunnel_dump
- vxlan_tunnel_details

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I0a7227e76a493731fd136f8e6310ad372fab2494
2023-06-27 14:46:50 +00:00
Stanislav Zaikin
7f27ed666e af_xdp: create_api_v3 without namespace keyword
Namespace keyword is reverved c++ word, so it's not possible to include
vapi header for af_xdp plugin and use it.

Type: fix

Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
Change-Id: I42a0e0a89ff2c407090d3c18c1bc5a5605ddf032
2023-06-27 11:42:42 +00:00
Stanislav Zaikin
5fe1cf80ca virtio: use fast-path for ethernet-input if possible
If a frame should be sent to 'ethernet-input' set the
ETH_INPUT_FRAME_F_SINGLE_SW_IF_IDX flag. It will force 'ethernet-input'
to use a fast-path for such frames.
This patch also aligns the behaviour with other input nodes.

Type: improvement

Change-Id: Icff0fa31204d5304a2ea0a4f4e7bc418dedbfe32
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
2023-06-27 08:18:10 +00:00
Florin Coras
d96859f09b udp: pass cless hdr to transport through buffer
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I7177ada23e5a69ec8e362ec98b98010c3b44b3d7
2023-06-26 10:33:49 +02:00