Commit Graph

11663 Commits

Author SHA1 Message Date
Florin Coras
7463900dbd http_static: fix coverity warning
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6d5527c49e9085f35be988549c2f1460be7fd4f0
2022-02-06 16:58:04 -08:00
Benoît Ganne
7a2574a8ca dpdk: remove dead code
rte_eth_tx_burst() returns the number of packets  actually stored in
transmit descriptors and the return type is uint16. n_sent cannot be
negative and the if branch is dead code.

Type: improvement

Change-Id: Idc2980d342756c1093ddf74ea6207d072e819331
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-02-06 11:46:49 +00:00
Ole Troan
291307e427 stats: fix memory leaks
Type: fix
Fixes: 72e31bc2d9
Fixes: db02380
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I92a62bb1cb799e8fdc3ec4110ae3428825254f8a
Signed-off-by: Ole Troan <ot@cisco.com>
2022-02-06 11:45:11 +00:00
Jon Loeliger
fdbafb8ca1 perfmon: Fix typo in debug log messages
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Type: style
Change-Id: I955c19ddbe06ef3651c03820fcc14054c63258b9
2022-02-06 11:44:49 +00:00
Florin Coras
6c33728a35 http_static: handle empty requests
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic002444c51b1ecbbf18a49863cf01888d28c4632
2022-02-05 21:20:29 +00:00
Florin Coras
a3d710e2d7 http: estimate tx packets for scheduler
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibca4bf59e6319ffdc1beaa084ca80f216e062af0
2022-02-05 21:19:53 +00:00
Florin Coras
3e157100b5 session: track bytes dequeued in snd params
Also reset send params flags before calling transports to avoid explicit
resets in all transports.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1da7b3fab009728e7fee4199425ced933fa8a122
2022-02-05 21:19:53 +00:00
Naveen Joy
6eaeea9003 tests: mark the test suites broken when ASan is enabled
Mark broken test suites using @tag_fixme_asan.The main issue
is that some tests do not pass with ASan. These will need to
be fixed, but it takes time and in the meantime, new issues are
introduced that trip up ASan. When this tag is set and Asan
is enabled, failing ASan tests are skipped, so incremental
fixes can pass the CI

Type: improvement

Change-Id: I02602eb74234c25a4c701279e14704b81d4c5b71
Signed-off-by: Naveen Joy <najoy@cisco.com>
2022-02-05 20:14:37 +00:00
Klement Sekera
ea2721f766 tests: remove constant argument
Reduce number of arguments by removing an argument which is only ever
used with same constant value.

Type: refactor
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I061635b28031d75eb1f853b570e85f6e5a9094df
2022-02-05 20:11:44 +00:00
Klement Sekera
0e95c18753 tests: fix test-checkstyle-diff if no .py changed
Type: fix
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I6d23ff14380b0154f617b3ab7cd1acd5aa45106a
2022-02-05 19:42:35 +00:00
Florin Coras
1a7344f732 prom: add option to set stat name prefix
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8b40d4e935c9280ff89a3d0f8b30bd7beac1e08a
2022-02-03 23:19:57 +00:00
Florin Coras
e38babcdf9 http: honor max seg len in ptr buffer
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I58ecd933f36c6622f4c6b373d2d94a48f9fc9eae
2022-02-03 20:43:00 +00:00
Florin Coras
f840880c2f ip nat: use ip rx sw_if_index in ip-local arc start
This also changes the behavior of the nat44-ei hairpinning feature.
Rather then enabling the feature on every nat interface, it is enabled
only on local0.

Type: improvement

Signed-off-by: Filip Varga <fivarga@cisco.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4e16a83c9e328aa75fc61df508b620ef743ca775
2022-02-03 20:38:18 +00:00
Florin Coras
7285be2aab prom: basic builtin prometheus stats exporter
This is a vpp builtin alternative, not a replacement, for the existing
vpp_prometheus_exporter.

The plugin works by registering with http_static as a url handler for
stats.prom and handles requests by scraping the stats segment in the
main thread. It will therefore consume vpp process cpu cycles.

By default the plugin is disabled. To enable, first start the http
static server an then use "prom enable" cli.

Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If6888e965d1b2361f6a5546586068213d37079d1
2022-02-02 17:04:46 -08:00
Andrew Yourtchenko
c556fa49b4 bfd: restore the data within the packet after hash verification
The BFD delayed auth change test was failing intermittently within CI.
Debugging has shown it depends on the initial random seed, e.g. the below
will consistently fail:

RND_SEED=1643734669.7126195 TEST='bfd.BFDAuthOnOffTestCase.test_auth_change_key_delayed'

Same thing will happen with:
RND_SEED=1643736595.1363552
RND_SEED=1643722239.8224792

The analysis of the behavior shown that the function that is doing the hash verification,
modifies the content of the packet for the purposes of hash computation.
In case of the auth rollover, this function may be called twice - resulting in the second
comparison to be made with a bogus packet data, thus failing the check and the test.

The above values of random seed are the ones where the test makes it
to the point of this double comparison.

The solution is to restore the data within the packet after the check from the array
where we have copied it into before modifying the packet.

Change-Id: Ibb09beb4b1230032db04527bbf38fa335651866b
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-02-02 19:30:49 +00:00
Florin Coras
bd8013ee8c http_static: add support for async tx from handlers
URL handlers can send data asynchronously if needed.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I89eae690cb26543479c7659b5dc46604cbb22eba
2022-02-02 10:35:23 +00:00
Mohsin Kazmi
d6eed1bb20 gso: remove the assert if packet is geneve or gre encaped
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I3265d4a3843b07c2e0050e297f1e014fc5b31cf7
2022-02-01 19:06:58 +00:00
Steven Luong
c4a48f2c39 virtio: coverity woes -- divide by zero
Coverity complains the expression, j % vif->num_txq, may encounter
divide by zero. While there is little chance that vif->num_txq is
zero, it is easy to prevent divide by zero if vif->num_txq is ever
zero.

Type: fix
Fixes: I337ec63d0868f665329d68eadf1744e080b73a0d

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I2e91f296737ce266ab70fffc1f442cc600724fa2
2022-02-01 16:33:26 +00:00
Steven Luong
0a214804f8 stats: vpp_get_stats crashes in stat_segment_data_free
STAT_DIR_TYPE_EMPTY is not handled. This can happen when the
interface is deleted.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ic1f5a1a0e7005059628d1dde31118d692c1967d8
2022-02-01 15:19:06 +00:00
Steven Luong
dafdcf7e6d nat: memory leak on nat44_plugin_disable
We invoke nat_affinity_enable for nat44_plugin_enable.
We need to invoke nat_affinity_disable for nat44_plugin_disable
to free the memory for bihash.

Type: fix
Fixes: I2743f7b1104b627bcc5ef937e3a50655313a26ea

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I9adeb3225136e3fff853c2d5b8f9a30e98ddcf4c
2022-02-01 15:18:37 +00:00
Filip Varga
53cee1579e nat: nat44-ei hairpinning code cleanup
Removing obsolete unused nat44-ei nodes and functions.

Type: refactor
Change-Id: I1e03e283091c3c0d92908d04037cba00a348351a
Signed-off-by: Filip Varga <fivarga@cisco.com>
2022-02-01 12:09:17 +00:00
Ray Kinsella
ca5f6b851d perfmon: Add perfmon maintainer
Add Ray Kinsella as maintainer of the perfmon plugin. Update maintainers of the
sphinx documentation.

Type: refactor

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I9c05dbed3dcc9909b497df776fa01c52bc048e0f
2022-01-31 19:01:50 +00:00
Klement Sekera
a8a9a8a569 tests: correct python usage in virtualenv
Use 'python3' for all python calls in virtualenv. Using $(PYTHON_INTERP)
(set to $(PYTHON)) is incorrect when $(PYTHON) contains absolute path
(e.g. '/usr/bin/pypy3') as it uses interpreter outside of virtualenv.

Type: fix
Change-Id: I19878360cfc1ab6a591e09a079b0b69c1a1a58cf
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2022-01-31 15:08:27 +00:00
Klement Sekera
01c1fa41f0 ip: reassembly - add a way to disable for forus
Add API to disable full reassembly of "forus" packets. Mark packets
passing through ip[4|6]-local nodes with a new buffer flag and check for
that flag in reassembly.

Enable IP6 "forus" full reassembly by default to be consistent with
existing IP4 setting.

Type: improvement
Change-Id: I7067792fcd4304182654237968e4c4d9293c6143
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2022-01-31 15:07:58 +00:00
Klement Sekera
cf1e8c1eea ip: fix length calculation in ip6-receive
Replace unconditional usage of
buffer->total_length_not_including_first_buffer with a logic checking
whether that length is set to a valid value.

Type: fix
Fixes: 17478e4eb8
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I161d0957d62cc23826edd821aa5560bcfc5c1a33
2022-01-31 14:58:36 +00:00
Klement Sekera
3a1a86f87f tests: make VPP_BUILD_DIR to point to correct dir
Make VPP_BUILD_DIR hold the correct value and adjust paths where
necessary.

Type: refactor
Change-Id: I5bc60666c04919956bf26badaf1ee1f1b188ef65
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2022-01-31 14:58:19 +00:00
Klement Sekera
c0a2f0ec9b tests: support skipping to test method with STEP
Allow entering a test name on stack trace window with STEP=y option
instead of a number. This allows to run a whole suite and skip all tests
until a particular test is hit.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I23e45f8022b82545365b8921390e0e106e02b39c
2022-01-31 14:52:44 +00:00
Nathan Skrzypczak
6de58f5fd0 cnat: maglev fixes & improvements
This fixes the maglev logic which previously
included a wrong simplication.
It moves the maglev logic to its own file,
and adds a test function in the debug cli.

Type: improvement

Change-Id: I2790ae2a26fc1c5739ff02f41d436bfcafd5b380
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-01-30 15:23:09 +00:00
Sivaprasad Tummala
c454e8993d snort: feature support on interface output
support snort plugin on interface output via ip4-output fa

Type: feature

Signed-off-by: Sivaprasad Tummala <Sivaprasad.Tummala@intel.com>
Change-Id: I2d5e7d0719c03f88806b12debfe596675dbd66c1
2022-01-30 15:20:38 +00:00
Ray Kinsella
9d0c638b0f perfmon: topdown level 1 and 2 for icx
Topdown level 1 and 2 for Intel Ice Lake (ICX). Limiting topdown support
to THREAD for the moment on Ice Lake, as NODE support is still
unreliable. Also removing Topdown Level 1 from Sapphire Rapids onwards,
as Topdown LeveL 2 also shows Level 1 on Sapphire, and it reduces the
overall number of bundles.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: Iaa68b711dc8b6fb1090880b411debadb3c37f8bc
2022-01-30 15:08:18 +00:00
Ray Kinsella
7e8aeb876b perfmon: fix init of bundles with pseudo events
Previously Linux pseudo events were being counted as multiple fixed
events, such that a bundle with pseudo events could exceed the number of
available fixed counters. Reworked to ignore pseudo events in the
accounting for the moment.

Type: fix
Fixes: 0024e53ad
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: Ic938f8266fd04d7731afbd02e261c61ef22a8522
2022-01-30 15:08:18 +00:00
Ray Kinsella
0a0e711cce perfmon: check for duplicates after other checks
Move checking for duplicate bundle names after the other checks.

Type: fix

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I7fed5be758814e166eb8756b3df090130ac13bfd
2022-01-30 15:08:18 +00:00
Florin Coras
fdb5a5a0e4 http_static: incorporate builtinurl plugin
External handlers can still be registered via hss_register_url_handler
but url handlers must be enabled when server is created.

builtinurl plugin to be removed in a future patch

Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I94e103d908b9e118c7927b997a21ce3f67809889
2022-01-30 14:44:40 +00:00
Florin Coras
ffd7a9876e linux-cp: check if libmnl headers are present
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Icb86be8b37fa821f05300ee4415065ca96425fcb
2022-01-30 14:44:11 +00:00
Ray Kinsella
fe85d87235 perfmon: topdown backend bound core bundle
Add a bundle to measure topdown backend bound core cycles, will indicate if any
given execution port has contention.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I37d1b38c101ac42d51c10fa4452b822d34b729c9
2022-01-30 14:43:34 +00:00
Florin Coras
1f2070a0fe misc: remove mbedtls from dependencies
Type: make

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I461d1f6289a4bb97c77952b87a35c90f37ec9d26
2022-01-29 04:26:25 +00:00
Pim van Pelt
307ff11acb linux-cp: Fix coverity issue
Type: fix

Possible negative return in open(), do not use curr_ns_fd if it is
negative.  Addresses Coverity issue 248535

Signed-off-by: Pim van Pelt <pim@ipng.nl>
Change-Id: I8429ede0f1fe9fe6619e3c4dbd83adb620ea62c2
2022-01-28 16:46:12 +00:00
Klement Sekera
15d0215b9c misc: vppctl - fix coverity warning
Calculate space left to silence coverity.

Type: fix
Fixes: 31f1924346
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I9cd2e91ce74444e2625bf86721a8d3e44bf6afdd
2022-01-28 15:14:45 +00:00
Klement Sekera
aa9903cabf misc: vppctl - fix coverity warning
Check that provided path fits into defined buffer. Don't write too many
bytes to avoid having an unterminated string.

Type: fix
Fixes: 31f1924346
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I1ea8b6d6a3474c032e542b6980ed14bac72093a8
2022-01-28 14:36:39 +00:00
Neale Ranns
616447c392 linux-cp: Linux Control Plane Netlink Listener
Type: feature

please see FEATURE.yaml for details.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Signed-off-by: Pim van Pelt <pim@ipng.nl>
Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I6255fd9953d0b03e6b4fe75b67a6845a7c206f74
Signed-off-by: Pim van Pelt <pim@ipng.nl>
2022-01-28 10:46:31 +00:00
Damjan Marion
1fd912c8dd build: fix compilation on OpenSSL 3.0
So far by suppressing depreciation messages, as there was no transition
period.

Type: make
Change-Id: I9887613fd71a22bf11bf22a04c129aca4a16867f
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-27 20:35:57 +00:00
Neale Ranns
0d47f20940 vppinfra: sparse_vec_free free should free the sparse_vec_header not the embedded vec_header_t
Type: fix

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ie9532543c4d4439beec8ce097eafa34588ad1266
2022-01-27 20:07:27 +00:00
Ray Kinsella
4a6306aa69 perfmon: frontend and backend boundness bundles
Renamed memory stalls to topdown backend-bound-mem, added topdown
frontend-bound-latency and frontend-bound-bandwidth.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I70f42b6b63fe2502635cad4aed4271e2bbdda5f1
2022-01-27 20:02:24 +00:00
Ray Kinsella
0024e53ad0 perfmon: prune bundles by available pmu counters
Prune perfmon bundles that exceed the number of available pmu counters.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I70fec26bb8ca915f4b980963e06c2e43dfde5a23
2022-01-27 20:01:45 +00:00
Florin Coras
ae0e3e748f http_static: code cleanup
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic8838c8ef558d671740094a98b5a627a18c8c808
2022-01-27 20:01:18 +00:00
Ray Kinsella
aedcfaf80c perfmon: add cli to show perf config
Added a cli to show Linux perf config for a give perfmon bundle. This
makes it easier to format Linux perf commands for next level analysis.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I9adafa7d441b72120390d186e3c8f884b1bc9828
2022-01-27 15:54:02 +00:00
Florin Coras
a1175b726d hsa: cleanup and rename http test server
- cleanup data structures, functions and cli
- remove option to return static html. For similar results, use
http static server
- rename to http_cli.c as it better describes what the app does

Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I502e7566fba4376c68fbe41de9e45079a159e864
2022-01-26 09:08:52 -08:00
Florin Coras
6a4a11f479 http_static: refactor to use http transport
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I66396a1879eb3c87ef64783eab82a22896413cd0
2022-01-26 16:54:46 +00:00
Florin Coras
1d88fb97be http: generalize buffer implementation
And add support for passing of pointers

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ida3e5ae4ff7842366ae92a5f33c5e761355951a6
2022-01-26 16:54:46 +00:00
Damjan Marion
b1c9c048a2 dpdk: not having cryptodev resources should not produce warnings
Type: fix
Change-Id: Ifb2e4d93dcf8648b1bd66f4c0ee937295683bd87
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-26 11:14:00 +01:00