13323 Commits

Author SHA1 Message Date
Mohammed Hawari
f4e3ee1dd1 vcl: propagate correctly EADDRINUSE for UDP bind
Change-Id: Ia8b5421cbaaf861ddb3ad7aeca53a077ff18864e
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: fix
2023-10-30 15:48:34 +00:00
Maxime Peim
0e2f188f7c ipsec: huge anti-replay window support
Type: improvement

Since RFC4303 does not specify the anti-replay window size, VPP should
support multiple window size. It is done through a clib_bitmap.

Signed-off-by: Maxime Peim <mpeim@cisco.com>
Change-Id: I3dfe30efd20018e345418bef298ec7cec19b1cfc
2023-10-30 15:23:13 +00:00
Alexander Chernavin
21922cec73 flowprobe: fix accumulation of tcp flags in flow entries
Currently, TCP flags of a flow entry don't get reset once the flow is
exported (unlike other meta information about a flow - packet delta
count and octet delta count). So TCP flags are accumulated as long as
the flow is active. When the flow expires, it is exported the last time,
and its pool entry is freed for further reuse. The next flow that gets
this pool entry will already have non-zero TCP flags. If it's a TCP
flow, the flags will keep being accumulated. This might look fine when
exported. If it's a non-TCP flow, that will definitely look erroneous.

With this fix, reset TCP flags once the flow is exported. Also, cover
the reuse case with tests.

Type: fix
Change-Id: I5f8560afffcfe107909117d3d063e8a69793437e
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-10-30 13:32:50 +00:00
Florin Coras
4197fb95f2 session: fix bind replies with errors
Type: fix

Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Icdff3528fcaf863b400b9aca6c30d284bc17d5f0
2023-10-27 16:15:58 +00:00
Filip Tehlar
81c8514219 hsa: fix coverity warning
Type: test

Change-Id: Iba94edb7eb439ddc994d9a16cb52108373d052ce
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-10-27 15:28:29 +00:00
Damjan Marion
4e8f9be435 devices: remove unused code
Type: improvement
Change-Id: I2427e1a93e89e9a7ac884b84352b96cf523ae11e
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-26 19:45:59 +00:00
Filip Tehlar
efe875e7cd hsa: unify echo test setup
Type: test

Change-Id: I8665492c2f7755901a428aacdb27e98329ff557a
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-10-26 16:32:17 +00:00
adrianvillin
4d05f069a3 tests: Added bufmon plugin test
Coverage increased from 35% to 94%

Type: test

Change-Id: I9a54a58bf53b29a771a93ce03998e95fbcd518eb
Signed-off-by: adrianvillin <avillin@cisco.com>
2023-10-26 15:45:11 +00:00
Andrew Yourtchenko
5ca8bfcacb build: allow for reproducible builds
Setting and using the SOURCE_DATE_EPOCH variable takes
care of most of the magic necessary.
https://reproducible-builds.org/docs/source-date-epoch/

vpp-ext-deps packages after this change is being built with that
date set to date of the last modification of the
subtree (similar logic to deriving the "number" for
the package version)

For the rest of the packages, pinning the following
three variables should result in bit-identical
artifacts across multiple runs:

export SOURCE_DATE_EPOCH=$(date +%s)
export VPP_BUILD_HOST="buildhost"
export VPP_BUILD_USER="builduser"

Add a blurb in the docs describing this new functionality.

Type: improvement
Change-Id: I71b085f0577b2358aa98f01dafd8e392239420a6
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2023-10-26 12:09:44 +00:00
Damjan Marion
e9d7babde0 lisp: fix missing symbol issue
Type: fix
Change-Id: I9373dabcdb2c4ba987e732b59e63b52603010873
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-25 15:20:28 +00:00
adrianvillin
6facf8cd45 tests: Added mdata plugin test
Coverage increased from 54% to 92%

Type: test

Change-Id: Ibb26f2b8989c5bb2826190c961bffe2c21c3f9a2
Signed-off-by: adrianvillin <avillin@cisco.com>
2023-10-25 15:13:29 +00:00
Damjan Marion
55a1f288ed buffers: buffer name is vector, not c string
Type: fix
Fixes: 8973b07
Change-Id: Iba6e29bab35be0148b469965c3af8391b5ab9140
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-25 11:51:30 +00:00
Damjan Marion
29de4694e6 marvell: fix compilation issues
Type: fix
Fixes: unknown
Change-Id: I81ee03aaea2e1e6ffb9d6ee91db7fb9acd6debb7
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-25 11:36:46 +00:00
Matthew Smith
9e5694b405 fib: only update glean for interface if necessary
Type: improvement

If an interface address is added, the glean adjacency for it's covering
prefix is updated with that address. In the case of multiple addresses
within the same prefix being added, the most recently added one will end
up being used as the sender protocol address for ARP requests.

Similar behavior occurs when an interface address is deleted. The glean
adjacency is updated to some appropriate entry under it's covering
prefix. If there were multiple interface addresses configured, we may
update the address on the adjacency even though the address currently in
use is not the one being deleted.

Add a new value PROVIDES_GLEAN to fib_entry_src_flag_t. The flag
identifies whether a source interface entry is being used as the address
for the glean adjacency for the covering prefix.

Update logic so that the glean is only updated on adding an interface
address if there is not already a sibling entry in use which has the
flag set. Also, only update the glean on deleting an interface address
if the address being deleted has the flag set.

Also update unit test which validates expected behavior in the case
where multiple addresses within a prefix are configured on an interface.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I7d918b8dd703735b20ec76e0a60af6d7e571b766
2023-10-25 08:46:20 +00:00
adrianvillin
52aaa9b0ac tests: Added STN plugin test to improve coverage.
Type: test

Change-Id: I30dfaed684e1f808089bb8eb301486434425ccd7
Signed-off-by: adrianvillin <avillin@cisco.com>
2023-10-25 02:15:54 +00:00
adrianvillin
4450aed056 tests: Added a simple Snort plugin test to increase coverage.
Type: test

Change-Id: I96ec8b4347210672bc587407ab2fd0f0305ea486
Signed-off-by: adrianvillin <avillin@cisco.com>
2023-10-25 01:53:43 +00:00
Ting Xu
51880abac1 dpdk: fix variable type in pattern parsing
In current pattern parsing function in DPDK, some of the variables of
packet length are defined as uint8_t, which are too small for some
large-size packets, such as srv6. Change the type to uint16_t.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I06819e9716da098ca456c0405f0e6fd9a8eb0bc9
2023-10-24 22:14:03 +00:00
Dmitry Valter
e8e4b5f9af crypto: fix algo selection
Check if crypto ops vector is matching actual ops instead if blindly
dereferencing it.

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.com>
Change-Id: Ib88ab44137d9360ee96228e72349a62b2fa7a7e0
2023-10-24 22:13:43 +00:00
Alexander Chernavin
6b027cfdbc flowprobe: fix sending L4 fields in L2 template and flows
Currently, when L2 and L4 recording is enabled on the L2 datapath, the
L2 template will contain L4 fields and L2 flows will be exported with
those fields always set to zero.

With this fix, when L4 recording is enabled, add L4 fields to templates
other than the L2 template (i.e. to the IP4, IP6, L2_IP4, and L2_IP6
templates). And export L2 flows without L4 fields. Also, cover that case
in the tests.

Type: fix
Change-Id: Id5ed8b99af5634fb9d5c6e695203344782fdac01
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-10-18 21:01:03 +00:00
Steven Luong
34c721fb47 memif: contention between memif_disconnect and memif RX/TX threads
memif_disconect may be called without barrier sync. It removes stuff in mq
without protection which may cause troubles for memif RX/TX worker threads.

The fix is to protect mq removal in memif_disconnect.

Type: fix

Change-Id: I368c466d1f13df98980dfa87e8442fbcd822a428
Signed-off-by: Steven Luong <sluong@cisco.com>
2023-10-18 09:16:35 +00:00
Damjan Marion
bf236630f5 buffers: introduce vlib_buffer_template_t
Type: improvement
Change-Id: Ie86a5edf2ada21355543e9a0382052b16ff86927
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-17 17:44:41 +00:00
Florin Coras
0094fe0190 tcp: initialize connection index on rst w packet
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie01d7e8d6eddf3ba88f2cd6eb8369c8ec8179cb4
2023-10-16 20:01:02 +00:00
Florin Coras
da2ae9af61 tcp: allow fins in syns in syn-rcvd
Also make sure connection is properly cleaned up.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I02f83e9a1e17cbbbd2ee74044d02049b2fd2f21c
2023-10-16 20:00:49 +00:00
Florin Coras
61d63e8323 tcp: handle syn-ack in fin-wait-2 in rcv process
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If74e04498423bed42593e79ec92482421cfda8d2
2023-10-16 20:00:31 +00:00
Ole Troan
dbeb56d2da ip-neighbor: do not use sas to determine NS source address
Using the source address selection algorithm to determine the best source
of an NS for address resolution risks incompatible behavior.
It may choose a source address that is off-link to the other host.
Which may drop it.

A safer approach is to always use the link-local address as the SA.
It's recommended to pick a source that an application will later use,
as VPP is mostly a router, that rarely applies. And regardlessly we have
no mechanism to signal from an application that triggered address resolutiuon
what source address it intends to use.

Type: fix
Change-Id: I3c5de66e41505f3682767706ef1195a20e4f0e54
Signed-off-by: Ole Troan <otroan@employees.org>
2023-10-16 14:48:46 +00:00
Alexander Chernavin
f68afe85a6 flowprobe: fix corrupted packets sent after feature disabling
When IPFIX flow record generation is enabled on an interface and the
active timer is set, flows will be saved and then exported according to
the active and passive timers. If then disable the feature on the
interface, the flow entries currently saved will remain in the state
tables. They will gradually expire and be exported. The problem is that
the template for them has already been removed. And they will be sent
with zero template ID which will make them unreadable.

A similar problem will occur if feature settings are "changed" on the
interface - i.e. disable the feature and re-enable it with different
settings (e.g. set a different datapath). The remaining flows that
correspond to the previous feature settings will be eventually sent
either with zero template ID or with template ID that corresponds to the
current feature settings on the interface (and look like garbage data).

With this fix, flush the current buffers before template removal and
clear the remaining flows of the interface during feature disabling.

Type: fix
Change-Id: I1e57db06adfdd3a02fed1a6a89b5418f85a35e16
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-10-16 13:13:55 +00:00
Vladislav Grishenko
da34f4add5 nat: add ipfix rate-limiter for nat44-ed, nat44-ei and nat64
This prevents ipfix flood with the repeating events and allows
to enable nat64 max_session and max_bibs events. Also fix wrong
endian for det44 and nat64 ipfix tests, now should be fine with
extended tests enabled.
Max session per user event @ nat44-ei requires more precise rate
limiter per user address, probably with sparse vec, not handled.

Type: improvement
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Ib20cc1ee3f81e7acc88a415fe83b4e2deae2a836
2023-10-16 13:13:00 +00:00
Ole Troan
ff344a98af npt66: icmp6 alg to handle icmp6 error messages
Support rewriting the inner packet for ICMP6 error messages.

Type: feature
Change-Id: I7e11f53626037075a23310f1cb7e673b0cb52843
Signed-off-by: Ole Troan <otroan@employees.org>
2023-10-16 10:59:22 +00:00
Ole Troan
1fe132ec1a ip-neighbor: add ip neighbor flush
Flushing the neighbor cache was only available through API.
Add CLI command. Either flushes whole table (IP4,IP6)
or all neighbors on specified interface.

Type: improvement
Change-Id: Ia8c68fb032a2dfd940a136edc2aee80db5c37685
Signed-off-by: Ole Troan <otroan@employees.org>
2023-10-16 10:52:51 +00:00
Damjan Marion
d0ffa26a0e feature: remove unused code
Type: improvement
Change-Id: If775b1d145e462346de562a3c893f302e8c7b814
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-14 09:58:10 +00:00
Stanislav Zaikin
a164636106 linux-cp: check if lcp_itf_pair exists before creating tap
Now we create tun/tap and then check whether lcp_itf_pair was already
created. Move the check in the beginning.

Type: fix

Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
Change-Id: I848685a9cfdbe92a5e38ecb8e5d5322262b4e384
2023-10-13 20:45:57 +00:00
Alexander Chernavin
8a92b68bc8 ethernet: run callbacks for subifs too when mac changes
When MAC address changes for an interface, address change callbacks are
executed for it. In turn adjacencies register a callback for MAC address
changes to be able to update their rewrite strings accordingly.

Subinterfaces inherit MAC address from the parent interface. When MAC
address of the parent interface changes, it also implies MAC address
change for its subinterfaces. The problem is that this is currently not
considered when address change callbacks are executed. After MAC address
change on the parent interface, packets sent from subinterfaces might
have wrong source MAC address as the result of stale adjacencies. For
example, ARP messages might be sent with the wrong (previous) MAC
address and address resolution will fail.

With this fix, when address change callbacks are executed for an
interface, they will be also executed for its subinterfaces. And
adjacencies will be able to update accordingly.

Type: fix
Change-Id: I87349698c10b9c3a31a28c0287e6dc711d9413a2
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-10-13 18:39:00 +00:00
Damjan Marion
29aabcf8f6 vlib: properly replicate nexts when sibling node is created on runtime
Change-Id: I5aff21b5ca32e7eb84b11cca8387e7ac42fbbe23
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-13 10:39:24 +00:00
Damjan Marion
c9275dadef vlib: allow unpriviledged vlib_pci_get_device_info()
When running unpriviledged sysfs allows reading only first
64 bytes of PCI config space.

Change-Id: I62d18328925a2e4936406c2842154b20182cacb9
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-13 10:39:10 +00:00
Ole Troan
bdeee2194b npt66: add show command and rx/tx counters
Add show npt66 bindings.
Add RX/TX and translation error counters.

Type: improvement
Change-Id: I4513b111f815a15d5a7537ce503f0c084b523aa1
Signed-off-by: Ole Troan <otroan@employees.org>
2023-10-13 08:27:26 +00:00
Florin Coras
054aa8c2f2 session: fix duplicate rx events
Be less aggressive with rx events on connect/accept notification.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie93a08c7eef69383bf0301a163fd2131dd51372a
2023-10-12 23:21:31 +00:00
Alexander Chernavin
120095d3d3 flowprobe: fix sending L2 flows using L2_IP6 template
Currently, L2 flows are exported using L2_IP6 template if L3 or L4
recording is enabled on L2 datapath. That occurs because during feature
enable, L2 template is added and its ID is not saved immediately. Then
L2_IP4 and L2_IP6 templates are added overwriting "template_id" each
time. And in the end, the current value of "template_id" is saved for L2
template. The problem is that "template_id" at that point contains the
ID of L2_IP6 template.

With this fix, save the template ID immediately after adding a template
for all variants (datapaths). Also, cover the case with a test.

Type: fix
Change-Id: Id27288043b3b8f0e89e77f45ae9a01fa7439e20e
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-10-12 22:15:20 +00:00
Alexander Kozyrev
006c071b0a dpdk: add Mellanox BlueField NICs
List BlueField NICs as a supported PCI devices.

Type: feature
Change-Id: Ida2300df516ab9cd2fcde1f816bbdc081016039a
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
2023-10-12 20:44:48 +00:00
Steven Luong
947aa8fffc session: ignore connecting half_open session in session_tx_fifo_dequeue_internal
s->tx_fifo is 0 for the connecting half open session.

Type: fix

Change-Id: I2ba1ae99a2fa4fae1896587f40e0e4fb73c1edcb
Signed-off-by: Steven Luong <sluong@cisco.com>
2023-10-12 18:06:39 +00:00
Brian Morris
733e093e70 tls: Fix SSL_CTX leak on every client session
Type: fix

Change-Id: I35b3920288269073cdd35f79c938396128d169c9
Signed-off-by: Brian Morris <bmorris2@cisco.com>
2023-10-11 20:12:50 +00:00
Florin Coras
9eaf377a38 session: ignore app rx ntf if transport closed
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id56a101a6350903b00f7c96705fb86039e70e12c
2023-10-11 19:23:38 +00:00
Florin Coras
fa9f37c15c session: fix tx deq ntf assert for cl
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I97a04ed0417f1a3433665f6aa1a9424138fd54cb
2023-10-11 19:23:26 +00:00
Dave Wallace
21bc900c34 lb: fix intermittent per-port-vip idx lookup failure
- Causes per-port-vip testcases to fail when the
  uninitialized reserved field in the stack variable
  key for the hash lookup was a non-zero stack memory
  location.

Type: fix

Change-Id: I56afa15e7df60bc2340514f2c7ce5e71a9cb47a9
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-10-10 23:19:18 -04:00
Florin Coras
84c9ee3d69 session: maintain old state on premature close
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2ea821e0499a3874c4579f5480ea86f30ebe615f
2023-10-10 15:59:16 +00:00
Dave Wallace
05cc62dd50 vppinfra: fix coverity issue CID 323952
Type: fix
Fixes: 08600ccfa

Change-Id: I53ba0d96507b55ab7cd735073d6c4cf20a3cc948
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-10-09 18:05:47 -04:00
Damjan Marion
65dc34bb0b buffers: buffer allocation improvements
- pass buffer pool name trough va
- make buffers naturaly aligned
- fix calculation of total number of buffers

Type: improvement
Change-Id: I6aebf249ebd67823b4632ac08905bfa3aa7d1ee5
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-10-09 09:58:37 +00:00
Florin Coras
aa7b88120a tls: propagate reads to app irrespective of state
Session input node handles rx notifications even if session not fully
accepted/connected

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6560c45db8f8e0b7f0dc3bdd0939f13ca2f43f15
2023-10-08 00:16:56 +00:00
Florin Coras
a3d55df1e9 tls: report error if connected cannot be initialized
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I987ac6b461b473836917bce6ce0d4ac109cc8ddb
2023-10-08 00:10:52 +00:00
Florin Coras
3843d0dd03 tls: no read after app close
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I34f8ee2e36d07e8e55e21561528fc6b73feb852f
2023-10-08 00:10:32 +00:00
Florin Coras
431b489c5a session: propagate delayed rx evts after connect/accept
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4a2e8f864df7269ec5a3c4fd4d8785a67b687d58
2023-10-07 14:23:18 -07:00