11048 Commits

Author SHA1 Message Date
Nick Brown
e3cf4d0cf3 build: use GNUInstallDirs install destinations
So as to be compliant with distribution layouts, as recommend by:
https://cmake.org/cmake/help/latest/command/install.html#installing-files

Type: make
Change-Id: Ic46ace4f26aab1aa4902cbd013c40a92c480680d
Signed-off-by: Nick Brown <nickbroon@gmail.com>
2021-09-17 20:25:49 +00:00
Benoît Ganne
8b99777263 dpdk: enable ENA tx offload
Type: improvement

Change-Id: Ic7c2ac4237ecd192def7c3530ae5f788c62cf9ad
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-09-17 20:12:22 +00:00
Nathan Skrzypczak
0e6584014a vppinfra: move format_table from perfmon
This code seems really usefull for reuse in
other plugins, for pretty table formatting

Type: feature

Change-Id: Ib5784a0dfc81b7d5a5d1f5ccdd02072e460a50fb
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-17 20:10:59 +00:00
Damjan Marion
a274c3a2ed misc: put devtools plugins into separate component/package
Type: make
Change-Id: I2958e9eddadee6434766ecd3cdb3b9cea742ed64
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-09-17 15:04:28 +00:00
Mohammed Hawari
9db198556c ebuild: cleanup of DPDK options in external.mk
With the move to meson, most DPDK options in external.mk are not used
anymore

Type: improvement
Change-Id: I603ccd30c9e52bdc89a69aa4bece2394b3eed1fe
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2021-09-17 14:59:23 +00:00
Steven Luong
d26a582759 memif: avoid double pool_put on a clib_file
When memif CP processes the socket connection error, it may go through
the following code paths which may eventually cause double pool_put on a
clib_file

memif_master_conn_fd_error:633 -> memif_disconnect ->
memif_socket_close -> memif_file_del_by_index ->
clib_file_del_by_index -> clib_file_del -> pool_put

After memif_master_conn_fd_error:633, the code continues on

memif_maser_conn_fd_error:651 -> memif_file_del -> clib_file_del ->
pool_put

The fix is to skip calling memif_file_del in
memif_master_conn_fd_error:651 if uf->file_descriptor == ~0 to catch
problem from all possible paths in memif_master_conn_fd_error

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I0960998db1ff358a8ddd4a5e22188a244eccd270
2021-09-17 14:57:33 +00:00
Florin Coras
91db3538c9 dpdk: fix checksum offload
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I89fb738903ee74ffcb7c77a041391f0388df6991
2021-09-16 20:50:12 -07:00
Benoît Ganne
895def45c8 avf: fix RSS hash key
Toeplitz hash key must respect certain properties, it cannot be purely
random. Use the default one from i40e.

Type: fix

Change-Id: Ic8e67a0426de8adfecc1fcdaa99879e13ae38cc9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-09-16 14:23:53 +00:00
Nathan Skrzypczak
1a9e2f96d4 session: Add sock_name option to add_ns
This adds a new API call to add session namespaces
It now takes a netns and a sock_name.
(1) If no netns is passed, sock_name will be used as
socket path. Defaulting to /run/vpp/app_ns_sockets/${ns_id}
(2) If a netns is passed, the sock_name has to be
abstract (i.e. start with '@'). It will default to
`@vpp/session/${ns_id}` and will be created in the provided
netns.

Type: feature

Change-Id: I90e9a8e5ecca2cabe7c05335663e33c8506dc9e7
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-16 14:14:38 +00:00
Mohsin Kazmi
4fd9f10c45 vxlan: improve to use the hardware offload
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ic0fa4f83048a280a7d1b04198c0f903798562d2d
2021-09-16 10:43:56 +00:00
Mohsin Kazmi
64dd1720e5 dpdk: add support for outer udp and ipv4 checksums
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I10141033030342881298d70742fa5bdea402b4c9
2021-09-16 10:42:59 +00:00
Mohsin Kazmi
82f9444dbe dpdk: fix the outer ipv4 checksum
Type: fix

Change-Id: Ibc476b807ba0310f0cc926b0e386831ef0cbcc25
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-09-16 10:40:15 +00:00
Mohsin Kazmi
cebb477339 ip6-nd: add ip6-nd proxy
Type: feature

Change-Id: I91f72f5802db195d1a15424d67c1b6e518168f9f
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-09-16 07:12:13 +00:00
Damjan Marion
ef4ddfa482 vlib: add option to plugin registration to prefer deep binding
Type: improvement
Change-Id: I9ce7e1ee7e7afe8e9befe36ae8c59291beaaaf36
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-09-15 15:15:40 +02:00
Duncan Eastoe
764a8780c2 tap: set device name on creation via TUNSETIFF
Type: fix

Currently when a new TAP/TUN device is created from tap_create_if()
via the TUNSETIFF ioctl(), a name is allocated by the kernel (eg.
tap0). If the caller supplied a name this is subsequently set via
netlink, after the device has been created.

Now we request the kernel to create the new device with the caller's
requested name in the first instance, thus avoiding the need to
rename the device, and therefore avoiding a window where the device
exists with a different name.

This can be beneficial, for example, when writing systemd-udevd link
files [1]. Having the TAP/TUN devices created with the requested name
ensures they can be correctly matched by the OriginalName option.

Writing link files might be necessary, for example, to avoid VPP and
systemd-udevd racing to set the MAC address on a newly created TAP
interface. systemd-udevd can be configured to not manipulate the MAC
addresses of matched interfaces.

These changes also resolve an issue where the created device would not
be renamed if the caller requested it be moved to a different network
namespace, since vnet_netlink_set_link_name() was not called in that
case.

[1] https://www.freedesktop.org/software/systemd/man/systemd.link.html

Signed-off-by: Duncan Eastoe <duncan@graphiant.com>
Change-Id: I3d657632856d03979d6b914225c3c841c379e0a1
2021-09-15 12:58:35 +00:00
Pierre Pfister
c26cc72edf vlib: add graceful termination with status
This commit allows a non-VPP thread to request VPP to gracefully
shutdown and return a specific process status value.

Type: improvement
Change-Id: I9bf52b789e7ee28eb272630eaea495fd94349f79
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2021-09-14 14:42:07 +00:00
Mohammed Hawari
46e020183e misc: volunteer as extra maintainer for DPDK
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Change-Id: I97fa566612641f78c2e9850a251cfe9f2d7cfde1
Type: docs
2021-09-14 06:52:10 +00:00
Nathan Skrzypczak
7854b46f77 interface: fix init fib_index_by_sw_if_index
Type: fix

The init of fib_index_by_sw_if_index wasn't
setting default value to 0. Which we now
need for setting interfaces unnumbered

Change-Id: Ie5be9b5e5373ef055557a871ad4d1c45fbfc1dee
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-13 13:54:59 +00:00
Tianyu Li
006bbc4945 snort: fix epoll_wait unsigned return value
When epoll_wait return -1, access array epoll_events[i] out of bound
and lead to segmentation fault.

1. Change return value to signed return value
2. Skip non fatal error e.g. EINTR

Type: fix
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I4ece118999402ec6054baf0efb52419151655def
2021-09-13 13:44:24 +00:00
Florin Coras
596c45b222 tcp session: initialize sw_if_index at connect time
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id0e67a9ce9c5d8bca2cd7a30493f03a02a46dc46
2021-09-13 13:39:18 +00:00
Tianyu Li
db79ac0502 dpdk: fix prefetch assert on Arm
CLIB_PREFETCH (cop[1], CLIB_CACHE_LINE_BYTES * 3, STORE);

Note on 64 bytes cache line size arm machines,
CLIB_CACHE_LINE_BYTES 128
CLIB_CACHE_PREFETCH_BYTES 6

above CLIB_PREFETCH () macro will be expand to
ASSERT ((size) <= 4 * CLIB_CACHE_PREFETCH_BYTES);
it will hit assert due to size (i.e. 3 * 128) > 4 * 64

Solution:
Change to CLIB_PREFETCH (cop[1], sizeof(*cop[1]), STORE);

Type: fix
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Reviewed-by: Lijian Zhang <lijian.zhang@arm.com>
Change-Id: Id0981fd5bd2b25ff71db4197b25578d0b7a9803e
2021-09-13 13:38:36 +00:00
Nathan Skrzypczak
14b472e373 ip: show ip table CLI
Type: feature

Thought this might be useful when using
many VRF to get the list of allocated
VRFs and corresponding names

Change-Id: If9d2c6612d4215e7576315d66d1eb130fcecfa13
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-13 13:37:03 +00:00
Nick Brown
ae4ed3265f build: verbose dpdk build requiring meson 0.55
allow verbose dpdk build to be enabled. Useful for tools, like debian
blhc, that want to inspect build logs.
The '--verbose' option to 'meson compile' requires at least version
0.55.

Type: make
Change-Id: I54e91298f632e2b91247680d9295701b05353abe
Signed-off-by: Nick Brown <nickbroon@gmail.com>
2021-09-13 13:21:23 +00:00
Neale Ranns
ea8adf7637 ip-neighbor: Handle local MAC address change for incomplete adjacencies
Type: fix

When the local MAC address of an interface changes the rewrite strings
of all adjacency types need to be updated - this patch fixes the missing
case of incomplete adjacencies.
I moved the update of all adj types into the adj module, since if the
complete adjs were done by the ip-neighbour module and incomplete ones
by adj module, that would mean two walks of the adj DB, as it is not
possible to walk only a specific type.
UT is updated to include the missing case.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: I36af94976c645bdd0d4d3bc0093b24d7d077e9d7
2021-09-13 08:36:08 +00:00
liuyacan
cba87100f1 vcl: avoid duplicated events in epoll lt
1. Filter event ACCEPTED for lt (same as event RX)
2. Do lt check before vppcom_epoll_wait_xxx to avoid
delivering duplicated events.

Type: fix

Signed-off-by: liuyacan <liuyacan@corp.netease.com>
Change-Id: Ib41c880ceb5072d49e11ab42e31e54398703c0b5
2021-09-10 21:28:44 +00:00
Florin Coras
8cc9321f38 vcl: fix free segments assert
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I837820fd1759cab55f42c54950e991a215234737
2021-09-10 11:37:12 -07:00
Benoît Ganne
10bb21fb13 vlib: fix vlib_buffer_enqueue_to_next() overflow
vlib_buffer_enqueue_to_next() requires to allow overflow of up to 63
elements of 'buffer' and 'nexts' array.
 - add helper to compute the minimum size
 - fix occurences in session and async crypto

Type: fix

Change-Id: If8d7eebc5bf9beba71ba194aec0f79b8eb6d5843
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-09-09 22:22:53 +00:00
Andrew Yourtchenko
2ac5c11cd3 nat: Revert "nat: nat44-ed add session timing out indicator in api"
This reverts commit f059a3452c285ec57a75c7b1ede5052244be4e5d, which broke the build.

https://s3-logs.fd.io/logs/production/vex-yul-rot-jenkins-1/vpp-merge-master-debian10-x86_64/1344/console.log.gz

Change-Id: I16fece8128fa9973495c587d105a8db57738e8f2
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2021-09-09 20:19:53 +00:00
Florin Coras
2abbdecc9b srtp: fix header len assert
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie7b04b11987caadde0942483f171a318ce852228
2021-09-09 19:03:27 +00:00
Alexander Chernavin
f059a3452c nat: nat44-ed add session timing out indicator in api
Type: improvement

Currently, NAT44-ED users sessions details are returned for both active
and timed out NAT sessions. It may confuse users that expect to see only
active sessions in the response and make them think that timeouts for
NAT sessions do not work.

With this change, introduce an indicator of timing out for NAT sessions
returned in NAT44-ED user session details.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ib81ed90369d4b495117538f521e5112e289cf7e6
2021-09-09 16:29:49 +00:00
Ray Kinsella
296f4a3056 stats: revert enable/disable segments polls
This reverts commit 034bd1067eddb700c6d2bc67974056fe00012310.

Type: refactor

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: Icce6052d6cf9616f7eac3185b4c9aace234aa59f
2021-09-09 16:07:19 +00:00
Benoît Ganne
0bb670eb66 session: fix non-NULL terminated string
vlib_unix_recursive_mkdir () expects a NULL-terminated C-string.

Type: fix

Change-Id: I412b48443d0792307d611c466747c0aa5e423417
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-09-09 14:18:27 +00:00
Klement Sekera
c479457096 flowprobe: simplify test logic
Type: refactor
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I9a3923ec1ff1371e870bc57ade4035de07bfbbcb
2021-09-09 14:07:52 +00:00
Benoît Ganne
10355d60db linux-cp: fix non-NULL terminated string
lip->lip_host_name is a non-NULL terminated vector.

Type: fix

Change-Id: Ic154ad7f57f0b507204e55f78995cc0e89132e57
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-09-09 13:20:40 +00:00
Pim van Pelt
b89c1ddcb3 linux-cp: Complete interface creation logic
Linux Control Plane interface creation logic is currently only able to
create untagged interfaces, and dot1q VLAN sub-interfaces. This change
makes it possible to create dot1ad VLAN sub-ints, and Q-in-AD as well
as Q-in-Q sub-interfaces as well.

It makes the plugin a bit more robust by catching a few common errors,
such as creating an lcp on a sub-interface without its parent having
one, and creating an lcp on a sub-interface that is not exact-match.

This change has a bunch of smaller improvemnets as well. I documented
my work in this post:
  https://ipng.ch/s/articles/2021/08/12/vpp-1.html

It shows that after the change is merged, all VPP interface types now
create and operate cleanly as LCP interfaces as well.

Type: improvement
Signed-off-by: Pim van Pelt <pim@ipng.nl>
Change-Id: I322669f7316d44c227090b83d6a574fb9c00e76a
2021-09-09 13:02:34 +00:00
Pim van Pelt
7b46e4bc57 linux-cp: fix crash on failed vlib_buffer_copy
Type: fix


Signed-off-by: Pim van Pelt <pim@ipng.nl>
Change-Id: I390282ecc63600728cf11413510c0169178e305c
2021-09-08 22:08:28 +00:00
Matthew Smith
0d56f60c8c vrrp: fix source address on advertisements
Type: fix

Advertisements are dropped by anti spoofing check in some situations.

When a VR has "accept mode" enabled, we must add the virtual IP addresses
to the interface when the VR transitions to master state. When this
happens, fib_sas4_get() starts selecting the newly added virtual IP
address as the source address for packets sent on the interface, so
advertisements are sent with that source address.

When the virtual IP address is being used as a NAT pool address on a peer
in the backup state, the peer sees the address as a local address and
drops incoming advertisements with that source address.

RFC 5798 section 5.1.1.1 says advertisements should use the primary
IPv4 address of the interface they are being sent on as the source
IP address. Since the virtual IP address is only temporarily added
while the VR is in the master state, the virtual IP address should
probably not be considered the primary address of the interface. The
definition of Primary IP Address in section 1.6 says that selecting
the first address is a valid selection algorithm. Do that instead of
calling fib_sas4_get().

Change-Id: Id92f0e3237c7fd491dd8d695bb27307d494f8573
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2021-09-08 14:40:23 +00:00
Steven Luong
f49734d3b9 interface: add custom interface name support
add CLI "set interface name <current-int-name> <new-int-name>
and the corresponding binary API to allow custom interface name
setting for any interface.

Type: feature

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I2b39da59879fd4526bcb5aa5854b6bd21e72ea73
2021-09-08 14:35:54 +00:00
Zachary Leaf
0c373fc928 perfmon: sort 'show perfmon bundle' output
This patch sorts 'show perfmon bundle' output in alphabetical order.

Type: improvement
Signed-off-by: Zachary Leaf <zachary.leaf@arm.com>
Change-Id: I26b379b5d6766b9f87f9a3a5013ea92b207fb5d4
2021-09-08 14:34:44 +00:00
Mohammed Hawari
2f8174ff51 interface: fix coverity issue
Change-Id: I5bb1ab3a57097bf03e7de5541cc8496655bc728f
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: fix
Fixes: 5b22339973feaa3eba48ead1e9fb428b1816c0cc
2021-09-08 14:33:03 +00:00
Ray Kinsella
710bdef43c perfmon: add membw-bound bundle
Added memory bandwidth boundedness bundle, closely related to cache-hierarchy.
This bundle works on ICX only, due to an ICX specific counter.

Type: improvement

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: Id385bd5f4e645ac020774e311c623afb64b79b1e
2021-09-08 14:30:03 +00:00
Ray Kinsella
c3cb2075de perfmon: adding support for papi TMAM
Adding support for Linux papi TMAM on Intel Snowridge. Adds the ability to
indicate that a bundle should be thread or node bundle type based on available
cpu features (rdpmc support).

Type: feature

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: Ib871b2644fdb2410fbb580e0d21c3a8e2be13aba
2021-09-08 14:30:03 +00:00
Klement Sekera
6f98d9900d nat: remove unusued parameters and use correct parameter types
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I4f7b3d5354a7658d7271c28444f2f4641f05b28b
2021-09-08 11:38:37 +00:00
Klement Sekera
1dc146efae tests: fix DEBUG=attach multiple worker config
Type: fix
Change-Id: Ie7920c0c699904de0f68ddb749725887b569f295
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-09-08 11:22:45 +00:00
Mohammed Hawari
6d1b079bf3 dpdk: fix coverity
Coverity does not seem happy about exotic control
flows in switch/case statements

Change-Id: Ie006190058f811aacf85125ebc58330d9c53510f
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: fix
Fixes: 0b42ac565b970c186a9ad734f980b440f56fb25b
2021-09-08 10:41:25 +02:00
Mohammed Hawari
eed6fc9a98 devices: restore regular af-packet tx path
This change restores the af_packet tx path prior
in use prior to Change
Idf0bdd88990254a614962c2f7bc3e0292ccfd61a but
fixes the stalling issue by ensuring that the next
tx frame pointer is only incremented when a new tx
frame is used. This change also enables the
af_packet PACKET_QDISC_BYPASS option, for better
performance.

Change-Id: I65dde648ed66d21654847a900ceda5a8980ae6ec
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2021-09-07 17:14:36 +00:00
Mohammed Hawari
0b42ac565b dpdk: lro support
Change-Id: Ifa09dcdfd567ac3c2afab4bd3bd468260f766e1d
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: improvement
2021-09-07 17:13:45 +00:00
Maxime Peim
5b22339973 interface: full poll vector on adaptive mode
When an input supports adaptive mode and enters
in polling, some rx queues may be missing from
the node's rx_poll_vector. To solve the issue,
a full poll vector is being computed in
vnet_hw_if_update_runtime_data, and returned
by vnet_hw_if_get_rxq_poll_vector when the
node is polling in adaptive mode.

Type: fix
Signed-off-by: Maxime Peim <mpeim@cisco.com>
Change-Id: I249bcb20ae0dd28afb0a5ca32993092bafd2f6b1
2021-09-07 15:48:37 +02:00
Ahmed Abdelsalam
277ae8ba43 sr: fixing typo in srv6 End.AS Proxy documentation
Type: docs

Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com>
Change-Id: I0cbc1b21f156425e067e9ce90769a62983ca5d01
2021-09-03 16:48:04 +00:00
Filip Varga
4d41f954ab nat: NAT44 ED improvements and fixes
Fixed FIB entry per interface, pool and
static mapping registrations in NAT control plane.
Improved FIB configuration handling in NAT -
added functions to generalize handling of FIB & NAT,
cleaned up interface callback functions. Changed "is_"
macros to inline functions for easier debugging.

Type: improvement

Change-Id: I68a17761a975dd819139ae94e52a8a85d3f27ffc
Signed-off-by: Filip Varga <fivarga@cisco.com>
2021-09-02 14:06:42 +00:00