12863 Commits

Author SHA1 Message Date
Mohammed Hawari
d5b6f9c0ef misc: fix INFO.yaml mistakes
Change-Id: If4e7911788b6aab67672b7e7228ecbdb402a85d5
Type: fix
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2023-06-08 13:16:56 +00:00
Benoît Ganne
f40bdbb80d af_xdp: make sure all packets are transmitted
AF_XDP socket will only tx enqueued packets up to a max batch size so
we need to retry until everything has been sent.

Type: fix

Change-Id: Ia487ab63d3e85a478471cd1d679c5fb471804ba3
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-06-08 11:53:21 +00:00
gaoginskx
f441b5d0ed crypto: use fixed crypto frame pool
The async frames pool may be resized once drained. This will cause 2 problems: original pool pointer is invalidated and pool size changed, both problems will confuse the crypto infra user graph nodes (like IPsec and Wireguard) and crypto engines if they expect the pool pointers always valid and the pool size never changed (for performance reason).

This patch introduces fixed size of the async frames pool. This helps zeroing surprise to the components shown above and avoiding segmentation fault when pool resizing happened. In addition, the crypto engine may take advantage of the feature to sync its own pool/vector with crypto infra.

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I2a71783b90149fa376848b9c4f84ce8c6c034bef
2023-06-08 09:18:58 +00:00
Artem Glazychev
f50929d370 af_xdp: remove the previous program before loading a new one
Otherwise, we will get an error. The program could remain from the previous run.

Type: fix

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I68e4072bd3b327592013804d67ccab7eb0ed3a0e
2023-06-08 09:15:09 +00:00
Florin Coras
470d72f54a vcl: fix epoll ctl frequent deq ntf requests
SVM_FIFO_WANT_DEQ_NOTIF_IF_FULL should be treated as a
config option that is not frequently changed. Or alternatively, it
should be set together with SVM_FIFO_WANT_DEQ_NOTIF to elicit a one time
tx notification.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie4132c7789ee87227a875ff981eb98f9f4d898a9
2023-06-06 18:39:14 +00:00
Mohsin Kazmi
e3d058fc75 misc: fix the license header
Type: style

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I6b3ecf0bdb6cfdf260cf4ccae89b6bc2335ff54c
2023-06-06 15:52:21 +00:00
Florin Coras
acecd0d9c2 vcl: avoid duplicate tx events with epoll lt
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic6436426ead561e47fb77ed9a95afbd85f2998ae
2023-06-05 17:28:35 +00:00
Benoît Ganne
d52f80f422 udp: improve port validity check
- do not allocate port sparse vector when only checking if a port is
   already in use
 - do not display port that have been unregistered by default

Type: improvement

Change-Id: I6cc94e35806dd8d415cd5d1c1c51e6b066ac26a1
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-06-05 16:23:43 +00:00
Pim van Pelt
af4fa965e9 linux-cp: Fix add vs update on routes
Linux uses NLM_F_REPLACE in the netlink message to signal a FIB update
The code invariably does a FIB update for IPv4 and a addition for IPv6.
Without this fix, the following:
 ip route add 2001:db8::/48 via 2001:db8::1
 ip route replace 2001:db8::/48 via 2001:db8::2

ends up as two separate FIB entries in VPP. With the fix, there will be one FIB entry (the second one with nexthop ::2).

Type: fix
Change-Id: I8f98d6ded52ae0c60bfddaa7fc39acbbaa19d34a
Signed-off-by: Pim van Pelt <pim@ipng.nl>
2023-06-05 15:27:21 +00:00
Mohammed Hawari
ce93f125d0 misc: update INFO.yaml
Change-Id: I55ea2c11148421aef8f891829671d88be171daa2
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2023-06-02 17:55:40 +00:00
Florin Coras
607eb203b1 vcl: refactor want deq ntf checks for null fifos
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5d0445ca381f1a4943bb2fe454433b3454043b56
2023-06-02 16:19:33 +00:00
Florin Coras
645ac119e8 session: cleanup cless listeners from session lookup
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I46b8194ff00c6a0a4a2bc19df9991f037856cede
2023-06-02 16:04:59 +00:00
Alexander Chernavin
f2b6edb149 wireguard: add support for chained buffers
Type: feature

With this change, packets that are larger than a single buffer can fit
will be able to be sent and received over a Wireguard tunnel. Also,
cover this with tests.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ifaf7325676d728580097bc389b51a9be39e44d88
2023-06-02 14:41:53 +00:00
Ondrej Fabry
b1239c4887 api: nat44_ed - Mark old message versions as deprecated
List of changed messages:
 - nat44_add_del_static_mapping
 - nat44_user_session_dump
 - nat44_user_session_details
 - nat44_user_session_v2_dump
 - nat44_user_session_v2_details

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I317ae93a0e763c3759a8c24fd550e1c97f6f4987
2023-06-02 13:18:28 +00:00
Filip Tehlar
d3b47c6d79 hs-test: fix vcl test parameter
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ieb6e46439d8e66a792f9c508e7dc49ecdd392487
2023-06-01 15:50:59 +00:00
Xiaoming Jiang
9a9604b09f crypto: make crypto-dispatch node working in adaptive mode
This patch can make crypto dispatch node adaptively switching
between pooling and interrupt mode, and improve vpp overall
performance.

Type: improvement
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: I845ed1d29ba9f3c507ea95a337f6dca7f8d6e24e
2023-06-01 10:17:50 +00:00
Stanislav Zaikin
8340b24997 fib: fix memory leak in fib_attached_export_purge
Type: fix

Change-Id: I879594fcade4e081190e8dfb1dbcfc53e8431edf
Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
2023-05-31 21:52:29 +00:00
Maxime Peim
94a0f57a62 misc: fix tracedump API
In some cases, in the trace dump v2 dump function, we iterate over the
client cache even though this one could be empty.

Type: fix
Change-Id: Ice5cefa25bb93dabe86fe565347cdc32faa674ac
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2023-05-30 09:16:22 +00:00
Mohsin Kazmi
562ac2f4e4 virtio: fix the packet buffering initialization order
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Idada695432d2bfac8808f35f1e8cd16f84d963c6
2023-05-30 09:15:25 +00:00
Mohsin Kazmi
7280e3f866 libmemif: add testing application
Type: test

This application creates two memif interfaces which connect
to an external application i.e. VPP.

Usage:
1) Start VPP with following config.
create interface memif id 0 master
create interface memif id 1 master
set int state memif0/0 up
set int state memif0/1 up
create packet-generator interface pg0
set int state pg0 up
create packet-generator interface pg1
set int state pg1 up

set int l2 xconn pg0 memif0/0
set int l2 xconn memif0/0 pg0
set int l2 xconn pg1 memif0/1
set int l2 xconn memif0/1 pg1

packet-generator new { \
  name memif           \
  limit -1             \
  node ethernet-input  \
  size 64-64           \
  interface pg0        \
  worker 0             \
  data {               \
    IP4: 42:01:0a:00:00:0a -> 02:fe:4b:6e:4d:c1 \
    UDP: 172.16.2.2 -> 172.16.0.2               \
    UDP: 1234 -> 1234                           \
      length 30 checksum 0 incrementing 1       \
  }                                             \
}

2) Compile and Run the test_app in another terminal.
mkdir -p extras/libmemif/build
cd extras/libmemif/build
cmake ..
make
sudo ./examples/test_app

3) Run in VPP cli
vpp# packet enable

4) Run monitor to see the throughput and pps
vpp# monitor interface memif0/0
Or
vpp# monitor interface memif0/1

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I4b9062fca8ad3020225adb7b1b09e5d66b1a7d48
2023-05-30 09:01:53 +00:00
Xiaoming Jiang
0c1454c1f3 ipsec: fix ipsec_set_next_index set with wrong sa index when async frame commit failed
Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: Ib4c61906a9cbb3eea1214394d164ecffb38fd36d
2023-05-29 09:52:59 +00:00
Damjan Marion
1000125395 vppinfra: add bit_extract_u32 and bit_extract_u64
Type: improvement
Change-Id: Icfaa856aa4b50ad5c6828f1690ce3fb6ba08ec00
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-05-27 17:44:23 +00:00
Damjan Marion
7e58d9b625 vlib: add foreach_vlib_frame_bitmap_set_bit_index to .clang-format
Type: improvement
Change-Id: I6b999bcc6394bcc9325de1568dba98d1eb5a7b15
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-05-27 17:41:45 +00:00
Damjan Marion
bf179a91d8 vlib: add vlib_log_is_enabled
Type: improvement
Change-Id: I052e0d56cc6d89cd66c83a9bb81e2273d396d510
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-05-27 17:41:28 +00:00
Alexander Chernavin
2355e49733 linux-cp: update adjs for subifs too when mac changes
The plugin creates and manages adjacencies for the physical interface in
each interface pair (they are part of the x-connect feature). When a
link update notification is received from the host system, MAC address
of the corresponding physical interface is updated (as needed) as well
as previously created adjacencies for it (because a new rewrite string
needs to be generated).

Subinterfaces inherit MAC address from the parent interface. When MAC
address of the parent interface changes, it also implies MAC address
change for its subinterfaces. The problem is that this is currently not
considered in the plugin. After MAC address update on the parent
interface, packets sent from subinterfaces might have wrong source MAC
address. For example, IPv6 Neighbor Solicitation messages will be sent
with the wrong (previous) MAC address and neighbor discovery will fail.

With this fix, when the plugin updates adjacencies for a physical
interface, it will also update adjacencies for the subinterfaces with
existing interface pair.

Type: fix
Change-Id: Ia5f617197e33cb79b9b025c02c2c126c31a551ec
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-05-26 21:52:18 +00:00
Xiaoming Jiang
4778164869 tls: fix memory leak when client/server init error
Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: I484f3759b6c27052e08741398ec389729285f035
2023-05-26 00:32:25 +00:00
Florin Coras
d921b89880 udp: fix local port reuse check
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I323946f7838507110c663f5a904399a74fc76691
2023-05-25 13:21:46 -07:00
Filip Tehlar
71fc194703 hs-test: add vcl echo tests
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I3e543cb292c7ed0f9d240f8f2473a1db07aff0fd
2023-05-24 17:38:10 +00:00
Mohsin Kazmi
5e42eae58b hash: add hash documentation
Type: docs

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I36764aa3c0e9657d228413aeafa0a54bbd755e49
2023-05-24 14:47:42 +00:00
Andrew Yourtchenko
a7dd04d73b misc: Initial 23.10-rc0 commit
Type: docs
Change-Id: Id9b0ca0d43db0e5a52fd9696a5cba77a6772db5b
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
v23.10-rc0
2023-05-24 11:25:10 +00:00
Andrew Yourtchenko
380c62d704 misc: VPP 23.02 Release Notes
Type: docs
Change-Id: I88ae8452ed1b39a4c6d82b790f63f31deae4c2fa
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 5516fc0f3bf50657446c4e68556c9f76ea2a43a4)
2023-05-24 07:00:40 +00:00
Florin Coras
db3fbfca51 vcl: avoid reusing user provided events in lt mode
Epoll events might not have been cleared by user so always compute event
flags locally and assign to user provided epoll event.

Type: fix

Signed-off-by: Ping Yu <ping.yu@intel.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3b594a0fd7be345a0e0ad81d1d3636e9354cc15d
2023-05-23 17:34:50 +00:00
Maxime Peim
02063b985a misc: fix tracedump API to match CLI behavior
When dumping packets from multiple threads using the API, first all
packets from thread 0 are dumped then all ones from thread 1, etc
Until we reach the limit specified by the API call, so we could never
get packets trace from threads with higher ids.
However, the tracedump CLI dump a maximum number of packets from all
threads, which we can expect from the API to do.

We also add a trace_clear_cache API so the client gets an answer when
he only wants to clear its packet cache.

Type: improvement
Change-Id: I0d4df8f6210a298ac3f22cd651eb4d8f445e1034
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2023-05-23 11:40:29 +00:00
Xiaoming Jiang
eed42b0efa bufmon: ptd should be alloced in main thread
Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: I7f8c975fae5d71ce1226a8e19761fc75134e61e2
2023-05-23 09:18:06 +00:00
Stanislav Zaikin
51541247cb teib: fix nh-table-id
Peer fib index and nh fib index should be different when nh-table-id is
specified.

Type: fix

Change-Id: I4c8296adb5aeab1c0022bfc1046e9559331b79b2
Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
2023-05-22 10:49:54 +00:00
Adrian Pistol
ae48ffb503 mpls: implement state change callbacks
There was already a basic type defined, but nothing more.
This implements callbacks similar to
ip4_enable_disable_interface_callback_t.

Type: feature
Change-Id: I34fcb146ca68af4eb8cdd244529eb149f884284d
Signed-off-by: Adrian Pistol <vifino@posteo.net>
2023-05-21 23:07:48 +00:00
Sergio Gonzalez Monroy
06f1290703 ip-neighbor: fix aged neighbor probe
The order of the parameters when calling the ip_neighbor_probe_dst for
an aged neighbor is wrong and given that it runs on the master thread,
probes for IPv6 neighbors were never sent, leading to a certain neighbor
strike out and death and its removal from the neighbor cache.

Change-Id: Ic021bd0ece05bd2c1c6ab90eab0e2dc27cb10360
Type: fix
Fixes: fd2417b2a42
Signed-off-by: Sergio Gonzalez Monroy <monroy@anapaya.net>
2023-05-21 23:06:41 +00:00
Filip Tehlar
f96b6c65fd hsa: add an option to configure ns in http cli
Type: feature

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ia81f1d8e706dbce9e57319d993bff595e6ba6f03
2023-05-20 17:04:29 +00:00
Filip Tehlar
608d0069d9 hs-test: support for multiple workers
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ie90e4b02c268bc3ca40171b03829f5686fb83162
2023-05-20 15:51:02 +00:00
Klement Sekera
47f3527108 tests: support for expected failures
- Add support for @unittest.expectedFailure decorator.

Type: improvement

Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I761751cda505e962225dc680b97c1fffa96f5176
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-05-20 02:34:14 +00:00
Klement Sekera
0157885517 tests: enhance counter comparison error message
- Make error message more human readable.

Type: improvement

Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: Iefc276b3a85ff82b927028a72bb91ed87ebd04ba
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-05-20 02:33:57 +00:00
Sergio Gonzalez Monroy
6d6d9ed161 misc: long overdue update to maintainers file
Type: make

Change-Id: I2ee286985819974e02e34b8166c69ef7d767e47e
Signed-off-by: Sergio Gonzalez Monroy <monroy@anapaya.net>
2023-05-19 21:48:01 +00:00
Klement Sekera
d3e0d104ad tests: refactor extra_vpp_punt_config
Rename extra_vpp_punt_config to a more generic name extra_vpp_config to
better fit its purpose. It's fit for general use and already used that
way by quic and vcl tests anyway.

Type: refactor
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: Ib0a5789b0dbb3a8c3cae654dea4e32ac5e56dd41
2023-05-19 21:29:39 +00:00
Duncan Eastoe
cf214cc600 stats: fix memory leak in stat_segment_dump_r()
The built stat_segment_data_t is leaked if stat_segment_access_end()
returns false.

Type: fix
Signed-off-by: Duncan Eastoe <duncan@graphiant.com>
Change-Id: I70adabbe7947d3e8a798cdfb3eaa14c683dce9da
2023-05-19 21:17:37 +00:00
Benoît Ganne
e211ac4886 fib: fix load-balance and replicate dpos buckets overflow
load-balance and replicate dpos both store their number of buckets as
u16, which can overflow if too many paths are configured. For
load-balance it can happens quite quickly because of weights
normalization.

Type: fix

Change-Id: I0c78c39fc3d40626dfc58b49e7d99d71f9852b50
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-05-19 21:14:52 +00:00
Andrew Ying
168bb1d55e dpdk: fix compatibility with DPDK < 21.11
Signed-off-by: Andrew Ying <hi@andrewying.com>
Type: fix
Change-Id: I3c428c90146387ad9ce291c7f646d74f06952b40
2023-05-19 20:56:15 +00:00
Florin Coras
d35c71c2f1 tls: flag no app session on handshake failure
If openssl tls server handshake fails, track the fact that the context
does not have an app session.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5f493059a3610067b59caffbbe441ce9e0868252
2023-05-19 20:46:06 +00:00
Daniel Ding
fc70a66456 dpdk: fix format device name using wrong index
When I setup vpp by netvsc driver, occurs the following crash:

(format_dpdk_device_name) assertion `(i) < vec_len (dm->devices)' fails

vnet[100166]: #6  0x00007f434d651f6a _clib_error + 0x2da
vnet[100166]: #7  0x00007f430b4bef64 format_dpdk_device_name + 0xf4
vnet[100166]: #8  0x00007f434d6555f3 do_percent + 0xee3
vnet[100166]: #9  0x00007f434d654359 va_format + 0xb9
vnet[100166]: #10 0x00007f434d7ac16e vlib_log + 0x3ce
vnet[100166]: #11 0x00007f430b49ebe3 dpdk_device_start + 0x193
vnet[100166]: #12 0x00007f430b4aa233 dpdk_interface_admin_up_down + 0x163
vnet[100166]: #13 0x00007f434d988fc8 vnet_sw_interface_set_flags_helper + 0x378
vnet[100166]: #14 0x00007f434d989338 vnet_sw_interface_set_flags + 0x48

This patch fix it by device_index as a index for devices vec, and not
dpdk port_id.

Type: fix
Change-Id: I84c46616d06117c9ae3b2c7d0473050f1b8ded5f
Signed-off-by: Daniel Ding <danieldin95@163.com>
2023-05-19 19:53:08 +00:00
Florin Coras
bc4d5b0ace vcl: set want deq flag earlier in epoll ctl mod
On epoll ctl mod, set want deq flag before checking if unhandled events
are needed.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id1491837c7156a66c21e0e45af60b04b1c18601c
2023-05-19 19:31:49 +00:00
Florin Coras
4817855115 vcl: always reset deq ntf flag in epoll evt handler
Reset deq notification flag even if session is no longer epolled.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4e9aed1849aa2817176f3a54ae41910df5e704a0
2023-05-19 19:31:30 +00:00