Compare commits

...

297 Commits

Author SHA1 Message Date
Monendra Singh Kushwaha
55457075d9 octeon: add clear counters for port and queues
Type: feature

Change-Id: Ie36be41694e7bd5341b4239dcba2ae6834c4a73f
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
(cherry picked from commit 68b8125dbfc2c5ba7703d8af1c02585fd1263b37)
2024-06-11 10:28:09 +00:00
Monendra Singh Kushwaha
4c872e9f75 dev: add port and queue counter clear operation
Type: feature

Change-Id: Ibd876c5251fc2f9d87816d235fff2de22be4b21c
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
(cherry picked from commit 2ea1e2c36124be4120e36a3385f5e27c7606597d)
2024-06-11 10:27:12 +00:00
Sriram Vatala
6e0f70a035 octeon: add support for vnet generic flow type
This patch adds vnet generic flow type support in OCTEON plugin, which
extends the existing vnet flow types supported. It allows users to
configure additional match patterns like 802.1q tag fields, 802.1ad tag
fields, MPLS fields, IP DSCP etc., if supported by the underlying hardware.
On OCTEON various match patterns including user defined custom protocol
types can be supported depending on the programmable classification profile.
Generic flows operate based on hexadecimal strings representing packet
data bytes and corresponding mask data bytes. The mask data bytes, with
bits set to '1', selectively identify the data bytes used for hardware
flow matching.

To configure generic flow rules, packetforge tool is recommended which
accepts inputs in a user readable and friendly format. This tool is
available in VPP tree under `extras/packetforge`. Detailed instructions
can be found in the documentation under `extras/packetforge`. Additionally
user can use existing vnet flow CLI and binary API interfaces to
configure rules manually.

Type: feature

Change-Id: I8198536cf1fe0a4719542a8b54c599230c7852e9
Signed-off-by: Sriram Vatala <svatala@marvell.com>
(cherry picked from commit 282f2ecd8e7d68b9930d6f1e2c62205c9dfe8285)
2024-06-10 18:51:40 +00:00
Monendra Singh Kushwaha
d8d3ad99af octeon: add counters support for port and queue
Type: feature

Change-Id: I5d52d78a93c7d0a12b9cee16fe7ebabdc2b19f0a
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
(cherry picked from commit b26b2bcd43500f2cf8b988874c7e0feb29e99afa)
2024-06-10 18:50:42 +00:00
Monendra Singh Kushwaha
2f93a43118 dev: fix counter_start in counter clear routine
This patch fixes counter_start value, as it should hold the cumulative
counter value whenever counter clear routine is called.

Type: fix
Fixes: 38c619115b

Change-Id: I50bf8ddcde419caf1170dfacdea03ff3d93a3327
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
(cherry picked from commit afd03ffff561b05ab5e9f4be8bfe5630283028ad)
2024-06-10 18:49:48 +00:00
Monendra Singh Kushwaha
29ad53b932 octeon: update trace to use qid instead of q
This patch updates trace to use "qid" keywords instead of "q".

Type: feature

Change-Id: Ib0f41a8a1a93cbbbf8c59304924d4e68efff48fd
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
(cherry picked from commit a391de68acbeadeb16b640b54ec53eb468c25f9b)
2024-06-10 18:48:49 +00:00
Harish Malik
2f06443855 octeon: enable vf device promiscuous mode feature
This patch enables promiscuous mode on vf devices except SDP vf
and LBK devices

Type: feature

Change-Id: I2e18c63590f22f99c69500f10b42b64d899249ce
Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
(cherry picked from commit 38f59c315b0587d570fb85825c1129ec14c959bf)
2024-06-10 11:38:10 +00:00
Monendra Singh Kushwaha
13780d4383 build: bump octeon-roc version to 0.5
This patch enables vf device promiscuous mode feature in
octeon-roc except SDP vf and LBK devices.

Type: feature

Change-Id: I221f64ba0bb768191e2228dab132166a8a3326c3
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
(cherry picked from commit 81f0f16b0929cabe32c4046be2ebcc2fff783949)
2024-06-10 11:37:02 +00:00
Monendra Singh Kushwaha
1b955f9ee6 octeon: convert link speed from Mbps to Kbps
Type: fix
Fixes: 01fe7ab88e

Change-Id: I88d03adcd4ef2a585ed77834b3bf8ef9d50b15c9
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
(cherry picked from commit 2b671aa3e9b9b23afd46854a4bdd144ed783e99e)
2024-06-06 08:51:55 +00:00
Monendra Singh Kushwaha
2ab34c8cb0 octeon: add support for Marvell Octeon9 SoC
Type: feature

Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
Change-Id: I5db58b8ec41b45596bc03b4a336a184c17871294
(cherry picked from commit a93c85a5793852b6edda20bc1100fa9fabd0eb29)
2024-06-06 08:51:01 +00:00
Monendra Singh Kushwaha
1121f0067c octeon: fix lbk vf initialization
Type: fix
Fixes: 0a2fdc56

Change-Id: I5d232a86be66edeec8b740a883104f5a22516697
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
(cherry picked from commit b2c8c481ccb2dab58219fe860321b349789af0aa)
2024-06-06 08:49:50 +00:00
Andrew Yourtchenko
b3304b2b76 misc: Initial changes for stable/2406 branch
Type: docs
Change-Id: I6e44dce8d46c93819158e7700a8a25dd1268a2fb
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2024-05-22 13:09:27 +02:00
Brian Morris
f03d448142 session: remove ipv6 lookup threading assert
This makes session_lookup_connection_wt6 consistent with session_lookup_connection_wt4 -
they both just return an error for wrong thread.

Type: fix
Change-Id: Ide38976e9a7274b53311e65711098e6b22a3f8d5
Signed-off-by: Brian Morris <bmorris2@cisco.com>
2024-05-21 15:30:08 +00:00
Matus Fabian
a5668eb055 builtinurl: mark api as deprecated
Plugin will be removed since it is incorporated in http_static plugin
for longer time.

Type: refactor
Change-Id: I6ed99d1b118fb5951aafceb05a953f39d325e87e
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-20 20:01:04 +02:00
Adrian Villin
688ac5ae55 hs-test: fixed timed out tests passing in the CI
Type: test

Change-Id: Id05ea56bc5dfd80d42b8600cf11e763e25420bd0
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-05-17 16:47:00 +00:00
Matus Fabian
595d8cb668 http: ignore http_proxy env in tests
Type: test

Change-Id: I45a091a43e7ecb3f321fc9ecc761df2b44c9c351
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-17 11:28:43 +02:00
Adrian Villin
46d66000fb hs-test: updated api calls
Type: test

Change-Id: I2583ee74426ef154d03d4991b78ab57c5cec436f
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-05-17 03:11:13 +00:00
Maxime Peim
f66702df6b ip-neighbor: show age instead of time in cli
To match the API behavior, and as it is more useful to have an entry
age than its time last probe.

Type: fix
Change-Id: I07680cd713d0d2b6208a58208b032af7f6a92825
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2024-05-15 17:55:27 +00:00
Matus Fabian
fec709125b http: fix unsupported client app method
HTTP client app code currently support only GET method but method
set in message from client app was silently ignored.

Type: fix

Change-Id: I99dc6323d9783ee5a20623e7923cfdbf31474a4f
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-14 22:39:38 +00:00
Matus Fabian
3d00893c37 http: notify client when connection failed
Type: fix

Change-Id: I87054e9667fe990d9a2dc3950bc3ce348460018a
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-14 22:38:23 +00:00
Matus Fabian
b7a9ed75fb http: fix server sending all status codes
Type: fix

Change-Id: I4bc748e3091c2fbe0142d1b74d21a543a62c4ce0
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-14 22:36:31 +00:00
Scott Hutton
182d8b2ddb sr: move srmpls to a plugin
Move sr_mpls folder under vnet to the plugin folder, update cmake configuration
and header paths, and add plugin.c to register plugin.

JIRA: VPP-2054

Type: improvement
Change-Id: I1ad6f287f67eb0c35588c339bcd51218fadf5f8e
Signed-off-by: Scott Hutton <schutton@cisco.com>
2024-05-14 07:53:35 +00:00
lajoskatona
9850d301b0 marvell: remove uses of uint
This change changes all instances of `uint` to `unsigned int` to avoid
use of the non-standard type. This fixes problems that some versions of
GCC may have.
For similar patch see: https://gerrit.fd.io/r/c/vpp/+/40762

Type: fix
Change-Id: I0c666de788ac5b3c457e0a073e3e279f2fb99a4f
Signed-off-by: lajoskatona <katonalala@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-05-14 07:52:19 +00:00
Tom Jones
2e87d942ab vppinfra: Add platform cpu and domain get for FreeBSD
Type: improvement
Change-Id: I5253f2b1b51493f2d4d0f451ad4c2208fd8f6bf2
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-05-14 07:46:44 +00:00
Vladislav Grishenko
703289224c vppinfra: fix mhash oob after unset and add tests
Fix out of buffer access after mhash_unset
Add format mhash pair functions
Add related mhash tests, similar to hash ones

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Idbefd7d32c4cd16b55d84ad4006c38251b4e2c33
2024-05-14 07:37:50 +00:00
Tom Jones
2f5d094ddd dpdk: Only prealloc huge pages on Linux
Type: improvement
Change-Id: I4d9c0f96d81c8b510086a54990b3fcd3d5fdb695
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-05-14 07:34:25 +00:00
Tom Jones
16cc51b88a netmap: Reinstate and update netmap plugin
Thet netmap plugin was moved to depreciated in commit 998b8fe.

On FreeBSD netmap offers a natively supported kernel interface for
userspace networking and enables VPP without the use of DPDK.

Reinstate the netmap plugin and adapt it to the newer plugin interface.

Type: improvement
Change-Id: I113daa33a490f04cbb29909f9789fa66284ac80e
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-05-14 07:15:12 +00:00
Matus Fabian
2516b1ac73 http: fix user agent in request
App name is used in HTTP request User-Agent header.

Type: fix

Change-Id: Ib761e8a8e793e04e8d77141cc8c0f8514ed0e547
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-13 15:06:26 +00:00
Vladimir Zhigulin
05c625f1f6 vlib: avoid pci scan without registrations
Type: improvement
Signed-off-by: Vladimir Zhigulin <scripath96@gmail.com>
Change-Id: Id1d78a36cec10a01fbf266b016ba364519e5cb66
2024-05-13 15:03:18 +00:00
Alok Mishra
5233ee29cc dev: fix mac address dump in trace output
"port->attr.hw_addr" is set during the port initialization. It won't be
updated if the mac address of the port is changed via the vpp command
line.
Use "port->primary_hw_addr" to dump the updated mac address correclty.

Type: fix
Fixes: 38c619115b

Change-Id: I6c99fcfdfae67efb3606e17f36781c56716ff7ea
Signed-off-by: Alok Mishra <almishra@marvell.com>
2024-05-13 14:59:38 +00:00
Guillaume Solignac
9e45a5732b wireguard: use clib helpers for endianness
In some cases, the Linux helpers for endianness conversion are not
present. We use clib helpers to fix this.

Type: fix

Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: I4d21fb5edae6fa6413b10f298a84ff4b88bda5db
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-05-13 14:57:50 +00:00
Guillaume Solignac
9d5fed08ae nat: fix unitialized variable
Fixes an unitialized variable.

Type: fix
Change-Id: I636dc8433679606262d9a974c01f81d8721634f2
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
2024-05-13 14:57:50 +00:00
Alok Mishra
b448568fad octeon: add support for mac address update
This patch adds support for updating primary hardware address
on octeon port.

Type: feature

Change-Id: Ib0ff6aaa6dafc209eb71c44b8a6504d3df9aa5c8
Signed-off-by: Alok Mishra <almishra@marvell.com>
2024-05-13 09:00:20 +00:00
Elod Illes
078a3607c3 docs: Use newer Ubuntu LTS in tutorial
The tutorial uses old 18.04 Bionic Ubuntu release, and tries to
install vpp from packagecloud.io's bionic repository which does not
exist. However newer ubuntu releases' repositories exist, so let's
update to newer Ubuntu LTS version: 22.04 Jammy.

Also, the ubuntu vagrant box is old, so let's replace it to a newer,
generic/ubuntu2204, which uses libvirt provider (instead of virtualbox)
and updated frequently, works well for the tutorial. Due to using
libvirt provider, there is no need to customize the VM as those
customizations are present in the box by default.

The truested=yes part is removed from the apt source list command, as
we add gpgkey anyway, thus, no need for this.

Tutorial and vpp build tested with this new box and looks to be working
fine.

Type: docs
Signed-off-by: Elod Illes <elod.illes@est.tech>
Change-Id: Idcff693240fc6a1496a240e0d07c5ed43fe833e9
2024-05-10 21:39:54 +00:00
Adrian Villin
637edda132 hs-test: logging improvements
Type: test

Change-Id: Iffefe085e846b6ba614b0d74c4ba9907080a9a59
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-05-10 03:53:42 +00:00
Matus Fabian
8761095e80 http: fix client parse error handling
Do not return HTTP errors to server on parse errors in client.

Type: fix

Change-Id: Id3e99d69626855848faa87af73002d559d948516
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-09 15:57:42 +00:00
Matus Fabian
2d1bc4c9fe hs-test: add make test-debug target
Run tests on vpp debug build.

Type: test

Change-Id: I51e6f4ac9449c1c5b7eb649af91347188f9227e1
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-09 10:46:58 +02:00
Steven Luong
e4238aa34f ethernet: check destination mac for L3 in ethernet-input node
When the NIC does not support mac filter, we rely on ethernet-input
node to do the destination mac check, ie, when the interface is in L3,
the mac address for the packet must be the mac address of the
interface where the packet arrives. This works fine in ethernet-input
node when all packets in the frame might have different interfaces, ie,
ETH_INPUT_FRAME_F_SINGLE_SW_IF_ID is not set in the frame. However,
when all packets are having the same interface,
ETH_INPUT_FRAME_F_SINGLE_SW_IF_ID is set, ethernet-input node goes
through the optimized routine eth_input_single_int -> eth_input_process_frame.
That is where dmac check has a bug when all packets in the frame are
either, ip4, ip6, or mpls without vlan tags. Because without vlan tags,
the code handles all packets in fast path and ignores dmac check.
With vlan tags, the code goes to slow path where dmac check is handled
properly.

The fix is to check if we have a bad dmac in the fast path and force the
code to go to slow path which will handle dmac check properly.

Also do a wholesale correction on all the testcases which do not use
the proper dmac when sending L3 packets.

Type: fix

Change-Id: I73153a805cecdc24c4eefcc781676de04737ae2c
Signed-off-by: Steven Luong <sluong@cisco.com>
2024-05-08 09:42:23 +00:00
Matus Fabian
dba5c41942 http: fix client send another request
HTTP client should be able to send another request after large data
receiving.

Type: fix

Change-Id: I8352ea760a4b3de4b79159531c7e4c1fa4e03203
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-07 17:06:51 +00:00
Matus Fabian
b8c762cc22 http: notify client on request error
Notify client app that we errored out while trying to generate request.

Type: fix

Change-Id: I3e20fe22d8a927ae8e9bf8391297e10c974dc941
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-07 17:01:01 +00:00
Ole Troan
1a319aadc6 api: add to_net parameter to endian messages
The VPP API auto-generated endian conversion functions are intended to
be symmetrical. They are used both by the API client and the API server.
Called on send to convert from host endian to network endian and on
receive to convert back.

For variable length arrays, we have to iterate over the array and call
a more specific handler for the array type. Unfortunately the length of
the array is part of the api definition, and if it's endian swapped
prior to the for loop, unexpected behaviour will ensue.

There was an earlier fix, for some specific messages, but unfortunately
that only fixed the problem from the VPP (server) side.

This adds a new parameters to the endian handler, so the boundary
argument to the loop can be treated differently depending on if this
message is to the network or from the network.

Type: fix
Change-Id: I43011aed384e3b847579a1dd2c390867ae17a9ad
Signed-off-by: Ole Troan <otroan@employees.org>
2024-05-07 09:59:31 +00:00
Ole Troan
4013851e42 api: upgrade cjson and fix realloc
Upgrade cJSON library to patchlevel 17.
Replace internal realloc added earlier 36217e3ca.

Type: fix
Fixes: 36217e3ca
Change-Id: I7d8a80dc4241e9f952895d24adca8fa2d873e746
Signed-off-by: Ole Troan <otroan@employees.org>
2024-05-07 09:59:00 +00:00
Eric Sun
ee98c9dd8e vlib: fix use of RTLD_DEEPBIND for musl
RTLD_DEEPBIND only exists in glibc. If it isn't defined we can just
ignore it.

Type: fix
Change-Id: I5b2d65b2462020808635b057d5f7665fb75a2444
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Signed-off-by: Eric Sun <esun@meraki.com>
2024-05-06 11:55:39 +00:00
Eric Sun
c353b3622b tests: remove uses of uint
This change changes all instances of `uint` to `unsigned int` to avoid
use of the non-standard type. This fixes problems that some versions of
GCC may have.

Type: fix
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Change-Id: I08cce367c2a8f31efb2fccabcb8f699d801b0f8a
Signed-off-by: Eric Sun <esun@meraki.com>
2024-05-06 11:54:44 +00:00
Guillaume Solignac
687707d0b8 vlib: fix missing integer init
Some compilers were not clever enough to figure out these inits
weren't needed. Hence adding them.

Type: fix
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: I50c4e978bfd2ef15ece7a29e517bb8ddba12f960
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-05-06 11:53:32 +00:00
Hadi Rayan Al-Sandid
4aecd4869c vlib: revert automatic core pinning changes
This reverts commit 71c32a898941e32b5d4f865b50fbe775560c582d.

Type: fix

Reason for revert: vnet pinning is not considered in this patch.
This causes keywords 'workers' and 'skip-cores' to be broken,
as well as keyword 'main-core auto' introduced in this patch.
If this patch is ever reconsidered, it must account for vnet
pinning fix in commit https://gerrit.fd.io/r/c/vpp/+/40711.

Change-Id: I1f3154a6c7e830b100f824375aa00e95b192f7f3
Signed-off-by: hsandid <halsandi@cisco.com>
2024-05-06 11:52:35 +00:00
Mohsin Kazmi
fb113ca560 iavf: disable VLAN stripping when VLAN offload is set in caps
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I4cc7433a707649c46d501249477949b62199c8a2
2024-05-06 11:52:07 +00:00
Tom Jones
04880a94c1 dpdk: Only use --file-prefix flag on Linux
--file-prefix is only supported by DPDK on Linux currently.

Type: improvement
Change-Id: I47765ea666b7d14011804e7cc90d9035bce1bc93
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-05-06 11:39:23 +00:00
Tom Jones
e625d0e7af vlib: Add FreeBSD specific platform files
Type: improvement
Change-Id: I0739959084d7cfd8309793f54c92c046b94d7a02
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-05-06 11:38:56 +00:00
Tom Jones
3d372e6553 dpdk: Only reconfigure max pipe size on linux
FreeBSD dynmically grows pipes based on usage and available system
memory. Don't try to resize pipes on FreeBSD for now.

Type: improvement
Change-Id: I78b06dead5d42a3a7bdf634a67b43ef854e510f8
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-05-06 11:38:40 +00:00
Tom Jones
f4c79967a6 vppinfra: Include param.h on FreeBSD
Type: improvement
Change-Id: I5fa90dd26d6cac2cefee009c97dd5ff8dac3ee1e
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-05-06 11:37:44 +00:00
Tom Jones
3b8819524f dpdk: Don't depend on rdma-core on FreeBSD
Type: improvement
Change-Id: Icad058df22d3f9d65b086215cc17b1ab32d59eb8
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-05-06 11:37:06 +00:00
Tom Jones
5267b53528 dpdk: Use gnu sed on FreeBSD for header fix ups
FreeBSD sed isn't compatible with gnu seds in place option. On FreeBSD
explicitly use gsed, on Linux and other platforms this is available just
as 'sed'.

Type: improvement
Change-Id: I6e4fcaf11d4d22cd3e4cd0c3327b16393542845f
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-05-06 11:36:29 +00:00
Monendra Singh Kushwaha
0a2fdc5669 octeon: fix rvu vf device id
Type: fix
Fixes: I1ea92f

Change-Id: Idf91b3f4cb3cc93081a282a14ffe2421a3628509
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
2024-05-06 11:23:16 +00:00
Monendra Singh Kushwaha
c2bbc7bc8c octeon: add max packet length check
This patch compares packet length with maximum supported
packet length and drops the packet accordingly.

Type: fix

Change-Id: I80ef453d43149818936649e1e58ae90c84a34ab9
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
2024-05-06 10:06:51 +00:00
Monendra Singh Kushwaha
622003c813 octeon: fix buffer free for more than 6 segment
Type: fix
Fixes: 01fe7ab

Change-Id: I4423d287e8148344754b2f6a13886c093a1384e4
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
2024-05-06 10:06:51 +00:00
Florin Coras
916ca8d5a0 vcl: allow more rx events on peek
If peek touches all data in the fifo, unset fifo event to request new
events when more data is enqueued.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I878fa017f18ada5cef557600673bba920f230542
2024-05-03 20:05:33 +00:00
Stanislav Zaikin
51e6c0d5fe interface: fix check in set_interface_name api
set_interface_name may crash if wrong sw_if_index is passed e.g. ~0

Type: fix

Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
Change-Id: Ic7e400c914fb33c2f9eac4f2985bb5b163a18d57
2024-05-03 17:08:55 +00:00
Matus Fabian
616201abe2 http: fix http server in response
App name is used in HTTP response Server header.

Type: fix

Change-Id: Ie3b2d985dd7d554a0352f7e602891f878bebd031
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-03 08:17:16 +02:00
Mohsin Kazmi
7b3339efff gso: use the header offsets from buffer metadata
Type: improvement

Change-Id: I955fbef0e0238cb69307e96cd1c677061737e5f3
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2024-05-02 14:51:59 +00:00
Eric Sun
c2db8491e8 acl: add missing byteswap header for musl
On glibc this builds fine; on musl the byteswap header doesn't seem to be
included properly. This change adds it, fixing the build.

Type: fix
Change-Id: I402812409395d471357b6317084774afba39548f
Signed-off-by: Eric Sun <esun@meraki.com>
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2024-05-02 10:46:05 +00:00
Filip Tehlar
d894438f04 http: fix client receiving large data
HTTP client was relying on synchronous rx notifications to the client
app when moving lage data from underlying transport proto.
Recent change in session layer made such notifications asynchronous
making http client not working. This patch fixes the issue.

Type: fix

Change-Id: I4b24c6185a594a0fe8d5d87c149c53d3b40d7110
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-05-01 05:07:26 +00:00
Damjan Marion
1db11b7d8d octeon: fix roc_nix_npc_mac_addr_get() return value check
Type: fix
Fixes: 01fe7ab
Change-Id: I46782c69773085f9e6a8dfff798bb42b1e822c32
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-05-01 01:17:20 +00:00
Klement Sekera
0f1fda9cec tests: remove duplicate SVR test case
Type: fix
Change-Id: I4105109c1c659190fc2da4ee1802ef53449a3c15
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2024-05-01 00:59:42 +00:00
Adrian Villin
fd9efaec17 hs-test: disable color output
Jenkins cannot display colors in console output

Type: fix

Change-Id: I5365dec471d773dae1f139c5fabd0711298f8bea
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-05-01 00:24:55 +00:00
Damjan Marion
9f2799fda4 crypto-native: add SHA2-HMAC
Type: feature
Change-Id: I9e7ebf43536c972a62621fc7ad7406abec0ce071
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-30 14:38:28 +00:00
Matus Fabian
18c9f14037 hs-test: fix cpu allocator
Effective CPUs file is different between cgroups v1 and v2.

Type: test

Change-Id: Ic1b9059435b3f0944624120f57e72da45adca223
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-04-29 15:44:41 +00:00
Guillaume Solignac
52bd5376e4 pci: fix missing limits.h
When building with musl, PATH_MAX is not available if we don't add its header
to pci.c.

Type: fix
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: I3d4e7cf5754d7c1d480834d7cd038d5bda46fd2f
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2024-04-29 08:35:20 +00:00
Dave Wallace
83b12bf895 hs-test: clean up Makefile for compatibility with ci-management
Type: test
Change-Id: Ic767bc1eef0180941dd8730f9fcca1389ad7e043
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-04-26 01:48:58 +00:00
Tom Jones
5389a70c9b vcl: Only exclude vcl ldpreload on FreeBSD
Previously all of the vcl library was excluded from the build on
FreeBSD, this was too agressive as only the ldpreload component requeres
platform specific implementation for FreeBSD

Type: improvement
Change-Id: I94e70d7730878cc98060561eedf07cb7e4d1868a
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-25 17:06:15 +00:00
Tom Jones
1613e401e7 hsa: Link against libepoll-shim
Type: improvement
Change-Id: I08610ce71282f10c587d956b27e0f572a812bedd
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-25 13:33:34 +00:00
Dave Wallace
62af9bb645 dpdk: bump rdma-core to 51.0
- Per dpdk 24.03 release notes (rdma-core >= 50.0)

Type: feature
Change-Id: Ieed077dc9b54cc1c59c75ebdbccfc683c7636222
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-04-24 19:17:29 +00:00
Tom Jones
d346b8852a vlib: Add FreeBSD thread specific header and calls
Type: improvement
Change-Id: Ia84683936da02968991ea717316a834a5da1a517
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24 16:40:24 +00:00
Tom Jones
1817c8e609 vppinfra: Link against lib execinfo on FreeBSD
Type: improvement
Change-Id: Ie3d6cba886e0779949e8d574f82cff62abc7ebed
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24 16:06:58 +00:00
Tom Jones
97188d71dd vppinfra: Add FreeBSD method for updating pmalloc lookup table
FreeBSD has a different interface to request memory mapping information.
Add a FreeBSD specific method for reading physical addresses and make it
available at build time.

Type: improvement
Change-Id: I3588dde8e0a6f6d53333040245341ed09cebef9d
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24 14:40:59 +00:00
Kai Ji
a0fd523013 dpdk: bump to DPDK 24.03
This patch bumps DPDK version to 24.03

Type: feature
Change-Id: I4d7d1348f905579ece3cbe4ab89873abd212c636
Signed-off-by: Kai Ji <kai.ji@intel.com>
2024-04-24 14:40:16 +00:00
Matus Fabian
0d0c590936 hsa: fix http client error handling
Type: fix

Change-Id: I5595260b903e3e1f15caccd168914f33f7161b59
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-04-24 14:40:06 +00:00
Damjan Marion
804255c9f0 misc: fix int/enum mismatch errors reported by gcc-14
Type: fix
Change-Id: I80e90cab8e2e9fef837779e36e0256baf791b801
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-24 14:33:34 +00:00
Damjan Marion
21c5ae36af dpdk: remove unnecessary includes
Type: improvement
Change-Id: Idf3d440ee9763b54c973e6d87394b786eb66e307
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-24 14:32:59 +00:00
Damjan Marion
ee577115ff dpdk: remove dead code
Type: improvement
Change-Id: I888f29e1ff15c5aa59a2a74dc0b2a818baf0bfde
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-24 14:32:29 +00:00
Tom Jones
b2a357bc1f vlib: Add a skeleton pci interface for FreeBSD
Implement a subset of the pci interface with unimplemented methods
marked with a comment. This is enough functionality to allow dpdk to
attach to pci devices and forward traffic on FreeBSD.

Type: improvement
Change-Id: I0d87778cd92ae332a6802c11083d3d99988678a1
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24 12:31:24 +00:00
Tom Jones
154e19c09a fateshare: Add FreeBSD specific API for controlling processes
Type: improvement
Change-Id: I7ea8b5505a2663d6751208f0001e4b9ba2deb150
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24 12:30:01 +00:00
Tom Jones
abd6a7b2b5 api: Add FreeBSD specific mechanisms for unix sockets
FreeBSD doesn't support SCM_CREDENTIALS, but has an equivalent mechanism
called SCM_CRED. This is documented in unix(4), use SCM_CREDS on
FreeBSD.

Type: improvement
Change-Id: Iaf4ec0d68445239c06fa0eef6c25db7e3328e989
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24 12:23:25 +00:00
Tom Jones
1dcb24c347 dpdk: Use FreeBSD specific values for network interface classes
The PCI class values used to identify devices are different between
platforms. Add a selector for the values used on FreeBSD.

Type: improvement
Change-Id: I981f0dc24954457068fc94bcc4681b120ee253db
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24 11:43:32 +00:00
Tom Jones
da03d6b3f5 dpdk: Only use vmbus on Linux
Type: improvement
Change-Id: If181c4bfd7fc93583a608d478bd070930c853f52
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24 11:38:01 +00:00
Tom Jones
2535bdea47 dpdk: Disable building FreeBSD kernel modules
Disable building the FreeBSD kernel modules, while these are required
to run, this dpdk step will fails inside the vpp build.

If the build succeeded this step would try to install the kernel modules
as root in the vpp build which also isn't desirable. For packaging the
kernel modules should be provided in a seperate package rather than
through the vpp build process.

Type: improvement
Change-Id: I01f1ae2845445e2babad380b675054b80d4b325b
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24 11:33:45 +00:00
Tom Jones
934bab6766 dpdk: Only use vmbus on Linux
Type: improvement
Change-Id: Iba3e287f420c0bdc8d248695163e7dfe1acd24d8
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24 11:33:19 +00:00
Tom Jones
cc0c8c7e9e dpdk: Only require libnuma on Linux
On FreeBSD the numa APIs are always available.

Type: improvement
Change-Id: I34b8f6b0a81bc3d73f9b95b10d3a788dcdd71b65
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-24 11:30:34 +00:00
Tom Jones
ab47993a00 vppinfra: Add method for getting current executable name
Add a unix method for getting the current executable name. This is
implemented to match the readlink api for existing calls.

Type: improvement
Change-Id: Id06a55892d09d0b305a56b55a424f53ffb685a72
Signed-off-by: Tom Jones <thj@freebsd.org>
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-24 10:30:20 +00:00
Brian Morris
c0580f91a1 tls: don't upper-case cipher string
Change-Id: Ic8308046610aa5d49d9595bcd450f9651b9915e4
Signed-off-by: Brian Morris <bmorris2@cisco.com>
The string is allowed to contain lower case characters, for example "TLSv1.2"
Type: fix
2024-04-23 20:17:10 +00:00
Gabriel Oginski
6edc6bcc31 ipsec: fix CLI for create ipsec itf
This commit adds missing support in CLI for creating ipsec itf
in p2mp mode.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I1bd1cc6667625b8e527af8d25bd8e723751dbc41
2024-04-23 13:03:10 +00:00
Guillaume Solignac
9abc01f251 octeon: add promisc support
We add the capability to enable and disable promiscous mode on the
octeon port.

Type: feature
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: I9a1464d2e1e8a0570ff16e221a4896aedc3ed6f8
2024-04-23 12:58:47 +00:00
Maxime Peim
f13534e79d tests: allow ip table name
Type: refactor
Change-Id: I4abbc77a447358f4beaa05505299cae732a3f374
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2024-04-23 08:52:48 +00:00
Denys Haryachyy
07b2274073 ikev2: uptime
Introduced SA and child SA uptime.

Type: improvement

Change-Id: I28cf9f90d35ebe035a31ed0a985a5e462c8536a8
Signed-off-by: Denys Haryachyy <garyachy@gmail.com>
2024-04-23 08:52:23 +00:00
Matus Fabian
bbee45c80b hs-test: add tests repeat option
Type: test

Change-Id: I0143d26d929f6408a5399d7ca536e48cbd9d46bb
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-04-23 00:37:23 +00:00
Matus Fabian
c899ab4e56 hs-test: fix TCP with loss test
Load NSIM plugin.

Type: test

Change-Id: I250f51e6622419d98fd17216031a5b4d2da07fba
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-04-22 20:37:11 +00:00
Monendra Singh Kushwaha
043560ef2d octeon: add support for SDP device
This patch adds support for SDP (System DPI Packet Interface Unit)
device.

Type: feature

Change-Id: Idf1f53b151edf2992613746d5818409187b4b051
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
2024-04-22 19:10:05 +00:00
Tom Jones
36d099a5cd vlib: Place linux pci headers in a linux include block
Type: improvement
Change-Id: I6b30ffd1eabfa9544d548082b7e38b8fe7224c07
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-22 19:09:13 +00:00
lijh_7
4c15c94b09 nat: add saddr info to nat44-ed o2i flow's rewrite
Type: fix

Change-Id: Ic303ff9b21872b7cc31f23c92e48ec3737eeb8fe
Signed-off-by: lijinhui <lijh_7@chinatelecom.cn>
2024-04-22 11:11:56 +00:00
Anton Nikolaev
67226438c6 ipip: specify af for a tunnel ip addresses
Currently ipip tunnel allows to use an empty addresses for dst when we
trying to add tunnel, but it doesn't return it correctly on ipip dump
call. There is case when we create an ipip tunnel with an empty ipv6
address, address is zero, but AF is ipv6. And when we dump ipip tunnels
we get an emtpy ipv4 address instead of an empty ipv6 address.
There is no point to detect AF for each address in
send_ipip_tunnel_details, because ipip tunnel can't handle different
AF for src and dst addresses, and prohibits creating ipip tunnel
with different AF of dst and src addresses.

With this fix, send_ipip_tunnel_details function return a correct AF
despite address value.

Type: fix
Change-Id: Ib343293ad79a300cdb70135fffbfd156dfef6e27
Signed-off-by: Anton Nikolaev <anikolaev@netgate.com>
2024-04-19 18:28:39 +00:00
Adrian Villin
cee15aa940 hs-test: transition to ginkgo test framework
Type: test

Change-Id: Ia38bf5549d20b22876f6082085b69a52a03d0142
Signed-off-by: Adrian Villin <avillin@cisco.com>
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-04-19 14:52:05 +00:00
Vratko Polak
3a05db6264 sr: use correct reply to sr_policy_add_v2
Type: fix
Fixes: c4c205b091934d96a173f4c0d75ef7e888298ac7

Change-Id: I110729601a9f19451297883b781ec56e2b31465b
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2024-04-18 15:28:47 +00:00
Florin Coras
9a5caec182 session: force session cleanups on app detach
Force transport and session cleanup on session detach if transport is
already closing. This should also avoid races between transport
initiated session cleanups and pending session control events.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I83a947a0c01f5af8ac70aa31fee660276f1d1c60
2024-04-17 19:03:28 +00:00
lijinhui
8188f47eb8 ip: fix comments for icmp4
Type: fix
Change-Id: I5f309ca4db4ae4a3e475d87b8f0188c4ead5e562
Signed-off-by: lijinhui <lijh_7@chinatelecom.cn>
2024-04-15 23:33:25 +00:00
Niyaz Murshed
dd5f75c6fd crypto-sw-scheduler: crypto-dispatch improvement
Currently sw_scheduler runs interchangeably over queues of one selected
type either ENCRYPT or DECRYPT, then switches the type for the next run.
This runs perfectly when we have elements in both ENCRYPT and DECRYPT
queues, however, this leads to performance degradation when only one
of the queues have elements i.e either all traffic is to be encrypted or
decrypted.
If all operations are encryption, then 50% of the time, the loop exits
without dequeueing.With this change, that dequeueing happens on every
loop. This increases the performance of single mode operation (ecryption
or decryption) by over 15%.

This change was also added in commit 61cdc09810
to fix similar performance issue when the crypto-dispatch node is in interrupt
node, however was removed by 9a9604b09f
which has its own limitations.

Type: improvement
Change-Id: I15c1375427e06187e9c4faf2461ab79935830802
Signed-off-by: Niyaz Murshed <niyaz.murshed@arm.com>
2024-04-15 23:30:55 +00:00
Anton Nikolaev
4ebe5eef8a linux-cp: fix seg fault in get_v2 methods
vl_api_lcp_itf_pair_get_v2_t_handler method was not be able to
handle invalid sw_if_index, it caused a seg fault.

With this fix, the method checks for an invalid sw_if_index and
sends error back to caller.

Type: fix
Change-Id: I4e89b0cab34f9109c4ce2689021ecfc2786055ab
Signed-off-by: Anton Nikolaev <anikolaev@netgate.com>
2024-04-15 14:41:21 +00:00
Florin Coras
d7f0daecce g2: fix gpointer cast complaints
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iadd6a4dd928002e764fc52343c14403620279aa7
2024-04-11 01:07:59 +00:00
Benoît Ganne
a1d20405b7 stn: fix non-NULL terminated string overflow
Type: fix

Change-Id: I9d7e6dd099cf9f4b7f6bb06d9e8a17fac7d7e772
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2024-04-11 01:06:20 +00:00
Benoît Ganne
11f7965350 tcp: check for header truncation
Type: fix

Change-Id: I0a43a37971d03a700926d59e848f0b6e6dbeb19a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2024-04-11 01:06:03 +00:00
Florin Coras
aa78631d75 session: add api to detach session from app
Type: improvement

Change-Id: Ib824d0ca9efc7d8967e043db69017655b2dcf6b5
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-04-10 19:35:48 +00:00
Benoît Ganne
50e7ea7b14 vlib: fix vlib_buffer_free_inline() AVX-512 overflow
'queue' is declared on the stack and must be big enough to handle
queue_size + max processed elements per loops.
When AVX-512 was added, this additional max was not increased from 4 to
8 accordingly.

Type: fix
Fixes: 767a9ab4b1

Change-Id: I15f2f930fc316f92da2e4642f41852d856c06a48
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2024-04-10 14:04:51 +00:00
Wim de With
f521df7200 build: use GNUInstallDirs where possible
Some installation destinations were already converted to the
GNUInstallDirs standard in e3cf4d0cf. This patch converts the share and
include directories (typically /usr/share and /usr/include respectively)
as well.

Type: improvement
Change-Id: Id481b16604f3f52203166a5c0647f43d6eb05239
Signed-off-by: Wim de With <wf@dewith.io>
2024-04-10 13:59:41 +00:00
Damjan Marion
a447c66e55 vppinfra: add support for precomputed SHA2 HMAC key and chained buffers
Change-Id: Ic1fa3bd164e80c2ca1146be001870da0238a5f2e
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-09 21:09:21 +00:00
Maxime Peim
b0d433978b tests: allow to add paths to default route
After adding a path to the default route, the prefix still be there
in the table as it is a mandatory prefix. However, the registry hence
fail to remove the route from VPP.

Type: fix
Change-Id: Ic4ad72455ac7a1a2f1d8baba59a7a3afe1610726
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2024-04-09 17:30:57 +00:00
adrianvillin
bfbe7a8c9a tests: Added a simple prom(etheus exporter) plugin test
Type: test

Change-Id: Ibceabc411f09d80cc23be6f2e7c8abd56d4c4ac2
Signed-off-by: adrianvillin <avillin@cisco.com>
2024-04-09 16:17:29 +00:00
Tom Jones
bf89b81779 build: Error out Makefile if bash can't be found
Type: improvement
Change-Id: I3bba4e53364dbcc0d7a373fdc9cac2db3bbb4249
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-09 15:15:45 +00:00
Tom Jones
5997a5db0a acl: Use clib_net_to_host rather than library bswap
Type: improvement
Change-Id: I51345fb75843c67c6bf6a4c56380e1f0899c45b1
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-09 15:14:54 +00:00
Benoît Ganne
7b899be710 fib: fix off-by-one error in rewrite length check
The rewrite string can be up to max_size, and max_size can be up to
VNET_REWRITE_TOTAL_BYTES. Don't waste the last byte.

Type: fix

Change-Id: I2fb7e9873b6b4c1e6a55b172c7f753f3c5910802
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2024-04-09 04:49:17 +00:00
Vladislav Grishenko
302db471a0 mpls: fix default mpls lb hash config
In case of multiple path within tunnel, mpls lookup node
computes lb hash with mpls_compute_flow_hash config value 0,
so only mpls label and l4 ports gets accounted, not 5-tuple.
This leads to flow traffic polarization and disbalance over
mpls paths.

Use mpls hash config from lb instead, usually it'll be
MPLS_FLOw_HASH_DEFAULT with 5-tuple plus flowlabel.
As optimization, fix flow hash reuse from the previous lookup
node if present, like ip_lookup does. Previously mpls lookup
always calcs the hash.
Test lb distribution for both cases.

Also, use the same flow hash hex format in ip4/ip6 and mpls
traces for easier reading, most code changes is due fixstyle
formatting.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Ib89e1ab3edec14269866fe825a3e887d6c817b7c
2024-04-09 04:47:02 +00:00
Pim van Pelt
2a7bc81ae3 vnet: fix ARP for unnumbered
On unnumbered interfaces, ARP fails because there is no attached route.
Allow replies to peer-to-peer addresses on unnumbered interfaces:
  eg. 192.0.2.1/32 <-> 192.0.2.2/32

Type: fix
Change-Id: Ibeb8d8ebc8d58d5bfb0724739a17694e0217356e
Signed-off-by: Pim van Pelt <pim@ipng.nl>
2024-04-09 04:26:21 +00:00
Florin Coras
0bfce6b724 tls: fix session state update on accept
Only set state to ready if session is not already closing.

Type: fix

Change-Id: Ic95667f43ed09d693f1cf7c9f1c16f7f995ea2d8
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-04-08 16:10:03 +00:00
Dmitry Valter
3150250bc9 vppinfra: fix mask compare and compress OOB reads
Use mask_load_zero to avoid out-of-buffer reads in vectorized
function versions.

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.com>
Change-Id: I12bcb817ccf2db210c1c99fdfa444dc3f540035b
2024-04-08 11:46:30 +00:00
Damjan Marion
df47a0812a octeon: fix memory ordering issue in tx batch free
Type: fix
Fixes: 01fe7ab
Change-Id: I4425e809f0977521ddecf91b58b26fe4519dd6e0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-05 19:33:32 +00:00
Florin Coras
d1364402b6 session: fix cleanup for refused sessions
Type: fix

Change-Id: I739b7129c7e5a3fccefcdeeaf7f4a298223dd8eb
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-04-05 16:22:32 +00:00
Damjan Marion
a2f53c700a octeon: fix buffer free on full tx ring
Type: fix
Fixes: 01fe7ab
Change-Id: I4419107c4bcb7f85b76addfc62178b6e75e10a52
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-05 16:00:41 +00:00
Klement Sekera
e8fb3cfe89 api: fix [un]formatting in vpp/api/types.c
vl_api_prefix_t.len is 1 byte only, but unformat %d writes 4 bytes
add helper functions unformat_u(8|16) which don't write more than
appropriate amount of bytes
fix other similar errors in vpp/api/types.c

Type: fix
Change-Id: I74a61a377147c373f8c25ed083052b2287763c39
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2024-04-05 14:03:40 +00:00
Maxime Peim
37d8c185b8 ip6: fix icmp trace flag copy
Type: fix
Change-Id: I56c1a2717f197c889425449b37f51b0f2cc89ea5
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2024-04-04 11:41:04 +02:00
Dave Wallace
940a70fff4 tests: upgrade python packages
Type: test

Change-Id: I01500466f3d15c79e38028677ce7e5c75d427fdc
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-04-03 14:10:47 -04:00
Matthew Smith
b48325100b tests: figure out correct version of sed to run
In run_in_venv_with_cleanup.sh, sed was changed to gsed to allow the
script to run properly on FreeBSD because the sed script uses an
expression that is specific to the gnu sed. Gnu sed is available to
be invoked as gsed on FreeBSD systems, but there is no executable or
symlink which allows sed to be run by the name gsed on ubuntu 22.04.

Check for the existence of gsed. If it's found, use it. Otherwise, just
use sed.

Type: fix
Fixes: b3c863eae4

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I487197e486f500711aa3e87ec7ba899a53606b40
2024-04-02 18:35:06 +00:00
Florin Coras
461aaa8d7a session: fix closing ntfs handling for refused sessions
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1464e93cd3020eaa26068df558924e39dd255ccb
2024-04-02 16:44:25 +00:00
Dave Wallace
9dec76be0f fib: coverity 335348 out-of-bounds access
- also fix memory leak in adj_glean_walk_proto()

Type: fix

Change-Id: I3cd72b14506e6bfc9d8d77a65d7b9b2703992367
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-04-02 11:12:23 +00:00
Dmitry Valter
966049986a vppinfra: fix array_mask_u32 underrun
Properly handle small buffers in the AVX256 version of array_mask_u32.

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.com>
Fixes: f62ed3f9c1ec3e8db36f63d6a54f46b7bea43723
Change-Id: Idf1cb43ccf37bd7c439d11e4f68fe30064c6d09a
2024-04-02 11:11:53 +00:00
Vladislav Grishenko
b24ff24da9 api: fix rx timeout thread busy loop after reconnect
After memclnt api client disconnect, read timeout is set to zero
and stays the same even after same client reconnect. It causes
client process to spin in timeout loop up to 100% cpu.
Fix it by resetting timeout process state upon every (re)connect.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I56812972a69c343f869eebbdfebdcbefd3d201e0
2024-04-02 06:56:37 +00:00
Dan Geist
e53e296841 map: BR rule lookup update
Update to the MAP rule lookup (in IPv6) based on the rule's source
prefix instead of DMR

Type: improvement

Per RFC, the DMR is allowed to serve multiple MAP Basic Mapping Rules, but this
capability was prevented by the above logic.

Updates to the code include populating a new hash table based on the MAP rule
ip6 prefix and length, changing several functions to reference this new table,
and slight alterations to a few functions regarding pre-lookup bitmasking.

All changes are commented with [dgeist] and are in need of peer review,
especially the bitmask alterations.

An attempt was made at generating an additonal MAP rule in the test_map_br test
harness, but the coding appears very much oriented towards testing just one
rule. I would appreciate suggestions on how to test multi-rule cases.

Issue: VPP-2111
Change-Id: Id1fea280eba625e23cd893575d9b63aac7f48405
Signed-off-by: Dan Geist <dan@polter.net>
2024-04-02 06:56:04 +00:00
Dave Wallace
3a0d7d2c95 misc: in crcchecker.py, don't check for uncommitted changes in CI
Type: fix

Change-Id: I63260a953e54518b3084b62fccdb4af81315b229
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-04-02 06:55:34 +00:00
Klement Sekera
0f4febfac3 vapi: avoid memory leak
Erase removed elements to avoid memory leaks.

Type: fix
Change-Id: I1605bea8df7e08455691364efb0a12eb0d9dae93
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2024-04-02 06:55:01 +00:00
Georgy Borodin
f46c5525d2 lb: fix using vip after free
fix use of vip after it was deleted

Type: fix
Fixes: 041eacc81656d2ed5bc01b96b15a7d03a1700f13
Change-Id: I5723485c5da7507fbc6c86ff6eb9f77127439f67
Signed-off-by: Georgy Borodin <bor1-go@yandex-team.ru>
2024-04-02 02:39:10 +00:00
Tom Jones
b3c863eae4 tests: Use gnu sed explicitly in test setup/tear down
Type: improvement
Change-Id: Ie79fd8a5bcfd72a97bf460ef6437913ac34f439c
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-02 02:26:29 +00:00
Tom Jones
800386ac3f tests: Add missing socket imports in tests
Type: fix
Change-Id: I646f96517d3bda5c0f5644e6bb89ade7818fc466
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-02 02:25:22 +00:00
Vladislav Grishenko
f2fc97aafc l2: fix vxlan src port entropy with mpls payload
l2 tunnels like vxlan, gtpu, geneva use vnet_l2_compute_flow_hash() to
compute flow hash for udp src port entropy. In case of inner mpls tunnels
to the same lsr ethernet src and dst macs are the same, so l2 flow hash
is also the same leading to no src port entropy and the only rss queue
overflow on receiver side.

Fix it for all the possible vnet_l2_compute_flow_hash callers by making
mpls playload hash in additon to ip4/ip6. Visible performance impact is
not expected as it's only one check for mpls ethertype for common cases.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I69153d42fb3d7c094a670c674fac8d14039c626a
2024-04-02 02:11:02 +00:00
Vladislav Grishenko
704d5a53e0 linux-cp: add support for tap num queues config
This change allows to limit lcp interface queues
to be used by explicit host interface workers.

Type: improvement
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I0626f66021e5a5f251470156231dc44ddaea5ee6
2024-04-01 20:20:08 +00:00
Jon Loeliger
d465fd0819 fib: add early config support for IP and IP6 default FIB table names
Type: improvement
Change-Id: I8c248d9e224bd069b641a174da57d448371470af
Signed-off-by: Jon Loeliger <jdl@netgate.com>
2024-04-01 18:06:09 +00:00
Tom Jones
e98031646a vhost: Only enable plugin on Linux
Type: improvement
Change-Id: I6cf5adbd609d911e15dcc6d976cda4ad21ce89ad
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-04-01 17:59:37 +00:00
lijinhui
eb2a4189f5 vlib: fix counter_index check
Ensure counter index is valid before using it to lookup
the counter.

Type: fix
Change-Id: I423c7a6aa6b65f6367b18d8e99cf40f52e06b416
Signed-off-by: lijinhui <lijh_7@chinatelecom.cn>
2024-04-01 17:57:58 +00:00
Damjan Marion
5e814768b8 octeon: specify pool when alloc buffers
Type: fix
Fixes: 01fe7ab
Change-Id: I72fdaca250468d91a31efcce2fb447c97ba49dc7
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-01 10:49:57 +00:00
Damjan Marion
cbaa256a14 octeon: refill even if nothing dequeued from rx queue
It may happen that rx queue is empty of free buffers due to previous
alloc failure.

Type: fix
Fixes: 01fe7ab
Change-Id: I344dcda11525444bd1358b3d36ffdf8ab9aa2677
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-04-01 10:48:53 +00:00
Kai Ji
0cbd623d72 ipsec: fix clang compile issue
Type: fix

Change-Id: Ic015b37e18a43c49c3fb3dbff284a17fa2c5fd99
Signed-off-by: Fan Zhang <fanzhang.oss@gmail.com>
Signed-off-by: Kai Ji <kai.ji@intel.com>
2024-03-30 18:54:15 +00:00
Florin Coras
7a18b0f0a5 tls: fix rescheduling when no data available
Don't force tx rescheduling of tls session if no forward progress is
made. The session will still be rescheduled by the session infra if
there's pending tx data.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic57b6ee79969055cec782938668c054bcc39f206
2024-03-30 18:25:24 +00:00
Florin Coras
ea5d5bdd1c session: fix api coverity warnings
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ieb4e9d9e39b937ad4c7316b3955b3ca296f0a191
2024-03-29 18:41:07 -07:00
Florin Coras
7e9e2bd8f2 session: add new api for enq tx io events
Type: improvement

Change-Id: Iefe5c2e610a26241a88ca783ac548fd8f2317bb0
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-03-29 21:48:20 +00:00
Florin Coras
a58fce23de session: use custom types for session flags and state
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I04f836d09a1cbd5a5b55dc64359d2d761dfc4988
2024-03-29 21:45:18 +00:00
Florin Coras
980ee74b16 session: improve use of session handles
First step towards moving to an 8 byte struct instead of u64.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idd0b95520ab7158e175b9af1702fc09c0613a4bb
2024-03-29 21:45:18 +00:00
hsandid
71c32a8989 vlib: improve automatic core pinning
Type: feature

Auto core pinning now fetches vpp cpu affinity list
using pthread api. This enables us to do core-pinning in
environments where the host cpu list does not necessarily align
with cpus available to vpp

Change-Id: Ife8c2a2351c08c5c6c4fdf7c729eeff2697bc39a
Signed-off-by: hsandid <halsandi@cisco.com>
2024-03-29 16:29:44 +00:00
hsandid
3e147f08ef misc: deprecate lawful-intercept
Type: refactor
Change-Id: Ifd7f5b351401cdcaaaf57fefc5dbbfdaf235054e
Signed-off-by: hsandid <halsandi@cisco.com>
2024-03-29 13:31:50 +00:00
Mohammed Hawari
dcb5eb5a18 acl: rework headers to enable out-of-tree usage
Change-Id: I1f8adf1f5650ab6c04e03c95d7a8d0bfa39b5f2d
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2024-03-28 16:56:32 +00:00
Florin Coras
7c2a3357f3 tls: init session for accepted ctx
Make sure session is marked as invalid.

Type: improvement

Change-Id: I1c861645de95ef15a24acd4fe6dd5364a55b4fb8
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-03-26 19:48:33 -07:00
Florin Coras
e8ea6be8df tcp: avoid fr segments less than mss if possible
Type: improvement

Change-Id: I958e059384db3c13a29f64be96877f57617bbae2
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-03-26 17:24:07 +00:00
Tom Jones
4941afb4f9 tests: Add support for getting corefile patterns on FreeBSD
Type: improvement
Change-Id: I960edc05a9a77eb55f67cb1ec01d2b3122298ef8
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-26 15:15:02 +00:00
Tom Jones
e49e75a4b5 tests: Add platform handling for FreeBSD
FreeBSD doesn't have an easy mechanism to discover CPU features
currently. For tests declare we don't support anything we are asked
about.

Add the FreeBSD spelling of amd64 while we are here.

Type: improvement
Change-Id: I3eb5db856ee5cbc71250e47eee619e2f620de33a
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-26 15:14:29 +00:00
Tom Jones
ebe3a11ca7 tests: Add missing struct import
Type: fix
Change-Id: I957877d7a82dea437c072e493561894f11321aaf
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-26 15:14:05 +00:00
Tom Jones
853cc9f2ad tests: Use errno value rather than a specific int
For portability we use errno defines rather than explicit int values
when checking for errors.

Type: improvement
Change-Id: Ib5fc1db357da150d008d5a11bef5dbc7ec354cfb
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-26 15:13:34 +00:00
Tom Jones
b3ee84d0bb tests: Add a socket timeout
On FreeBSD a races seems to occur between the states socket connecting
and VPP accepting the connection and calling getpeername. The recv_fd
call here will fail with no fds before the VPP process has time to
handle the connection.

Introducing a socket timeout removes this failure on FreeBSD and allows
the test suite to run. Add a timeout on all platforms to try to avoid
this race everywhere.

Type: improvement
Change-Id: I96f77f924a9491222bc213b534cb17001d081f3f
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-26 15:12:48 +00:00
Tom Jones
26eec75f2b build: Detect number of CPUs for build processes on FreeBSD
Type: improvement
Change-Id: Ia3a00266f47f0c3e567efa143ef08bf4e8cffe35
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-26 15:09:39 +00:00
Tom Jones
b10561bbec papi: Use CMSG_SPACE for sizing ancillary buffer space
CMSG_LEN provides the length required to store an ancillary item, but it
does not consider padding. RFC 3542 requires portable applications to
use CMSG_SPACE(), this is documented in the python API:

https://docs.python.org/3/library/socket.html#socket.CMSG_LEN

Type: improvement
Change-Id: I0eab470585f2f39bea38639db95d6b0e047d2cff
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-26 15:09:29 +00:00
Tom Jones
dfd426c2c8 nat: Include platform specific headers on FreeBSD
Type: improvement
Change-Id: I43f59037181ec6b76499e8ee1d82c04670119dc9
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-26 15:08:49 +00:00
luoyaozu
4f30bc7457 vrrp: fix vrrp_garp_or_na_send()'s memory leak
need free bi after send packets

Type: fix

Signed-off-by: luoyaozu <luoyaozu@foxmail.com>
Change-Id: I98d03820366c3d106df212c4eb353ec6a228e20e
2024-03-26 14:25:39 +00:00
Florin Coras
8ae63db020 vcl: add api to retrieve num bytes for tx
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iaa1b026e2baea1c03f8c75e7d6879d0ff6d379d6
2024-03-25 18:53:05 +00:00
Florin Coras
a8d266a7a4 tls: pass session state to engine on client init
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibe218a922ab656b8362e3c085193cb848783c255
2024-03-24 00:03:49 +00:00
Dmitry Valter
5f22f7d11c fib: fix vectorized impl buffer typo
Fix copy-paste typo with an incorrect index.

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.com>
Change-Id: I463e6f016df9cd24e96defcd30c1b442b8809416
2024-03-23 12:13:28 +00:00
Fan Zhang
a4df00f651 ipsec: esp_decrypt code clean up
Type: improvement

Change-Id: Icac31a8a3da71334e2b877f3b8e5d5a7cc5e76b8
Signed-off-by: Fan Zhang <fanzhang.oss@gmail.com>
2024-03-22 14:30:40 +00:00
Dmitry Valter
b300180082 dpdk-cryptodev: fix coverity issues
Copy v23.10-rc0-154-gfeda2ff64 fix to the unbatched path

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.com>
Change-Id: I2f58ed9a39439b22918946f328f96e676c68add9
2024-03-22 13:40:47 +00:00
Maxime Peim
e119586138 mss_clamp: fix next layer in ipv6
Type: fix
Change-Id: I06d56e6d4be2e728e13053a66273a71656ac14c4
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2024-03-22 10:15:55 +00:00
Florin Coras
5bd96b7733 session: fix workers race to allocate lookup table
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I60600452c91184da571d4630bf2f0d9c24a3e85e
2024-03-21 18:01:32 +00:00
Arthur de Kerhor
2f4586d9b3 ip: add support for buffer offload metadata in ip midchain
The offload should be handled by gso node or by the NIC
if the latter has the relevant capabilities. But ip midchain
is missing the support for buffer offload metadata in case
of GSO packet.

This patch adds the relevant support to add the buffer metadata
if the packet is GSO/IPIP to be handled accordingly.

Type: improvement

Change-Id: I17f5d71bf4c5f43a85ca3f2fbebfa1426b42ef69
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2024-03-21 14:38:49 +00:00
Fan Zhang
b8cb22318c ipsec: remove unused parameter for esp_add_footer_and_icv
Type: improvement

Change-Id: Ib6c4e6bc42dd63cb2fdb2dfa7e94baa709e7185b
Signed-off-by: Fan Zhang <fanzhang.oss@gmail.com>
2024-03-21 13:34:18 +00:00
Florin Coras
e565902654 tls: avoid app session preallocation
Since async rx event infra decouples notification event generation from
delivery we no longer run the risk of having tls realloc session pools
while session layer still holds a pointer to the accepted/connected tcp
session.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1bb429a058707aba1d4f32ea33615a2367e66969
2024-03-20 20:07:05 +00:00
Tom Jones
40c95f50ba vppinfra: Define EBADFD on FreeBSD
Type: improvement
Change-Id: I303a8a7333d44f6eab902d4d61023cfa96760dd2
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-20 16:44:20 +00:00
Tom Jones
3076c69a9e vcl: Only build vcl_ldpreload on Linux
vcl_ldpreload requires some additional porting for FreeBSD, until that
can be completed only build on Linux.

Type: improvement
Change-Id: I9b0942114252a0c6241640d2e454861c2b5d4304
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-19 15:21:05 +00:00
Florin Coras
ac60efd523 tls: handle attepts to renegotiate hs
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I549d0c8715e5c06bfc22be26ca1dc78ec3c29a61
2024-03-18 19:20:38 +00:00
Stanislav Zaikin
dc4d21e9ce vapi: uds transport support
introduce ability to connect over unix socket instead of shared memory

Type: improvement

Change-Id: Id9042c74e33ad4e418896c4d7ae48bb9106195c9
Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2024-03-18 17:30:07 +00:00
Damjan Marion
3eb6cbec50 vppinfra: os agnostic api for getting CPU information
Avoid direct sysfs reads when possible...

Type: improvement
Change-Id: I2b84cd18f3da47925d068951f24b79b5b6e20bb1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-18 16:01:35 +00:00
Damjan Marion
8799bf6ca6 build: add option to specify supported OS list for plugin
Type: improvement
Change-Id: I0d6f11d5ece19c5e0e00dfdadc9d4c09274ae8e1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-18 16:01:25 +00:00
Klement Sekera
99c317a606 ip: reassembly - return correct value
If already enabled, return 0 to indicate success.

Type: fix
Change-Id: I4a182e14df9b05698ad93d596a97c46a020fd54b
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2024-03-15 19:05:18 +00:00
Tom Jones
8942e07332 misc: Add platform specific header on FreeBSD
Type: improvement
Change-Id: Ia23414e87d64567d5124b8297315ed7a426c3651
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-03-15 17:48:08 +00:00
Florin Coras
39e7f2e650 vcl: fix bitfield truncation with clang16
Reported by phlax while building Envoy with clang16

error: implicit truncation from 'int' to a one-bit wide bit-field
changes value from 1 to -1
[-Werror,-Wsingle-bit-bitfield-constant-conversion]

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib1b731780cf27a9498299f0424a06000dc67e81e
2024-03-13 17:06:32 +00:00
Andrew Yourtchenko
e574736322 misc: fix the static vppctl build
Change I58e1ae1c91f4a62e80eaf4e16e9932d8bab17c74 has introduced a reference to config.h,
which is not there in a case of building a static standalone vppctl.

Solution: add a variable STATIC_VPPCTL which, when defined, avoids including
the missing include file. Thanks a lot to Damjan for the suggestion.

Type: fix
Change-Id: I133235ba07e5c2e0d5669be9c2292cab0fdf436f
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2024-03-13 13:39:22 +01:00
Klement Sekera
e45fac02fd papi: use correct size for fixed length strings
This is required for correct packing of unions.

Type: fix
Change-Id: I92d04b1bbcb3fc3fe06474d8f2c59ed3502e6bd6
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2024-03-13 07:57:44 +00:00
Klement Sekera
ceed1e3b81 tests: use proper unit test skip instead of prints
Using unittest skip instead of print unclutters display by not printing
skip messages when not applicable, e.g. when somebody runs tests which
are unrelated to netns tests, e.g. with FILTER=vapi.

Type: fix
Fixes: e416893a59
Change-Id: Ie09e213249aa47da7e4ff484c3d072fbce3c2001
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2024-03-12 19:33:12 +00:00
Damjan Marion
c3148b1be8 misc: remove GNU Indent directives
Type: refactor
Change-Id: I5235bf3e9aff58af6ba2c14e8c6529c4fc9ec86c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-12 19:29:56 +00:00
Dmitry Valter
e2ed599331 vpp: set asan default options
set asan default options in vppctl and vpp_get_stats

Type: improvement
Signed-off-by: Dmitry Valter <d-valter@yandex-team.com>
Change-Id: I58e1ae1c91f4a62e80eaf4e16e9932d8bab17c74
2024-03-12 16:52:01 +00:00
adrianvillin
28bd8f07d3 hs-test: experimental support for multiple test instances
- appending PID to interface and container names
- added a check for used IP addresses
- TestEnvoyProxyHttpTcp and TestTcpWithLoss are broken when running multiple instances

Type: test

Change-Id: Ib917079ec7cf851dee59ff9c67e74f48c7c5e3c6
Signed-off-by: adrianvillin <avillin@cisco.com>
2024-03-12 16:48:46 +00:00
Maxime Peim
7a2961523e urpf: fix uprf_update prototype
Type: fix
Change-Id: Idc325a096903dcdfad5157db2eb728f2e61ce974
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2024-03-11 10:54:24 +01:00
Florin Coras
236534136d session: use no for ports in transport port allocator
Type: improvement

Change-Id: Ia1d8aaa3c51938cfa15dd09102471f52ebe67a3d
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-03-10 00:13:01 +00:00
Florin Coras
91bfe5b658 session: fix port alloc for fixed lcl port reuse
Type: fix

Change-Id: If30d1aa8aa752ae4bddde776832a3009ebc7e316
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-03-09 04:29:33 +00:00
Alexander Chernavin
4c7305f124 flowprobe: fix flush callbacks when multiple workers
IPFIX buffers are stored on a per worker thread basis. Currently, the
flush callbacks will flush only buffers stored for the main thread. And
buffers for worker threads will not be sent until their size reach the
path MTU configured for the exporter. So if traffic is constant, the
problem will unlikely to be visible. Buffers will be sent once they
reach the maximum size. However, if traffic stops at some point and
flush is triggered in order to make the plugin send all currently
buffered data, this will not happen. And collectors will not receive
that data. The plugin will keep the remaining data until traffic starts
again, the buffers reach the maximum size, and be sent.

With this fix, flush buffers for worker threads and for the main thread
when the flush callbacks are triggered.

This will allow to remove @tag_fixme_vpp_workers from the unit tests
that don't set timers. The tests that set timers will still be failing
for other multi-worker related problems.

Type: fix
Change-Id: I9a7d9cef8ddbec7ee68c79309e48e7bc0953d488
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2024-03-07 21:18:03 +00:00
Andrew Yourtchenko
93d38823f9 misc: VPP 24.02 Release Notes
Type: docs
Change-Id: I4209b4edf387f2d7b88ecc338cca3b4901210ed2
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit 455960759b5417c767ed331748c7ee76662ffd18)
2024-03-06 01:01:23 +00:00
Matthew Smith
205ed8f884 ip: force full reassembly before virtual
Type: improvement

The vnet buffer metadata for full IP reassembly and shallow virtual
reassembly overlaps. If you have full reassembly and virtual reassembly
enabled on the same interface and virtual reassembly happens to process
packets first, full reassembly will stomp on the metadata populated by
virtual reassembly.

Virtual reassembly gets enabled implicitly when NAT feature nodes
are enabled. Those NAT feature nodes rely on the virtual reassembly
metadata being populated correctly in order to find L4 proto & ports.
When NAT and IP full reassembly are both enabled on an interface, NAT
can drop fragmented packets because the virtual reassembly metadata
can be overwritten by full reassembly.

Ensure that full reassembly runs before virtual reassembly. Add a
runs_before dependency to ensure that ip4-full-reassembly-feature
runs before ip4-sv-reassembly-feature.

There was a duplicate VNET_FEATURE_INIT() for
ip4-full-reassembly-feature. It seems to have been intended for enabling
ip4-full-reassembly-custom as a feature node, but its contents are
identical to the earlier VNET_FEATURE_INIT() for
ip4-full-reassembly-feature. Removed the duplicate.

Change-Id: Ie600b854d4ceb90a7cb736810140d410b8f72447
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2024-03-05 23:31:40 +00:00
Georgy Borodin
904459ff32 dpdk: correct waiting times
When link state interval is 3 and stats interval is 10, updates
for stats will be made every 12 seconds (next number after 10,
that divisible by 3). And if you get counters every 30 secs, you
will get ideal "saw"-line instead of real smooth chart.

This commit makes smooth line on stats intervals that are divisors
of the charts update interval (regardless of link state interval),
and makes it possible to configure them.

Type: fix
Fixes: cb9cadad578297ffd78fa8a33670bdf1ab669e7e
Change-Id: Ia4350467be2b0ec0c1be37c7fda63f43b3330f44
Signed-off-by: Georgy Borodin <bor1-go@yandex-team.ru>
2024-03-05 18:53:01 +00:00
Vladislav Grishenko
29e916a07c vpp: fix stdin vs non-interactive command clash
In case of both stdin and non-interactive inputs are there
vppctl parses them all, causing mixed corrupted output:
  $ echo foo | vppctl sh bar
  show: unknown input `bar'
  unknown input `foo'

This is not desired, stdin should be ignored if there's a command
but still allow stdin commands - following cases are still equal:
  $ vppctl foo
  $ echo foo | vppctl

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I98667391627150c98a57d49ae544e48ef3351f34
2024-03-05 18:51:37 +00:00
Monendra Singh Kushwaha
09c6cae8c8 octeon: add support for VF device
This patch adds support for VF and loopback device.

Type: feature

Change-Id: I1ea92f3a1161851957206300ab921c27290b0305
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
2024-03-05 18:50:36 +00:00
Vladislav Grishenko
3026ffa091 vlib: fix initial stats time for the process nodes
Uninitialized stats time for new dynamic processes (like unix
cli) leads to invalid and too high clocks diff, breaking the
stats collecting.

  $ sudo vppctl sh runtime | grep unix
  unix-cli-new-session  any wait      0  0  30   2.72e3  0.00
  unix-cli-process-0      active     14  0  27  3.73e15  0.00
  unix-epoll-input       polling   6464  0   0   3.56e6  0.00
  unix-epoll-input       polling  68360  0   0   1.31e3  0.00

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Ic70678b67a3fb3f78ed4a1a03077ae243ed5d7cd
2024-03-05 18:49:49 +00:00
Vladislav Grishenko
fb9d1ac843 vnet: fix format of deleted sw interfaces
As similar 535364e90459566b603661c3dbe360c72f59ad71 is
merged, printing possibly deleted interfaces by index
only in all the rest cases.

Type: improvement
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I4fa58b382c0279ff893523ba0188fdb9b09e10af
2024-03-05 18:48:28 +00:00
Damjan Marion
7ad751ba53 vppinfra: SHA2-256 ARM ISA support
Change-Id: I0fcda3e7afaab037bd12d0079d6639c6cbe8647e
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-04 14:07:25 +00:00
Mohsin Kazmi
7ad43a4184 af_packet: fix the device input feature arc support
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I1c900bbe441c6797215f16e99b71149904aa745f
2024-03-04 13:10:03 +00:00
Maxime Peim
2cc14de7eb misc: fix icmp
- fix ICMPv6 lookup FIB (don't reset sw_if_index[VLIB_TX] to -1)
- add locally generated flag in ICMPv4 buffers (reflect ICMPv6)

Type: fix
Change-Id: If25a176a9952cbe185a030f8b136718af1bff9e8
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2024-03-04 11:30:24 +00:00
Vladislav Grishenko
5be4b869a4 bpf_trace_filter: support bpf filter optimization and dump
BPF filter w/o optimization can take x2 - x3 more instructions,
causing significant slow down in fast path.

Enable pcap optimization by default via cli and introduce api v2
with pcap optimization control, keep v1 for a while as it exists
in previous release already.
Intriduce bpf filter cli dump, similar to tcpdump -d.

Also fix memleak, function name typo, cli pcap format hint and
add related tests.

Type: improvement
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I92b2b519e92326f1b8e1a4dda6a3e3edc52f87ad
2024-03-04 09:29:12 +00:00
Damjan Marion
4b6614030f vppinfra: add os_get_online_cpu_core() and os_get_online_cpu_node()
Type: improvement
Change-Id: I6f99f09c7724ce656a4f41a1d5f9c88d74c00faf
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-04 08:53:08 +00:00
Vladislav Grishenko
2921e02341 ip: fix warning on interface ipv6 prefix remove
Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I428f52abbdddd9caca9b0f619a0e934f96ac0b4a
2024-03-04 07:57:03 +00:00
Vladislav Grishenko
dea806da53 fib: fix crash while adding intf-rx routes
Fix crash while adding intf-rx ip4 and ip6 routes via api due
invalid exporting of interface rx routes as attached.
Also, add missed route path via rx-ip6 cli support.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I15711c8c0787398dd7e3baa4787019bb1f317666
2024-03-04 07:51:16 +00:00
Vladislav Grishenko
eb5a08e91d svm: fix svm queue overwrite while adding 2 elements
Adding two elements to the full svm queue passes exact
bounds check, therefore tail gets overwritten w/o any
waiting. Fix it with requiring at lease two free slots.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I704ee606c47b523952cb965f848339ae1988cb60
2024-03-03 18:47:41 +00:00
Samvel Vartapetov
7f5f21ebc4 udp: fix ipv6 udp punt show
Type: fix
Signed-off-by: Samvel Vartapetov <svartapetov@yandex-team.ru>
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I57cba1e724f851419c7dfdee896568fc7416feaf
2024-03-03 01:12:14 +05:00
Florin Coras
4f3da9c1f7 session: add api cb for listen and unlisten
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I28ccebf4d2f0728dd174ab3ee77a0d7ad4b90951
2024-03-01 22:22:53 +00:00
Damjan Marion
242fe13c62 crypto-native: fix AES-CBC encrypt loop
Type: fix
Change-Id: I11cc52ff3867277e6591efb061f96cadfcc70c88
Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-01 15:33:53 +00:00
Tom Jones
46bddc3b4a dhcp: Compare DIUD_LL as a network short
The existing comparision triggers the following clang assertion:

    error: result of comparison of constant 50331648 with expression of type
    'u16' (aka 'unsigned short') is always true

Section 9.1 of RFC3315 describes the DUID type field as:
    "A DUID consists of a two-octet type code represented in network byte"

correctly convert the local type to a network short for the comparison.

Type: fix
Change-Id: I7cb048035bd5e06372e29471ae6004ee1b2191b9
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-29 14:57:45 +00:00
Monendra Singh Kushwaha
3d1459b142 octeon: add flow offload infra
Type: feature

Change-Id: I3485e1627eafc5125255985003573247e7562db2
Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
2024-02-28 15:35:52 +01:00
Niyaz Murshed
7f050d9749 crypto: CLI to change dispatch mode
This change aims to affect crypto_sw_scheduler behavior,
but all the edits end up in vnet/crypto.

After 9a9604b introduced adaptive mode for crypto dispatch,
the performance of async mode at lower rate got worse.

A work around for CSIT test is done by changing dispatch mode via explicit API call
in 139aba2047

In this change, the CLI is brought back to allow user to fix the
dispatch mode.

set crypto async dispatch mode <polling|interrupt|adaptive>

Type: improvement
Change-Id: I029e98aa25889eddcf62e75a6c78926cdee862ef
Signed-off-by: Niyaz Murshed <niyaz.murshed@arm.com>
2024-02-28 13:40:03 +00:00
Florin Coras
ea158d64a0 tls: pass reset ntf to engines
Type: improvement

Change-Id: Ie042605e50656229874b7a93638f0f04c894410f
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-02-27 18:49:20 +00:00
Florin Coras
7c90be5e29 session: fix transport closed and disconnect race
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie7ff4bac22e9dbb449610072b52d1ec4e46fe757
2024-02-27 18:49:06 +00:00
Monendra Singh Kushwaha
4af3fdfdd0 dev: add per-port vnet flow
Type: feature

Change-Id: If63f39211288ab2eba8bc1ab50a2a4c7755abc66
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
2024-02-27 15:37:20 +00:00
Florin Coras
4e32bc6b6d tcp: fix fin retransmit when out of buffers
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I787825dea7f82748537cc4372104cc6647cf2132
2024-02-26 18:43:48 +00:00
Tom Jones
5bce60353c hsa: Undef libepoll-shims close on FreeBSD
libepoll-shim has some hacks to enable functionality, one of these
redefines close as a macro. This conflicts with a close call back. On
FreeBSD undefine this macro at point of use.

Type: improvement
Change-Id: I7b4f7cd874f3451d76c580cf999369426d9e89c2
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-26 18:04:11 +00:00
Mohsin Kazmi
84847c4762 virtio: fix the packed ring support
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: If27702d2a9755e0e0a6eaeab4cf26b4974444b44
2024-02-26 16:15:48 +00:00
Tom Jones
4e16e782ad memif: don't include prctl.h
Type: improvement
Change-Id: I3ab8df625524b5ff85e62760f5e29daf0d650773
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-26 09:23:15 +00:00
Florin Coras
60732dff6d tls: initialize app session app wrk
Type: fix

Change-Id: I8832839738b96495bd775a778dd736bb25e1236c
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-02-23 18:06:36 -08:00
Tom Jones
eceef16b5c svm: Use ftruncate to expand svm on FreeBSD
Linux doesn't support the Linux idiom of using lseek and a write to set
the size of a file, instead use ftruncate to accomplish the same effect.

This change is taken from the Nanoteq VPP port commit:
04a1b19b37

Type: improvement
Change-Id: Ie0b83e751b8b8f20b6814e5c9f760035747dfad9
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-23 18:48:29 +00:00
Tom Jones
b613d411a4 vcl: Use FreeBSD specific errno value for bad fd
Type: improvement
Change-Id: I7693f2647f65f662c9b20f77bbf7e1a530b58259
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-23 10:51:40 +00:00
Tom Jones
5ed27ef8b6 build: Discover libepoll-shim on FreeBSD
FreeBSD doesn't offer epoll, but an implementation which uses kqueue is
available as an external library. On FreeBSD in subsystems which require
epoll have cmake look for libepoll-shim.

Type: improvement
Change-Id: Iafd5406a9e2ebaa53fd94034489ffbbf87a7d040
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-23 10:07:49 +00:00
Tom Jones
72cb9f7e44 vlib: Use platform specific headers for sched.h
FreeBSD only defines posix scheduling policies, remove the others from
the for each look to allow build.

Type: improvement
Change-Id: Ifdb9414417e8b6ffdf216fd001708b347c496b97
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-23 10:02:34 +00:00
Tom Jones
532a1ce98a build: Add support to add_vpp_library for platform specific sources
Add support for adding Linux and FreeBSD specific sources to
add_vpp_library and support for installing Linux specific headers. Don't
add support for FreeBSD specific headers until we have some to install.

Type:	improvement
Change-Id: I38549cf4d71999b71b3298e529323956e54ddc36
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-23 10:01:47 +00:00
Benoît Ganne
89c7b545dd ip6: ECMP hash support for ipv6 fragments
Type: improvement

Change-Id: I41f70e5977fedbf0050205ebe52126ef373ebc06
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2024-02-22 08:24:02 +00:00
Florin Coras
8074fc6209 tls: fix transport endpoint get
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Idb8cc576168ce0ffa8f06be1acef4be4b3b29433
2024-02-20 11:27:03 -08:00
Maxime Peim
7217dcdb54 pg: fix stream pg interface
When an other interface is specified to generate packets from, we should
bind its sw_if_index to the pg interface to use.
Fix if_index_by_sw_if_index variable name, and force to specify a pg
interface to source traffic from.

Type: fix
Change-Id: Ib3e6dca92774b307def82926fc09945b7998267d
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2024-02-20 17:20:43 +00:00
Kaj Niemi
088d1a0168 build: Enable building on AlmaLinux 9
AlmaLinux is identical to Rocky and can be made to work with
the same build dependencies

Type: feature

Change-Id: I24bb8781a02c15f887c9c26cc98621e6256f4115
Signed-off-by: Kaj Niemi <kajtzu@a51.org>
2024-02-19 18:19:24 +00:00
Tom Jones
078affa92c vnet: include platform specific un.h
On FreeBSD define UNIX_PATH_MAX so it is available in punt.c. FreeBSD's
max path is 4 bytes shorter than Linux's.

Type: improvement
Change-Id: I2c4b7aa11246213575b557fab44669706885e6b7
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-19 18:12:06 +00:00
Tom Jones
ac80b8be8b vppinfra: Stub out get_current_cpu and get_current_numa on FreeBSD
FreeBSD has its own set of syscalls for getting current CPU and NUMA
domain information. Stub out these calls and return CPU 0 and NUMA domain
0 as placeholders until we bring in FreeBSD specific calls.

Type: improvement
Change-Id: Id61df0273b0bcc6acf4844ee626e4f246f9f217b
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-19 18:11:34 +00:00
Monendra Singh Kushwaha
03b7ac929e dev: fix type for uint32 arg value
Type: fix

Change-Id: Ib09d6a0dfc95d82ecfd2ff123be9004cb038d0d4
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
2024-02-19 18:10:38 +00:00
Monendra Singh Kushwaha
3e594d6d7d build: bump octeon-roc version to 0.3
This patch updates cache line size in octeon-roc library.

Type: fix

Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
Change-Id: Ifbb6e7d2a5436a88ef10d22c414112edc23e0b35
2024-02-19 18:10:07 +00:00
Lijian Zhang
97c9f5e7c7 crypto-openssl: refactor openssl API usage
For the openssl crypto engine based cipher encrypt/decrypt and HMAC IPSec
use cases, the openssl API calls of doing ctx init and key expansion are
moved to initialization stage.

In current implementation , the ctx is initialized with "key" and "iv" in
EVP_EncryptInit_ex (ctx, 0, 0, key->data, op->iv)
in data plane, while the ctx can be initialized with 'key' and 'iv' separately,
which means there could be two API calls:
 1. EVP_EncryptInit_ex (ctx, 0, 0, key->data, 0)
 2. EVP_EncryptInit_ex (ctx, 0, 0, 0, op->iv)

As the 'key' for certain IPSec SA is fixed and known, so call #1 can
be placed in IPSec SA initialization stage.
While call #2 should be kept in data plane for each packet, as the "iv"
is random for each packet.

Type: feature
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Change-Id: Ided4462c1d4a38addc3078b03d618209e040a07a
2024-02-19 15:37:19 +00:00
Lijian Zhang
6f8252e83c wireguard: notify key changes to crypto engine
This is a prerequisite patch for the following openssl API optimization
patch, which tries to offload openssl ctx init and key expansion work to
the initialization stage.

Wireguard adds crypto keys via vnet_crypto_key_add (), and whenever it
modifies the keys, the underneath openssl crypto engine shoud be informed
of the changes to update the openssl ctx.

Type: feature
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Change-Id: I3e8f033f3f77eebcecfbd06e8e3bbbfdc95a50e2
2024-02-19 15:36:36 +00:00
Matthew Smith
ff71939c30 ipsec: check each packet for no algs in esp-encrypt
In esp_encrypt_inline(), if two or more consecutive packets are
associated with the same SA which has no crypto or integrity algorithms
set, only the first one gets dropped. Subsequent packets either get sent
(synchronous crypto) or cause a segv (asynchronous crypto).

The current SA's index and pool entry are cached before it can be
determined whether the packet should be dropped due to no algorithms
being set. The check for no algorithms is only performed when the cached
SA index is different than the SA index for the current packet. So
packets after the first one associated with the "none" alg SA aren't
handled properly.

This was broken by my previous commit ("ipsec: keep esp encrypt pointer
and index synced") which fixed a segv that occurred under a different
set of circumstances.

Check whether each packet should be dropped instead of only checking
when a new SA is encountered.

Update unit tests:
- Add a test for no algs on tunnel interface which enables
  asynchronous crypto.
- Send more than one packet in the tests for no algs.

Type: fix
Fixes: dac9e566cd16fc375fff14280b37cb5135584fc6

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I69e951f22044051eb8557da187cb58f5535b54bf
2024-02-19 15:35:54 +00:00
Florin Coras
37127f7bcc udp: use transport port refcnt on accept
Use udp transport refcnt instead of local port refcnt when accepting new
connections.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibc34677b1138682497f98e96b6fddb5b96094ff9
2024-02-18 18:54:55 +00:00
Tom Jones
9a97fb8ad7 svm: Only include sys/user on Linux
Type: improvement
Change-Id: Idb318eb386617013015c43153bf0bd92fa28b9b6
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:08:21 +00:00
Tom Jones
9447adc429 vnet: Add required header for pthread_np
Type: improvement
Change-Id: Ia9295b79340a18de6eb5fe80877dcf4ce97b35eb
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:08:04 +00:00
Tom Jones
67e7f016d2 vppinfra: Place hugepage MMAP call behind linux specific ifdef
Type: improvement
Change-Id: I3a48ec4fd4a4063b6e3792b87def7bb796fc947c
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:06:31 +00:00
Tom Jones
9bf4f8fb58 vnet: Use platform specific netlink headers on FreeBSD
Type: improvement
Change-Id: Ifbd84a45edc82c79ac2850dd70ecdd2f9f1289ae
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:05:33 +00:00
Tom Jones
0f7830023a vnet: Disable tuntap build on not Linux
tuntap requires porting on FreeBSD, only build on Linux for now.

Type: improvement
Change-Id: I448c462b31f3bc06f291a95d0ff5df9d6f8f24b8
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:03:01 +00:00
Tom Jones
aaa2a89a3d vlib: Only init vfio on Linux
Type: improvement
Change-Id: Id1c72928324b85bc67860e600722bf8baeff45b2
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:02:27 +00:00
Tom Jones
646e5d2ad4 vpp: Add required socket headers on FreeBSD
Type: improvement
Change-Id: I948e447082233187d9ca794ca56a62fad4592e13
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:01:57 +00:00
Tom Jones
e12f69f773 vppinfra: Provide FreeBSD implementation of clib_mem functions
Working from the implementation in linux/mem.c add FreeBSD specific
functionality. This duplicates parts of the Linux implementation and a
depuplication job could be run in the future.

Stub out some parts of the API for now, they are either use unavailable
features on FreeBSD or require further implementation than this initial
implementation.

Type: improvement
Change-Id: I1e443e32304d19776a9a4d5e34adfa16ec919427
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 16:00:09 +00:00
Tom Jones
2cbbbb6d15 build: Add FreeBSD as a supported platform for cmake
Allow FreeBSD as a platform in the main CMakeLists file. This requires a
correct target for the compiler and an explicit name in the system
check.

The included subdirs require further changes to build, but the compiler
needs to find them before it can complain.

Type: improvement
Change-Id: Ic56fe68290519ef5d3ed61082e7fb0ba0528a3fc
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 15:59:11 +00:00
Tom Jones
61b4efc4da vnet: Provide platform specific if_tap headers
Type: improvement
Change-Id: Ia5cec0afc7f929491e495bb337493e64f752d75f
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 15:58:01 +00:00
Tom Jones
6ce1e930e8 vnet: Only build tap on Linux
tap requires some porting on FreeBSD, while we wait for those changes
only build tap on Linux.

Type: improvement
Change-Id: I4361bf43764fdb046c2138d4a2ee5d7efa31bd5a
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 15:57:17 +00:00
Tom Jones
393bfa786c vpp: Add platform specific headers for socket and inet
Type: improvement
Change-Id: Idcedc14089a49483d83c28a82ecb79d1b856f225
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-18 15:53:09 +00:00
Florin Coras
d1e17a8738 tcp: retransmit fins in last-ack
Fix instances where timers are reset after programming fin.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib80e3a401d585f388a97c7f2bb62e68ee774d50d
2024-02-17 02:25:07 +00:00
Florin Coras
81a6ffced1 udp: unregister ports on all cleanups
UDP transport port refcount is incremented even if port is shared. So
decrement it, by unregistering, whener udp connections are cleaned up.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id0a2c60c5faf4dea8b2cd9ded0334934ad9e918c
2024-02-16 18:18:56 +00:00
Denys Haryachyy
d5d510f795 vppapitrace: Fixed trace dump API result issue.
Set last thread id and last packet position in TRACE_DUMP_REPLY.
To enable collection of traces from multiple workers using iterator.

Type: fix

Change-Id: I69872af4f6981d50cd050fa3d16de2a3c0d6b496
Signed-off-by: Denys Haryachyy <garyachy@gmail.com>
2024-02-16 15:29:07 +00:00
adrianvillin
fbf5f2b030 hs-test: shortened interface names to avoid character limit
Type: test

Change-Id: I09df597ccb8a3c4af47b8a36010afb81df533236
Signed-off-by: adrianvillin <avillin@cisco.com>
2024-02-15 18:35:34 +00:00
Florin Coras
0ded4890be tls: mark ho done atomically after ctx init
Make sure ctx is initialized before ho is marked as done.

Type: fix

Change-Id: If0525a9890a56e289e2ab006c669a9d64dc6505d
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-02-15 17:52:51 +00:00
Florin Coras
e439b1e70e session: postpone ct cleanup if rx evt pending
Type: fix

Change-Id: I8cfaa62abd38d5356263b0ffd428638d1a027617
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-02-15 17:20:41 +00:00
Benoît Ganne
a421d564cd build: add fib configuring option
Allow to select 8-8-8-8 or 16-8-8 mtrie FIB implementation.

Type: improvement

Change-Id: I2f4aec8bfec987d3f3d9f9cc5a16fabf4b6cc2ac
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2024-02-15 08:34:58 +00:00
adrianvillin
7c675471e8 hs-test: improved logging
- improved readability of some error messages
- printing container logs to stdout on test failure (last 20 lines)

Type: test

Change-Id: Idbb358bdd89aa7b1a6bdc9d96bf029d4c299ce64
Signed-off-by: adrianvillin <avillin@cisco.com>
2024-02-15 02:38:10 +00:00
Naveen Joy
0215ef1010 tests: refactor virtual interface tests
Split virtual interface tests in VPP into smaller and modular
tests for testing various interface types and features.

Type: test

Change-Id: Ic38af88379f75eee3090679d411edbdc8fd5d2e5
Signed-off-by: Naveen Joy <najoy@cisco.com>
2024-02-14 22:08:20 +00:00
Niyaz Murshed
28aef29e01 tls: fix compilation error
After changes done in https://gerrit.fd.io/r/c/vpp/+/40281 ,
mbedtls plugin is failing to build if enabled.

Discussion https://lists.fd.io/g/vpp-dev/topic/104344802#24060

Type: fix
Signed-off-by: Niyaz Murshed <niyaz.murshed@arm.com>
Change-Id: Iee58b69301ac64f058bca0a7f7a0dedd2def4b35
2024-02-14 18:46:56 +00:00
Denys Haryachyy
f40a354dab ikev2: dump state and profile name in CLI and API
Type: improvement

Change-Id: Ide4b45da99e3a67376281f6438997f3148be08e5
Signed-off-by: Denys Haryachyy <garyachy@gmail.com>
2024-02-14 18:47:23 +02:00
Florin Coras
e81f27ffb2 vcl: fix epollet test for unhandled evts
Argument to vcl_epoll_ctl_add_unhandled_event is often the result of an
and between events and EPOLLET which is larger than u8

Type: fix

Change-Id: I8c98f557fa1db9f3eb79c90ecdd60ac9366d4d40
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-02-13 17:19:20 +00:00
Tom Jones
775002358f svm: Add FreeBSD specific signal handling path
FreeBSD's siginfo_t doesn't have the ptr value used on linux to encode a
token. Fow now recover the code from siginfo_t and leave the opaque
value as 0.

Type: improvement
Change-Id: Ic6ef96f018b326b99d68534a4488cfc49fdf16e1
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:33:06 +00:00
Tom Jones
7ec62fb0cd vppinfra: Put clib_perf* behind Linux checks and provide stubs for FreeBSD
As a placeholder stub out clib_perf functions on FreeBSD, the interface
for performance counters on FreeBSD is different and will require its
own implementation.

Type: improvement
Change-Id: I61511ebe5ee1fd6fe93d3179c7843c811f47a846
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:28:51 +00:00
Tom Jones
a0b8538837 vppinfra: Add netlink header on FreeBSD
FreeBSD has support netlink since 13.2, but keeps its header in a
slightly different place. Correctly include netlink/netlink.h for
FreeBSD.

Type: improvement
Change-Id: Iec78ca72db74ea7f9c874e7039c7d17b6321f9dc
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:28:21 +00:00
Tom Jones
93fc6920fb vppinfra: Protect Linux specific features behind CLIB_LINUX
Place Linux specific features behind CLIB_LINUX. The previous #ifdef
calls would still pass even if CLIB_LINUX is set to 0 in clib.h, instead
use #if.

Type: improvement
Change-Id: Ibe4424eee4bc0065f54764b017b9a56a3e854380
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:27:26 +00:00
Tom Jones
b077d6678c build: Limit external libraries on FreeBSD
Limit the libraries we build on FreeBSD. This change intends to get us
closer to building on FreeBSD, DPDK will require a larger set of changes
so remove it until those changes are ready to integrate.

Type: improvement
Change-Id: I0f672a2b5bc30f2228020049fa71a81a2569ef54
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:26:41 +00:00
Tom Jones
caf9d4f4f8 svm: Include stdint on FreeBSD
On FreeBSD we need to include stdint.h to get __WORDSIZE.

Type: improvement
Change-Id: I784aa0856fd8298f33016b7ccedecfa3672d5429
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:25:18 +00:00
Tom Jones
7d2978dab9 vppinfra: Make program counter printing more portable
Finding the program counter in the ucontext struct is platform and
architecture specific, place the Linux checks inside an #ifdef and add a
look up for the FreeBSD amd64 specific naming.

Type: improvement
Change-Id: I42fcef5f20227c23d84acee336e37c4870146bb4
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:24:45 +00:00
Tom Jones
249f0dcdf6 vnet: Don't use __unused for struct padding
__unused is a clang keyword, this struct member will trip the build when
using clang. Instead call the unused padding 'pad' which should be clear
to the purpose if not the usage.

Type: improvement
Change-Id: I0abae34841651be1ef6b7d94864f0dc8185f0733
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:20:18 +00:00
Tom Jones
7c0415450b vppinfra: Add a stubbed out test_perf function for FreeBSD
Type: improvement
Change-Id: If136e0854dbaecfa62fc009ca2b0b94e8d9a56f2
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:18:41 +00:00
Tom Jones
77ce67f70b vppinfra: MAP_HUGETLB isn't available on FreeBSD
Don't use the MAP_HUGETLB mmap flag on FreeBSD as it isn't available on
the platform.

Type: improvement
Change-Id: Ie2046601c693f9ef12cf8113d6dbd87c322f1cf0
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:17:02 +00:00
Tom Jones
cb3372ddc8 vppinfra: Only prealloc hugepages on Linux
FreeBSD doesn't support sysfs or preallocating hugepages directly.  In
lieu of refactoring clib_sysfs calls place this one behind an #ifdef
linux.

Type: improvement
Change-Id: I4079ca70175e4cec44d913db2b0407a3ca6306c9
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:16:43 +00:00
Tom Jones
000b5e1b71 vppinfra: Don't build perfmon on FreeBSD
FreeBSD has platform specific APIs for interfacing with performance
counters. Until we bring in FreeBSD support, don't build perfmon on
platforms which aren't linux.

Type: improvement
Change-Id: Iabc418922c0d2e851c6098508761135f53433ae8
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:16:23 +00:00
Tom Jones
b2e0ce96ea vppinfra: Place SIGPWR behind a linux define
The SIGPWR signal is specific to Linux, place it behind a Linux flag to
help the build on FreeBSD.

Type: improvement
Change-Id: Ie36c2ceb201afff98e92bbe64595c3953b11c457
Signed-off-by: Tom Jones <thj@freebsd.org>
2024-02-13 16:13:19 +00:00
Steven Luong
58f37b21ea fib: contention with DP on deleting a route
Add vlib_worker_wait_one_loop prior to invoking dpo_reset
upon uninstalling a fib entry to avoid contention with DP.

Type: fix

Change-Id: If2a6c4cb9b5629dd61e506ab9f9c3e6aef121b45
Signed-off-by: Steven Luong <sluong@cisco.com>
2024-02-12 16:55:11 -08:00
hsandid
d1fa7ae03e af_packet : fix crash on interface creation
Type: fix

Attempting to create a host-interface with an invalid af_packet name
causes a crash, as we attempt to read the contents of a null ptr.

Change-Id: Ia31ae21684c2b66baa1ceaadf29e19fae33c4ed4
Signed-off-by: hsandid <halsandi@cisco.com>
2024-02-12 16:29:22 +00:00
Vratko Polak
04fd51c03c buffers: bring back cache occupancy improvement
The improvement was removed in 40129,
causing 5-40% regressions in AVF tests.

There is a memory-speed trade-off,
this change prefers speed over memory efficiency.

Ideally, the choice should be configurable,
but that is not easy to achieve, considering
how early is vlib_buffer_main_init called.

Type: fix
Fixes: 038dad7ef29b0b724071edb5f8cc7a9845584454

Change-Id: I4746f3634abe6d233c9d092a372de05b3d1ae4b6
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2024-02-12 16:20:31 +00:00
Benoît Ganne
7286065911 ip_session_redirect: export symbols
Add/del functions can be used from external modules.

Type: improvement

Change-Id: I267bcfacd58970bcacae13744d8acc690b87d2fc
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2024-02-12 09:59:57 +00:00
Atzm Watanabe
d4f405a70f ikev2: accept rekey request for IKE SA
RFC 7296 describes the way to rekey IKE SAs: to rekey an IKE SA,
establish a new equivalent IKE SA with the peer to whom the old
IKE SA is shared using a CREATE_CHILD_SA within the existing IKE
SA.  An IKE SA so created inherits all of the original IKE SA's
Child SAs, and the new IKE SA is used for all control messages
needed to maintain those Child SAs.

Type: improvement
Signed-off-by: Atzm Watanabe <atzmism@gmail.com>
Change-Id: Icdf43b67c38bf183913a28a08a85236ba16343af
2024-02-09 14:19:31 +00:00
Florin Coras
d9b4d9fb1f udp: add cli to dump transport ports
show udp transport ports

Dumps list of ports registered by udp transport, as opposed to udp
local, and their refcount.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If3cbe51a7176cb89fa38b524defffbbd76af8f58
2024-02-07 00:17:36 +00:00
Florin Coras
f9bdc03c1c session: guard session lookup table allocs
Session lookup tables could be allocated from workers, e.g., connects
are done from first worker. Make sure consumers are not affected by
stopping workers.

Type: fix

Change-Id: I63b53c58b41ce91b08f50a2325c69c9f9fd25ed3
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-02-02 13:22:31 -08:00
Florin Coras
e060b0a079 vlib: flush rpcs on worker sync
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I89624254649089e497d119eb6cee2cecf3dc11f3
2024-02-02 17:46:44 +00:00
Florin Coras
4cadd3b15b vlib api: move wrkr rpc flushing to vlib
Move vlib worker rpc flushing to main worker from memclnt api into vlib.
RPCs are no longer delivered via binary api queues

Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5b8761a57d1f4a1f2220e860cfb2e6b980f46f6d
2024-02-02 14:44:26 +00:00
Florin Coras
d7f17a2393 tls: set app closed flag in framework
Set the flag in tls framework as opposed to tls engines. This is similar
to passive close.

Type: improvement

Change-Id: I0c2a774b1ef9d7ec6ba74daf1678ea449815184f
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-01-31 17:08:18 -08:00
Florin Coras
4a98b9360e tls: convert ctx fields to connection flags
Type: refactor

Change-Id: I527bbc1cf2e7b6d06fd0c88b7563fb59ed28bc40
Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-01-31 22:01:57 +00:00
Anton Nikolaev
83ad79d69a linux-cp: add add_del_v3 and get_v2 methods
Added vl_api_lcp_itf_pair_add_del_v3_t_handler method, it can return
vif_index in reply. Also added vl_api_lcp_itf_pair_get_v2_t_handler
methods, this method is able to dump only one lcp pair or dump all
lcp pairs via stream_msg.

Type: improvement
Change-Id: I1d25344ee57f8fac8b857bb3a9a03116230b4d2c
Signed-off-by: Anton Nikolaev <anikolaev@netgate.com>
2024-01-30 12:07:12 +00:00
Ole Troan
ac0babd412 api: provide api definition over api
This patch allows a client to bootstrap itself by downloading the
JSON API definitions over the API itself.

This patch enables it for Python (probably need a dynamic language).
Call VPPApiClient with the new bootstrapapi=True parameter.

Example (Python):

from vpp_papi import VPPApiClient
vpp = VPPApiClient(bootstrapapi=True)
rv = vpp.connect("foobar")
assert rv == 0
print(f'SHOW VERSION: {vpp.api.show_version()}')
vpp.disconnect()

Type: feature
Change-Id: Id903fdccc82b2e22aa1994331d2c150253f2ccae
Signed-off-by: Ole Troan <otroan@employees.org>
2024-01-29 22:57:31 +00:00
Filip Tehlar
f34b6800de hs-test: update docs on debugging
Type: docs

Change-Id: I3bd89feb53a35532c79283bcdac2c87635c60920
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2024-01-29 19:59:02 +00:00
Filip Tehlar
a1bd50c7a2 hs-test: use relative paths for docker volumes
Type: test

Change-Id: I9d5c15662e50ceea08d2ccc653db36c5e3df869e
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2024-01-29 19:58:37 +00:00
Arthur de Kerhor
af1ddd39f1 ip: don't export useless error counters for ip6 rewrite
the error node is set to ip6_input in the inline funcition
associated with ip6_rewrite. Thus, error counters defined
for node ip6 rewrite are never used.

Type: fix
Change-Id: Id6bef633928b0fff9069498c2e39e9f5bea2cf9b
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
2024-01-29 10:22:17 +00:00
adrianvillin
707210c636 hs-test: updated golang and packages
ioutil.ReadFile is deprecated, replaced with os.ReadFile

Type: test

Change-Id: I9f8075796d05d47ea4dddd7e986026a267a7fe0c
Signed-off-by: adrianvillin <avillin@cisco.com>
2024-01-26 16:59:02 +00:00
Florin Coras
f1acfc00ee udp: update rx sw_if_index to ip-local selected one
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0afd1b9ddbc17825aab3bfa3e5f9c6c0fbc561ca
2024-01-25 10:10:06 +00:00
Andrew Yourtchenko
6fb2b3dc72 misc: Initial 24.06-rc0 commit
Type: docs
Change-Id: Ia459d5ba6f7da3081192c6aba156e66fb2d6377c
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2024-01-24 12:28:55 +00:00
996 changed files with 15106 additions and 8127 deletions

3
.gitignore vendored
View File

@ -122,7 +122,8 @@ compile_commands.json
/extras/hs-test/vpp-data
/extras/hs-test/hs-test
/extras/hs-test/http_server
/extras/hs-test/.build.vpp
/extras/hs-test/.build.ok
/extras/hs-test/summary/
# ./configure
/CMakeFiles

View File

@ -2,3 +2,4 @@
host=gerrit.fd.io
port=29418
project=vpp
defaultbranch=stable/2406

View File

@ -192,7 +192,7 @@ I: sr
M: Pablo Camarillo <pcamaril@cisco.com>
M: Ahmed Abdelsalam <ahabdels@cisco.com>
F: src/vnet/srv6/
F: src/vnet/srmpls/
F: src/plugin/srmpls/
F: src/examples/srv6-sample-localsid/
VNET IPSec
@ -892,3 +892,8 @@ M: vpp-dev Mailing List <vpp-dev@fd.io>
C: Missing Maintainer
F: *
F: */
Netmap
I: netmap
M: Tom Jones <thj@freebsd.org>
F: src/plugins/netmap/

View File

@ -23,6 +23,10 @@ MACHINE=$(shell uname -m)
SUDO?=sudo -E
DPDK_CONFIG?=no-pci
ifeq ($(strip $(SHELL)),)
$(error "bash not found, VPP requires bash to build")
endif
,:=,
define disable_plugins
$(if $(1), \
@ -57,7 +61,7 @@ endif
ifeq ($(filter ubuntu debian linuxmint,$(OS_ID)),$(OS_ID))
PKG=deb
else ifeq ($(filter rhel centos fedora opensuse-leap rocky,$(OS_ID)),$(OS_ID))
else ifeq ($(filter rhel centos fedora opensuse-leap rocky almalinux,$(OS_ID)),$(OS_ID))
PKG=rpm
endif
@ -82,6 +86,7 @@ DEB_DEPENDS += nasm
DEB_DEPENDS += iperf ethtool # for 'make test TEST=vm_vpp_interfaces'
DEB_DEPENDS += libpcap-dev
DEB_DEPENDS += tshark
DEB_DEPENDS += jq # for extracting test summary from .json report (hs-test)
LIBFFI=libffi6 # works on all but 20.04 and debian-testing
@ -150,6 +155,15 @@ else ifeq ($(OS_ID),rocky)
RPM_DEPENDS += python3-virtualenv python3-jsonschema
RPM_DEPENDS += infiniband-diags llvm clang cmake
RPM_DEPENDS_GROUPS = 'Development Tools'
else ifeq ($(OS_ID),almalinux)
RPM_DEPENDS += yum-utils
RPM_DEPENDS += subunit subunit-devel
RPM_DEPENDS += openssl-devel
RPM_DEPENDS += python3-devel # needed for python3 -m pip install psutil
RPM_DEPENDS += python3-ply # for vppapigen
RPM_DEPENDS += python3-virtualenv python3-jsonschema
RPM_DEPENDS += infiniband-diags llvm clang cmake
RPM_DEPENDS_GROUPS = 'Development Tools'
else ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
RPM_DEPENDS += yum-utils
RPM_DEPENDS += compat-openssl10 openssl-devel

View File

@ -650,11 +650,18 @@ configure_check_timestamp = \
# /proc/cpuinfo does not exist on platforms without a /proc and on some
# platforms, notably inside containers, it has no content. In those cases
# we assume there's 1 processor; we use 2*ncpu for the -j option.
#
# On FreeBSD we can call nproc to get the number of processors.
#
# NB: GNU Make 4.2 will let us use '$(file </proc/cpuinfo)' to both test
# for file presence and content; for now this will have to do.
ifndef MAKE_PARALLEL_JOBS
ifeq ($(shell uname), FreeBSD)
MAKE_PARALLEL_JOBS = $(shell nproc)
else
MAKE_PARALLEL_JOBS = $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo), \
$(shell grep -c ^processor /proc/cpuinfo), 2)
endif # FreeBSD
endif
MAKE_PARALLEL_FLAGS ?= $(if $($(PACKAGE)_make_parallel_fails),,-j $(MAKE_PARALLEL_JOBS))

View File

@ -21,8 +21,12 @@ INSTALL_DIR ?= $(CURDIR)/_install
PKG_VERSION ?= $(shell git describe --abbrev=0 --match 'v[0-9]*' | cut -d- -f1 | cut -dv -f2 | cut -d. -f1,2)
PKG_SUFFIX ?= $(shell git log --oneline v$(PKG_VERSION)-rc0.. . | wc -l)
SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct .)
ifeq ($shell(uname), FreeBSD)
JOBS := $(shell nproc)
else
JOBS := $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo),\
$(shell grep -c ^processor /proc/cpuinfo), 2)
endif # FreeBSD
B := $(BUILD_DIR)
I := $(INSTALL_DIR)
@ -39,20 +43,30 @@ AARCH64=$(filter aarch64,$(shell uname -m))
include packages.mk
include packages/ipsec-mb.mk
include packages/quicly.mk
ifneq ($(shell uname), FreeBSD)
include packages/rdma-core.mk
include packages/dpdk.mk
include packages/xdp-tools.mk
include packages/octeon-roc.mk
endif # FreeBSD
.PHONY: clean
clean:
@rm -rf $(B) $(I)
.PHONY: install
ifeq ($(shell uname), FreeBSD)
install: $(if $(ARCH_X86_64), ipsec-mb-install) quicly-install
else
install: $(if $(ARCH_X86_64), ipsec-mb-install) dpdk-install rdma-core-install quicly-install xdp-tools-install $(if $(AARCH64), octeon-roc-install)
endif # FreeBSD
.PHONY: config
ifeq ($(shell uname), FreeBSD)
config: $(if $(ARCH_X86_64), ipsec-mb-config) quicly-build
else
config: $(if $(ARCH_X86_64), ipsec-mb-config) dpdk-config rdma-core-config quicly-build
endif # FreeBSD
##############################################################################
# .deb packaging

View File

@ -1,2 +1,2 @@
rdma=46.1 dpdk=23.07
rdma=49.0 dpdk=23.11
rdma=51.0 dpdk=24.03

View File

@ -19,9 +19,10 @@ DPDK_FAILSAFE_PMD ?= n
DPDK_MACHINE ?= default
DPDK_MLX_IBV_LINK ?= static
dpdk_version ?= 23.11
dpdk_version ?= 24.03
dpdk_base_url ?= http://fast.dpdk.org/rel
dpdk_tarball := dpdk-$(dpdk_version).tar.xz
dpdk_tarball_md5sum_24.03 := a98da848d6ba09808ef00f9a26aaa49a
dpdk_tarball_md5sum_23.11 := 896c09f5b45b452bd77287994650b916
dpdk_tarball_md5sum_23.07 := 2b6d57f077585cb15b885482362fd47f
dpdk_tarball_md5sum_23.03 := 3cf8ebbcd412d5726db230f2eeb90cc9
@ -32,8 +33,11 @@ dpdk_tarball_md5sum_21.11 := 58660bbbe9e95abce86e47692b196555
dpdk_tarball_md5sum := $(dpdk_tarball_md5sum_$(dpdk_version))
dpdk_url := $(dpdk_base_url)/$(dpdk_tarball)
dpdk_tarball_strip_dirs := 1
ifeq ($(shell uname), FreeBSD)
dpdk_depends := $(if $(ARCH_X86_64), ipsec-mb)
else
dpdk_depends := rdma-core $(if $(ARCH_X86_64), ipsec-mb)
endif
DPDK_MLX_DEFAULT := $(shell if grep -q "rdma=$(rdma-core_version) dpdk=$(dpdk_version)" mlx_rdma_dpdk_matrix.txt; then echo 'y'; else echo 'n'; fi)
DPDK_MLX4_PMD ?= $(DPDK_MLX_DEFAULT)
DPDK_MLX5_PMD ?= $(DPDK_MLX_DEFAULT)
@ -133,14 +137,19 @@ endif
DPDK_DRIVERS_DISABLED := $(shell echo $(DPDK_DRIVERS_DISABLED) | tr -d '\\\t ')
DPDK_LIBS_DISABLED := $(shell echo $(DPDK_LIBS_DISABLED) | tr -d '\\\t ')
SED=sed
ifeq ($shell(uname), FreeBSD)
SED=gsed
endif
HASH := \#
# post-meson-setup snippet to alter rte_build_config.h
define dpdk_config
if grep -q RTE_$(1) $(dpdk_src_dir)/config/rte_config.h ; then \
sed -i -e 's/$(HASH)define RTE_$(1).*/$(HASH)define RTE_$(1) $(DPDK_$(1))/' \
$(SED) -i -e 's/$(HASH)define RTE_$(1).*/$(HASH)define RTE_$(1) $(DPDK_$(1))/' \
$(dpdk_src_dir)/config/rte_config.h; \
elif grep -q RTE_$(1) $(dpdk_build_dir)/rte_build_config.h ; then \
sed -i -e 's/$(HASH)define RTE_$(1).*/$(HASH)define RTE_$(1) $(DPDK_$(1))/' \
$(SED) -i -e 's/$(HASH)define RTE_$(1).*/$(HASH)define RTE_$(1) $(DPDK_$(1))/' \
$(dpdk_build_dir)/rte_build_config.h; \
else \
echo '$(HASH)define RTE_$(1) $(DPDK_$(1))' \
@ -156,7 +165,7 @@ if [[ "$(DPDK_$(1))" == "y" ]]; then \
>> $(dpdk_build_dir)/rte_build_config.h ; \
fi; \
elif [[ "$(DPDK_$(1))" == "n" ]]; then \
sed -i '/$(HASH)define RTE_$(1) .*/d' $(dpdk_build_dir)/rte_build_config.h \
$(SED) -i '/$(HASH)define RTE_$(1) .*/d' $(dpdk_build_dir)/rte_build_config.h \
$(dpdk_src_dir)/config/rte_config.h ; \
fi
endef
@ -172,6 +181,7 @@ DPDK_MESON_ARGS = \
-Db_pie=true \
-Dmachine=$(DPDK_MACHINE) \
--buildtype=$(DPDK_BUILD_TYPE) \
-Denable_kmods=false \
${DPDK_MLX_CONFIG_FLAG}
PIP_DOWNLOAD_DIR = $(CURDIR)/downloads/

View File

@ -2,12 +2,12 @@
# SPDX-License-Identifier: Apache-2.0
# https://spdx.org/licenses/Apache-2.0.html
octeon-roc_version := 0.2
octeon-roc_tarball := octeon-roc-v$(octeon-roc_version).tar.gz
octeon-roc_tarball_md5sum := a72bb3b27fd3bbaf58aadd99514620e1
octeon-roc_version := 0.5
octeon-roc_tarball := v$(octeon-roc_version).tar.gz
octeon-roc_tarball_md5sum := 76bc56c84935da944bbf340fe5283ef0
octeon-roc_tarball_strip_dirs := 1
octeon-roc_url := https://github.com/MarvellEmbeddedProcessors/marvell-vpp/archive/refs/tags/$(octeon-roc_tarball)
octeon-roc_url := https://github.com/MarvellEmbeddedProcessors/marvell-octeon-roc/archive/refs/tags/$(octeon-roc_tarball)
define octeon-roc_config_cmds
@true

View File

@ -23,10 +23,10 @@ RDMA_CORE_DEBUG?=n
# 2. Verify that the file build/external/dpdk_mlx_default.sh was generated
# and contains 'DPDK_MLX_DEFAULT=y'
#
rdma-core_version := 49.0
rdma-core_version := 51.0
rdma-core_tarball := rdma-core-$(rdma-core_version).tar.gz
rdma-core_tarball_md5sum_46.1 := 3ac7c00717ea2720df5d90f8a43ae33a
rdma-core_tarball_md5sum_49.0 := 9fe3909f19c7e0276c9e546411bbb49c
rdma-core_tarball_md5sum_51.0 := ed95d79f782ea00bd7233d453abd60b3
rdma-core_tarball_md5sum := $(rdma-core_tarball_md5sum_$(rdma-core_version))
rdma-core_tarball_strip_dirs := 1
rdma-core_url := http://github.com/linux-rdma/rdma-core/releases/download/v$(rdma-core_version)/$(rdma-core_tarball)

14
configure vendored
View File

@ -33,6 +33,7 @@ OPTIONS:
--wipe, -w Wipe whole repo (except startup.* files)
--sanitize, -s Enable sanitizer (mem)
--platform, -p Specify target platform
--option, -o Enable specific VPP options (fib8, fib16)
__EOF__
}
@ -104,6 +105,19 @@ while (( "$#" )); do
;;
esac
;;
-o|--option)
shift 1
case "$1" in
fib8)
shift 1
args+=("-DVPP_IP_FIB_MTRIE_16=OFF")
;;
fib16)
shift 1
args+=("-DVPP_IP_FIB_MTRIE_16=ON")
;;
esac
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1

View File

@ -6,9 +6,9 @@ Release notes
.. toctree::
:maxdepth: 2
v24.02
v23.10
v23.06
v23.02
v22.10.1
v22.10
past

View File

@ -6,6 +6,7 @@ Past releases
.. toctree::
:maxdepth: 1
v22.10
v22.06.1
v22.06
v22.02

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
../../../../src/vnet/srmpls/sr_doc.rst
../../../../src/plugins/srmpls/sr_doc.rst

View File

@ -6,7 +6,7 @@
Progressive VPP Tutorial
########################
Learn to run FD.io VPP on a single Ubuntu 16.04 VM using Vagrant with this walkthrough
Learn to run FD.io VPP on a single Ubuntu VM using Vagrant with this walkthrough
covering basic FD.io VPP scenarios. Useful FD.io VPP commands will be used, and
will discuss basic operations, and the state of a running FD.io VPP on a system.

View File

@ -3,15 +3,15 @@
Setting up your environment
===========================
All of these exercises are designed to be performed on an Ubuntu 16.04 (Xenial) box.
All of these exercises are designed to be performed on an Ubuntu 22.04 (Jammy) box.
* If you have an Ubuntu 18.04 box on which you have sudo or root access, you can feel free to use that.
* If you do not, a Vagrantfile is provided to setup a basic Ubuntu 18.04 box for you in the the steps below.
* If you have an Ubuntu 22.04 box on which you have sudo or root access, you can feel free to use that.
* If you do not, a Vagrantfile is provided to setup a basic Ubuntu 22.04 box for you in the the steps below.
Install Virtual Box and Vagrant
Install Libvirt and Vagrant
-------------------------------
You will need to install Virtual Box and Vagrant.
You will need to install Libvirt and Vagrant.
Create a Vagrant Directory
---------------------------
@ -32,21 +32,16 @@ Create a file called **Vagrantfile** with the following contents:
Vagrant.configure(2) do |config|
config.vm.box = "bento/ubuntu-18.04"
config.vm.box_check_update = false
config.vm.box = "generic/ubuntu2204"
vmcpu=(ENV['VPP_VAGRANT_VMCPU'] || 2)
vmram=(ENV['VPP_VAGRANT_VMRAM'] || 4096)
config.ssh.forward_agent = true
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--ioapic", "on"]
config.vm.provider "libvirt" do |vb|
vb.memory = "#{vmram}"
vb.cpus = "#{vmcpu}"
#support for the SSE4.x instruction is required in some versions of VB.
vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.1", "1"]
vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.2", "1"]
end
end
@ -97,7 +92,7 @@ We write this file with the following contents:
.. code-block:: console
$ sudo bash
# echo "deb [trusted=yes] https://packagecloud.io/fdio/release/ubuntu bionic main" > /etc/apt/sources.list.d/99fd.io.list
# echo "deb https://packagecloud.io/fdio/release/ubuntu jammy main" > /etc/apt/sources.list.d/99fd.io.list
#
Get the key.

View File

@ -1047,6 +1047,7 @@ srcIP
srcPortDefinition
srcUP
srh
srmpls
Srmpls
srtp
SRTP

View File

@ -391,9 +391,9 @@ class VppGbpEndpointGroup(VppObject):
def encode(self) -> dict:
return {
"uplink_sw_if_index": self.uplink.sw_if_index
if self.uplink
else INDEX_INVALID,
"uplink_sw_if_index": (
self.uplink.sw_if_index if self.uplink else INDEX_INVALID
),
"bd_id": self.bd.bd.bd_id,
"rd_id": self.rd.rd_id,
"vnid": self.vnid,
@ -460,12 +460,12 @@ class VppGbpBridgeDomain(VppObject):
return {
"flags": self.flags,
"bvi_sw_if_index": self.bvi.sw_if_index,
"uu_fwd_sw_if_index": self.uu_fwd.sw_if_index
if self.uu_fwd
else INDEX_INVALID,
"bm_flood_sw_if_index": self.bm_flood.sw_if_index
if self.bm_flood
else INDEX_INVALID,
"uu_fwd_sw_if_index": (
self.uu_fwd.sw_if_index if self.uu_fwd else INDEX_INVALID
),
"bm_flood_sw_if_index": (
self.bm_flood.sw_if_index if self.bm_flood else INDEX_INVALID
),
"bd_id": self.bd.bd_id,
"rd_id": self.rd.rd_id,
}
@ -510,12 +510,12 @@ class VppGbpRouteDomain(VppObject):
"scope": self.scope,
"ip4_table_id": self.t4.table_id,
"ip6_table_id": self.t6.table_id,
"ip4_uu_sw_if_index": self.ip4_uu.sw_if_index
if self.ip4_uu
else INDEX_INVALID,
"ip6_uu_sw_if_index": self.ip6_uu.sw_if_index
if self.ip6_uu
else INDEX_INVALID,
"ip4_uu_sw_if_index": (
self.ip4_uu.sw_if_index if self.ip4_uu else INDEX_INVALID
),
"ip6_uu_sw_if_index": (
self.ip6_uu.sw_if_index if self.ip6_uu else INDEX_INVALID
),
}
def add_vpp_config(self):

View File

@ -92,14 +92,12 @@ set_li_command_fn (vlib_main_t * vm,
return 0;
}
/* *INDENT-OFF* */
VLIB_CLI_COMMAND (set_li_command, static) = {
.path = "set li",
.short_help =
"set li src <ip4-address> collector <ip4-address> udp-port <nnnn>",
.function = set_li_command_fn,
};
/* *INDENT-ON* */
static clib_error_t *
li_init (vlib_main_t * vm)

View File

@ -36,12 +36,10 @@ typedef struct
extern li_main_t li_main;
/* *INDENT-OFF* */
typedef CLIB_PACKED(struct {
ip4_header_t ip4;
udp_header_t udp;
}) ip4_udp_header_t;
/* *INDENT-ON* */
extern vlib_node_registration_t li_hit_node;

View File

@ -260,7 +260,6 @@ VLIB_NODE_FN (li_hit_node) (vlib_main_t * vm,
return frame->n_vectors;
}
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (li_hit_node) = {
.name = "li-hit",
.vector_size = sizeof (u32),
@ -277,7 +276,6 @@ VLIB_REGISTER_NODE (li_hit_node) = {
[LI_HIT_NEXT_ETHERNET] = "ethernet-input-not-l2",
},
};
/* *INDENT-ON* */
/*
* fd.io coding-style-patch-verification: ON

View File

@ -56,9 +56,9 @@ class VppVxlanGbpTunnel(VppInterface):
"dst": self.dst,
"mode": self.mode,
"vni": self.vni,
"mcast_sw_if_index": self.mcast_itf.sw_if_index
if self.mcast_itf
else INDEX_INVALID,
"mcast_sw_if_index": (
self.mcast_itf.sw_if_index if self.mcast_itf else INDEX_INVALID
),
"encap_table_id": self.encap_table_id,
"instance": self.instance,
}

View File

@ -1,3 +1,4 @@
export HS_ROOT=$(CURDIR)
ifeq ($(VERBOSE),)
VERBOSE=false
@ -23,6 +24,14 @@ ifeq ($(CPUS),)
CPUS=1
endif
ifeq ($(PARALLEL),)
PARALLEL=1
endif
ifeq ($(REPEAT),)
REPEAT=0
endif
ifeq ($(VPPSRC),)
VPPSRC=$(shell pwd)/../..
endif
@ -35,13 +44,14 @@ ifeq ($(ARCH),)
ARCH=$(shell dpkg --print-architecture)
endif
list_tests = @(grep -r ') Test' *_test.go | cut -d '*' -f2 | cut -d '(' -f1 | \
tr -d ' ' | tr ')' '/' | sed 's/Suite//')
list_tests = @go run github.com/onsi/ginkgo/v2/ginkgo --dry-run -v --no-color --seed=2 | head -n -1 | grep 'Test' | \
sed 's/^/* /; s/\(Suite\) /\1\//g'
.PHONY: help
help:
@echo "Make targets:"
@echo " test - run tests"
@echo " test-debug - run tests (vpp debug image)"
@echo " build - build test infra"
@echo " build-debug - build test infra (vpp debug image)"
@echo " build-go - just build golang files"
@ -60,6 +70,8 @@ help:
@echo " TEST=[test-name] - specific test to run"
@echo " CPUS=[n-cpus] - number of cpus to run with vpp"
@echo " VPPSRC=[path-to-vpp-src] - path to vpp source files (for gdb)"
@echo " PARALLEL=[n-cpus] - number of test processes to spawn to run in parallel"
@echo " REPEAT=[n] - repeat tests up to N times or until a failure occurs"
@echo
@echo "List of all tests:"
$(call list_tests)
@ -68,30 +80,53 @@ help:
list-tests:
$(call list_tests)
.PHONY: build-vpp-release
build-vpp-release:
@make -C ../.. build-release
.PHONY: build-vpp-debug
build-vpp-debug:
@make -C ../.. build
.PHONY: test
test: .deps.ok .build.vpp
@bash ./test --persist=$(PERSIST) --verbose=$(VERBOSE) \
--unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \
--vppsrc=$(VPPSRC)
.build.ok: build
@touch .build.ok
.build_debug.ok: build-debug
@touch .build.ok
.PHONY: test
test: .deps.ok .build.ok
# '-' ignores the exit status, it is set in compress.sh
# necessary so gmake won't skip executing the bash script
-bash ./test --persist=$(PERSIST) --verbose=$(VERBOSE) \
--unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \
--vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT)
@bash ./script/compress.sh
.PHONY: test-debug
test-debug: .deps.ok .build_debug.ok
# '-' ignores the exit status, it is set in compress.sh
# necessary so gmake won't skip executing the bash script
-bash ./test --persist=$(PERSIST) --verbose=$(VERBOSE) \
--unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \
--vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT)
@bash ./script/compress.sh
.PHONY: build-go
build-go:
go build ./tools/http_server
.PHONY: build
build: .deps.ok build-vpp-release build-go
@rm -f .build.vpp
@rm -f .build.ok
bash ./script/build_hst.sh release
@touch .build.vpp
@touch .build.ok
.PHONY: build-debug
build-debug: .deps.ok build-vpp-debug build-go
@rm -f .build.vpp
@rm -f .build.ok
bash ./script/build_hst.sh debug
@touch .build.vpp
@touch .build.ok
.deps.ok:
@sudo make install-deps
@ -101,14 +136,13 @@ install-deps:
@rm -f .deps.ok
@apt-get update \
&& apt-get install -y apt-transport-https ca-certificates curl software-properties-common \
&& apt-get install -y golang apache2-utils wrk bridge-utils
apache2-utils wrk bridge-utils
@if [ ! -f /usr/share/keyrings/docker-archive-keyring.gpg ] ; then \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg; \
echo "deb [arch=$(ARCH) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(UBUNTU_CODENAME) stable" \
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null ; \
apt-get update; \
fi
@apt-get install -y docker-ce
@touch .deps.ok
.PHONY: fixstyle

View File

@ -9,7 +9,10 @@ End-to-end tests often want multiple VPP instances, network namespaces, differen
and to execute external tools or commands. With such requirements the existing VPP test framework is not sufficient.
For this, ``Go`` was chosen as a high level language, allowing rapid development, with ``Docker`` and ``ip`` being the tools for creating required topology.
Go's package `testing`_ together with `go test`_ command form the base framework upon which the *hs-test* is built and run.
`Ginkgo`_ forms the base framework upon which the *hs-test* is built and run.
All tests are technically in a single suite because we are only using ``package main``. We simulate suite behavior by grouping tests by the topology they require.
This allows us to run those mentioned groups in parallel, but not individual tests in parallel.
Anatomy of a test case
----------------------
@ -24,15 +27,16 @@ Anatomy of a test case
**Action flow when running a test case**:
#. It starts with running ``make test``. Optional arguments are VERBOSE, PERSIST (topology configuration isn't cleaned up after test run),
and TEST=<test-name> to run specific test.
#. ``make list-tests`` (or ``make help``) shows all test names.
#. ``go test`` compiles package ``main`` along with any files with names matching the file pattern ``*_test.go``
and then runs the resulting test binaries
#. The go test framework runs each function matching :ref:`naming convention<test-convention>`. Each of these corresponds to a `test suite`_
#. Testify toolkit's ``suite.Run(t *testing.T, suite TestingSuite)`` function runs the suite and does the following:
TEST=<test-name> to run a specific test and PARALLEL=[n-cpus].
#. ``make list-tests`` (or ``make help``) shows all tests. The current `list of tests`_ is at the bottom of this document.
#. ``Ginkgo`` looks for a spec suite in the current directory and then compiles it to a .test binary
#. The Ginkgo test framework runs each function that was registered manually using ``registerMySuiteTest(s *MySuite)``. Each of these functions correspond to a suite
#. Ginkgo's ``RunSpecs(t, "Suite description")`` function is the entry point and does the following:
#. Ginkgo compiles the spec, builds a spec tree
#. ``Describe`` container nodes in suite\_\*_test.go files are run (in series by default, or in parallel with the argument PARALLEL=[n-cpus])
#. Suite is initialized. The topology is loaded and configured in this step
#. Test suite runs all the tests attached to it
#. Registered tests are run in generated ``It`` subject nodes
#. Execute tear-down functions, which currently consists of stopping running containers
and clean-up of test topology
@ -43,23 +47,25 @@ This describes adding a new test case to an existing suite.
For adding a new suite, please see `Modifying the framework`_ below.
#. To write a new test case, create a file whose name ends with ``_test.go`` or pick one that already exists
#. Declare method whose name starts with ``Test`` and specifies its receiver as a pointer to the suite's struct (defined in ``framework_test.go``)
#. Declare method whose name ends with ``Test`` and specifies its parameter as a pointer to the suite's struct (defined in ``suite_*_test.go``)
#. Implement test behaviour inside the test method. This typically includes the following:
#. Retrieve a running container in which to run some action. Method ``getContainerByName``
from ``HstSuite`` struct serves this purpose
#. Interact with VPP through the ``VppInstance`` struct embedded in container. It provides ``vppctl`` method to access debug CLI
#. Run arbitrary commands inside the containers with ``exec`` method
#. Run other external tool with one of the preexisting functions in the ``utils.go`` file.
For example, use ``wget`` with ``startWget`` function
#. Use ``exechelper`` or just plain ``exec`` packages to run whatever else
#. Verify results of your tests using ``assert`` methods provided by the test suite,
implemented by HstSuite struct
#. Retrieve a running container in which to run some action. Method ``getContainerByName``
from ``HstSuite`` struct serves this purpose
#. Interact with VPP through the ``VppInstance`` struct embedded in container. It provides ``vppctl`` method to access debug CLI
#. Run arbitrary commands inside the containers with ``exec`` method
#. Run other external tool with one of the preexisting functions in the ``utils.go`` file.
For example, use ``wget`` with ``startWget`` function
#. Use ``exechelper`` or just plain ``exec`` packages to run whatever else
#. Verify results of your tests using ``assert`` methods provided by the test suite, implemented by HstSuite struct or use ``Gomega`` assert functions.
#. Create an ``init()`` function and register the test using ``register*SuiteTests(testCaseFunction)``
**Example test case**
Assumed are two docker containers, each with its own VPP instance running. One VPP then pings the other.
This can be put in file ``extras/hs-test/my_test.go`` and run with command ``./test -run TestMySuite/TestMyCase``.
This can be put in file ``extras/hs-test/my_test.go`` and run with command ``make test TEST=MyTest`` or ``ginkgo -v --trace --focus MyTest``.
::
@ -69,7 +75,11 @@ This can be put in file ``extras/hs-test/my_test.go`` and run with command ``./t
"fmt"
)
func (s *MySuite) TestMyCase() {
func init(){
registerMySuiteTest(MyTest)
}
func MyTest(s *MySuite) {
clientVpp := s.getContainerByName("client-vpp").vppInstance
serverVethAddress := s.netInterfaces["server-iface"].AddressString()
@ -86,8 +96,7 @@ Modifying the framework
.. _test-convention:
#. Adding a new suite takes place in ``framework_test.go`` and by creating a new file for the suite.
Naming convention for the suite files is ``suite_name_test.go`` where *name* will be replaced
#. To add a new suite, create a new file. Naming convention for the suite files is ``suite_name_test.go`` where *name* will be replaced
by the actual name
#. Make a ``struct``, in the suite file, with at least ``HstSuite`` struct as its member.
@ -99,7 +108,17 @@ Modifying the framework
HstSuite
}
#. In suite file, implement ``SetupSuite`` method which testify runs once before starting any of the tests.
#. Create a new slice that will contain test functions with a pointer to the suite's struct: ``var myTests = []func(s *MySuite){}``
#. Then create a new function that will append test functions to that slice:
::
func registerMySuiteTests(tests ...func(s *MySuite)) {
nginxTests = append(myTests, tests...)
}
#. In suite file, implement ``SetupSuite`` method which Ginkgo runs once before starting any of the tests.
It's important here to call ``configureNetworkTopology`` method,
pass the topology name to the function in a form of file name of one of the *yaml* files in ``topo-network`` folder.
Without the extension. In this example, *myTopology* corresponds to file ``extras/hs-test/topo-network/myTopology.yaml``
@ -111,6 +130,8 @@ Modifying the framework
::
func (s *MySuite) SetupSuite() {
s.HstSuite.SetupSuite()
// Add custom setup code here
s.configureNetworkTopology("myTopology")
@ -123,19 +144,62 @@ Modifying the framework
::
func (s *MySuite) SetupTest() {
s.HstSuite.setupTest()
s.SetupVolumes()
s.SetupContainers()
}
#. In order for ``go test`` to run this suite, we need to create a normal test function and pass our suite to ``suite.Run``.
These functions are placed at the end of ``framework_test.go``
#. In order for ``Ginkgo`` to run this suite, we need to create a ``Describe`` container node with setup nodes and an ``It`` subject node.
Place them at the end of the suite file
* Declare a suite struct variable before anything else
* To use ``BeforeAll()`` and ``AfterAll()``, the container has to be marked as ``Ordered``
* Because the container is now marked as Ordered, if a test fails, all the subsequent tests are skipped.
To override this behavior, decorate the container node with ``ContinueOnFailure``
::
func TestMySuite(t *testing.T) {
var m MySuite
suite.Run(t, &m)
}
var _ = Describe("MySuite", Ordered, ContinueOnFailure, func() {
var s MySuite
BeforeAll(func() {
s.SetupSuite()
})
BeforeEach(func() {
s.SetupTest()
})
AfterAll(func() {
s.TearDownSuite()
})
AfterEach(func() {
s.TearDownTest()
})
for _, test := range mySuiteTests {
test := test
pc := reflect.ValueOf(test).Pointer()
funcValue := runtime.FuncForPC(pc)
It(strings.Split(funcValue.Name(), ".")[2], func(ctx SpecContext) {
test(&s)
}, SpecTimeout(time.Minute*5))
}
})
#. Notice the loop - it will generate multiple ``It`` nodes, each running a different test.
``test := test`` is necessary, otherwise only the last test in a suite will run.
For a more detailed description, check Ginkgo's documentation: https://onsi.github.io/ginkgo/#dynamically-generating-specs\.
#. ``funcValue.Name()`` returns the full name of a function (e.g. ``fd.io/hs-test.MyTest``), however, we only need the test name (``MyTest``).
#. To run certain tests solo, create a new slice that will only contain tests that have to run solo and a new register function.
Add a ``Serial`` decorator to the container node and ``Label("SOLO")`` to the ``It`` subject node:
::
var _ = Describe("MySuiteSolo", Ordered, ContinueOnFailure, Serial, func() {
...
It(strings.Split(funcValue.Name(), ".")[2], Label("SOLO"), func(ctx SpecContext) {
test(&s)
}, SpecTimeout(time.Minute*5))
})
#. Next step is to add test cases to the suite. For that, see section `Adding a test case`_ above
@ -186,13 +250,23 @@ Alternatively copy the executable from host system to the Docker image, similarl
**Skipping tests**
``HstSuite`` provides several methods that can be called in tests for skipping it conditionally or unconditionally such as:
``skip()``, ``SkipIfMultiWorker()``, ``SkipUnlessExtendedTestsBuilt()``.
``skip()``, ``SkipIfMultiWorker()``, ``SkipUnlessExtendedTestsBuilt()``. You can also use Ginkgo's ``Skip()``.
However the tests currently run under test suites which set up topology and containers before actual test is run. For the reason of saving
test run time it is not advisable to use aforementioned skip methods and instead prefix test name with ``Skip``:
test run time it is not advisable to use aforementioned skip methods and instead, just don't register the test.
**Debugging a test**
It is possible to debug VPP by attaching ``gdb`` before test execution by adding ``DEBUG=true`` like follows:
::
func (s *MySuite) SkipTest(){
$ make test TEST=LDPreloadIperfVppTest DEBUG=true
...
run following command in different terminal:
docker exec -it server-vpp2456109 gdb -ex "attach $(docker exec server-vpp2456109 pidof vpp)"
Afterwards press CTRL+\ to continue
If a test consists of more VPP instances then this is done for each of them.
**Eternal dependencies**
@ -208,8 +282,38 @@ Generally, these will be updated on a per-need basis, for example when a bug is
or a new version incompatibility issue occurs.
.. _testing: https://pkg.go.dev/testing
.. _go test: https://pkg.go.dev/cmd/go#hdr-Test_packages
.. _test suite: https://github.com/stretchr/testify#suite-package
.. _ginkgo: https://onsi.github.io/ginkgo/
.. _volumes: https://docs.docker.com/storage/volumes/
**List of tests**
.. _list of tests:
Please update this list whenever you add a new test by pasting the output below.
* NsSuite/HttpTpsTest
* NsSuite/VppProxyHttpTcpTest
* NsSuite/VppProxyHttpTlsTest
* NsSuite/EnvoyProxyHttpTcpTest
* NginxSuite/MirroringTest
* VethsSuiteSolo TcpWithLossTest [SOLO]
* NoTopoSuiteSolo HttpStaticPromTest [SOLO]
* TapSuite/LinuxIperfTest
* NoTopoSuite/NginxHttp3Test
* NoTopoSuite/NginxAsServerTest
* NoTopoSuite/NginxPerfCpsTest
* NoTopoSuite/NginxPerfRpsTest
* NoTopoSuite/NginxPerfWrkTest
* VethsSuite/EchoBuiltinTest
* VethsSuite/HttpCliTest
* VethsSuite/LDPreloadIperfVppTest
* VethsSuite/VppEchoQuicTest
* VethsSuite/VppEchoTcpTest
* VethsSuite/VppEchoUdpTest
* VethsSuite/XEchoVclClientUdpTest
* VethsSuite/XEchoVclClientTcpTest
* VethsSuite/XEchoVclServerUdpTest
* VethsSuite/XEchoVclServerTcpTest
* VethsSuite/VclEchoTcpTest
* VethsSuite/VclEchoUdpTest
* VethsSuite/VclRetryAttachTest

View File

@ -1,11 +1,20 @@
package main
import "fmt"
import (
"errors"
"fmt"
"os"
"strings"
"github.com/edwarnicke/exechelper"
)
type AddressCounter = int
type Ip4AddressAllocator struct {
networks map[int]AddressCounter
networks map[int]AddressCounter
chosenOctet int
assignedIps []string
}
func (a *Ip4AddressAllocator) AddNetwork(networkNumber int) {
@ -28,12 +37,59 @@ func (a *Ip4AddressAllocator) NewIp4InterfaceAddress(inputNetworkNumber ...int)
return "", fmt.Errorf("no available IPv4 addresses")
}
address := fmt.Sprintf("10.10.%v.%v/24", networkNumber, numberOfAddresses)
address, err := a.createIpAddress(networkNumber, numberOfAddresses)
a.networks[networkNumber] = numberOfAddresses + 1
return address + "/24", err
}
// Creates a file every time an IP is assigned: used to keep track of addresses in use.
// If an address is not in use, 'counter' is then copied to 'chosenOctet' and it is used for the remaining tests.
// Also checks host IP addresses.
func (a *Ip4AddressAllocator) createIpAddress(networkNumber int, numberOfAddresses int) (string, error) {
hostIps, _ := exechelper.CombinedOutput("ip a")
counter := 10
var address string
for {
if a.chosenOctet != 0 {
address = fmt.Sprintf("10.%v.%v.%v", a.chosenOctet, networkNumber, numberOfAddresses)
file, err := os.Create(address)
if err != nil {
return "", errors.New("unable to create file: " + fmt.Sprint(err))
}
file.Close()
break
} else {
address = fmt.Sprintf("10.%v.%v.%v", counter, networkNumber, numberOfAddresses)
_, err := os.Stat(address)
if err == nil || strings.Contains(string(hostIps), address) {
counter++
} else if os.IsNotExist(err) {
file, err := os.Create(address)
if err != nil {
return "", errors.New("unable to create file: " + fmt.Sprint(err))
}
file.Close()
a.chosenOctet = counter
break
} else {
return "", errors.New("an error occurred while checking if a file exists: " + fmt.Sprint(err))
}
}
}
a.assignedIps = append(a.assignedIps, address)
return address, nil
}
func (a *Ip4AddressAllocator) deleteIpAddresses() {
for ip := range a.assignedIps {
os.Remove(a.assignedIps[ip])
}
}
func NewIp4AddressAllocator() *Ip4AddressAllocator {
var ip4AddrAllocator = new(Ip4AddressAllocator)
ip4AddrAllocator.networks = make(map[int]AddressCounter)

View File

@ -9,10 +9,12 @@ import (
"time"
"github.com/edwarnicke/exechelper"
. "github.com/onsi/ginkgo/v2"
)
const (
logDir string = "/tmp/hs-test/"
logDir string = "/tmp/hs-test/"
volumeDir string = "/volumes"
)
var (
@ -37,7 +39,7 @@ type Container struct {
vppInstance *VppInstance
}
func newContainer(yamlInput ContainerConfig) (*Container, error) {
func newContainer(suite *HstSuite, yamlInput ContainerConfig) (*Container, error) {
containerName := yamlInput["name"].(string)
if len(containerName) == 0 {
err := fmt.Errorf("container name must not be blank")
@ -48,6 +50,7 @@ func newContainer(yamlInput ContainerConfig) (*Container, error) {
container.volumes = make(map[string]Volume)
container.envVars = make(map[string]string)
container.name = containerName
container.suite = suite
if image, ok := yamlInput["image"]; ok {
container.image = image.(string)
@ -74,19 +77,20 @@ func newContainer(yamlInput ContainerConfig) (*Container, error) {
}
if _, ok := yamlInput["volumes"]; ok {
r := strings.NewReplacer("$HST_DIR", workDir)
workingVolumeDir := logDir + CurrentSpecReport().LeafNodeText + volumeDir
workDirReplacer := strings.NewReplacer("$HST_DIR", workDir)
volDirReplacer := strings.NewReplacer("$HST_VOLUME_DIR", workingVolumeDir)
for _, volu := range yamlInput["volumes"].([]interface{}) {
volumeMap := volu.(ContainerConfig)
hostDir := r.Replace(volumeMap["host-dir"].(string))
hostDir := workDirReplacer.Replace(volumeMap["host-dir"].(string))
hostDir = volDirReplacer.Replace(hostDir)
containerDir := volumeMap["container-dir"].(string)
isDefaultWorkDir := false
if isDefault, ok := volumeMap["is-default-work-dir"]; ok {
isDefaultWorkDir = isDefault.(bool)
}
container.addVolume(hostDir, containerDir, isDefaultWorkDir)
}
}
@ -246,7 +250,7 @@ func (c *Container) copy(sourceFileName string, targetFileName string) error {
}
func (c *Container) createFile(destFileName string, content string) error {
f, err := os.CreateTemp("/tmp", "hst-config")
f, err := os.CreateTemp("/tmp", "hst-config"+c.suite.pid)
if err != nil {
return err
}
@ -270,7 +274,7 @@ func (c *Container) execServer(command string, arguments ...any) {
serverCommand := fmt.Sprintf(command, arguments...)
containerExecCommand := "docker exec -d" + c.getEnvVarsAsCliOption() +
" " + c.name + " " + serverCommand
c.suite.T().Helper()
GinkgoHelper()
c.suite.log(containerExecCommand)
c.suite.assertNil(exechelper.Run(containerExecCommand))
}
@ -279,21 +283,21 @@ func (c *Container) exec(command string, arguments ...any) string {
cliCommand := fmt.Sprintf(command, arguments...)
containerExecCommand := "docker exec" + c.getEnvVarsAsCliOption() +
" " + c.name + " " + cliCommand
c.suite.T().Helper()
GinkgoHelper()
c.suite.log(containerExecCommand)
byteOutput, err := exechelper.CombinedOutput(containerExecCommand)
c.suite.assertNil(err)
c.suite.assertNil(err, err)
return string(byteOutput)
}
func (c *Container) getLogDirPath() string {
testId := c.suite.getTestId()
testName := c.suite.T().Name()
testName := CurrentSpecReport().LeafNodeText
logDirPath := logDir + testName + "/" + testId + "/"
cmd := exec.Command("mkdir", "-p", logDirPath)
if err := cmd.Run(); err != nil {
c.suite.T().Fatalf("mkdir error: %v", err)
Fail("mkdir error: " + fmt.Sprint(err))
}
return logDirPath
@ -310,27 +314,33 @@ func (c *Container) saveLogs() {
cmd = exec.Command("docker", "logs", "--details", "-t", c.name)
output, err := cmd.CombinedOutput()
if err != nil {
c.suite.T().Fatalf("fetching logs error: %v", err)
Fail("fetching logs error: " + fmt.Sprint(err))
}
f, err := os.Create(testLogFilePath)
if err != nil {
c.suite.T().Fatalf("file create error: %v", err)
Fail("file create error: " + fmt.Sprint(err))
}
fmt.Fprint(f, string(output))
f.Close()
}
func (c *Container) log() string {
cmd := "docker logs " + c.name
// Outputs logs from docker containers. Set 'maxLines' to 0 to output the full log.
func (c *Container) log(maxLines int) (string, error) {
var cmd string
if maxLines == 0 {
cmd = "docker logs " + c.name
} else {
cmd = fmt.Sprintf("docker logs --tail %d %s", maxLines, c.name)
}
c.suite.log(cmd)
o, err := exechelper.CombinedOutput(cmd)
c.suite.assertNil(err)
return string(o)
return string(o), err
}
func (c *Container) stop() error {
if c.vppInstance != nil && c.vppInstance.apiChannel != nil {
if c.vppInstance != nil && c.vppInstance.apiStream != nil {
c.vppInstance.saveLogs()
c.vppInstance.disconnect()
}
@ -342,15 +352,15 @@ func (c *Container) stop() error {
func (c *Container) createConfig(targetConfigName string, templateName string, values any) {
template := template.Must(template.ParseFiles(templateName))
f, err := os.CreateTemp("/tmp/hs-test/", "hst-config")
c.suite.assertNil(err)
f, err := os.CreateTemp(logDir, "hst-config")
c.suite.assertNil(err, err)
defer os.Remove(f.Name())
err = template.Execute(f, values)
c.suite.assertNil(err)
c.suite.assertNil(err, err)
err = f.Close()
c.suite.assertNil(err)
c.suite.assertNil(err, err)
c.copy(f.Name(), targetConfigName)
}

View File

@ -2,11 +2,14 @@ package main
import (
"bufio"
"errors"
"fmt"
"os"
"os/exec"
"strings"
)
var CPU_PATH = "/sys/fs/cgroup/cpuset.cpus.effective"
var CgroupPath = "/sys/fs/cgroup/"
type CpuContext struct {
cpuAllocator *CpuAllocatorT
@ -36,9 +39,27 @@ func (c *CpuAllocatorT) Allocate(nCpus int) (*CpuContext, error) {
return &cpuCtx, nil
}
func (c *CpuAllocatorT) readCpus(fname string) error {
func (c *CpuAllocatorT) readCpus() error {
var first, last int
file, err := os.Open(CPU_PATH)
// Path depends on cgroup version. We need to check which version is in use.
// For that following command can be used: 'stat -fc %T /sys/fs/cgroup/'
// In case the output states 'cgroup2fs' then cgroups v2 is used, 'tmpfs' in case cgroups v1.
cmd := exec.Command("stat", "-fc", "%T", "/sys/fs/cgroup/")
byteOutput, err := cmd.CombinedOutput()
if err != nil {
return err
}
CpuPath := CgroupPath
if strings.Contains(string(byteOutput), "tmpfs") {
CpuPath += "cpuset/cpuset.effective_cpus"
} else if strings.Contains(string(byteOutput), "cgroup2fs") {
CpuPath += "cpuset.cpus.effective"
} else {
return errors.New("cgroup unknown fs: " + string(byteOutput))
}
file, err := os.Open(CpuPath)
if err != nil {
return err
}
@ -60,7 +81,7 @@ func (c *CpuAllocatorT) readCpus(fname string) error {
func CpuAllocator() (*CpuAllocatorT, error) {
if cpuAllocator == nil {
cpuAllocator = new(CpuAllocatorT)
err := cpuAllocator.readCpus(CPU_PATH)
err := cpuAllocator.readCpus()
if err != nil {
return nil, err
}

View File

@ -16,6 +16,8 @@ COPY \
$DIR/unittest_plugin.so \
$DIR/quic_plugin.so \
$DIR/http_static_plugin.so \
$DIR/ping_plugin.so \
$DIR/nsim_plugin.so \
$DIR/prom_plugin.so \
$DIR/tlsopenssl_plugin.so \
/usr/lib/x86_64-linux-gnu/vpp_plugins/

View File

@ -1,8 +1,13 @@
package main
func (s *VethsSuite) TestEchoBuiltin() {
func init() {
registerVethTests(EchoBuiltinTest)
registerSoloVethTests(TcpWithLossTest)
}
func EchoBuiltinTest(s *VethsSuite) {
serverVpp := s.getContainerByName("server-vpp").vppInstance
serverVeth := s.netInterfaces["vppsrv"]
serverVeth := s.getInterfaceByName(serverInterfaceName)
serverVpp.vppctl("test echo server " +
" uri tcp://" + serverVeth.ip4AddressString() + "/1234")
@ -16,29 +21,29 @@ func (s *VethsSuite) TestEchoBuiltin() {
s.assertNotContains(o, "failed:")
}
func (s *VethsSuite) TestTcpWithLoss() {
func TcpWithLossTest(s *VethsSuite) {
serverVpp := s.getContainerByName("server-vpp").vppInstance
serverVeth := s.netInterfaces[serverInterfaceName]
serverVeth := s.getInterfaceByName(serverInterfaceName)
serverVpp.vppctl("test echo server uri tcp://%s/20022",
serverVeth.ip4AddressString())
clientVpp := s.getContainerByName("client-vpp").vppInstance
// Ensure that VPP doesn't abort itself with NSIM enabled
// Warning: Removing this ping will make the test fail!
// Warning: Removing this ping will make VPP crash!
clientVpp.vppctl("ping %s", serverVeth.ip4AddressString())
// Add loss of packets with Network Delay Simulator
clientVpp.vppctl("set nsim poll-main-thread delay 0.01 ms bandwidth 40 gbit" +
" packet-size 1400 packets-per-drop 1000")
clientVpp.vppctl("nsim output-feature enable-disable host-vppcln")
clientVpp.vppctl("nsim output-feature enable-disable host-" + s.getInterfaceByName(clientInterfaceName).name)
// Do echo test from client-vpp container
output := clientVpp.vppctl("test echo client uri tcp://%s/20022 verbose echo-bytes mbytes 50",
serverVeth.ip4AddressString())
s.log(output)
s.assertNotEqual(len(output), 0)
s.assertNotContains(output, "failed: timeout")
s.assertNotContains(output, "failed", output)
}

Some files were not shown because too many files have changed in this diff Show More