Compare commits

...

528 Commits

Author SHA1 Message Date
Andrew Yourtchenko
7c4027fa5e misc: VPP 23.10 Release Notes
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Icd40064c06ccc53efba1cd9564613108b999b656
2023-10-20 11:24:41 +02:00
Florin Coras
fe95c23795 session: ignore app rx ntf if transport closed
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id56a101a6350903b00f7c96705fb86039e70e12c
(cherry picked from commit a0b8c8fdf3fc555fc2ed7792d67bf3fb4fb99b9f)
2023-10-11 20:05:48 +00:00
Dave Wallace
015a6f7f17 vppinfra: fix coverity issue CID 323952
Type: fix
Fixes: 08600ccfa

Change-Id: I53ba0d96507b55ab7cd735073d6c4cf20a3cc948
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 05cc62dd504bbb0fb230fcf3786ed7f4d5be2364)
2023-10-11 03:13:11 +00:00
Florin Coras
471dc6b1e3 session: maintain old state on premature close
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2ea821e0499a3874c4579f5480ea86f30ebe615f
(cherry picked from commit 84c9ee3d696ef5c1162530a30ba591b806a7e175)
2023-10-10 23:49:41 +00:00
Florin Coras
1ec3a70f66 session: propagate delayed rx evts after connect/accept
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4a2e8f864df7269ec5a3c4fd4d8785a67b687d58
(cherry picked from commit 431b489c5a4f60a82781ace60d07471d003787af)
2023-10-09 23:39:49 +00:00
Florin Coras
9003233377 tls: propagate reads to app irrespective of state
Session input node handles rx notifications even if session not fully
accepted/connected

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6560c45db8f8e0b7f0dc3bdd0939f13ca2f43f15
(cherry picked from commit aa7b88120ad83a29a05522bed4e5aa71524b8aba)
2023-10-09 21:46:16 +00:00
Florin Coras
3c06859f9f session: handle accept and connect errors
If builtin apps refuse connections, they should be cleaned up.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I95ef22902ac3fe873e15e250aa5f03031c2dc0c4
(cherry picked from commit 9ffec14a2202e1268c4a2f189c39a90986090a25)
2023-10-09 21:42:49 +00:00
Florin Coras
4ba523740f tls: no read after app close
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I34f8ee2e36d07e8e55e21561528fc6b73feb852f
(cherry picked from commit 3843d0dd03a3ebbdb5d13b54e1b871a8ea72498c)
2023-10-09 21:41:12 +00:00
Florin Coras
05919da49d tls: report error if connected cannot be initialized
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I987ac6b461b473836917bce6ce0d4ac109cc8ddb
(cherry picked from commit a3d55df1e91a7df4ad4c0e1b639ba12a1ed04c79)
2023-10-09 21:40:38 +00:00
Damjan Marion
b53daca83f vppinfra: fix string termination in clib_file_get_resolved_basename
Type: fix
Fixes: 40f4810
Change-Id: Idf51462c8154663de23154f17a894b7245c9fbf0
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 08600ccfa12f529d6ca7b852106227fc5f7addbf)
2023-10-09 21:38:26 +00:00
Florin Coras
15d0c7a3fb tls: limit openssl engine max read burst
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic7a8fd37d79fc9c09c8b1539d630f3b8983b8bb3
(cherry picked from commit c1b038001e1f18effb3c9ff5daa9e9cac1cd66e8)
2023-10-09 21:37:55 +00:00
Florin Coras
f9af6b32ef tls: init connection for prealloced app sessions
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Icd62dc110e3a73b24372f3a5162f8008b7edee9f
(cherry picked from commit a127d3c157cb6e7658451a877abbfe0dd16c982a)
2023-10-09 21:37:24 +00:00
Florin Coras
ee2e502736 tls: ignore tx events for not fully established sessions
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I401a116a1a46c0dc5d591115de5ff0eef2f6440b
2023-10-09 21:36:45 +00:00
Florin Coras
e7295fd974 tls: fix formatting of half open connections
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If96dc748a716a261edfcb1020210bd73058e382f
2023-10-02 19:33:49 +00:00
Andrew Yourtchenko
14df6fc1ea misc: Initial changes for stable/2310 branch
Type: docs
Change-Id: I82d323c6e4585772e5c9a9f5b5bbb77b65c1da85
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2023-09-20 16:56:20 +02:00
Naveen Joy
df17a1f068 tests: remove unsupported qemu feature
pretty=on|off has been removed from qemu and its presence
causes VM boot up issues.

Type: fix

Change-Id: I4a9f15dba5015e81fbd32278b1c74b2606c32c8f
Signed-off-by: Naveen Joy <najoy@cisco.com>
2023-09-20 01:55:47 +00:00
Ole Troan
a05f93a9e5 npt66: ensure feature is not configured multiple times
If the control agent enabled a binding on an interface multiple times,
we would add the node in the feature arc multiple times.

Type: fix
Change-Id: I2ca247db0a0211f5fa3974a18ca4fcae8485cb12
Signed-off-by: Ole Troan <otroan@employees.org>
2023-09-19 14:16:28 +00:00
Florin Coras
ae036d3b7d vcl: unset fifo evt before size check
For blocking sessions, if fifo event still active before size check it
could lead to vpp not generating an event because of race to check flag
in vpp and to eventually unset flag in vcl.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0e350b9ff92a4e08a9249345ae224589c09d305b
2023-09-18 10:22:35 -07:00
Dave Wallace
604c627dc3 vapi: fix coverity warnings
- CID-322713, CID-322712, CID-314881, CID-314880,
  CID-314878 COPY_INSTEAD_OF_MOVE

Type: fix

Change-Id: Idad6806fcd4e1a89a750dcc0584b5b1f0432bf3c
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-09-16 07:50:17 +00:00
Andrew Yourtchenko
74cbed1497 misc: VPP 23.06 Release Notes
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Id39d7d6a6340e65885ab0845b6fc9a2b81e4f565
(cherry picked from commit 493b8990d1185f818890560101e13e1b69f54b1d)
2023-09-16 04:54:53 +00:00
Gabriel Oginski
052b023488 vpp-swan: fix configuration of policies
This patch fixes configuration of priority, port and type of protocol
for inbound and outbound policies in policy-based IPsec of this plugin.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I01ddc2e13ebbe87380e66a525aac1b615f619604
2023-09-15 11:19:16 +02:00
Vladislav Grishenko
5b3e04c74f nat: fix nat44_ed set_session_limit crash
Setting session limit should return error for unknown fib.
Optimize max_translations_per_fib expanding and drop unnecessary
trailing fib entry.

Type: fix
Change-Id: Ie7d2b363ade48f53598faa617a49cce7b2db6400
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
2023-09-13 16:56:19 +00:00
Florin Coras
e8a1dbf8da quic: fix quic sessions state updates
Session state cannot be updated after async notification event is
generated for app. Instead, make sure quic sessions that accept new
streams are switched to listening state only on accept.

Type: fix
Fixes: 0242d30

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9663ccadbea99d555ad49e871f7dff897239dc84
2023-09-13 16:35:51 +00:00
Andrew Yourtchenko
238cf3bd49 sr: mark sr_policies_v2_details message as production
As per discussion on the VPP community call,
since the message is used in CSIT tests and did
not see the changes in a while, mark as production
for the purposes of change process.

Type: improvement
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I4a79aafb1a9f37ac87faea7abea28cf01d1ffb4c
2023-09-13 16:06:53 +00:00
Andrew Yourtchenko
b116bf8f37 adl: stabilize the API
As discussed on the VPP call, since CSIT tests use these messages
and they have not been changedfor quite a while, bump the version
so these messages are considered as "production" from the change
process standpoint.

Type: improvement
Change-Id: I93a04b10b273d5904c0678fa0b85d47f9f683a9b
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2023-09-13 16:06:29 +00:00
Andrew Yourtchenko
9c7e033488 flow: mark API as production
As per discussion on the VPP call - since the APIs are used
in CSIT tests, mark them as production from the change process
perspective.

Type: improvement
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I9164073425384e8aa281445a2852fee49b777e2f
2023-09-13 16:05:55 +00:00
Andrew Yourtchenko
f29d9f0604 wireguard: stabilize the API
As per discussion on VPP call - since the APIs are used in CSIT tests,
and there has not been changes in a while, mark them as stable from
the API change process PoV.

Type: improvement
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Ia644e1dfcd9d182cc6f10089fc44397a61e8aaf6
2023-09-13 16:05:14 +00:00
Andrew Yourtchenko
a998f80cd9 crypto-sw-scheduler: stabilize the API
As per discussion on the VPP call: since the CSIT tests use these
APIs and the APIs have not changed in quite a while, stabilize the API
from the change process point of view.

Type: improvement
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Id81999d03cce37764f6ed7d4f77ef5a71fe41ad1
2023-09-13 16:04:47 +00:00
Dave Wallace
4cae8f9bee hsa: fix coverity issue CID-313635
Type: fix

Change-Id: Ieb50ab548bb34bdbb44d973037ee452d48f412ea
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-09-13 15:51:17 +00:00
Dave Wallace
7f9b690b06 api: fix vlibmemory coverity warning CID-300152
Type: fix

Change-Id: Icdebc8629946e0e7c8dde3e45ee93ff9027e7c68
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-09-13 15:50:15 +00:00
Damjan Marion
7bf8f5e484 vppinfra: add ARM Neoverse-N2 support
Type: improvement

Change-Id: Ief77ae7338667ede290aece6933bb5ae2e76ffc6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-09-13 15:02:43 +00:00
Damjan Marion
3d2f718e6f build: fix clang-16 build
Change-Id: I882bef6f45fd276587fb93944ff4e21dc57dbca2
Type: fix
Fixes: 1c82cd4
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-09-13 13:41:36 +00:00
Damjan Marion
aa9177c751 idpf: make plugin default disabled until issues are fixed
Type: improvement
Change-Id: I2daa8fc338289555649135e7f0898e139807fdce
Signed-off-by: Damjan Marion <damjan.marion@gmail.com>
2023-09-13 13:40:29 +00:00
Vratko Polak
c142cd115b docs: mention how to build VPP outside git
Type: docs

Change-Id: Iceee9ef489f7f68049882651bb338311295ca12d
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-09-13 13:37:22 +00:00
Benoît Ganne
e462e543b2 build: add vpp_plugins include directory
Type: fix

Change-Id: Iacb04846c634231854f26348cc17cc729d6e0d87
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-09-13 12:21:14 +00:00
Dave Wallace
73f23a806d vppinfra: fix coverity warning CID-313632
Type: fix

Change-Id: Idc036d5967495cc2522b2a30e3acd3ec4c0cd3ff
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-09-13 12:19:40 +00:00
Vratko Polak
fee945940c vlib: deuglify the offset finding loop in pci.c
Type: style
Fixes: 054229ebbdeb3f87d96c1abf93b511c86cd6ff0f

Change-Id: I7c3080db94566af249e5082d59a4e6373c616888
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-09-13 12:17:53 +00:00
Tianyu Li
4585bb121b perfmon: fix perf_user_access_enabled type
perf_user_access_enabled is defined as u8,
clib_sysfs_read format type is %u, this is for unsigned int,
change type from u8 to u32.

Type: fix
Fixes: 268d7be66b8b ("perfmon: enable perfmon plugin for Arm")

Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I48ec00605e496d185370e77d894d7852d6d22124
2023-09-13 12:15:53 +00:00
Artem Glazychev
986ca97311 vppinfra: fix setns typo
Type: fix

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: Ib8eb70336956bc2e8d0454f3c1f2c62ec98cb009
2023-09-13 12:15:17 +00:00
Dave Wallace
63335e4898 pci: fix coverity issue CID-322372
Type: fix

Change-Id: Iaf16bb720d76ea3ae04afb8123b7cac15771ef2b
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-09-13 12:14:18 +00:00
Xiaoming Jiang
7a72658665 ipsec: improve fast path policy searching performance
Type: improvement
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: Ib8bb300f5b62648f6b634046415742bdf5365982
2023-09-12 12:42:56 +00:00
Vratko Polak
139aba2047 crypto: allow changing dispatch mode
This change aims to affect crypto_sw_scheduler behavior,
but all the edits end up in vnet/crypto.

Previous release CSIT tests were testing async crypto in polling mode.
After 9a9604b09f15691d7c4ddf29afd99a31e7e31eed introduced adaptive mode
for crypto dispatch, the CSIT performance got way worse.

Possibly, there is another VPP bug related to adaptive mode
(it should not lose as many packets as seen in CSIT),
but the next release is too close for trying to fix that.

This change (instead of fixing adaptive mode)
allows CSIT to continue testing polling mode (after explicit API call),
while keeping the adaptive mode as default behavior.

The deprecated crypto_set_async_dispatch always disable adaptive mode,
crypto_set_async_dispatch_v2 has parameter to enable or disable it.
The mode parameter is still used for the inital state of adaptive mode.

Type: feature

Change-Id: Ib98080eefb4be291207af543884f2c3837f92f59
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-09-12 12:42:11 +00:00
Vratko Polak
ceb64add2a crypto-sw-scheduler: improve function indentation
The checkstyle --fix command remains confused
around the def/foreach/undef usage in convert_async_crypto_id,
but at least the other functions now look correctly indented to me.

Type: style

Change-Id: Ic8f7b580267386b7a6b07d33d9ba7ae9787c0e0a
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-09-12 12:38:08 +00:00
Florin Coras
48cd559fb5 session: make sure rx evt flag is cleared for builtin rx
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I99631b1be6e19f0cefd1cefa82a51e6f8e9be2ac
2023-09-07 16:46:50 +00:00
Frédéric Perrin
a4157aec1c ipsec: clear L4-cksum flags when decap'ing packets
Type: fix

Signed-off-by: Frédéric Perrin <fred@fperrin.net>
Change-Id: I45191b7316c88038bcd57d62aeb07bb109cf4a4d
2023-09-07 08:07:51 +00:00
Piotr Bronowski
c143cc8967 dpdk-cryptodev: fix cache ring stats cli command
The logic for calcuating processed elements in the cache ring was broken.
In case tail and deq_tail equals and frame element pointed by the tile
is not NULL it means there is exactly one processed element in the ring.

Type: fix

Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I69c978334fc952049393214ccc9cc5245351f7f7
2023-09-07 08:05:54 +00:00
Damjan Marion
f0fc65a4b9 build: add option to specify native -march= flag with VPP_BUILD_NATIVE_ARCH
Type: improvement
Change-Id: I98eeba1ad2f9ed0531a7c615e0e70e535f24f813
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-09-06 18:57:54 +00:00
Vladislav Grishenko
579a6fb89b nat: improve nat44-ed outside address distribution
Use client address hash to pick the first outside address
instead of just address high octet, becasue it may denegerate
into stable 10/172/192, depending on nat address count.

Fix outside address distribution test to acually test the
distribution, not the algo, so previous distribution will
fail with 65 nat addresses and 100 clients:

FAIL: Outside address distribution based on source address
Traceback (most recent call last):
  File ".../test/test_nat44_ed.py", line 2048, in test_outside_address_distribution
    msg="Bad outside address distribution")
AssertionError: 156.25 not less than 0.33 : Bad outside address distribution

Type: improvement
Change-Id: I604b1294422f20d211db5614c47559557a78a193
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
2023-09-06 16:44:15 +00:00
Mohsin Kazmi
a181eaa59b virtio: add support for tx-queue-size
Type: improvement

DBGvpp# set loggin class virtio level debug
DBGvpp# create int virtio 0000:00:03.0 tx-queue-size 1024

show virtio pci
```
  Virtqueue (TX) 1
    qsz 1024, last_used_idx 0, desc_next 0, desc_in_use 0
    avail.flags 0x1 avail.idx 0 used.flags 0x0 used.idx 0
```

show logging
```
2022/07/22 23:20:22:557 debug      virtio         0000:00:03.0: tx-queue: number 1, default-size 256
2022/07/22 23:20:22:557 debug      virtio         0000:00:03.0: tx-queue: number 1, new size 1024
```

Change-Id: Ib1a3ebe742b3a6c9fe72bd1c5accfe07682cbdd1
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2023-09-06 12:13:45 +00:00
Ole Troan
56b8abc07f ip: punt add punt socket support for icmp6
Punt support for ICMP6 messages allows for an external IPv6 RA advertisement agent.

Type: feature
Change-Id: I0cc928b747ac1f8335ee9f7c42a3231424825dbc
Signed-off-by: Ole Troan <otroan@employees.org>
2023-09-06 10:48:18 +00:00
Vladislav Grishenko
e7c57c45aa api: fix mp-safe mark for some messages and add more
Several api messages were not mp-safe although marked as such
because non-zero base id was not taken into account, and therefore
some other (from zero base id) were falsely mp-safe instead.

Keep messages as mp-safe, as they falsely were before:
    10   get_first_msg_id                              0       1
    12   api_versions                                  0       1

Messages that are no longer mp-safe as they weren't marked:
    15   sockclnt_create                               0       1
    33   proxy_arp_intfc_dump                          0       1

Fix messages to be really mp-safe:
    809  bridge_domain_dump                            0       1
    920  ip_route_add_del                              0       1
    921  ip_route_add_del_v2                           0       1
    1362 get_node_graph                                0       1
    1671 create_vhost_user_if                          0       1
    1675 create_vhost_user_if_v2                       0       1

Additionally mark messages as mp-safe, seems they need no barrier:
    1360 show_threads                                  0       1
    1370 show_version                                  0       1
    1372 show_vpe_system_time                          0       1

Type: fix
Change-Id: Ie6c1e3aa89f26bf51bfbcb7e7c4d9fee885487b7
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
2023-09-06 08:34:33 +00:00
Sylvain Cadilhac
db8c285081 vapi: fix verification for reply message
Type: fix
Byte swapping should be done before verifying message otherwise the message length will be wrongly computed.

Change-Id: I90b2f60bd33e5362e0edd5ee425f6a6f07886f1e
Signed-off-by: Sylvain Cadilhac <sylvain.cadilhac@freepro.com>
2023-09-06 08:23:55 +00:00
Filip Tehlar
109f3ce4eb hs-test: point gdb to vpp source files
Type: test

Change-Id: Ie5867737e5d49fd45cc15b690af3493263fb2f6f
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-09-05 15:55:55 +00:00
Filip Tehlar
3b770881b9 hs-test: verbose output on single test run
Type: test

Change-Id: I12ae7db36a6f7f9758fd195088877dfcd5606f84
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-09-05 15:58:28 +02:00
Ole Troan
9587d39993 npt66: make plugin default disabled
Plugin is still in experimental state. No reason why it needs
to be default enabled.

Type: fix
Change-Id: Ibf1810215d4c8079a068bfc60aa7dd49306ee4e4
Signed-off-by: Ole Troan <otroan@employees.org>
2023-09-05 08:47:08 +02:00
Filip Tehlar
4b3598e39a hs-test: log external apps
Type: test

Change-Id: Id2b0d408bd46f20b81422506f9db4eb655feddac
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-09-04 20:56:14 +00:00
Filip Tehlar
a6b1a7d809 hs-test: fix gdb attach
Type: test

Change-Id: Ic48ca7a3aab47df50d4e38e6123c90140c944172
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-09-04 20:55:56 +00:00
Florin Coras
931a32876a udp: buffer packets for connections in accepting state
Type: fix
Fixes: 0242d30

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6e313000bccce749b813f20a52432154bfd494ed
2023-09-04 18:33:41 +00:00
Ole Troan
8af78b8e36 arping: api to return responder mac address
The new arping_acd call includes the responders mac address in the reply.
Enabling a client doing address conflict detection to identify if it
is itself that is replying or that it is another host uses the IP
address.

Type: feature
Change-Id: Ia4bab2af1086f06ed71ba42e2e07368d4e330a27
Signed-off-by: Ole Troan <otroan@employees.org>
2023-09-04 17:05:48 +00:00
Ole Troan
34850e0187 npt66: checksum applied to src address instead of dst address on rx
Applied the checksum delta to the source address instead of the destination address
in the RX direction.

Cleaned up tests a little.

Type: fix
Change-Id: I871f3448365587e5319dfbca6ea356935321ff9b
Signed-off-by: Ole Troan <otroan@employees.org>
2023-09-04 15:14:46 +00:00
Maxime Peim
77812045e7 tracenode: filtering feature
In order to be able to filter on encapsulated packet, a new node
has been added to the ip4/6-unicast arcs.

Type: feature
Change-Id: I1e8ee05bc6d0fce20cadd8319c81bab260c17d21
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2023-09-04 07:57:44 +00:00
Florin Coras
2ceb818f8e session: fix allocation of proxy fifos
Fifos need to be synchronously allocated once a transport like tcp
accepts a session. Since events are now delivered asynchronously,
proxy apps must explicitly register a cb function that manages
fifo allocation prior to being notified of connect event.

Type: fix
Fixes: 0242d30

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7df973b7014e53e0766ea2bdc61e9871160bc18b
2023-09-04 00:08:40 +00:00
Maxime Peim
23d13c071e map: test fix feature disabling
Upon test teardown, MAP features were not disabled, potentially
leading packets to be treated by the wrong node.

Type: test
Change-Id: I0c1c614318d1308f825c5cc0bf95688e92f6d00a
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2023-09-01 08:43:23 +00:00
Florin Coras
da652cc466 vcl: set min threshold for tx ntf
Make sure there's at least 3% space in the tx fifo before notifying vcl
of a tx event. The threshold is somewhat arbibrary but for a 4M fifo, it
now means that ~120kB of space should be available.

Should help minimize the amount of tx notifications generated by
session layer when apps are faster.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I11dd0931dca8f989000a2481f1f495bd267589c4
2023-09-01 02:31:42 +00:00
Andrew Yourtchenko
f234b0d462 fateshare: a plugin for managing child processes
For the reasons of modularity and security, it is useful
to have various functionality split into processes different from VPP.
However, this approach presents the challenges of managing those processes,
and is markedly different from simply running everything within VPP process.

This plugin is an experiment in having the VPP itself start off a monitor
process which in turn starts the child processes, and restarts them if they
quit.

If the VPP process ceases to exist, the monitor process terminates all
the descendant processes and quits itself.

This allows to preserve the "single entity to manage" approach of
simply running a barebones VPP.

An example of running it:

export DPDK_CONFIG=""
export DISABLED_PLUGINS=dpdk
export EXTRA_VPP_CONFIG="fateshare { monitor ./build-root/install-vpp_debug-native/vpp/bin/vpp_fateshare_monitor command ./test1 }"
make run

Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I66221fd7403f220d9652fe76958ca499cfd070a7
Type: feature
2023-08-31 09:50:00 +00:00
Florin Coras
1765f014bc session: fix compilation when SESSION_DEBUG is on
Wrap SESSION_EVT in do loop to avoid complaints about if statement
having no arguments which can happen if debugging for groups is not
enabled.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I35af179b806ed47a1e20816a19291c31fdb7566a
2023-08-31 01:05:15 +00:00
Pim van Pelt
8d61c59c3f mpls: add mpls_interface_dump
Add an API call mpls_interface_dump() which returns a list of mpls_interface_details:
- If no sw_if_index is given, all MPLS enabled sw_if_index are returned.
- If a particular sw_if_index is given, and it doesn't exist, an empty list is returned.
- If a sw_if_index exists and has MPLS enabled, a list of that one sw_if_index is returned.

Tested:
- Create 3 loopback interfaces
- Call for ~0 and for sw_if_index 0..5 all return empty lists
- set int mpls loop0 enable
- set int mpls loop1 enable
- Call for ~0 returns 2, and the call for sw_if_index=1 and =2 (the loopbacks) returns
  each a list of one sw_if_index 1 resp 2, the other values of sw_if_index return empty list
- set int mpls loop0 disable
- Call for ~0 returns 1, and the call for sw_if_index=2 (loop1) returns both a list of one
  sw_if_index=2, the other values of sw_if_index return empty list
- set int mpls loop1 disable
- Call for ~0 and for sw_if_index 0..5 all return empty lists

Example Python3 API program:
```
api_response = vpp.api.mpls_interface_dump()
print(f"Response is {api_response}")

for i in [ 0, 1, 2, 3, 4, 5 ]:
  api_response = vpp.api.mpls_interface_dump(sw_if_index=i)
  print(f"Response[{i}] = {api_response}")
```

Type: improvement
Change-Id: If87f7d7f8972d99260e859757dbcb251c6fa54a8
Signed-off-by: Pim van Pelt <pim@ipng.nl>
2023-08-29 12:42:13 +00:00
Florin Coras
7e43005d4d perftool: fix delsvec use of _vec_len
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iab80e009d8717f759edb8133beaa55ed05e57bd5
2023-08-26 13:14:46 -07:00
Wei Li
d7c94ce18e nat: nat44-ed bug fix
fix lb static mapping
"nat44_ed_sm_o2i_add" laddr and lport

Type: fix

Signed-off-by: Wei Li <realbaseball2008@gmail.com>
Change-Id: I249a00919e8154d92cbce03f6db196c13612948f
2023-08-26 13:46:26 +00:00
Wei Li
942e78aa98 nat: nat44-ed cli bug fix
lport and eport in Cli "nat44 add load-balancing static mapping" should hton()

Type: fix

Signed-off-by: Wei Li <realbaseball2008@gmail.com>
Change-Id: I2eadb7e341efb70cc406e10b3b189e5ebff09ff4
2023-08-26 13:45:55 +00:00
Benoît Ganne
19c22a42c2 cnat: fix cnat_endpoint_encode
Type: fix

Change-Id: I4ab713811626c097c7927228f3819b7785bbb951
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-08-25 15:32:03 +02:00
Ole Troan
6ee3aa41c3 npt66: network prefix translation for ipv6
This is the initial commit of a NPTv6 (RFC6296) implementation for VPP.
It's restricted to a single internal to external binding and runs
as an output/input feature on the egress interface.

Type: feature
Change-Id: I0e3497af97f1ebd99377b84dbf599ecea935ca24
Signed-off-by: Ole Troan <otroan@employees.org>
2023-08-25 09:15:32 +02:00
spencercoder
ecb62d2e5d build: support linuxmint OS
Support compiling in Linux Mint OS

Type: improvement

Change-Id: I08721227352b00127fe0acac67269775997fd974
Signed-off-by: spencercoder <xiexiaosong@ruijie.com.cn>
2023-08-22 15:44:10 +00:00
Piotr Bronowski
feda2ff640 dpdk-cryptodev: fix coverity issues
This patch addresses coverity issues CID 322716 and CID 322717.

Type: fix
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I59d6f40c1af8e829d8cb3c042a52e144aeaf1e6b
2023-08-22 15:42:49 +00:00
Vratko Polak
6d4b3fd19c l2: fix prefetch
This is a clone of Gerrit 35419.
(It is abandoned and I am not the owner so I cannot reopen.)

Ticket: CSIT-1816
Type: fix
Fixes: 5e0ea09d96010e99a7ce0d2f3370f0de50c46c83

Change-Id: I2265cf38a9ce3155460a1025821c2749afca0add
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-08-22 11:52:22 +00:00
Julian Klaiber
e3ce81e56a sr: SRv6 Path Tracing midpoint processing performance improvement
Moved the kernel call for the timestamp outside of the inner loop to improve the batch proccessing, and minimizing the kernel calls.

Type: improvement

Change-Id: I0245c223fc8a178724bb8c5df2b98083be046c26
Signed-off-by: Julian Klaiber <julian@klaiber.me>
2023-08-21 13:03:07 +00:00
Steven Luong
a3808ee5b2 nat: documention fix
s/nat44 enable sessions/nat44 plugin enable sessions/

Type: docs

Change-Id: I93dbd161f085bff5b98df50cd29c9bedf5038307
Signed-off-by: Steven Luong <sluong@cisco.com>
2023-08-18 11:21:55 -07:00
Piotr Bronowski
45e8a672f0 dpdk-cryptodev: improve cryptodev cache ring implementation
Sw ring is renamed to the cache ring. This name better reflects the
puropse of this ring. We've introduced push/pop functions, as well as
other utility functions which remove code repetition. Error handlig
is improved: previously in case of an error all frame elements were
marked as bad, now only these for which errors occured have the error
status set.
Unnecessary stats counters have been removed.

Type: improvement
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I2fd42a529ac84ce5ad260611d6b35a861d441c79
2023-08-18 15:20:02 +00:00
Klement Sekera
03e1d559f9 vapi: improve vl_api_string_t handling
Define vl_api_string_t to correspond with vlibapi/api_types.h
Fix allocation and size calculation routine generation.

Type: improvement
Change-Id: I6b0a3eb3459d75d326e67bfb76dac8125e480afa
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2023-08-18 06:09:41 +00:00
Stanislav Zaikin
56777b9409 vapi: support services
Add missing support for

service { rpc X_get returns X_get_reply stream X_details; }

Type: improvement

Change-Id: I27555f61a2974e414cb6554f32c550b8ee5eb037
Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2023-08-18 06:09:10 +00:00
HediBouattour
f6beee077e cnat: add host tag to bitmap in cnat snat
Type: feature

this patch adds a new tag "host" to interfaces for cnat-snat
if an interface is tagged pod and host we do not snat traffic outgoing through it

Change-Id: I71f5bfcb85581bb8508ba547374f0603f1079ac6
Signed-off-by: hedi bouattour <hedibouattour2010@gmail.com>
2023-08-18 02:42:33 +00:00
Klement Sekera
c5fa5391ed tests: more descriptive error message
Type: improvement
Change-Id: Icf8a5dc711e1e11ec919b515d7af2f487a1c04c2
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-08-17 17:24:56 -04:00
Ting Xu
737edea328 idpf: add native idpf driver plugin
Add a new native idpf driver. This patch enables the device
initialization. Add some necessary functions and definations
for input and output. A new version of virtchnl is introduced.

Type: feature

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Ibbd9cd645e64469f1c4c8b33346c1301be3f6927
2023-08-17 01:37:44 +00:00
nucleo
cc22d38100 dpdk: Newer meson 0.55.3
Fixes error with python 3.12

No module named 'pkg_resources'

'import pkg_resources' removed in 0.55.3

Type: fix

Change-Id: I15c8cf195fd07a0eb2f3b58f895ef4b26cc17b90
Signed-off-by: nucleo <alekcejk@googlemail.com>
2023-08-17 01:23:31 +00:00
Dave Wallace
7b8b465269 tests docs: update python3 venv packages
- Package update performed by
  1. updating pip, pip-tools, setuptools
  2. 'make test-refresh-deps' on ubuntu 22.04
  3. fixing 'make test' and 'make docs' issues
     on ubuntu 22.04
  4. 'make test-refresh-deps' on ubuntu 20.04
- Add dependency for 'make test-refresh-deps'
  to insure python venv is set up.
- Update of python formatter, black,
  caused reformating of 41 python code
  files.

Type: make

Change-Id: I7cafdf4b5189065ac57cb6b254937f6e0897a924
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-08-16 19:53:12 +00:00
yanlong
d826a60269 l2:Add doc for l2 rewrite, and add examples
Supplemented the documentation of "l2 rewrite", and added examples

Type:docs

Change-Id: If49ae0b22989b3cd1c88a27a4e51b74be32d75e7
Signed-off-by: yanlong <dyl_wlc@163.com>
2023-08-16 15:51:22 +00:00
Andrew Yourtchenko
ad417a8e6d nat: mark several messages as production
As per discussion on the VPP call, since they are being
used in CSIT tests and have not seen changes in a while,
mark the messages as production from the change process
standpoint.

Type: improvement
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I7fda71edd923b798d034380320a869f7c35cb5a6
2023-08-16 15:08:33 +00:00
Florin Coras
55c699e098 vcl: fix ldp epoll events array overrun
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3dd65946c220f958a4fda0551b053d690bf06c39
2023-08-15 20:58:35 +00:00
Florin Coras
5e9ed0dc81 vcl: handle postponed disconnects with select
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia8449344a471129c0d148b39d97a5d310c2a1fc7
2023-08-15 11:54:13 -07:00
wanghanlin
4747b346d0 vcl: fix error state switch for vcl_handle_mq_event
When a listen session receives an ACCEPTED message, but then
receives either a RESET or DISCONNECTED message from VPP before the
session is accepted, the listen session state is switched to
VPP_CLOSING or DISCONNECT.
The subsequent CLEANUP message handler attempts to send a
disconneted or reset reply message to VPP, but since the vpp_evt_q
for the listen session is null, this leads to a crash.

Type: fix
Change-Id: Ic51f78f631fe8d15bf8c56b795f4a900c3e2f724
Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
2023-08-15 18:06:10 +00:00
Dave Wallace
61ab094721 dpdk: bump rdma-core to 46.1
- Per dpdk 23.07 release notes (rdma-core >= 46.0)

Type: feature

Change-Id: I7c15e15e1cf4b6f652711f9446d9f8324f6c4092
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-08-14 16:19:46 -04:00
Kai Ji
4421898491 dpdk: bump to DPDK 23.07
This patch bumps DPDK version from 23.03 to 23.07.

Type: feature

Change-Id: I15140cecd008bfafb358f6348a1cb8fc08f70f02
Signed-off-by: Kai Ji <kai.ji@intel.com>
2023-08-14 15:46:34 +00:00
Florin Coras
09c0e8fac2 session: fix coverity warnings
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I910c8ce1713c6d346cc5ea4eb58a89c1c30a10a1
2023-08-11 21:33:58 +00:00
Dave Wallace
ef68bb57db tests: filter coverage report output
- Remove test code & non-vpp code from coverage report
- Remove driver/hardware vpp code which cannot be tested
  in 'make test' from coverage report

Type: fix

Change-Id: I04b50c14bc3437b845f2afafae47297189e61e3f
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-08-11 02:15:07 +00:00
Vratko Polak
11af9e6bfe crypto-sw-scheduler: avoid crypto work on vpp_main
+ Checkstyle demanded indentation edits.

Type: fix
Ticket: VPP-2083
Fixes: 9a9604b09f15691d7c4ddf29afd99a31e7e31eed

Change-Id: Ie2d33d290330247d36435a073675b732bb64ae93
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-08-10 11:33:17 +00:00
Steven Luong
2faac91f67 docs: correct the directory path for index.html
Type: fix

Change-Id: Ia0d6f57790dbca92662c6d8b986c325f1c399131
Signed-off-by: Steven Luong <sluong@cisco.com>
2023-08-09 19:01:24 +00:00
Florin Coras
0242d30fc7 session: async rx event notifications
Move from synchronous flushing of io and ctrl events from transports to
applications to an async model via a new session_input input node that
runs in interrupt mode. Events are coalesced per application worker.

On the one hand, this helps by minimizing message queue locking churn.
And on the other, it opens the possibility for further optimizations of
event message generation, obviates need for rx rescheduling rpcs and is
a first step towards a fully async data/io rx path.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id6bebcb65fc9feef8aa02ddf1af6d9ba6f6745ce
2023-08-09 18:45:26 +00:00
Nathan Skrzypczak
6d733a93b2 cnat: remove rwlock on ts
Type: improvement

Remove rwlock contention on timestamps. ~10% pps with
10k sessions. Use fixed-size-pools of increasing sizes
starting with 4K, and with a x2 step each time.
We don't free/shrink allocated pools.

Change-Id: I5fea51faba40430106c823275a6356e81709d118
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2023-08-09 08:23:45 +00:00
Nathan Skrzypczak
897844d1e9 cnat: add ip/client bihash
This replace the cnat ip4/ip6 to client
lookups previously done with a regular
hash, by a bihash lookup.

Type: improvement

Do the client lookup in a bihash instead of
a hash.

Change-Id: I730c1893525c002b44ada8e290a36802835e88e9
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2023-08-09 07:59:09 +00:00
Dave Wallace
878a9f5706 tests: fix setting gcov flag for test-cov target
Type: fix

Change-Id: I3c663babe4f32f5d2870265336b5d272cc029ce7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-08-08 21:22:54 +00:00
Nathan Skrzypczak
6631032791 cnat: flag to disable rsession
This adds a flag on the translation
asking the VIP & input-feature nodes
not to create the return session when
translating / load-balancing an incoming
flow. This is needed with maglev & DSR

Type: feature

Change-Id: I699012310ddc59f6ceeeb4878638eac6da5128dc
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2023-08-08 14:06:08 +00:00
yanlong
cad2111129 docs:Improve the README of vpp docs
Type:fix

Change-Id: Ie2ae728450ef123379b697cdf9c873d5bec01b47
Signed-off-by: yanlong <dyl_wlc@163.com>
2023-08-08 12:36:33 +00:00
Benoît Ganne
84e6658486 ipsec: add support for RFC-4543 ENCR_NULL_AUTH_AES_GMAC
Type: improvement

Change-Id: I830f7a2ea3ac0aff5185698b9fa7a278c45116b0
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-08-08 10:16:26 +00:00
Gao Feng
96600f9077 vcl: Fix the ldp init check
Maybe some function calls the wrapper funtion like read which invokes
the ldp_init_check in the other libs as a constructor before
ldp_constructor. Then the ldp has been initialized already when
ldp_constructor is invoked. And it's normal case, we shouldn't treat it
as an error.

So ldp_init should return success if ldp is initialized already instead
of an assert.

Type: fix

Change-Id: Ifa2a7b1d5471981a3f840b14a4fa5d48fb1f1374
Signed-off-by: Gao Feng <gfree.wind@outlook.com>
2023-08-08 04:24:58 +00:00
Damjan Marion
6508ed51a8 vlib: support sibling node creation with vlib_register_node()
Type: improvement
Change-Id: I7e82a262692b2b6513f81889d78a43c10ca7bfb2
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-08-07 18:03:19 +00:00
Damjan Marion
40f481037e vppinfra: add clib_file_get_resolved_basename
more generic version of clib_sysfs_link_to_name with support for
format strings...

Type: improvement
Change-Id: I0cb263748970378c661415196eb7e08450370677
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-08-07 18:00:10 +00:00
Damjan Marion
993735913c vppinfra: add vec_foreach_pointer macro
works with vectors of pointers...

Type: improvement
Change-Id: I530653978fcf981be299cf42a1133be000d74d0c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-08-07 17:33:25 +00:00
Damjan Marion
8d0c0c6821 vppinfra: add unformat_init_path
More conveninet way to unformat file by providing filesystem path.
Takes format string for easier constuction of path...

Type: improvement
Change-Id: I433204fa20dc98e2b11c53914883d047a7fc62c6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-08-07 17:33:09 +00:00
wanghanlin
696db20e33 vcl: fix error state switch for VCL_STATE_LISTEN_NO_MQ sessions
When a VCL_STATE_LISTEN_NO_MQ session receives an ACCEPTED message,
but then receives either a RESET or DISCONNECTED message from VPP
before the session is unlistened, the listen session state is
switched to DISCONNECT.
The subsequent CLEANUP message handler attempts to send a reset
reply message to VPP, but since the vpp_evt_q for the listen
session is null, this leads to a crash.

Type: fix
Change-Id: Id7e88dcb16df3eda912b3f763730ec8d8973473a
Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
2023-08-07 16:58:07 +00:00
Nathan Skrzypczak
b22da9c7d1 cnat: Support offloaded check sums
This patch removes zero checks for new_addr, new_port
meaning sessions with zero values will rewrite the packet
with a 0 value instead of leaving it in place. This allows
to reduce branchiness in the code, and sessions are fully
resolved at creation time anyway.

This also adds support for checksum offloads:
- IP checksum offload : we always compute the checksum to
avoid issues with drivers. We'll revert this if we realize
cost gets too important.
- TCP/UDP checksum offload : we add the implementation for
pseudo header checksum computation. This is needed for the
drivers that do not re-compute this pseudo-checksum before
the packet is TX-ed (e.g. a few DPDK drivers).

Type: improvement

Change-Id: I6543f3aec8c120ec50f4219108609138283620ef
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2023-08-07 11:34:48 +02:00
Benoît Ganne
994a58997d nsh: fix nsh gre references
Since gre is a plugin, nsh should not use symbol names directly.

Type: fix
Fixes: cefb178aa487a217d4ac75d7d4fa62db4b7d70fd

Change-Id: I1a1c20740aabdaafd69f507cd71016c3109b0205
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-08-04 16:13:43 +02:00
Damjan Marion
faeadca89e vpp: detect early nosyslog and interactive flags
So error logs are displayed on console earlier....

Type: improvement
Change-Id: If31b76c9d06254b0fec5b5b3f4e92a881b4cf786
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-08-04 10:52:07 +00:00
Damjan Marion
91ff0e965a vppinfra: add pool_foreach_pointer()
Works on pools of pointers...

Type: improvement
Change-Id: I194dec389ca4c5ec2ce3361b54a9968c9caecefc
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-08-02 17:41:22 +00:00
Florin Coras
39a8e16448 quic: fix closing of streams
Avoid explicit manipulation of session state and generate closing event
if need be.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I07cda1db08a2673b27b496ea1371b0dfd8e6f98a
2023-08-02 16:36:44 +00:00
Damjan Marion
3706636ca0 vlib: remove dependency on libuuid
Type: improvement
Change-Id: I4e2b2e4f227dfcb3df36166db13c8aa5c0b603f5
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-08-02 16:07:06 +00:00
Damjan Marion
f566524a21 vppinfra: add unformat_c_string_array
Type: improvement
Change-Id: Iea5ecca5d4cbc6c7aea69104830afcfe78c708ee
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-07-31 20:10:57 +02:00
Sylvain Cadilhac
83ca6e66d0 ipsec: fix IPv6 IPsec tunnel punting
Type: fix
Buffer needs to be rewinded before being passed to punt-dispatch node.

Change-Id: I43d103515d372e425f4c3b08ca1779398f1fced4
Signed-off-by: Sylvain Cadilhac <sylvain.cadilhac@freepro.com>
2023-07-31 13:00:31 +00:00
Mohsin Kazmi
c709f2cd9d libmemif: add support for buffer size
Type: improvement

buffer size can be configurable:
./test_app -b 9216

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Id77f6baac27d45dec3d5b7ea8a9a53acf2a302fc
2023-07-31 09:55:41 +00:00
Dave Wallace
054229ebbd vlib: fix gcc build breakage
Type: fix
Fixes: 00ea98ad6

Change-Id: I4ac8c9c5902299d5f283ba4912d52d9bfcedef5c
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-07-28 16:36:22 -04:00
Filip Tehlar
543cd57ea2 hs-test: improve get stats
Type: test

Change-Id: Ie681ee43007f4fe787d51d80bda9b433dcb6c09a
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-07-28 18:55:55 +00:00
Florin Coras
8f3147d102 session: regrab evt llist elt for app transports tx
App transports like TLS can close sessions on tx and consequently
generate new events. That can realloc the event pool.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I58a97502acc1182b3d051ba1aa9e0e98c16f4593
2023-07-28 16:05:56 +00:00
Damjan Marion
8797956bac vnet: add vnet_register_device_class function
To allow dynamic registration of device classes..."

Change-Id: Ie8435e8c55b7e300be06abe97b653c0c3ce7f732
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-07-28 15:52:35 +00:00
Damjan Marion
00ea98ad60 vlib: pci cleanup and improvements
Change-Id: Ieafbed6f2db3dec65e4b43d84a4661f6a1bbe891
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-07-28 15:51:12 +00:00
Damjan Marion
c5c0d0cf8a vlib: fix coverity issue in vlib_node_set_interrupt_pending
Type: fix
Fixes: cc8249c
Change-Id: Iebfbbd1e00782c4097cc840460b5177d18921131
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-07-28 12:57:24 +02:00
Filip Tehlar
229dab615a hsa: add total bytes parameter to vcl_test_client
Type: test

Change-Id: Ib1131eedb8eeaa9adfed9cfc47beeb1c7c8adb5c
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-07-27 17:16:00 +00:00
Filip Tehlar
6fc5311f41 session: remove unused code
Type: improvement

Change-Id: I7525aa81acf073707550b23541fdcc358b9bf49c
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-07-27 16:35:34 +00:00
Maxime Peim
f902ba534a ipsec: fix sa bind cli
Small mistake was made, reported by coverty scan.

Type: fix
Change-Id: I98ca16c0275a94b2def99831f9353d4ff3fe93a9
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2023-07-27 16:32:27 +00:00
Denys Haryachyy
2652867480 ikev2: cleanup stuck sessions
The following issues are fixed:
* in responder code: do lookup again as the old pointer could be
  invalidated during the cleanup operation
* in initiar code: do the cleanup of session if there're no child SAs or
  if there's no response from the responder during initial request (this
  can easily happen if the response packet was lost/dropped/etc)
* print the state of ikev2 profile (for easier tshooting)

Type: fix

Change-Id: I853d9851c0cf131696585e3c98fa97e66789badd
Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
2023-07-27 07:45:01 +00:00
Florin Coras
0eff4e722c vcl: allow rx of zero length dgrams
Type: fix

Change-Id: I438ef488357456e9415e51a17355e9eba8518808
Signed-off-by: Florin Coras <fcoras@cisco.com>
2023-07-26 11:28:03 -07:00
Vratko Polak
e9ea7d5216 vlib: rename vnet_log_get_class_data
It is a function in vlib, so no reason to mention vnet.

Type: fix
Fixes: bf179a91d8d224c64d08643a2bb52580f68ce96b

Change-Id: Ic5f601d94d88b667f7ce44a017a0e1d5b4db5da1
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-07-26 13:48:20 +02:00
Steven Luong
116392b174 stats: remove extra format line
The extra format line was added for no reason from patch ff27c9f8e.

Type: fix
Fixes: ff27c9f8e

Change-Id: Ib25149cc8a17c29d0c8a0dbc06f0ea12ca4f328c
Signed-off-by: Steven Luong <sluong@cisco.com>
2023-07-26 01:57:13 +00:00
Filip Tehlar
0028e6f316 session: use session error type instead of vnet error
Type: improvement

Change-Id: Ie0bad9e03ac2e29da23af01ee7f63cb44489ad9c
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-07-26 01:09:17 +00:00
Damjan Marion
cc8249c5fd vlib: interrupt mode support for pre-input nodes
Type: improvement
Change-Id: Ic6e60597d2be63e3a0ae4399a81dbbd72392f30d
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-07-25 20:10:29 +00:00
Maxime Peim
3f40755749 classify: add bpf support to pcap classifier
Type: feature
Change-Id: I28fb38e49c89f4c4d4cc58c1a5c0aa8502678472
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2023-07-25 10:06:16 +00:00
Tianyu Li
4ab1aa3145 dpdk: fix signed single bit field
clang-16 complains about signed one-bit bitfield value changes
from 1 to -1. Use unsigned type instead.

Type: fix
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I84f8cf314d36183a5e6f544cd756c01d1d10a1a5
2023-07-25 08:13:26 +00:00
Gabriel Oginski
c3f505fe7b vpp-swan: fix handler API messages
In the current implementation there is a bug related to the incorrect
message handling due to the wrong id.

The fix changes logic responsible for handling incoming API messages
by correcting their ids.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Iea29506053c9fd2e1d01bce83e7f4a6e1de39321
2023-07-24 08:15:21 +00:00
qinyang
af9b7156c8 vcl: ldp support SO_ORIGINAL_DST
Type: improvement

Support SO_ORIGINAL_DST socket option to get original dst_ip4 and dst_port if nat44 rule enabled.

Change-Id: If00e00d03e48f3b78a23a68f1b078954d79dd0f7
Signed-off-by: qinyang <qiny@yusur.tech>
2023-07-21 16:27:14 +00:00
Naveen Joy
ae916b3904 tests: Add checksum offload interface tests
Type: test

Change-Id: I6edc8858b802d3d32159d71c1e867a06cc1025d5
Signed-off-by: Naveen Joy <najoy@cisco.com>
2023-07-21 13:00:05 +00:00
Piotr Bronowski
3a6bc6f127 ipsec: fix logic in ext_hdr_is_pre_esp
When _VEC128 instructions are not enabled logic is buggy.
The function always returned 1.

Type: fix

Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I603200637e8d65813f4e49ef15d798e74b79b9cf
2023-07-21 00:28:05 +00:00
Steven Luong
2da272e3da vcl: zero out cmsg for recvmsg API
When msg->msg_controllen is set in recvmsg, the caller wants to receive
additional information about the messages. However, they might not
always be available. In that case, we should clear cmsg since
the caller uses CMSG_NXTHDR which might access uninitialized fields in
cmsg.

Type: fix

Change-Id: Ifdf9634bfcb1427f7ae3812014a46bfd7f4bc473
Signed-off-by: Steven Luong <sluong@cisco.com>
2023-07-19 06:37:29 +00:00
Gabriel Oginski
0e1fe7ba86 vpp-swan: change flow in function for add route
This patch addresses the issue when the list of available interfaces
is not up to date. Due to this issue adding a new route fails
and finally the connection is not established.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I3a63c0dd99ebc28ea149b4b23867440937682761
2023-07-19 02:38:00 +00:00
Gabriel Oginski
efd2350d65 vpp-swan: fix incorrect msg ID in register_event
This patch addresses the issue where the message ID registration
in the register_event function is incorrect. Due to this incorrect
registration, the lookup for the corresponding callback on received
messages fails, eventually leading to a segmentation fault
and double-free memory space.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: If95182f972f64adb44d514e18c831cc9627d8f0f
2023-07-19 02:32:11 +00:00
Gabriel Oginski
73d82d1273 vpp-swan: fix function to get sw_if_index
In the current implementation there is a bug in the function
responsible for getting software interface index by the name of the
interface. Incorrect function is used to send the API message, also
the handler with replied message is incorrect.

The fix changes function to send dump message and also adds handler
with replied message in the correct way.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Id1a3ba2ce7e92d216907f344431b9e2acb1d5572
2023-07-19 02:31:21 +00:00
Dave Wallace
f72a32a1e4 docs: add api change process from wiki
- Move the VPP API Change Process documentation
  from the wiki page into the in-tree VPP docs

Type: docs

Change-Id: I42f661618b8632230bebe3aa8fbad455b9a05d01
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-07-17 14:55:06 +00:00
Matthew Smith
e870d5b6ac ipip: populate mode in tunnel details
Type: improvement

There is a mode field in ipip_tunnel_details. The handler for the dump
API does not do anything to populate it so it always contains 0
(TUNNEL_API_MODE_P2P). This is correct for p2p tunnels but is wrong for
multipoint tunnels.

Populate the field with the correct mode.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I6c1288a0d3929db0f67100748b5760c36b594f97
2023-07-14 17:42:26 +00:00
Florin Coras
5464134288 hsa: fix echo client init
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ieb2d1e6e0949844a70c81b218ca7dc83690776ca
2023-07-13 10:43:19 +00:00
Nobuhiro MIKI
95c2da7c25 lb: Fix src_ip_sticky evaluation bug in per-port-vip case.
Before this fix, the src_ip_sticky flag was passed as an argument to
the lb_node_get_hash function, which computes a hash value for a packet.
However, in per-port-vip case, the value of src_ip_sticky flag may be
different for each port number. As a result, the value is the same for
all port numbers, even though it is a per-port-vip case.

This commit fixes the src_ip_sticky evaluation by delaying it until the
packet is received, so that the correct value is obtained. Also, the
unit test case has been enhanced for this bug fix.

The steps to reproduce this bug are described below:
https://lists.fd.io/g/vpp-dev/message/23248

Type: fix
Fixes: 613e6dc0bf92 ("lb: add source ip based sticky load balancing")
Change-Id: I483492b214a1768e7a21fd86edd5151b3c46528b
Signed-off-by: Nobuhiro MIKI <nmiki@yahoo-corp.jp>
2023-07-13 08:10:26 +00:00
Alexander Chernavin
df4d342d76 linux-cp: fix crash on processing dump of routes
nl_route_add() recently started to use its optional argument to check
whether replace flag is set for the message. When notification messages
are processed, the argument is a pointer to the corresponding message
info. However, when dump replies are processed, the argument is a null
pointer. This leads to null pointer dereference and crash when dump of
routes is processed.

With this fix, check for replace flag only if message info was passed
to nl_route_add(). Otherwise, assume the flag is not set. Dump replies
do not have it set.

Type: fix
Change-Id: Icb04a1146e09cc965b623018c28f91b347be0eab
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-07-12 17:03:49 +00:00
Damjan Marion
cf1880284c avf: remove barrier
Type: improvement

Change-Id: I95023d2e6034b77952e0423d0430b433ea0dab15
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-07-11 20:37:23 +00:00
Adrian Pistol
44b3abe86a linux-cp: Basic MPLS support.
1) Imports ENCAP_MPLS labels from IPv4/IPv6 routes.
Note that this requires libnl 3.6.0 or newer.

In previous patches, the fib_path_ext_t had a path ID of -1.
After a long investigation, it turned out to be caused by route weight
being set to 0. There is a comment explaining more details.

2) Handles MPLS routes.
MPLS routes were wrongly added as IPv4 routes before.

POP and SWAP are now both supported.
All the routes are installed as NON-EOS and EOS routes,
as the Linux kernel does not differentiate.

EOS POP used in PHP uses the next-hop address family
to determine the resulting address family.

This patch is sufficient for P setups.
PE setups with implicit null should also function okay, as long as a
seperate label gets programmed per address family.

PE setups with explicit null will also forward packets,
but punting is a bit odd and needs MPLS input enabled on the LCP host
device.

3) Propagate MPLS input state to LCP Pair and Linux.
Since the Linux kernel uses the MPLS routes itself,
the LCP pair tap needs MPLS enabled to allow host originated packets.

This also syncs the Linux `net.mpls.conf.<host_if>.input` sysctl to
allow punted packets to have MPLS labels, mostly explicit nulls.

In addition, a special feature is enabled to cross connect MPLS packets
coming from Linux directly to interface-output untouched.

Make sure to enable MPLS/add a table in VPP first and load the
MPLS kernel modules!!

Type: feature
Change-Id: Ie4184bb4cc96905bf8b483a27e7ca6d251697374
Signed-off-by: Adrian Pistol <vifino@posteo.net>
Signed-off-by: Pim van Pelt <pim@ipng.nl>
2023-07-11 17:09:25 +00:00
Steven Luong
ff27c9f8ec stats: fix duplicate /if/names entry
stats entries /if/names are never deleted as it is a vector of the
sw_if_index value. When the interface is deleted and then created again
later, and if the new interface takes a different sw_if_index, we may
end up with duplicate entries for the same interface name. For example,
the following configuration sequence causes problem

create loopback interface
create loopback interface
delete loopback interface intfc loop0
delete loopback interface intfc loop1
create loopback interface

vpp_get_stats dump /if/names
[0]: local0 /if/names
[1]: loop0 /if/names
[2]: loop0 /if/names

The fix is to set the delete /if/names entry to deleted when the interface is deleted.

Type: fix

Change-Id: I7d811b12d56e3cf8c7deffe14736ea0f24814d02
Signed-off-by: Steven Luong <sluong@cisco.com>
2023-07-07 16:55:31 +00:00
Tianyu Li
becfab0f17 api: fix signed single bit field
clang-16 complains about signed one-bit bitfield value
changes from 1 to -1. Use unsigned type instead.

Type: fix
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: Iab006c036d4068af2fe3caaefc871a95b26cc578
2023-07-07 18:06:15 +08:00
Ondrej Fabry
fa6d21b4ff api: lcp - Mark old message versions as deprecated
List of changed messages:
- lcp_itf_pair_add_del
- lcp_itf_pair_add_del_reply
- lcp_itf_pair_add_del_v2
- lcp_itf_pair_add_del_v2_reply

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: Ic20a852dd1fb27858c8776095f9c98757b89bfe8
2023-07-06 18:44:01 +00:00
Ondrej Fabry
755e3aa54f api: ip - Mark old message versions as deprecated
List of changed messages:
- ip_punt_redirect_dump
- ip_punt_redirect_details

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: Icf91f760b9bd328110b0f9fc2e421bb954033d21
2023-07-06 18:30:57 +00:00
Ondrej Fabry
cfd8e4ec88 api: memif - Mark old message versions as deprecated
List of changed messages:
- memif_socket_filename_add_del
- memif_socket_filename_add_del_reply
- memif_create
- memif_create_reply

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: Id334990584b64a0efa3c28a3d8b6b641adab8c09
2023-07-06 18:30:11 +00:00
Ondrej Fabry
7108cb15ca api: memclnt - Mark old message versions as deprecated
List of changed messages:
- memclnt_create
- memclnt_create_reply

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I0031cc2f1604ca4c34574c8e1ee28e358c2bbe5d
2023-07-06 18:29:34 +00:00
Ondrej Fabry
be56761663 api: pg - Mark old message versions as deprecated
List of changed messages:
- pg_create_interface
- pg_create_interface_reply

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I574927f0820c54d748f27fd96a45afec5243b645
2023-07-06 18:28:21 +00:00
Ondrej Fabry
5c476e7ac3 api: sr - Mark old message versions as deprecated
List of changed messages:
- sr_policies_dump

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I16ae1bed83ad8c73e3254b6d195251702de84f97
2023-07-06 18:27:57 +00:00
Ondrej Fabry
63305843e2 api: ipsec - Mark old message versions as deprecated
List of changed messages:
- ipsec_sad_entry_add_del_v2
- ipsec_sad_entry_add_del_v2_reply
- ipsec_sa_v2_dump
- ipsec_sa_v2_details

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I8fd6906e9684ef7ebc0688dc8b0637ae2dc8d0a2
2023-07-06 18:26:32 +00:00
Laszlo Kiraly
6b4aa2b7f4 build: generate debug info rpm packages for opensuse
Enabling debug info RPM creation in spec file.

Type: fix

Signed-off-by: Laszlo Kiraly <laszlo.kiraly@est.tech>
Change-Id: Id284b135ec4125905145f7902a6e1cf42ba65aa4
2023-07-06 14:46:41 +00:00
Laszlo Kiraly
3ff76761f4 build: add missing dependences for opensuse
VPP build failed when build xdp-tool on opensuse
Add the missing libraries and headers.

Type: fix

Signed-off-by: Laszlo Kiraly <laszlo.kiraly@est.tech>
Change-Id: I8c3f28ac6e88cd61a1bf0a823ffa1d5f3097be40
2023-07-06 11:36:42 +02:00
Piotr Bronowski
ea7111ed40 dpdk-cryptodev: introduce sw_ring to the crypto op data path
This patch introduces sw_ring to the crypto op data path implementation,
so that raw data path and crypto op data path use same mechanism of processing
async frames. Crypto op ring has been removed from the implementation.

Type: improvement
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: Id823f80a88cfa0ff40252616a36de8bb044c7f45
2023-07-06 07:55:04 +00:00
Ting Xu
61762c7aac packetforge: fix has_key invalid in python3
Python Dict attribute "has_key" was removed in Python3. Use "in"
operation instead.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I7b63b0689e9970ca798921368c5616875f7d5682
2023-07-04 06:45:17 +00:00
Benoît Ganne
8aa47b7a76 docs: fix packages path in tutorial
Type: fix

Change-Id: I84bbb28490d9c66c5bf55839ab75b3aec1bf5854
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-06-30 20:45:46 +00:00
Mohammed Hawari
ccd3070958 bpf_trace_filter: plugin for BPF Trace Filtering
Change-Id: I342de0a375b783725aa2b621c1c70bc8bf646450
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: improvement
2023-06-30 11:53:06 +00:00
Mohammed Hawari
52fa5f21b9 vlib: introduce trace filter functions
Change-Id: I7a988fafe98599e4fcf7cdaa307a69b9d76650f0
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: improvement
2023-06-30 11:35:44 +00:00
Piotr Bronowski
60527bd6df dpdk-cryptodev: sync mbuf length with corresponding vlib buffer
When vlib buffer is processed on vnet side its length is corrected by
cipher padding and icv_sz. These changes need to be reflected in
the mbuf internals.

Type: fix
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I0aa03f67f556dfc8f9a577ca1967210527221e02
2023-06-29 08:20:38 +00:00
Alexander Chernavin
e1cc875360 ip-neighbor: add api for getting neighbor db config
There is an API call to change neighbor database configuration (i.e.
limit on peer number, aging, and recycling). With this change, make
getting current values of these settings available via the API.

Type: improvement

Change-Id: Ie9394e086b68cf9b28ad98dea162f203f8043cbb
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-06-29 05:11:10 +00:00
Florin Coras
c8767c42aa session udp: add len check for tx dgrams
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I35391fb8c39defbe0e57a241a357c3c98e8cef54
2023-06-27 20:34:21 -07:00
Filip Tehlar
31eaea9eef hs-test: add nginx+quic test
Type: test

Change-Id: I15e4f2fb84cb4f34b6fea95978db000854a63e78
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-06-27 15:58:47 +00:00
Ondrej Fabry
fe965a3a17 api: af_packet - Mark old message versions as deprecated
List of changed messages:
- af_packet_create
- af_packet_create_reply
- af_packet_create_v2
- af_packet_create_v2_reply

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: Ia065c3bbc2c7923de64f47417099aea1aa1216b1
2023-06-27 14:47:50 +00:00
Ondrej Fabry
74d9f0ae3b api: tapv2 - Mark old message versions as deprecated
List of changed messages:
- tap_create_v2
- tap_create_v2_reply

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I7b1b22cc4a0e31f5c19fe48e7a0f30631576f9df
2023-06-27 14:47:14 +00:00
Ondrej Fabry
9ebd2b92e3 api: vxlan - Mark old message versions as deprecated
List of changed messages:
- vxlan_add_del_tunnel
- vxlan_add_del_tunnel_v2
- vxlan_add_del_tunnel_reply
- vxlan_add_del_tunnel_v2_reply
- vxlan_tunnel_dump
- vxlan_tunnel_details

This change is part of VPP API cleanup initiative.

Type: fix
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I0a7227e76a493731fd136f8e6310ad372fab2494
2023-06-27 14:46:50 +00:00
Stanislav Zaikin
7f27ed666e af_xdp: create_api_v3 without namespace keyword
Namespace keyword is reverved c++ word, so it's not possible to include
vapi header for af_xdp plugin and use it.

Type: fix

Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
Change-Id: I42a0e0a89ff2c407090d3c18c1bc5a5605ddf032
2023-06-27 11:42:42 +00:00
Stanislav Zaikin
5fe1cf80ca virtio: use fast-path for ethernet-input if possible
If a frame should be sent to 'ethernet-input' set the
ETH_INPUT_FRAME_F_SINGLE_SW_IF_IDX flag. It will force 'ethernet-input'
to use a fast-path for such frames.
This patch also aligns the behaviour with other input nodes.

Type: improvement

Change-Id: Icff0fa31204d5304a2ea0a4f4e7bc418dedbfe32
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
2023-06-27 08:18:10 +00:00
Florin Coras
d96859f09b udp: pass cless hdr to transport through buffer
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I7177ada23e5a69ec8e362ec98b98010c3b44b3d7
2023-06-26 10:33:49 +02:00
Florin Coras
503480d772 tcp: avoid initializing counters multiple times
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia98dae5fdde16426d5457742aff0a1b04db4d034
2023-06-25 01:49:58 +00:00
Maxime Peim
1271e3a2a1 ipsec: manually binding an SA to a worker
An SA is normally bound to the first thread using it. However, one
could want to manually bind an SA to a specific worker.

Type: improvement
Signed-off-by: Maxime Peim <mpeim@cisco.com>
Change-Id: I05cbbf753e44a01d9964ee47812c964db9bbb488
2023-06-23 17:38:55 +00:00
Stanislav Zaikin
601972bb20 fib: walk over adj glean per table
Type: fix

Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
Change-Id: I07f54bb643c24b1839a2d0e93acc593d13a43fed
2023-06-23 17:32:31 +00:00
Florin Coras
6052f4b9d8 tcp: add simple stats collector
Type: feature

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I435ff10fa3af15b0bed83607aca508a1c087a159
2023-06-22 20:14:49 +00:00
Dave Wallace
1c95e12b0d tests docs: fix lcov code coverage report generation
- Updated/rebased version of https://gerrit.fd.io/r/c/vpp/+/34199

Type: test
Change-Id: I43913ecfd11a4578bdb10c4be76253fe38d57976
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-06-22 13:35:28 +00:00
Maxime Peim
fdf6fbe2e7 tcp: options support into pg
Packet-generator does not support TCP options.
Along with its support, a formatting function has been added.
Further work will be needed to update header formatting functions
to take into account TCP connection options. For now, TCP options
are taken on a per-packet basis.

Type: improvement
Change-Id: Id800887853c4941d893be353ce6d8624ed8bbc5d
Signed-off-by: Maxime Peim <mpeim@cisco.com>
2023-06-22 12:39:35 +00:00
Andrew Yourtchenko
9ba6dcf558 tests: do not run qemu interface tests if the environment does not allow it
cdf73b973181ff4c67147900408216e37bae897a has added the qemu tests as part of the default test run,
which results in "make test" failure in more restricted environments which do not allow the
namespace creation.

Add a config flag to skip those tests, and skip them if the namespace creation fails.

Type: test
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Ie631f7fb2a80864f77c79619eba4a43712e950e5
2023-06-21 17:20:03 +00:00
Florin Coras
4aeba37762 session: mark half-open transport closed on ntf
Make sure half-open sessions are marked as transport closed once
connected notification is provided. This ensures that if they've been
scheduled for tx, the event is ignored.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8c44584e843d93365ec737ae4e1bcb74eba35506
2023-06-21 16:52:22 +00:00
Benoît Ganne
a9edb9a168 af_xdp: fix chained buffer free on failure
Type: fix

Change-Id: I7c6fb783e5200773cbd02c86d39fd241efcc39f9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-06-21 09:21:51 +00:00
Florin Coras
5cca669fc7 vcl: fix epoll lt coverity warning
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6900d9ab147d35f99f944bf741f6bb329c8ea0df
2023-06-20 08:47:37 -07:00
Piotr Bronowski
f0c67adfb2 dpdk-cryptodev: enq/deq scheme rework
This rework tries to address issues found on SPR QAT, for traffic
reaching max possible throughoutput for single QAT PF packet drops were
observed.
Fix changes enq/deq scheme by utilizing software ring in enq call from
VNET but enq and deq to QAT happens only in deq callback function what
should enable better utlization of hardware resources.

Type: improvement
Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I2e8c473d20a269fd5e93f0c8d1f8c8aa193712bd
2023-06-19 18:12:09 +00:00
Florin Coras
30ecfa8ceb vcl: no hup events in lt mode if session not epolled
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9f7dfe086bf7e11b7e0de7392f020c1052ba656a
2023-06-16 19:47:53 -07:00
Dave Wallace
cdf73b9731 tests: Run interface tests as a regular test
Type: test

Change-Id: I5cf5a0e6437b274e565066f1012d7225c62b87a8
Signed-off-by: Naveen Joy <najoy@cisco.com>
2023-06-15 13:27:23 -07:00
Florin Coras
1f40ab467a vcl: fix debug logging of mapped segments
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I73034cdba51157466713884c3fbeae7054d92ad7
2023-06-14 17:51:01 +00:00
Shmuel Hazan
07e6c82950 af_xdp: linearize buffer chains before TX
The af_xdp plugin does not support chained buffers; attempting to send
chain buffers will result truncated packets or even send other packet's
data. As a workaround, turn any buffer chain into a single buffer before
tx.

Type: fix

Change-Id: I05dec912455eb2bb6c8122a28cd646f88983aa9a
Signed-off-by: Shmuel Hazan <shmuel.h@siklu.com>
2023-06-14 14:16:27 +00:00
Dave Wallace
39c40fa349 vppapigen: fix crash with autoendian arrays
Type: fix
Ticket: VPP-2078

Change-Id: I418269632bdfc823c5f0ba7652957277276d294d
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-06-13 13:25:18 +00:00
Piotr Bronowski
d53a95cead dpdk-cryptodev: introduce sw_ring
This patch introduces sw_ring. This ring is used in next set of patchas
and plays role of a buffer for QAT, allowing collecting frame elements
in case QAT queue is fully utilized, and assembling frame
from QAT dequeued elements.

Type: improvement
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Signed-off-by: Dastin Wilski <dastin.wilski@gmail.com>
Change-Id: I20718e200986ab4dba5cbc31c05a904072a6981a
2023-06-13 12:08:54 +00:00
Artem Glazychev
84fb83def4 af_xdp: set frame_no_append flag
Make sure the same frame is not used for multiple interfaces, otherwise it breaks the ETH_INPUT_FRAME_F_SINGLE_SW_IF_IDX promise.

Type: fix

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I02546259ceaea36f65cb9f78b9b3ee45ed4075c9
2023-06-13 11:01:02 +07:00
Florin Coras
9a1fbb5244 tcp: cleanup next nodes and drop logic
TCP nodes consume the buffers so they have no nexts. To avoid long drop
path through vlib graph, add drop node.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibe6e075e83612ed16270934398c6a013f236ae35
2023-06-08 21:19:00 -07:00
Florin Coras
81e3243c1b svm: convert fifo want_deq_ntf ops to atomics
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iba2e4de24ff0724e31859f5d2f4ffa3cfe2cf284
2023-06-08 19:23:51 +00:00
Filip Tehlar
5aa59c7cfc hs-test: increase test run timeout
Type: test

Change-Id: Ica211c79373777c3352d6ccbb619c0d67b70fa06
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-06-08 17:33:15 +00:00
Filip Tehlar
3a910ab768 hs-test: rename address allocator
Type: test

Change-Id: I1745719315d4e0785df5a03aa4312f84c40cb18f
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-06-08 17:04:36 +00:00
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>
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
Mohsin Kazmi
7869985758 interface: add the transmit queue infrastructure document
Type: docs

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I57f27f8ec4be7f3d8dc3d13ff4ea6b1b21c3cf6b
2023-05-19 19:08:17 +00:00
Filip Tehlar
84fd6493b3 hsa: make http cli client thread safe
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I9e6fd29c0e09406e48215f06977b2d4678650669
2023-05-19 12:54:18 +02:00
Filip Tehlar
4810e5b483 hsa: detach app on unsuccessful listen
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Idba74f880a251dbeec2205ee41e16b40d4799b06
2023-05-16 22:07:03 +00:00
Florin Coras
7ff7274c6b vcl: avoid skipping last event in epoll lt
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic89256d16230593b61a7b3e29582444fb3f93e4d
2023-05-16 13:05:28 -07:00
Benoît Ganne
83e73709c3 ip_session_redirect: add session redirect plugin
This feature enables the use of the classifier and ip-in-out-acl nodes
to redirect matching sessions via arbitrary fib paths instead of relying
on additional VRFs.

Type: feature

Change-Id: Ia59d35481c2555aec96c806b62bf29671abb295a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-05-16 13:29:04 +00:00
Xiaoming Jiang
5b55526da4 dpdk: fix format rx/tx burst function name failed
Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: I9971e69135e0652a36e4b4754774a43ea1d92e8b
2023-05-16 09:30:12 +00:00
Xiaoming Jiang
e10c524206 ethernet: fix adding p2p ethernet crash
Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: Ib0ca3379439d6ee23e696f8f0840e6ddf42430b8
2023-05-16 09:28:47 +00:00
Marvin Liu
754f79c36a memif: fix coverity warnings
Type: fix

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Change-Id: Ie3f390be16df81f6824344034377f9a6f4fa9f92
2023-05-16 09:28:07 +00:00
Benoît Ganne
00c37199d7 misc: make format_hexdump length u32
format_hexdump currently requires the length parameter to be uword
(64-bits) hence all callers must make sure to cast the length to uword.
Use u32 instead to benefit from C automatic integer promotion: any
length smaller or equal to u32 will be promoted to int fitting in u32).
Only callers using a length of u64 needs to downcast.
It also makes it similar to other variants.

Type: fix

Change-Id: I09b52fdde3970cec0be4150a29126ff63106c75b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-05-16 09:27:41 +00:00
Yulong Pei
24d7e72aa5 flow: fix wrong to use ntohl function to u64 type variable
This caused that failed to create flow rule with rss types.

Type: fix

Signed-off-by: Yulong Pei <yulong.pei@intel.com>
Change-Id: I77696286a32804cbe884075cb027eec19eb5c7cb
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
2023-05-16 09:27:16 +00:00
Tianyu Li
c405f755e3 vppinfra: add aarch64 support for format_ucontext_pc
Add the missing AArch64 support for printing program counter.

Type: improvement
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: Idb63737ed72e10fa29fd61e1eab5af059e2b8e28
2023-05-16 09:26:04 +00:00
Florin Coras
4add3f4c8b hsi: interop with ip reassembly
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8d3a1939870601297ecccf4cda6767510c2abfa5
2023-05-15 22:04:55 +00:00
Ting Xu
f34420ff11 packetforge: add option to show spec and mask only
In some cases with Generic FLow, it is only required to show the pattern
of spec and mask, but no need to add the flow. Therefore, add an option
in packetforge so that users can show spec and mask only.

Type: improvement

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I7b3040689eb82d0b58924712ee6fc9cfa0a42fa1
2023-05-15 20:20:12 +00:00
Florin Coras
9794326125 udp: improvements to connection format fn
Print fib-index, next node index and opaque.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id2ff265c9acffc75f8b04fb9f26c6d571fc2ef98
2023-05-15 17:54:49 +00:00
Florin Coras
639beb91f6 ip: allow overriding fib index in reass
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic28da52b9c8286f71e472ef6c3afc23d464f85b0
2023-05-15 17:11:43 +00:00
Steven Luong
e77af765e2 dpdk: Be wary of the return value from rte_eth_dev_socket_id
Prior to dpdk-22.11, VPP can count on rte_eth_dev_socket_id to return
numa node 0 if the device didn't set it. Ever since below patch is
committed in dpdk
https://patchwork.dpdk.org/project/dpdk/patch/20220929120512.480-1-olivier.matz@6wind.com/#152498
the aforementioned assumption is no longer true. If the device didn't
set the numa node, VPP gets -1 from the aforementioned API call. This
causes VPP to crash.

This fix is to set the numa node to 0 if the API returns -1, or SOCKET_ID_ANY

Type: fix

Change-Id: I2fde2870e5a3eb98473fe8d119fef594bfba9a8d
Signed-off-by: Steven Luong <sluong@cisco.com>
2023-05-15 04:58:40 +00:00
Florin Coras
4a0e08eb60 vcl: fix ldp ioctl FIONBIO handler
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ife5f72dc9587c9f6b8aa513cd039fa28bb22fca3
2023-05-12 23:59:38 +00:00
Chuhao Tang
cefb178aa4 gre: move to a plugin
Move GRE folder under vnet to the plugin folder, and modify some of path
of the #inlude<header> to the new path.

Add a plugin.c file to register a plugin.

JIRA: VPP-2044

Type: improvement
Change-Id: I7f64cecd97538a7492e56a41558dab58281a9fa5
Signed-off-by: Chuhao Tang <nicotang@cisco.com>
2023-05-12 06:59:09 +00:00
Ole Troan
683bdb6743 vppapigen: support counters only .api
In some cases an .api file may contain only counter definitions.
If so do not generate the setup_msg functions.

Type: improvement
Change-Id: Idf89a7a5ab135428e9577726bc356acfd7c30113
Signed-off-by: Ole Troan <otroan@employees.org>
2023-05-11 22:04:46 +02:00
Dave Wallace
0b7200f7ee api: clean up error message
- remove non-inclusive language in message and improve
  clarity of the error message

Type: style

Change-Id: I3f4895d6a502c2583a8b6b3c325a3f30ced03f84
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-05-10 20:00:36 +00:00
Dave Wallace
0e8ec6468b rdma: bump version to 45.0
- Update rdma-core library to 45.0 to work with DPDK 23.03

Type: feature

Change-Id: I6bd54c509b93de905e1b0194dce414e4a6e11990
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-05-09 20:42:17 -04:00
Xinyao Cai
df6a00f581 dpdk: bump to DPDK 23.03
This patch bumps DPDK version from 22.11 to 23.03.

Type: feature

Signed-off-by: Xinyao Cai <xinyao.cai@intel.com>
Change-Id: I10203a6408ceb5a40fe392924130652b91ebc993
2023-05-09 21:29:30 +08:00
Xinyao Cai
648006b3c0 dpdk: code preparation for bumping to DPDK 23.03
This patch prepares code for bumping DPDK version to 23.03, but the DPDK version of this patch keeps at 22.11 for compatibility.

the "no-dsa" parameter in DPDK configuration is removed, the "blacklist" parameter can be used to block the related DSA devices.

Type: feature

Signed-off-by: Xinyao Cai <xinyao.cai@intel.com>
Change-Id: I589afba165e85138437e731531414a033f64f8d3
2023-05-09 21:23:39 +08:00
Dave Wallace
4141ded3ec dpdk: correct build to include rdma driver
Type: fix

Change-Id: I23ef347adc97d7d806acf98c3dcdbe80f2a03441
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-05-04 13:46:46 +00:00
Florin Coras
c9fb987a9d session: cleanup ho lookup table on close
Make sure half-open table is cleaned up on close and cleanup of
half-open.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id7ad177f364d6395f7379dc927e449a40547510e
2023-05-04 11:57:27 +00:00
Alexander Kozyrev
6f83352822 rdma: bump to 43.0
Update rdma-core library to 43.0 to work with DPDK 22.11.

Type: feature
Change-Id: Iad8bb9c7745dd5bc5f8c0935a31362fd92447ff6
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
2023-05-01 20:53:51 +00:00
Florin Coras
89627e8c58 vcl: inherit connected flag on accepted cl sessions
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2d1976cb8061534a7e93d4dd2283abaf70a33f7c
2023-04-28 15:57:09 +00:00
Nathan Skrzypczak
51f1b26e85 session: update due to clib_socket refactoring
After the clib_socket_init syntax changed, the behavior of VCL
socket creation was broken. This patch introduces app_namespace_add_del_v4
to address the behavioral change.

Type: refactor

Change-Id: Ice016bdb372233fd3317f166d45625e086e9b4df
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2023-04-28 03:00:59 +00:00
Ondrej Fabry
9db32048de api: Mark old message versions as deprecated
This change is part of VPP API cleanup initiative.

Type: refactor
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I9f0f786b50aa77383b16e0f844c85f236f7aa8d0
2023-04-27 13:09:14 +00:00
Xinyao Cai
efcf1befc5 dpdk: bump to DPDK 22.11
This patch bumps DPDK version from 22.07 to 22.11.

Type: feature
Signed-off-by: Xinyao Cai <xinyao.cai@intel.com>
Change-Id: I82df2c0678e1cc1b3739a5b0677f0c4a4180a489
2023-04-27 10:31:36 +00:00
Dave Wallace
d0df24dc47 hs-test: add missing make target for .deps.ok
Type: make

Change-Id: I8983778b4c2f5123b27aeeb1fdc4721c8e9c9160
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-04-26 18:04:41 -04:00
Filip Tehlar
e08fdf316a hs-test: remove untagged images after build
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I55731fa546df01ac4bd327b444ac1a5c2052bed1
2023-04-26 18:03:35 +02:00
Ole Troan
ad92743925 build: plugin disable vat2 test2 plugin build
A plugin can set "VAT_AUTO_TEST_ OFF" to disable building of the autogenerated

Type: improvement
Change-Id: I856fbfd83bbc5c7df0759e550b20ac75df77d9d7
Signed-off-by: Ole Troan <otroan@employees.org>
2023-04-26 10:30:41 +00:00
Ole Troan
816b5d613c ip: change icmp4 throttle
traceroute sends 3 packets rapidly that triggers and depends on ICMP error
generation. The current ICMP4 throttle setting at 1-e3 throttles the last
ICMP error and makes traceroute sit in a timeout.

Type: fix
Change-Id: Ie886303600ad0374dcb6ae311e949154727a93d2
Signed-off-by: Ole Troan <otroan@employees.org>
2023-04-26 01:51:30 +00:00
Alexander Skorichenko
61cdc09810 crypto-sw-scheduler: fix interrupt mode
Type: fix

Currently sw_scheduler runs interchangeably over queues of one selected
type either ENCRYPT or DECRYPT. Then switches the type for the next run.
This works fine in polling mode as missed frames get processed on the
next run. In interrupt mode if all of the workers miss a frame on the
first run the interrupt flag is lowered so the frame remains pending in
queues waiting for another crypto event to raise the interrupt.

With this fix force sw_scheduler in interrupt mode check the second half
of the queues if the first pass returned no results. This guarantees a
pending frame gets into processing before interrupt is reset.

Change-Id: I7e91d125702336eba72c6a3abaeabcae010d396a
Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
2023-04-25 18:02:43 +00:00
Gabriel Oginski
980f3fb2d3 vpp-swan: assign src/dst port in udp encap
This patch add in missing src/dst port assignment in SA for udp port
if encap.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I84219c016c5a32590aba0371c01ad8d44cbf4c5c
2023-04-25 15:50:05 +00:00
Klement Sekera
c7d50475ec tests: fix parallel runs skipping some tests
Fix corner case when a test would be skipped if it was not possible to
start it due to insufficient cpus available in the middle of the loop.

Type: fix
Change-Id: Ie4580685ff55688375d649d7009131d9fe1e4f33
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2023-04-25 15:46:42 +00:00
Klement Sekera
cffeca4f1e tests: fix test-help formatting
Type: improvement
Change-Id: Ib7703359b998456bff88caee88c2734c7724bc09
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2023-04-25 15:44:53 +00:00
Klement Sekera
08c50e3b7a tests: support multiple filter expressions
Support multiple comma-delimited filter expressions,
e.g. to run both bfd and ip4 tests, it's now possible to do:

make test TEST=bfd,ip4

Same goes for wildcards, e.g.:

make test TEST=bfd,..test_longest_prefix_match,..test_icmp_error

Type: improvement
Change-Id: I0cceaa443cb612dca955f301c7407959f9a71a6e
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2023-04-25 15:44:13 +00:00
Ondrej Fabry
39d7699c20 api: Mark old message versions as deprecated
This change is part of VPP API cleanup initiative.

Type: refactor
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I26d13a697c9b70a75555c04e925e9d6aaf7ed755
2023-04-25 15:27:41 +00:00
Maxime Peim
2eb8d1ae0c perfmon: fix perfmon start type argument
When trying to start perfmon with a bundle that has a unique type while
specifying that type as argument, the command fails
(e.g. perfmon start bundle branch-mispred type node).
This error occurs because the returned value of
unformat_perfmon_active_type is actually a perfmon_bundle_type_t, but
it was treated as a perfmon_bundle_type_flag_t by a test in the CLI
function.

However, this test is useless and thus can just be removed.

Type: fix
Signed-off-by: Maxime Peim <mpeim@cisco.com>
Change-Id: I5d8b9815871621e8ee7b935586f4cedbc0e7a53d
2023-04-25 15:21:25 +00:00
Marvin Liu
cada0c5075 memif: support dma option
Introduce async model into memif by utilizing new DMA API. Original
process is broken down to submission stage and completion stage. As
multiple submissions may in flight simultaneously, per thread data is
no longer safe, now replace thread data into each dma data structure.

As slave side already support zero copy mode, DMA option is only added
in master side.

Type: feature

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Change-Id: I084f253866f5127cdc73b9a08c8ce73b091488f3
2023-04-25 15:18:27 +00:00
Xinyao Cai
efad24a84d dpdk: code preparation for bumping to DPDK 22.11
This patch prepares code for bumping DPDK version to 22.11, but the DPDK version of this patch keeps at 22.07 for compatibility.

the "no-dsa" parameter in DPDK configuration is removed, the "blacklist" parameter can be used to block the related DSA devices.

Type: feature
Signed-off-by: Xinyao Cai <xinyao.cai@intel.com>
Change-Id: I08787c6584bba66383fc0a784963f33171196910
2023-04-25 15:13:22 +00:00
Koki Kiriyama
140ca0fa95 build: correct variable name
Type: fix
Signed-off-by: Koki Kiriyama <kiriyama.kk@gmail.com>
Change-Id: I47c4c91aa6f973bd93dca352f470642e90aa70e0
2023-04-25 15:12:23 +00:00
Filip Tehlar
dda1f6871e hs-test: adjust performace testing parameters
Apache ab sometimes fails during extensive performace testing.
This patch makes sure hs-test perf tests always pass.

Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I0921682f0f07df3af45b342b9a7ddfa1af037ceb
2023-04-24 18:32:44 +02:00
Filip Tehlar
25ef5d3fc4 tcp: remove unused code
Type: improvement

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ib188f3331696dff6357a18f5bac5f1db3cefaeab
2023-04-21 15:29:17 +00:00
Jieqiang Wang
26c7605243 rdma: fix rx CQ mask to calculate right next_cqe_index
Set the mask of calculating the next cqe index to the corresponding CQ
size instead of rxq size.

Type: fix
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: I67494f029967af64051f51452eba1fd699984cd9
2023-04-21 09:13:43 +00:00
Vratko Polak
2cebd4270d lb: improve formatting in lb_types.api
Type: style

Change-Id: I969bc72185d3675a35cf227c60bedca20e09fdf5
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-04-21 08:46:38 +00:00
Florin Coras
9f1ae220d0 session svm: fix mq cleanup
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8519bcd76a0ade2f24b62bf69f6a103379639cb7
2023-04-20 22:33:08 +00:00
Matthew Smith
5b32d3a13b api: fix trace_plugin_msg_ids segv in trace dump
With 'api-trace { on }' in startup.conf, running 'api trace dump' in
vppctl was causing VPP to seg fault. vl_msg_print_trace() was calling
m->endian_handler() without checking whether its null.

Checking if its non-null prevents a crash, but the trace dump prints
the message IDs for trace_plugin_msg_ids in network byte order. There is
an auto-generated endian function for that message. Set it on the call
to vl_msg_api_config() for trace_plugin_msg_ids so the IDs will be
printed in host byte order in trace dump output.

Type: fix
Fixes: fe45f8f5

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I0ab463985e9a983155feba13ac4eb99ab883ace6
2023-04-20 21:11:41 +00:00
Filip Tehlar
bc4dc16a5c tcp: fix tcp packet trace
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Id4ca9a749a343c55b24f6eb4b5eb0909a57e0c23
2023-04-20 17:43:23 +00:00
Xiaoming Jiang
1f7042506c session: fix app_listener memory leak if session listen failed
Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: Iaa3ad87d56163396476bcaaa34e52948b9032f4e
2023-04-19 15:38:03 +00:00
Vratko Polak
9339af358f lb: initialize lb_vip_add_args_t
Previously, .src_ip_sticky may have been left uninitialized.

Type: fix
Fixes: 613e6dc0bf928def5d337312d522e1a15df87b00

Change-Id: Ifd866d6322fe9ff723f92b7ab3fd77e720a3cfa4
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-04-19 12:38:15 +00:00
Ole Troan
f00cb43190 vpp: install version.h
To make out of tree plugins require a particular version, they need
access to the version they are built with. Install version.h.

Type: fix
Change-Id: I5916d0a16aed7e054ede452af956fee56cd078f0
Signed-off-by: Ole Troan <ot@cisco.com>
2023-04-18 20:18:24 +00:00
Filip Tehlar
5811356a40 hs-test: filter relevant data from perf tests output
Type: test
Change-Id: I90faed91639ce1792646531cfc0cac649d737f16
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2023-04-18 18:34:40 +00:00
Sivaprasad Tummala
206592bb73 vppinfra: Multiarch support for AMD EPYC processors
Type: feature

- Added multiarch support for AMD Zen architectures

Change-Id: I65d3fe94b6cc622ebecbe1ac803efa674e87c87a
Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
2023-04-18 12:12:05 +00:00
Damjan Marion
b1c5c3fc34 vppinfra: missing static_always_inline in crc32c.h
Change-Id: Ie7ee71af7dbbc23de3f413423070ea87fb36ed8c
Type: fix
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-04-18 02:35:26 +00:00
Damjan Marion
687823f017 vppinfra: SFENCE requires SSE2 to be enabled
Change-Id: I0469bb91107cf0acced3cd19820db8d3712701c0
Type: fix
Fixes: eaabe07
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-04-17 15:45:26 +00:00
Sivaprasad Tummala
6a1a832346 vppinfra: add AMD EPYC cpu family details
Type: feature

- Added support for AMD EPYC processor family

Change-Id: I60da87cca429117c209d240e5a5f3b4d9f4981d8
Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
2023-04-17 14:36:10 +00:00
Ole Troan
22ca0d03db stats: check if stats vector entry is empty
When a stats entry is removed it is marked empty.
The stats client did not check for that and returned an empty string.
This resulted in blank lines in vpp_get_stats. Fix by returning null instead
and checking value.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I08a39ba3ef4421bf275747a6300f97fe36791b50
2023-04-17 14:04:06 +00:00
Damjan Marion
003330c55a vppinfra: native poly1305 implementation
Type: feature
Signed-off-by: Damjan Marion <damarion@cisco.com>
Change-Id: Ic170464d7c63f243e7e676567d41d800647ebec3
2023-04-17 12:40:17 +00:00
Damjan Marion
98f7f0a873 build: add scalar (no-simd) march variant
for testing purposes, disabled by default

Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
Change-Id: Id616e2b3b21ae0f0b44e2b55ecefd501afacc7f2
2023-04-17 10:54:34 +00:00
Damjan Marion
b42d27ad48 vppinfra: table based crc32c for targets without crc32c instructions
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
Change-Id: I45cef390c72f2102c8c3d94f49bed7d0e0e0d7b2
2023-04-17 10:54:14 +00:00
Damjan Marion
cbc0410d62 vppinfra: add format_hexdump_u{16,32,64}
Change-Id: I0eeccfc5739276d58a81a6552a043c6c105fe67a
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-04-17 10:53:27 +00:00
Damjan Marion
4621966638 build: few more .gitignore entries
Change-Id: I833151c077bf054de6b09fff1180570e32a1ecaa
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-04-17 10:53:08 +00:00
Adrian Pistol
8f78c935f8 linux-cp: Handle RTA_VIA routes.
RTA_VIA allows routes to have a next-hop in a different address family.
This commit makes linux-cp import those types of routes correctly,
instead of importing the routes without a gateway.

This uses rtnl_route_nh_get_gateway, which is available since libnl
3.4.0 (Oct. 9, 2017). Even Debian Stretch has it via backports.

Type: fix
Change-Id: I06297c700461ba7874eb8baf9355bd40990b3121
Signed-off-by: Adrian Pistol <vifino@posteo.net>
2023-04-14 21:12:12 +00:00
Vladislav Grishenko
b8a663c56d nat: distribute nat44-ed in2out sessions by rx vrf
Nat in2out sessions are distributing among workers by client
addresses. In case there's multiple client vrfs with very
similar client addresses (usually from rfc1918), session
distribution/load can be unfair just due similar hash.
Let's take dynamic client fib_index into account, it'll affect
external port range only, outside address picking has own
address-based hash therefore not affected.

Type: improvement
Change-Id: I56ab2e1ce8dd27f2b1f9e7f22839ccf7774bfb82
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
2023-04-13 08:04:22 +00:00
Ted Chen
407b1488d5 nat: fix the wrong unformat type
The unformat type for "%d" should be u32 or int.

Type: fix
Signed-off-by: Ted Chen <znscnchen@gmail.com>
Change-Id: I2483df6259ed8d3c7648c8db6345e5063ac8b57e
2023-04-13 08:04:12 +00:00
Daniel Béreš
d9df165038 nat: adding a new api nat44_ed_vrf_tables_v2_dump
Adding api nat44_ed_vrf_tables_v2_dump which may replace
nat44_ed_vrf_tables_dump in the future.
 - fixing endianess

Type: improvement

Signed-off-by: Daniel Béreš <daniel.beres@pantheon.tech>
Change-Id: I40d09ea3252589bdcb61db9f1629dacd87f69978
2023-04-13 08:03:59 +00:00
Florin Coras
6bec05b56d vlib dhcp: default to logging without elogs
Some components, like dhcp, log constantly changing strings which in
turn forces elog string table to grow unbound.

To avoid this, as a workaround, only turn on elog logging if requested.
Actual fix that adds configuration for logging subclasses should come in
a later patch.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie8b26251fb7115d866c2bd65353daa33cdab1ab6
2023-04-12 21:49:15 +00:00
Andrew Yourtchenko
feb77422a3 ip: punt socket - take the tags in Ethernet header into consideration
The punt socket code rewinds the current_data pointer by sizeof (ethernet_header_t),
which is incorrect if the header is tagged - resulting in truncated destination MAC
address. Use ethernet_buffer_header_size() instead, which takes tags into account.

Also add the unittest that verifies the issue and the fix.

Type: fix
Change-Id: I6352a174df144ca1e4230390c126f4b698724ebc
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2023-04-12 15:26:23 +00:00
Mohsin Kazmi
393a05f289 misc: change of address
Type: style

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ie02d068122ab8f2c6049754f28722d851ae9b3f1
2023-04-12 15:05:04 +00:00
Stanislav Zaikin
fdf917e8f8 linux-cp: don't create tap for non-eth ifaces
Creation of lcp tap for non-ethernet interfaces can potentially lead to a crash, so avoid it.

Type: fix

Change-Id: I76ded8a08ea38a2c31d0215804af023207d4d3e1
Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
2023-04-11 22:40:21 +00:00
Jieqiang Wang
00f5d96f04 rdma: disable compressed CQE mode for txq CQ
Previously we encountered the issue of failing to create completion
queues on some Arm platforms because DPDK may set MLX5_CQE_SIZE to 128
if DPDK MLX PMDs are built and DPDK plugin is loaded, which does not
satisfy the requirement of 64B size CQE by RDMA plugin.
We fixed this issue in 844a0e8b0("always use 64 byte CQEs for MLX5"),
but some of CSIT test cases failed due to this code change. It turns out
that we don't need to specify compressed CQE mode for txq CQ because
RDMA tx doesn't have the code logic to handle compressed CQEs, which
might cause unexpected behavior if it is enabled.

Type: fix
Fixes: 844a0e8b0 ("always use 64 byte CQEs for MLX5")
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: I7909a6d44b15bcf39c15dfac9377b65520a0cbfb
2023-04-11 08:37:28 +00:00
jinsh
b7756b26a9 vlib:process node scheduling use timing_wheel have problem.
The time wheel should not be started in the loop while processing expired events.
can be set  p->stop_timer_handle = ~0 to solve.

Type: fix

Signed-off-by: jinsh <jinsh11@chinatelecom.cn>
Change-Id: Ie9a4293f39f981f50d280b39a5d958d319ee2300
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2023-04-10 17:31:38 +00:00
Matthew Smith
9aa4ac55b0 vlib: reset stop_timer_handle on expired processes
Type: fix

The main loop populates a vector of suspended process nodes to dispatch
by calling TW (tw_timer_expire_timers_vec), which identifies expired
timers and appends the user handle for each one to the vector.

Subsequently, the vector is iterated and the process node corresponding
to each handle is dispatched. The vast majority of the time, the process
node will end up suspending itself again to wait for a new timer or
event.

Given a process node A whose timer has expired, between the point when
the timer expired and the point when A is dispatched and suspends itself
again, its stop_timer_handle contains a stale value.

If another process node B is dispatched before A is dispatched, it may
end up using the timer ID that A formerly used. If another process node
C is dispatched after B and before A and calls
vlib_process_signal_event() to signal A, the timer started by B can be
deleted by vlib_process_signal_event_helper().

After getting the vector of process node IDs for expired timers, reset
the stop_timer_handle on each of those nodes.

Change-Id: I266da438e76e1fc356016da0b9b4941efac1c28a
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2023-04-06 22:07:00 +00:00
Damjan Marion
5294cdc792 vppinfra: refactor uword bitmaps
Type: improvement
Change-Id: I4f05a0435825cd23b8ad8a6f8f1397e60c522319
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-04-06 08:00:08 +00:00
Florin Coras
1315d14d4c session: fix ct connect session flush assert
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I90eaeed07dc4864adfed3bc4cef1e3edacf4bf8f
2023-04-04 20:36:29 +00:00
Damjan Marion
156d452750 vlib: add vlib_frame_bitmap_{set,clear}_bit_at_index
Type: improvement
Change-Id: I5703728f680f0c8431e4099b398827bd094b60df
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-04-02 22:13:16 +00:00
Daniel Béreš
2c03879ce4 nat: fix nat44 vrf handlers
Change of enums used in REPLY_MACRO() to appropriate one
for handlers:
-vl_api_nat44_ed_add_del_vrf_table_t_handler
-vl_api_nat44_ed_add_del_vrf_route_t_handler

Type: fix

Change-Id: I58e97817b1678da7c025c0d03a8b938a4e0f7b6c
Signed-off-by: Daniel Béreš <daniel.beres@pantheon.tech>
2023-03-31 12:43:45 +00:00
Takeru Hayasaka
b23c6f4f29 ip: support flow-hash gtpv1teid
support with  GTPv1 TEID added to the flow hash.
This can able to ECMP to PGW and parallelization.
Type: feature

Change-Id: I6f758579027caf6123831ef2db7afe17e424a6eb
Signed-off-by: Takeru Hayasaka <hayatake396@gmail.com>
2023-03-31 06:04:42 +00:00
Florin Coras
55686e1c59 session: async flush of pending connects to workers
Since connects can be done without a worker barrier, first
worker should flush connects to destination workers only
after session layer has a chance to fully initialize the
half-open session.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I82fe0f0c7e520baa72fd380d0a43a76ebbd5f548
2023-03-30 18:45:27 +00:00
Mikhail Sokolovskiy
8309517f23 vlib: fix segfault on panic in worker
Vlib panic uses longjmp to exit main loop, but workers don't set main_loop_exit
field on initialization, so this jump corrupts registers and causes segfault.

There I add clib_warning and abort if longjmp context hasn't been set.

Type: fix
Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com>
Change-Id: I0d705f1f139c4083af75066aeb525964ed0aa202
2023-03-30 13:27:33 +03:00
Gabriel Oginski
2844aa186f dpdk-cryptodev: fix name formatting of session pools
Originally the name for each session pool is incorrectly prepared.
It doesn't have right length. It is not null terminated.

The fix corrects the name formatting for each session pool.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I67da3d64702ccb27a5907825528f8c95d91040bb
2023-03-29 14:31:51 +00:00
Filip Tehlar
b41b0af609 hs-test: containerize ab and wrk
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I66af84257fa0692d9be3445d49b52fb7ca810d27
2023-03-29 04:43:40 +00:00
Ondrej Fabry
7c11156752 docs: Update info about GoVPP
Type: docs
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I1e28c6858a986d6ede1c7a6d06055400fdc0196b
2023-03-28 13:04:41 +00:00
Damjan Marion
4172448954 vppinfra: small improvement and polishing of AES GCM code
Type: improvement
Change-Id: Ie9661792ec68d4ea3c62ee9eb31b455d3b2b0a42
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-27 10:09:50 +00:00
Filip Tehlar
75776f03a8 hs-test: remove colons from log files
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I56c57de180e44c888458e4f4020802ce9b4a6b8b
2023-03-24 17:14:49 +00:00
Ondrej Fabry
c9fac2111b api: Remove deprecated message from API
Type: refactor
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: Ib80a4d1f8bac5dc27db1aafe65165cbb509b4edf
2023-03-24 16:46:07 +00:00
Vladislav Grishenko
696f8e042f udp: fix udp_local length errors accounting
In case of UDP length errors in udp_local node, these errors are
being lost and incomplete header may be advanced by wrong offset.
Fix it with only full packets processing and explicit error set
otherwise. Also, optimize two buffer loop perfomance into fast
path with both buffers are ok and slow path with one or none.

Type: fix
Change-Id: I6b7edc3eb5593981e55d7ae20d753c0fd1549d86
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
2023-03-24 16:44:20 +00:00
Gabriel Oginski
b052c6702e dpdk-cryptodev: fix formatting name of pools
Originally the name for each session pool can be incorrect prepared.

The fix changes formatting for name for each session pool.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I42e0752f9f46c5a42524ec7b863a7c9dd3c23110
2023-03-24 09:31:46 +00:00
Xiaoming Jiang
5f305184db session: fix session node switching to interrupt mode failded if no user events
wrk->event_elts has 5 elements if no user events

Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: Ib38fab422304efc470e20ccb7121442f05bf8bf3
2023-03-24 02:53:17 +00:00
Florin Coras
49a103202e session: fix formatting of half open sessions
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I45a524bebd2dc1e318fa8d2a645bfc769e1da840
2023-03-23 17:27:53 +00:00
Damjan Marion
b47376f0b4 vppinfra: AES-CBC and AES-GCM refactor and optimizations
- crypto code moved to vppinfra for better testing and reuse
- added 256-bit VAES support (Intel Client CPUs)
- added AES_GMAC functions

Change-Id: I960c8e14ca0a0126703e8f1589d86f32e2a98361
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-23 12:04:46 +00:00
Benoît Ganne
5527a78ed9 ipsec: make pre-shared keys harder to misuse
Using pre-shared keys is usually a bad idea, one should use eg. IKEv2
instead, but one does not always have the choice.

For AES-CBC, the IV must be unpredictable (see NIST SP800-38a Appendix
C) whereas for AES-CTR or AES-GCM, the IV should never be reused with
the same key material (see NIST SP800-38a Appendix B and NIST SP800-38d
section 8).
If one uses pre-shared keys and VPP is restarted, the IV counter
restarts at 0 and the same IVs are generated with the same pre-shared
keys materials.

To fix those issues we follow the recommendation from NIST SP800-38a
and NIST SP800-38d:
 - we use a PRNG (not cryptographically secured) to generate IVs to
avoid generating the same IV sequence between VPP restarts. The PRNG is
chosen so that there is a low chance of generating the same sequence
 - for AES-CBC, the generated IV is encrypted as part of the message.
This makes the (predictable) PRNG-generated IV unpredictable as it is
encrypted with the secret key
 - for AES-CTR and GCM, we use the IV as-is as predictable IVs are fine

Most of the changes in this patch are caused by the need to shoehorn an
additional state of 2 u64 for the PRNG in the 1st cacheline of the SA
object.

Type: improvement

Change-Id: I2af89c21ae4b2c4c33dd21aeffcfb79c13c9d84c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-23 08:59:31 +00:00
Arthur de Kerhor
ad95b06181 ipsec: add per-SA error counters
Error counters are added on a per-node basis. In Ipsec, it is
useful to also track the errors that occured per SA.

Type: feature
Change-Id: Iabcdcb439f67ad3c6c202b36ffc44ab39abac1bc
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
2023-03-23 08:58:55 +00:00
Maxime Peim
f6ba56296c vnet: throttling configuration improvement
To allow a more flexible throttling configuration, the number of bits
used in the throttling bitmap can be chosen.

Type: improvement
Signed-off-by: Maxime Peim <mpeim@cisco.com>
Change-Id: I7bfe391dd64729011b03f3e5b89408dfc340e036
2023-03-23 08:58:30 +00:00
Filip Tehlar
ac3c8dcb07 session: add session stats
Type: feature

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I02d9bb5292b32ffb1b2f05daccd8a7d5dba05125
2023-03-22 19:43:56 +00:00
Tianyu Li
b53b88a08e build: fix rpm build error with test_infra
RPM build errors:
error: Installed (but unpackaged) file(s) found:
   /usr/bin/test_infra

Add NO_INSTALL tag in CMakeLists to avoid installing test binary.

Type: fix
Fixes: c3542e17b5df ("vppinfra: widen the scope of test_vector_funcs")

Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I359ba79af2e3cb32b47dda3bb8707a5d2fd8586b
2023-03-22 15:05:45 +08:00
Stanislav Zaikin
653ef7355c linux-cp: fix get_default_ns api method
Type: fix

Change-Id: I141e5779aab7eee3068b702dd2f93765420fb920
Signed-off-by: Stanislav Zaikin <stanislav.zaikin@46labs.com>
2023-03-21 14:56:23 +00:00
Ole Troan
86698fca30 papi: vla list of fixed strings
Handle a variable length array of fixed strings.
Like:
fixed_string = VPPType("fixed_string", [["string", "data", 32]])
s = VPPType("string_vla", [["u32", "length"], ["fixed_string", "services", 0, "length"]])

Previously instead of packing and unpacking as strings, exception packed as u8 instead
of list.

Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I501a8a4755828042e1539fd5a54eacec21c5e364
Signed-off-by: Ole Troan <ot@cisco.com>
2023-03-21 13:53:09 +00:00
Alexander Chernavin
d76c029a85 wireguard: fix sending peer events from worker threads
Type: fix

API clients can register for peer events (e.g. to be notified when
connection is established). In a multi-worker setup, peer events might
be triggered from a worker thread. In order to send a peer event to the
clients, an API message needs to be allocated and populated.

API messages allocation is only allowed from the main thread. Currently,
the code does not handle the case when a peer event is trying to be sent
from a worker thread. In debug builds, when this happens, it causes
SIGABRT in vl_msg_api_alloc_internal() because assertion "pool == 0 ||
vlib_get_thread_index () == 0" fails. In production builds, when this
happens, it might cause unexplained behavior.

There is a test that is supposed to catch this but all multi-worker
Wireguard tests are currently disabled. This problem is likely to be one
of the reasons they were disabled.

With this fix, when a peer event is triggered from a worker thread,
allocate and send corresponding API message from the main thread using
RPC.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: Ib3fe19f8070563b35732afd16c017411c089437e
2023-03-20 16:41:14 +00:00
Piotr Bronowski
645a588ee3 ipsec: set fast path 5tuple ip addresses based on sa traffic selector values
Previously, even if sa defined traffic selectors esp packet src and dst
have been used for fast path inbound spd matching. This patch provides
a fix for that issue.

Type: fix
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: Ibd3ca224b155cc9e0c6aedd0f36aff489b7af5b8
2023-03-20 16:38:36 +00:00
Vladislav Grishenko
8a4b79778f vppinfra: fix pool free bitmap allocation
Using clib_bitmap_vec_validate makes free bitmap vector
to be x64 times bigger (assuming x86_64) than necessary
when non-zero and possible oom due (u32)(0 - 1) math with
zero alloc.
Fix it with clib_bitmap_validate which takes bit size, not
index and ensure at least one bit is allocated.

Type: fix
Change-Id: I7e191f4e2fb3722a06bb800e1d075f7c7e2dcec9
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
2023-03-19 12:17:23 +00:00
Dave Barach
b9c8c57e98 vppinfra: fix corner-cases in bihash lookup
In a case where one pounds on a single kvp in a KVP_AT_BUCKET_LEVEL
table, the code would sporadically return a transitional value (junk)
from a half-deleted kvp. At most, 64-bits worth of the kvp will be
written atomically, so using memset(...) to smear 0xFF's across a kvp
to free it left a lot to be desired.

Performance impact: very mild positive, thanks to FC for doing a
multi-thread host stack perf/scale test.

Added an ASSERT to catch attempts to add a (key,value) pair which
contains the magic "free kvp" value.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I6a1aa8a2c30bc70bec4b696ce7b17c2839927065
2023-03-18 18:35:46 +00:00
Damjan Marion
04bd0ea8e2 vppinfra: move sha2.h to crypto/
Type: refactor
Change-Id: I3d0c57b82e5bdb4575c1ca13e463685fd11b7f11
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-17 16:34:15 +00:00
Damjan Marion
c7d3a5b968 vppinfra: auto-free test memory
Type: improvement
Change-Id: Ibc40a02c8c45fc8d9409c9a86fea7aaf70d9c048
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-17 16:34:06 +00:00
Damjan Marion
f8b61fb538 vppinfra: add FOREACH_ARRAY_ELT macro
Type: improvement
Change-Id: Iac1b3a66176c9a38a161246159140f30a1c168da
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-17 16:20:02 +00:00
Andrew Yourtchenko
f39485ff6a vppinfra: add clib_crc32c testcase into infra tests
Type: test
Change-Id: Id96448ba3ab69a5b22dfc27812fc17194136b969
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2023-03-16 19:16:51 +00:00
Florin Coras
e541d6f0ed session: support active opens with same source port
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2b426e9e988c32d261f36367087f358d8cc25e2f
2023-03-16 16:57:00 +00:00
Filip Tehlar
890eced917 hs-test: check exit value of ab/wrk
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I967e91e4ea97edff427013c92376b388d6ce5d85
2023-03-16 13:52:54 +01:00
Maros Ondrejicka
e7625d0856 hs-test: use consistent naming convention
Exported indentifiers in Go start with capital letters. Only few fields
in hs-test, which are being unmarshaled from yaml are required to be
exported. Every other field name or method name should start with
lower-case letter, to be consistent with this naming convention.

Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I7eab0eef9fd08a7890c77b6ce1aeb3fa4b80f3cd
2023-03-15 17:20:57 +00:00
Damjan Marion
c3542e17b5 vppinfra: widen the scope of test_vector_funcs
Location changed and binary renamed to test_infra
Also it is built by default.

Type: improvement
Change-Id: I27cd97f274501ceb7a01213e2bc9676cea00f39c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-15 17:07:01 +00:00
Damjan Marion
adeaf16960 crypto-native: 256-bit AES CBC support
Used on intel client CPUs which suppport VAES instruction set without
AVX512

Type: improvement
Change-Id: I5f816a1ea9f89a8d298d2c0f38d8d7c06f414ba0
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-15 14:58:56 +00:00
Damjan Marion
1ca681838c build: add support for intel alderlake and sapphirerapids, part 2
Type: improvement
Change-Id: I64ca5bd3a959190111f61c5311a908d242c10bad
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-15 11:10:24 +00:00
Marvin Liu
6a6df00abc dma_intel: fix potential invalid batch status
DMA batch status was set by hardware. Its value may be variable between
cpus twice accesses. Saving the value of status can fix it.

Type: fix

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Change-Id: Ibc9337239555744a571685b486c986991c3e9b18
2023-03-15 23:15:06 +08:00
Maros Ondrejicka
f4ddf16eec hs-test: create temporary folder at init
Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I6444582ce83beddc5cb2fcb31942a4c2e9556bb6
2023-03-15 04:43:39 +00:00
Marvin Liu
e10ace2674 dpdk: enable Google Virtual Ethernet
Recognize and drive google virtual ethernet (gve) in google cloud.

Type: feature

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Change-Id: Ia559615ac059cabbca5d10bcd4049e87beaad638
2023-03-14 20:10:19 +00:00
Andrew Yourtchenko
0d07a5d27f vlib: fix clib_crc32c on odd lengths and clib_crc32c_u8
Fix the typo in the intrinsic name, which caused incorrect intrinsic to be used.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Ib7fde14d12897e4d1bfb5a01f6d65025473e4f8e
2023-03-14 19:58:04 +00:00
Florin Coras
aeb7c1cb6e session vcl: refactor builtin tx event for main tx
Rename unused SESSION_IO_EVT_BUILTIN_TX to SESSION_IO_EVT_TX_MAIN and
leverage it for non-connected udp tx.

Non-connected udp sessions are listeners and are therefore allocated on
main thread. Consequently, whenever session queue node is not polling
main, tx events generated by external applications might be missed or
processed with some delay. To solve this, request that apps use
SESSION_IO_EVT_TX_MAIN tx events as opposed to SESSION_IO_EVT_TX and
send that to first worker as opposed to main.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5df5ac3dc80c0f192b2eefb1d465e9deefe8786b
2023-03-14 17:02:15 +00:00
Marvin Liu
48d2e15e3d session: pre-alloc required dma batches
Specify the number of max_batches when applying for dma config.
Skip this round when no batch available from vlib_dma_batch_new.

Type: improvement

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Change-Id: Ic6e0acf81ba4fc3ed33aea6ac6990ef841021c59
2023-03-14 16:40:41 +00:00
Marvin Liu
738aba7b51 vlib: pre-alloc dma backend batches
Allocate and initialize dma batch structure when adding dma config.
The number of required dma batches is set by max_batches parameter.
Thus dma batches are not allocated dynamically in worker thread.
Application need to check the return value of vlib_dma_batch_new.

Type: improvement

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Change-Id: I5d05a67b59634cf2862a377d5ab77cb1040343ce
2023-03-14 16:40:41 +00:00
Florin Coras
0d712c1a96 session: format transport connection flags
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id87c41c472898d4f66b0771f18f822d1069bbfd0
2023-03-14 16:12:54 +00:00
Florin Coras
02aa2ca093 session: cleanup lcl endpt freelist before all alloc
Make sure endpoint freelist is drained before alloc of fixed local
source port is tried.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I302deee5609a463af8135185af71722ac8c55a27
2023-03-14 16:09:50 +00:00
Damjan Marion
1552228350 build: add support for intel alderlake and sapphirerapids
Disabled by default..

Type: improvement
Change-Id: I36176c009e0873c048874ae38a7ea0a91449235c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-14 16:01:08 +00:00
Damjan Marion
8ade308e17 crypto-native: avoid crash on 12th and 13th gen Intel client CPUs
Those CPUs are announcing VAES capability but they don't support AVX512.

Type: fix
Fixes: 73a60b2
Change-Id: I7b4be95e91bb6f367cd71461f1126690f3ecd988
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-14 16:00:14 +00:00
Damjan Marion
f6d3abd0d1 memif: don't leak error strings in API handlers
Type: fix
Fixes: ab4d917
Change-Id: I226044f64e1577033798fd203a2e981c894830d6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-14 15:59:31 +00:00
Steven Luong
a361a3951c udp: Use udp_output_get_connection instead of udp_connection_get
udp_output_get_connection handles correctly if the connection
is a listener whereas udp_connection_get does not which may lead
to a crash.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I40b57287a8686820d29872cae2cfd6ae27a57c26
2023-03-13 11:11:29 -07:00
Leyi Rong
0638619e05 avf: 512-bit SIMD version of avf_tx_prepare
Exploiting AVX-512 operations on avf_tx_prepare().

Type: improvement

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Change-Id: I01e0b4a2e2d440659b4298668a868d983f5091c3
2023-03-13 10:40:51 +08:00
Florin Coras
c6c4e86637 vcl: init ldp config before vcl init
This avoids printing ldp debug messages while debug is disabled and vcl
is initializing.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5dfd1d59032db937fea146b6b84b8e26307a0de0
2023-03-10 16:43:33 +00:00
Leyi Rong
767a9ab4b1 vlib: 512-bit SIMD version of vlib_buffer_free
Process 8 packets perf batch in vlib_buffer_free_inline() when
CLIB_HAVE_VEC512 is enabled.

Type: improvement

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Change-Id: I78b8a525bce25ee355c9bf0e0f651698a8c45bda
2023-03-10 15:57:09 +00:00
Mohsin Kazmi
7b0d48fbb3 af_packet: fix the broken functionality upon admin down
Type: fix

In vpp, file descriptor handler closes the fd upon error
if there is no error handling function is registered.
This patch fixes the issue for af_packet interface by
registering the error handling function.

Errors will also be gracefully logged.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I260d780ac54ffd0199dcd6ca5b95e5afe957e968
2023-03-10 15:54:22 +00:00
Florin Coras
66c675e1a5 vcl: fix select connected deq notification
Also make sure that only sessions with fifos try to set deq notification
flag on fifo

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I878c2d2e18bb98109ee03b42a4f0f8c48aa23e9f
2023-03-09 16:43:02 -08:00
Florin Coras
436c7badcd vcl: fix epoll out evt on connect
Make sure session has a tx fifo.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibde40645b401ca0255da298ea4ba691ee924a2d2
2023-03-09 18:04:06 +00:00
Steven Luong
a468fd7e58 session: Use session->thread_index to correctly retrieve the session
For non-connected udp, when retrieving the subscriber session to send
the notification, it uses the current worker thread index whereas the
subscriber session is actually on the main thread. Using the worker
thread may cause a crash since the corresponding session may not be
valid in the worker thread context and even if it is valid, it is the
wrong session. This scenario is seen when the application forks
and adds subscribers to the worker thread session.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I236ee9d9ff9f3b2f7f9f8e782d70d1080aa1b627
2023-03-08 16:43:16 -08:00
Dave Wallace
f72bb6fb24 hs-test: fix install-deps
- Skip addition of docker apt source/key if
  already installed.

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I747e4dd5e79e23b64e6eb11c6a9348e2ae1a157f
2023-03-08 13:53:32 -05:00
Florin Coras
51cb655b75 quic: use tx instead of builtin_tx event with timers
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic11069c912a5e59bb3ea0e0c6de6cfcc879c5f4e
2023-03-08 17:00:03 +00:00
Dave Wallace
05120fb1a1 hs-test: fix docker-ce install
Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I449cd4ad71e33a2dd41e53accc6b325803a32c70
2023-03-08 16:06:43 +00:00
Filip Tehlar
1a66150f18 hs-test: add vppctl wrapper script
Type: test

Add a helper wrapper script for vppctl called vppcli to vpp docker image
with proper cli socket path.

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I1a51aa54bc91c1c812698501a56401c525d498e8
2023-03-08 12:08:07 +01:00
Filip Tehlar
9abba11a94 hs-test: fix envoy test
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I776e0f1f7ea700439d1fe6a598772776ae6a1493
2023-03-07 17:47:45 +00:00
Xinyao Cai
21121f60d2 avf: enable rss action of flow
This patch enables RSS action of avf flow.

Type: feature

Signed-off-by: Xinyao Cai <xinyao.cai@intel.com>
Change-Id: I65de18d0c2eaa415893959563ea917a6b1956550
2023-03-07 11:38:32 +00:00
Vladislav Grishenko
d1dc1060df vlib: stop worker threads on main loop exit
If not, worker threads may continue own loops after deinit and/or
thread0 exit with related crashes due no rpc capability, unmapped
shared memory, etc. Main loop exit handlers that uses barrier sync
will be happy too as long as recursive barrier sync is supported.

Type: feature
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I255a796b06936d96715683e3f062128060233dc6
2023-03-07 11:36:47 +00:00
Tianyu Li
b7936405ab avf: fix cli memory leak with incorrect options
Remove extra line_input and unformat_user.

Type: fix
Fixes: b4ff07a2f843 ("Intel Adaptive Virtual Function native device driver plugin")

Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I9e502f3b254d0b1c7d8fd4b80925338a18da8269
2023-03-07 11:35:26 +00:00
Steven Luong
16581f5dcb udp: crash in format_udp_connection
format_udp_connection takes 2 arguments from the caller.

Type: fix

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ie618a809936a01c094982f9a8c81309826e0b087
2023-03-07 04:34:33 +00:00
Damjan Marion
16cc15b232 build: check for presence of python ply
Type: improvement
Change-Id: I4f190607bfce404fbe68ec968e6923509ea9519b
Signed-off-by: Damjan Marion <dmarion@me.com>
2023-03-07 02:29:56 +00:00
Damjan Marion
1cada9ad78 build: make Python3 mandatory
Type: refactor
Change-Id: Iac27ac4d11745b68c57a0394ced51942db8f0431
Signed-off-by: Damjan Marion <dmarion@0xa5.net>
2023-03-07 02:22:47 +00:00
Florin Coras
3ffc77da2b tcp: allow syns in closed state
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If223096cf912c1748ae417b40585a9bea5d9d9a9
2023-03-06 23:02:19 +00:00
Florin Coras
a41a0b5a4c vcl: do not stop listeners on vls epoll del
Although removal from epoll means listener no longer accepts new
sessions, the accept queue built by vpp cannot be drained by stopping
the listener. Morover, some applications, e.g., nginx, might constantly
remove and add listeners to their epfds. Removing listeners in such
situations causes a lot of churn in vpp as segments and segment managers
need to be recreated.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia412b3f8d50fbb4881a99ff024f798353b521af7
2023-03-06 23:01:19 +00:00
Florin Coras
c86662a213 vcl: always drain libc epoll with eventfds in ldp
Otherwise if vcl epoll lt events are ignored by the app, libc and vcl mq
events are never drained.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1e22f6da46d56236c52714181f6c20dcb80a33a5
2023-03-06 22:59:40 +00:00
Florin Coras
87767d82d7 hs-test: nginx mirroring test improvements
- avoid setting LD_PRELOAD for container
- save nginx error log to shared volume
- reduce test run time to 10s
- add vcl and ldp debug env variables to docker file. Default to
disabled.

Type: test

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I401ac74e7c0ebe87befedb44150b04f773f244ea
2023-03-06 11:16:19 -08:00
luoyaozu
2d3da8054b vlib: fix vlib_log for elog
test output before fix:
DBGvpp# event-logger clear
DBGvpp# test log warn cli log test-log for-elog
cli/log            [warn  ]: test-log for-elog
DBGvpp# test log info cli log test-log for-elog
cli/log            [info  ]: test-log for-elog
DBGvpp# show event-logger
2 of 131072 events in buffer, logger running
      53.022586433: log-notice: test-log for-elog
      60.318329361: log-debug: test-log for-elog
DBGvpp#

test output after fix:
DBGvpp# event-logger clear
DBGvpp# test log warn cli log test-log for-elog
cli/log            [warn  ]: test-log for-elog
DBGvpp# test log info cli log test-log for-elog
cli/log            [info  ]: test-log for-elog
DBGvpp# show event-logger
2 of 131072 events in buffer, logger running
      18.362721151: log-warn: test-log for-elog
      25.124570555: log-info: test-log for-elog
DBGvpp#

Type: fix

Signed-off-by: luoyaozu <luoyaozu@foxmail.com>
Change-Id: Ie1122787f9efb611cdafc671b4ccf68b43984924
2023-03-06 18:00:04 +00:00
Benoît Ganne
79cb1d53c1 stats: fix tests with multiple workers
Type: fix

Change-Id: Ic4b8478d390c7373bfb43a39ae6a70e978ae9321
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06 17:55:48 +00:00
Benoît Ganne
064ff15150 lb: keep AddressSanitizer happy
vec_alloc() does not mark vector as accessible contrary to
vec_validate().
Also removes redundant memset(0) as vector allocation always zeroed
new memory.

Type: fix

Change-Id: I8309831b964a618454ed0bebbcdec7ec21149414
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06 17:55:08 +00:00
Benoît Ganne
22460d6a87 vppinfra: fix memory traces
- allocates the memory trace spinlock independently from the main heap
 - disable tracing on a per thread basis
 - make sure we hold the memory trace spinlock when changing tracing

Type: fix

Change-Id: I7d84f22132abdc895343d447cd3a2c574786f58d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06 17:54:26 +00:00
Mohsin Kazmi
eb415414b4 af_packet: fix the first packet offset
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I927ba4e6f10ae4527f339a890c3a0de33a84b7eb
2023-03-06 17:51:56 +00:00
Benoît Ganne
258aac905c af_xdp: fix netns configuration
- clib_open_netns() expects a NULL-terminated C-string
 - if no netns was given, we should not try to format it otherwise we'll
   get "(nil)" as netns name.

Type: fix

Change-Id: I7b6022f6e8999640d0d2a83b854455b15fa4c134
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06 17:51:10 +00:00
Benoît Ganne
634873c3ee build: add sanitizer option to configure script
Type: improvement

Change-Id: Ia679d6e5fb7eff6dbd7363465e5667119751e908
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06 17:49:06 +00:00
Vladislav Grishenko
ff2fba7264 vlib: avoid non-mp-safe cli process node updates
Node renames, clone and node_by_name hash updates should be done
in vlib_node_register() / vlib_node_rename() under barrier, or
else runtime per-node stats can be either inaccurate or lead to UB.

Drop cli process nodes renaming rather than adding barrier
syncronization on reuse, nodes will get "unix-cli-process-ID"
stable names, description and terminal names are preserved and can
be obtained with "show cli-sessions" and "show terminal" commands.
Also fix insufficient name width for "show cli-sessions" with table
formatting, output sample:

    DBGvpp# sh cli-sessions
    PNI   FD    Name                     Flags
    708   14    unix-cli-local:10558     iSLpa
    710   15    unix-cli-127.0.0.1:33252 ISlpA

    DBGvpp# sh terminal
    Terminal name:   unix-cli-127.0.0.1:33252
    Terminal node:   unix-cli-process-1
    Terminal mode:   char-by-char
    Terminal width:  158
    Terminal height: 43
    ANSI capable:    yes
    Interactive:     yes
    History enabled: yes
    History limit:   50
    Pager enabled:   yes
    Pager limit:     100000
    CRLF mode:       CR+LF

Type: improvement
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I40af4c0a5e5be92d5e3ebcd440fa55390aeb0e8b
2023-03-06 17:47:26 +00:00
varasteh
8181727ee5 interface: more cleaning after set flags is failed in vnet_create_sw_interface
There's a chance that vnet_sw_interface_set_flags_helper()
has successfully called some sw interface add callback functions
before returning the error. So the sw interface del callbacks
should also be called

Type: fix

Signed-off-by: varasteh <mahdy.varasteh@gmail.com>
Change-Id: I2cd7dc6d5b3a5ebfd2c4d1a6be5390083dee6401
Signed-off-by: varasteh <mahdy.varasteh@gmail.com>
2023-03-06 17:39:33 +00:00
Mohsin Kazmi
88d9414e82 interface: add the missing tag keyword in the cli helper
Type: style

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I6399ad2b0b30f94c6c51db1afc39f5e875dfaa67
2023-03-06 17:21:40 +00:00
Benoît Ganne
063549f960 crypto: remove VNET_CRYPTO_OP_FLAG_INIT_IV flag
IV requirements vary wildly with the selected mode of operation. For
example, for AES-CBC the IV must be unpredictable whereas for AES
counter mode (CTR or GCM), it can be predictable but reusing an IV with
the same key material is catastrophic.
Because of that, it is hard to generate IV in a generic way, and it is
better left to the crypto user (eg. IPsec).

Type: improvement

Change-Id: I32689c591d8c6572b8d37c4d24f175ea6132d3ec
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06 17:15:24 +00:00
Liangxing Wang
f471e3339f memif: fix input vector rate of memif-input node
Explicitly set the ptd->n_packets to 0 if no packet is received in
memif_device_input_inline(). Otherwise ptd->n_packets just keeps
last time rx packets number, then this stale number is added to
memif_input_node->vectors_since_last_overflow in every dispatch_node()
call for memif_input_node.

Type: fix

Signed-off-by: Liangxing Wang <liangxing.wang@arm.com>
Change-Id: Ide98a481c925262f9a609535a314f784cab424d8
2023-03-06 17:13:48 +00:00
Xiaoming Jiang
4d830d2142 vlib: fix macro define command not work in startup config exec script
Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: Idb34490199a78d5b0c1fe2382b6483a6e3a6fd1f
2023-03-06 17:09:01 +00:00
Xiaoming Jiang
4646cd4e20 vlib: fix ASAN fake stack size set error when switching to process
Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: I2add6cb8dba837e47596983ec8303883aba3a138
2023-03-06 17:02:57 +00:00
Xiaoming Jiang
c36f9b567d dpdk: plugin init should be protect by thread barrier
Witout thread barrier, when dpdk_process_node initiating
dpdk lib, workers thread may also be initiating. Main
and workers threads may both setting error_main info,
that will cause memory ASAN issue.

Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: I87b73b310730719035d4985a2cff2e3308120ec2
2023-03-06 16:48:30 +00:00
Mohsin Kazmi
60a107c8fd vppinfra: adding support for socket mounting paths
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: If894b2b741d0d417a6fc458dda83ca1d8192385d
2023-03-06 16:47:29 +00:00
Xinyao Cai
99d3a40543 flow dpdk: introduce IP in IP support for flow
This patch introduces IP in IP packet support for flow cli and dpdk plugin.
Specifically, the following IP in IP packet types are supported:
	MAC-IPv4-IPv4-TCP/UDP/None,
	MAC-IPv4-IPv6-TCP/UDP/None,
	MAC-IPv6-IPv4-TCP/UDP/None,
	MAC-IPv6-IPv6-TCP/UDP/None,

IP in IP flow rules can be created by using the following new keywords in vppctl:
	in-src-ip, in-dst-ip        : to provide information for inner IPv4 header
	in-ip6-src-ip, in-ip6-dst-ip: to provide information for inner IPv6 header
	in-proto                    : to specify inner transport layer protocol type (TCP or UDP)
	in-src-port, in-dst-port    : to provide information for inner TCP/UDP header

An example to create flow rule for MAC-IPv6-IPv6-TCP:
	test flow add index 0 ip6-src-ip any ip6-dst-ip any in-ip6-src-ip any in-ip6-dst-ip any in-proto tcp in-src-port 1234 in-dst-port any rss function default

Another example to create flow rule for MAC-IPv6-IPv6:
	test flow add index 0 ip6-src-ip any in-ip6-src-ip any rss function default

Type: feature

Signed-off-by: Xinyao Cai <xinyao.cai@intel.com>
Change-Id: I6a1ca36d47eb65b9cb5a4b8d874b2a7f017c35cd
2023-03-06 16:46:17 +00:00
Vladislav Grishenko
a20afdc845 vppinfra: fix clib_bitmap_will_expand() result inversion
Pool's pool_put_will_expand() calls clib_bitmap_will_expand(),
so every put except ones that leads to free_bitmap reallocation
will get false positive results and vice versa.

Unfortunatelly there's no related test and existing bitmap
tests are failing silently with false positive result as well.

Fortunatelly neither clib_bitmap_will_expand() nor
pool_put_will_expand() are being used by current vpp codebase.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Id5bb900cf6a1b1002d37670f5c415c74165b5421
2023-03-06 14:31:47 +00:00
Benoît Ganne
1ee334c6f8 crypto: make it easier to diagnose keys use-after-free
Type: improvement

Change-Id: Ib98eba146e24e659acf3b9a228b81fcd641f4c67
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06 14:26:26 +00:00
Jieqiang Wang
d69233f44e build: replace phony target with .ok file
When VPP builds its external packages from source, it will download the
package, patch it, configure it, build and install it. For DPDK, it will
depend on rdma-core if mlx4/mlx5 PMD is enabled. So phony target
dpdk-config needs to have the prerequisites of rdma-core-install and
ipsec-mb-install(x86 only), which are both phony targets. This leads to
redundant behavior of recipes executing twice in dpdk-config.
Replace the phony target with hidden file *.install.ok to avoid that.

Type: improvement
Signed-off-by: Lijian Zhang <lijian.zhang@arm.com>
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: Ibf3b766ab7a4ccfcbffe08f6cdb90da72ca1ce29
2023-03-06 14:24:57 +00:00
Christian Svensson
79687d92fe misc: define SElinux mapped file permissions
SElinux added support for defining what files can be mmap()'d a while back.
This change defines those files that VPP maps.

This is needed for EL9 support

Type: fix

Signed-off-by: Christian Svensson <blue@cmd.nu>
Change-Id: Iedd26914e29347169c4cc138628df7823ddd5691
2023-03-06 14:22:36 +00:00
Christian Svensson
184a70a58c build: add Rocky Linux 9 support
Currently only RHEL/CentOS 8 and Fedora are supported.
EL9 is a middle ground and thus require some different dependencies.

Type: feature

Signed-off-by: Christian Svensson <blue@cmd.nu>
Change-Id: I7be79e61994800bb796d4e9141f0ff6ad8bdead2
2023-03-06 14:22:36 +00:00
jiangxiaoming
15eec552b5 snort: fix descriptor offset may be truncated if buffers num too large
Type: fix
Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com>
Change-Id: I9694f7d8aad8868b11e08fabe179fd51c14dfcdb
2023-03-06 14:20:55 +00:00
lijinhui
e13baaa788 interface: fix 4 or more interfaces equality comparison bug with xor operation using (a^a)^(b^b)
Type: fix
Signed-off-by: lijinhui <lijh_7@chinatelecom.cn>
Change-Id: I80783eed2b819a9e6fd4cee973821c9d97c285a6
2023-03-06 14:20:27 +00:00
Benoît Ganne
af62f93478 vppinfra: display only the 1st 50 memory traces by default
When using memory traces it can take a long time to display all traces
bigger than 1k if there are lots of them, especially as we need to
resolve symbols.
It is better to display only the 1st 50 by default, unless verbose is
used.
Also fix the help string.

Type: improvement

Change-Id: I1e5e30209f10d2b05c561dbf856cb126e0cf513d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06 14:11:07 +00:00
Xiaoming Jiang
73507dd1aa stats: fix node name compare error when updating stats segment
Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: Ib39aa345415720dd05a1b3e12e3e03eac43c5606
2023-03-06 14:07:18 +00:00
Nathan Skrzypczak
8b213ee652 memif: autogenerate socket_ids
This patch adds an API memif_socket_filename_add_del_v2
that allows autogenerating memif socket_id when passing
~0 in the socket_id field.

It opportunistically walks the hash to find a free ID
to use, and returns it in the reply.

socket_filename also becomes a variable length string,
to accomodate for longer names (in case a netns gets
passed)

Type: feature

Change-Id: I33fc3e1cf553af27579d6bad8691b22b530531cc
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2023-03-06 13:54:06 +00:00
Filip Tehlar
ec5c40b83a hs-test: add support for running vpp in gdb
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I6e03b88ca013cafd73f424ea63f706f105bebe6b
2023-03-02 17:34:24 +00:00
Gabriel Oginski
2da99e5072 vpp-swan: fix memory leaks
This patch fix the memory leaks discovered in the current
implementation, inlcuding expired data, spd dump, and host names.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I3794f5db3c58d1e78df25f242c91e7a67363de53
2023-03-02 13:23:24 +00:00
Gabriel Oginski
9ad423fceb wireguard: add barrier to sync data
The current implmentation of the hash table is not thread-safe.
This design leads to a segfault when VPP is handling a lot of tunnels
for Wireguard, where one thread modifies the hash table and other
threads start the lookup at the same time.

This fix adds a barrier sync to the hash table access when Wireguard
adds or deletes an element.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Id460dfcd46ace17c7bdcd23bd9687d26cecf0a39
2023-03-02 13:21:52 +00:00
Ole Troan
04853c67e4 stats: expose symlink to stats client
For e.g. prometheus export it makes more sense to use the same metric name,
and expose the various symlinks as labels.

The VPP symlink metric:
/interfaces/local0/rx_unicast

that points to
/if/rx_unicast

Becomes in Prometheus:
interfaces_rx_unicast_bytes{index="0",label="local0"} 0

Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: Ide0ab4fda4b3eb7ba7ddfc44680121c53f5267f6
2023-03-02 08:00:50 +00:00
Nobuhiro MIKI
d346f393fd docs: fixed to use unified "pcap trace" command
Type: docs
Fixes: 33909777c637 ("misc: unify pcap rx / tx / drop trace")
Signed-off-by: Nobuhiro MIKI <nmiki@yahoo-corp.jp>
Change-Id: I049616cfad300658e62e5026c0655ee6f07a2421
2023-03-01 19:36:39 +00:00
Florin Coras
01ee7a7782 vcl: accept bound notifications in epoll wait
Async binds may be possible due to vls generated async binds as a result
of application adding or removing listeners from epoll.

App does not need to be notified of the event.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4d01be7ddb39ba894db85feef55e9935556c24f5
2023-03-01 19:28:18 +00:00
Florin Coras
7a1e95a317 vcl: accept vcl spurious wakeup in epoll wait eventfd
Accept one spurious wakeup from vcl in epoll_pwait_eventfd to avoid
returning zero events to app without timeout.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I447c7f8176413c562be28605376a92d15e22a1f9
2023-03-01 19:28:06 +00:00
Florin Coras
06defbc5de vcl: close libc epfd on vls epfd close
Nginx recreates epfds. Make sure ldp tracks the event and recreates the
libc epfd or eventfd flavor of epoll pwait will not work.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2994bead9494f0fbb85dd32767cecc1cf69ff6eb
2023-03-01 19:27:47 +00:00
Florin Coras
c2a1417c5a vcl: only add sessions to lt list if needed
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I777979dbb89f9af774533cb280e77af58b81fb29
2023-03-01 16:59:30 +00:00
Maros Ondrejicka
56bfc63b28 hs-test: update hs-test documentation
Type: docs
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I123898923afa382ff0d4410652f4a17a8740d711
2023-03-01 16:51:02 +00:00
Maros Ondrejicka
b5c731738f hs-test: fix error check
Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I445f5357817fceeb9b5ead01c3530edaae45189a
2023-03-01 16:49:39 +00:00
Mohammed Hawari
2cc8c0a8db udp: fix optimistic assert for UDP RX
Change-Id: I431c4a6f409b129e4290dba2e1acadea460ac797
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: improvement
2023-03-01 16:46:28 +00:00
Fan Zhang
ad215f211d vpp-swan: improve Makefile
Type: improvement

Since VPP-SWAN does not really need StrongSwan to be compiled,
this patch refines the Makefile to reflect the change.

In addition README is updated.

Signed-off-by: Fan Zhang <fanzhang.oss@gmail.com>
Change-Id: I185957167ac71a44f4d12e78e1dac31c194f80f4
2023-03-01 15:54:40 +00:00
Tianyu Li
2073fe49b6 vcl: fix undeclared UDP_SEGMENT for centos 8
Old distros Centos 8 / Ubuntu 18.04 header files doesn't have UDP_SEGMENT
declared, define UDP_SEGMENT to right value if not defined.

Type: fix
Fixes: eff5f7aea8c7 ("vcl: ldp support for ip_pktinfo")

Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I99314b895e7d09962a36e7f5582c09d0d77563dc
2023-03-01 11:08:44 +08:00
Florin Coras
e2415f79f7 hs-test: fix wait for app after ldp change
After gerrit 38370 (729b9c94), apps are registered via ldp using program
name. Update tests to support that.

Also add make file help for UNCONFIGURE.

Type: test

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4ad50abfd175664b47b358df1a72e0758f51190d
2023-03-01 00:12:01 +00:00
Florin Coras
3d6156fed8 session: consolidate port alloc logic
Move port allocation logic from transports into generic transport layer.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I55a21f185d00f5e118c36bcc4a6ffba2cbda885e
2023-02-28 22:50:36 +00:00
Florin Coras
045a6ae99d tcp: add dispatch errors to counters
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I27112947071a757065162f0e50f69983d258525d
2023-02-28 22:18:38 +00:00
Maros Ondrejicka
85396a5488 hs-test: fill configuration files at runtime
Treat certain configuration files, which contain runtime-dependent
information, as templates. The information is filled at runtime and the
files are copied into containers.
This allows to avoid hard-coding IP addresses into configuration files.

Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I1dae8f15f4f76c0bf1779d7c68b7f3859bf5a861
2023-02-28 22:13:21 +00:00
Florin Coras
729b9c94f8 vcl: use program invocation name in ldp app name
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I2c97faa2cdca32d083aabc3344c8fe67c74ff2fd
2023-02-28 20:01:20 +00:00
Maros Ondrejicka
7e1d6efb58 hs-test: allow nginx suite to unconfigure topology
Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I84209e6d2c914d1c7b9dec7efc3898b75552db1b
2023-02-28 19:52:44 +01:00
Maros Ondrejicka
c2f76f4590 hs-test: test vpp+nginx mirroring with tap ifaces
Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I05bbed8fd9d40929f040574044aed5292a475e91
2023-02-28 18:27:17 +00:00
Florin Coras
b0116a13dc vcl: handle lt events in epoll ctl
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4e176e9ada32d5f61d10aeca1c68f72114dec9b8
2023-02-28 17:50:34 +00:00
Maros Ondrejicka
af004ddad1 hs-test: add option to unconfigure topology
Adding `UNCONFIGURE=true` argument when running `make test` will skip
test run and unconfigure existing topology for that test.

Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I197747a56ca68807f0b2c3f25b6f61c3dcc41ace
2023-02-28 16:36:41 +00:00
Florin Coras
32881935bb vcl: improve vls handling of shared listeners
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1970408de52e53d24cea06b3ae0cc68a38cbc97a
2023-02-27 20:58:09 +00:00
Maros Ondrejicka
40cba405c5 hs-test: refactor netconfig
This joins separate representations of veth and tap interfaces
into a single struct. It removes the need for type interface
and embedding which simplifies the code.

Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I1b2c368bfe90a5bdfaaa9a5129c27d7d96f8fe3b
2023-02-27 17:26:41 +00:00
Gabriel Oginski
9cb3e15c9f vpp-swan: fix segmentation fault in arp function
This patch adds a missing file descriptor free handler to prevent
invalid dereferencing in the future

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Idc809a70b1fedec9a06446344d5481d467c78c19
2023-02-27 13:40:05 +00:00
Gabriel Oginski
a10437fccc wireguard: fix potential leaks of async frame
The current implementation can cause memory leaks of async frames
and exhaust the async frames pool. Wireguard can early get async frame,
even when later it turns out it is not needed. Then such frame won't
be freed.

This fix changes the moment of acquiring async frame from the pool, so
it doesn't leak.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: If7696de6a6f5db84e0dffef60caa31d4a5e6280e
2023-02-27 13:33:21 +00:00
Filip Tehlar
5035bf0413 tcp: fix error counters
Type: fix

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I9f4944f77ecf94f16f809392f28466e33f7f779d
2023-02-25 01:28:18 +00:00
Maros Ondrejicka
a2d5262afb hs-test: store logs
Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I50ad5d8c2e5066d8d24f7959aeb534a2f0a6fae0
2023-02-24 18:56:56 +01:00
Maros Ondrejicka
ad406077af hs-test: modify nginx tests
This will make name of the test unique so that executing specifically
this test won't execute also other tests starting with same name.

Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I8013aa453c2a1c3c156e6476a93fd58bbb850b93
2023-02-24 17:17:09 +00:00
Filip Tehlar
671cf51d6d hs-test: improve test infra
- add support for building/running debug/release images
- have one point of control (Makefile)
- list all test cases

Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I97949abc2fff85d7a2b3784122be159aeec72b52
2023-02-24 14:38:15 +01:00
Dave Wallace
182d2b466d srtp: fix build on ubuntu-22.04
- The version of libsrtp2 (2.4.2) on ubuntu-22.04 changed
  the 'ekt' field in srtp_policy_t to 'deprecated_ekt'.

Type: fix

Change-Id: Icb9d8f3b56c8305bcdac5066a5f8e3e5d17d37cf
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-02-23 20:37:17 +00:00
Dave Wallace
67dbc4aa80 hs-test: fix install/build on new ubuntu instance
Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I9c59d98d16e387925057626ba9080210f4334c53
2023-02-22 16:12:37 -05:00
Maros Ondrejicka
300f70d3a3 hs-test: clean-up ip address generation
Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I74c505920d1363d0ff2b3213fd831c181b70a173
2023-02-21 18:40:49 +00:00
Florin Coras
7c06b5790d session: track app session closes
Make sure applications, especially builtin ones, cannot close a session
multiple times.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I960a1ae89a48eb359e7e1873a59d47c298c37ef1
2023-02-20 18:17:52 -08:00
Florin Coras
eff5f7aea8 vcl: ldp support for ip_pktinfo
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3c15f38a4a3f5e92506059277948e7fca9cd8b55
2023-02-20 18:50:52 +00:00
Liangxing Wang
7c7231fc30 vcl: fix incorrect ldp worker in ldp_epoll_pwait()
For some apps(e.g. wrk2) upon vpp hoststack, ldp_epoll_pwait()
is called. In this function, epoll fd was created on one thread,
but it is now used on another thread. The vcl worker index is still
invalid, so the fetched ldp worker is also invalid and can corrupt
some already allocated memory.

Just as the ldp_epoll_pwait_eventfd(), make sure the vcl worker is valid
before getting the ldp worker in ldp_epoll_pwait().

Type: fix

Signed-off-by: Liangxing Wang <liangxing.wang@arm.com>
Change-Id: I2ec23a4b5d5b0879a06642ffd80f95e948af4274
2023-02-16 17:49:43 +00:00
Maros Ondrejicka
2ddb2fdaaf hs-test: check for missing output in nginx tests
Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I08cd492fff4b9d50a1761a29c2b231cc8544313b
2023-02-16 16:26:42 +00:00
Alexander Skorichenko
edd28a4102 wireguard: move buffer when insufficient pre_data left
Currently wg-output-tun() doesn't check if a buffer has enough space for
prepending an ethernet header (wg header over ipv6 vxlan header case
leaves only 8 bytes free).

In such a case move buffer's content.

Type: fix

Change-Id: Iad18860e6b86a3d81f3d96d782de7c59556152d0
Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
2023-02-16 15:01:07 +00:00
Florin Coras
5b704f4fa1 session: ignore zero length dgrams
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I70596ffcf90fa4cd57092584cb7a454f44208943
2023-02-16 01:51:55 +00:00
Maros Ondrejicka
7d7ab1008a hs-test: clean-up obsolete code
Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I52cd825f903e41c35f6c4a9db71f00dbedbb8680
2023-02-14 12:56:49 +01:00
Tianyu Li
590a82c237 build: add missing dependences for centos 8
VPP build failed on Centos stream 8 when build xdp-tool
and dpdk mlx driver, Add the missing tools, libraries and headers.

Type: fix
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: Ie705dc8f558ceb872029f9ab4f1351b514c87405
2023-02-14 01:32:02 +00:00
Dmitry Valter
71d02aa631 tests: support tmp-dir on different filesystem
Support running tests with `--tmp-dir` on a filesystem different from /tmp.
os.rename withs only within a single FS whereas shutil.move works accross
different filesystems.

Type: improvement
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: I5371f5d75386bd2b82a75b3e6c1f2c850bc62356
2023-02-14 01:26:01 +00:00
Gabriel Oginski
8de66c090e vpp-swan: removed adding the same rule in SPD
The current implementation of vpp-swan plugin adds the same policy rule
in SPD twice, and it is not necessary to have two the same rules in
inbound-protect database.

This patch fixes an issue that prevents the addition of a second
identical policy rule in SPD.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Ieef74288e5301455658e4e101433147d6d2482e9
2023-02-14 01:20:34 +00:00
Nathan Brown
844a0e8b07 rdma: always use 64 byte CQEs for MLX5
When DPDK MLX PMDs are built, and the DPDK plugin is loaded, DPDK may
set the MLX5_CQE_SIZE environment variable to 128. This causes the RDMA
plugin to be unable to create completion queues. Since the RDMA plugin
expects the CQEs to be 64 bytes, set the cqe_size explicitly when
creating the CQ. This avoids any issues with different values for the
MLX5_CQE_SIZE environment variable.

Type: improvement
Signed-off-by: Nathan Brown <nathan.brown@arm.com>
Change-Id: Idfd078d3045a4dcb674325ef36f85a89df6fbebc
2023-02-13 15:36:28 +00:00
Dave Wallace
1d998b7c27 misc: VPP 22.10.1 Release Notes
Type: docs
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I70374ea376c895d92d5789debf4b437113e3d884
(cherry picked from commit 57302fe52f141c19b5448997774271d2eedf5cb1)
2023-02-11 00:24:30 +00:00
Dave Wallace
f5256d4dd0 misc: VPP 22.06.1 Release Notes
Type: docs
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I8770a35c801126ffd2de8f58d79e6616642709a9
(cherry picked from commit 1513b381d8879d9d437bbbc9a270b4ff5f4b19ba)
2023-02-10 14:26:03 -05:00
Takeru Hayasaka
c4c205b091 sr: support define src ipv6 per encap policy
Can to define src ip of outer IPv6 Hdr for each encap policy.
Along with that, I decided to develop it as API version V2.
This is useful in the SRv6 MUP case.
For example, it will be possible to handle multiple UPF destinations.

Type: feature
Change-Id: I44ff7b54e8868619069621ab53e194e2c7a17435
Signed-off-by: Takeru Hayasaka <hayatake396@gmail.com>
2023-02-10 16:17:27 +00:00
Maros Ondrejicka
7550dd268f hs-test: refactor test cases from no-topo suite
This converts remaining tests to configation of VPP from test context.

Type: test
Change-Id: I386714f6b290e03d1757c2a033a25fae0340f5d6
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
2023-02-10 05:23:32 +00:00
Maros Ondrejicka
2908f8cf07 hs-test: refactor test cases from ns suite
This converts more tests to configure VPP from test context.

Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: Idf26b0c16f87e87c97b198412af39b99d947ced6
2023-02-10 05:23:19 +00:00
Naveen Joy
0a192ea93d tests: use existing pip compiled req file for building the run.py venv
pip compiled requirements file named requirements-3.txt exists in the
test directory. No need to auto-generate it again

Type: improvement

Change-Id: Ib2b51c983af8d0e4b000e4544012b6cd94405519
Signed-off-by: Naveen Joy <najoy@cisco.com>
2023-02-10 02:15:26 +00:00
Naveen Joy
25b6e44424 tests: use iperf3 for running interface tests on the host
Type: improvement

Change-Id: I7123591932d51ce0c5b372893454945bbd3913b2
Signed-off-by: Naveen Joy <najoy@cisco.com>
2023-02-10 02:14:44 +00:00
Maros Ondrejicka
ffa3f60290 hs-test: configure VPP from test context
Instead of configuring VPP instances running inside of a container,
now the configuration is going to be done from within the test context
by using binary API and shared volume that exposes api socket.

This converts just some of the test cases, rest is to follow.

Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I87e4ab15de488f0eebb01ff514596265fc2a787f
2023-02-09 17:02:43 +00:00
Florin Coras
7a6532bb9f session: accept lcl ip updates on cl sessions
Allow apps/vcl to provide updated local ips for dgrams. In particular,
allow sessions bound to 0/0 to send data with valid local ips.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I50a086b1c252731a32a15b6a181ad3dba0c687e0
2023-02-08 21:32:34 -08:00
Mohammed Hawari
9db6db065a build: allow skipping external-deps
Change-Id: I0e5090ec6978af0dc4baecc7654918cf40663f42
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: feature
2023-02-08 10:13:51 +00:00
Ting Xu
11d9d02459 avf dpdk: fix incorrect handling of IPv6 src address in flow
In current flow creating process in native avf and dpdk-plugins, when
parsing the input arguments, it does not copy IPv6 src address correctly,
so that IPv6 src address will not be configured in any flow rule, and
any packet with the same address will not be matched.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Ic957c57e3e1488b74e6281f4ed1df7fd491af35c
2023-02-08 10:10:28 +00:00
Ting Xu
25ab42e33b avf: fix incorrect flag for flow director
When parsing flow action type in avf, there is an incorrect flag for
flow director, which makes flow director rule created unexpectedly.

Type: fix
Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Id9fed5db8ccacd5cc6c2f4833183364d763188c1
2023-02-08 10:09:37 +00:00
Ting Xu
26d841870f avf: fix checksum offload configuration
Fix some configurations of avf checksum offload to get the correct
udp and tcp checksum. Change Tx checksum offload capability since
avf supports ipv4, tcp and udp offload all. Remove the operation to
swap bit of checksum.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I55a916cc9ee6bef5b2074b5b6bb5f517fc2c178d
2023-02-08 10:09:04 +00:00
Ting Xu
dc95634a23 avf: fix bit calculation function fls_u32
In avf the function fls_u32 is used to calculate the power of 2.
Fix the expression of this function.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I27160de8588a5efb3f24306597a5a240deb3ab74
2023-02-08 10:08:16 +00:00
Alexander Chernavin
3b28fd7306 ip6-nd: support dump/details for IPv6 RA
Type: improvement

With this change, add support for dumping IPv6 Router Advertisements
details on a per-interface basis (or all). Also, cover that with a test.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I89fa93439d33cc36252377f27187b18b3d30a1d4
2023-02-08 03:20:32 +00:00
Benoît Ganne
02dfd29634 ipsec: fix AES CBC IV generation (CVE-2022-46397)
For AES-CBC, the IV must be unpredictable (see NIST SP800-38a Appendix
C). Chaining IVs like is done by ipsecmb and native backends for the
VNET_CRYPTO_OP_FLAG_INIT_IV is fully predictable.
Encrypt a counter as part of the message, making the (predictable)
counter-generated IV unpredictable.

Fixes: VPP-2037
Type: fix

Change-Id: If4f192d62bf97dda553e7573331c75efa11822ae
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-02-08 01:06:39 +00:00
Florin Coras
aaad4f977c vcl: drop lock on segment attach failure
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3bc2c7986f492b7b7dfbc84e4893202354223790
2023-02-07 18:19:51 +00:00
Florin Coras
f1a232fd86 vcl: add ldp implementation for recvmmsg
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7322abc3d3b0aa81399667bf02b03786fc62c958
2023-02-07 18:06:44 +00:00
Florin Coras
3684794336 vcl: better handlig of ldp apis that rely on gnu source
Control use of apis that rely on _GNU_SOURCE being defined with compile
time macro.

Also fixes sendmmsg and recvmmsg which were not probably wrapped.

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I207de23210d4b9dc960bb4289159502760c5614d
2023-02-07 18:06:44 +00:00
Ting Xu
656a550f1f packetforge: fix lack of edge for ipv6 after gtppsc
Add one new edge for ipv6 after gtppsc so that packetforge can parse
this protocol combination.

Type: fix
Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I1bae1ec617c4867de2e0b3de27eda77b89e5580c
2023-02-07 15:15:07 +00:00
Filip Tehlar
8df3de4882 hs-test: add nginx perf tests
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ic609cf70c1d381afa78f393700359434c8bd0452
2023-02-06 22:29:28 +00:00
Damjan Marion
085757bb49 vppinfra: refactor clib_socket_init, add linux netns support
Type: improvement
Change-Id: Ida2d044bccf0bc8914b4fe7d383f827400fa6a52
Signed-off-by: Damjan Marion <dmarion@me.com>
2023-02-06 10:17:40 +00:00
Arthur de Kerhor
0df06b6e95 ipsec: fix SA names consistency in tests
In some IPsec tests, the SA called scapy_sa designs the SA that
encrypts Scapy packets and decrypts them in VPP, and the one
called vpp_sa the SA that encrypts VPP packets and decrypts them
with Scapy. However, this pattern is not consistent across all
tests. Some tests use the opposite logic. Others even mix both
correlating scapy_tra_spi with vpp_tra_sa_id and vice-versa.

Because of that, sometimes, the SA called vpp_sa_in is used as an
outbound SA and vpp_sa_out as an inbound one.

This patch forces all the tests to follow the same following logic:
- scapy_sa is the SA used to encrypt Scapy packets and decrypt
them in VPP. It matches the VPP inbound SA.
- vpp_sa is the SA used to encrypt VPP packets and decrypt them in
Scapy. It matches the VPP outbound SA.

Type: fix
Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
Change-Id: Iadccdccbf98e834add13b5f4ad87af57e2ea3c2a
2023-02-06 03:49:14 +00:00
Benoît Ganne
ab412cdc07 ipsec: fix async crypto linked keys memory leak
Type: fix

Change-Id: I7bd2696541c8b3824837e187de096fdde19b2c44
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-02-06 03:35:48 +00:00
Florin Coras
af2e88d964 session: fix out of bounds event memcpy
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If5300653edd2dad470985f4591959d00cad2a43b
2023-02-03 20:11:51 +00:00
Dmitry Valter
6b97c43005 nat: fix accidental o2i deletion/reuse
Nat session is allocated before the port allocation. During port allocation
candidate address+port are set to o2i 6-tuple and tested against the flow hash.
If insertion fails, the port is busy and rejected. When all N attempts are
unsuccessful, "out-of-ports" error is recorded and the session is to be
deleted.

During session deletion o2i and i2o tuples are deleted from the flow hash.
In case of "out-of-ports" i2o tuple is not valid, however o2i is and it refers
to **some other** session that's known to be allocated.

By backing match tuple up session should be invalidated well enough not to
collide with any valid one.

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: Id30be6f26ecce7a5a63135fb971bb65ce318af82
2023-02-03 14:31:54 +00:00
Atzm Watanabe
fc2d95d115 vpp-swan: allow SAs to be used to the route-based IPsec
This patch adds a "charon.plugins.kernel-vpp.use_tunnel_mode_sa"
key into strongswan.conf.  If this is turned off, SAs will be
installed without tunnel information and can be used to
"ipsec tunnel protect".  For the route-based IPsec, it will be
used with turning "policies" off in swanctl.conf.

Type: feature

Signed-off-by: Atzm Watanabe <atzmism@gmail.com>
Change-Id: I58fb94bfe56627fa7002d9b95c48930a32993d2d
2023-02-03 14:24:51 +00:00
Ondrej Fabry
a4f994f31e vppapigen: fix incorrect comments in json
Type: fix

Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Change-Id: I241cefbbce98cf6fef83f36bd87ae2c1f4b067f0
2023-02-03 13:29:35 +01:00
Ofer Heifetz
905ec87977 tls: openssl: fix SSL_read partial read scenario
When application performs SSL_read from the app rx-fifo, it can
pre-allocate multiple segments, but there is an issue if the OpenSSL
manages to partially fill in the first segment, in this case, since
data is assumed to be copied over by OpenSSL to the pre-allocated
segments(s), vpp uses svm_fifo_enqueue_nocopy API which performs
zero copy by passing the pre-allocated segment to SSL_read.

If the decrypted data size is smaller than the pre-allocated fifo
segment buffer size, application will fetch buffers including zero
in the area not filled in by SSL_read.

Type: fix

Signed-off-by: Ofer Heifetz <oferh@marvell.com>
Change-Id: I941a89b17d567d86e5bd2c35785f1df043c33f38
2023-02-02 18:36:29 +00:00
Stanislav Zaikin
9b02f72fed linux-cp: fix auto-sub-int
lcp_itf_pair_pool could grew during sub-interface creation.

Type: fix
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
Change-Id: Ideafe392f9bb2b418ce9d6faa4f08dfe26f4a273
2023-02-02 16:43:33 +00:00
Benoît Ganne
051d3a3f60 ip: fix ip ACL traces
If we match a next table, we must save its index in the trace instead of
the index of the 1st table.

Type: fix

Change-Id: Idd862242e7fc200eb3ab29b17a26131b844af2c0
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-02-02 16:27:28 +00:00
Yulong Pei
a3f1b4c719 af_xdp: update custom XDP program example
Update custom XDP program example to work with libbpf 0.8.0 and
libxdp 1.2.9.

Type: fix

Signed-off-by: Yulong Pei <yulong.pei@intel.com>
Change-Id: Ib8d03f0be7f71fe996dfb7da0cfe35165711ebb0
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
2023-02-02 12:51:45 +00:00
Ting Xu
02bdd3f5cb packetforge: fix order of dst/src address of mac
In the defination of mac node, the order of dst and src address is
reversed. Swap their order in this patch.

Type: fix
Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: I039accc0a881eef12f13c75c5becf8b7df97d525
2023-02-02 09:30:24 +00:00
Yulong Pei
231a3659ab af_xdp: fix default xdp program unload fail
Change to get ad->linux_ifindex in af_xdp_create_if() instead of in
af_xdp_load_program(), previous if did not load custom XDP program,
ad->linux_ifindex will be none, but bpf_xdp_detach() need it, so default
xdp program will be not unloaded when delete af_xdp interface.

Type: fix

Signed-off-by: Yulong Pei <yulong.pei@intel.com>
Change-Id: Id8a640204e8d29152f03349a0b58104b275635aa
2023-02-02 09:03:08 +00:00
Maxime Peim
2d1a62bfdd policer: API policer selection by index
Policer API calls were only by policer name. It is now possible to
select a policer by its index.
Some functionalities are also added to allow updating a policer
configuration and to refill its token buckets.
Some dead codes are being removed, and small fixes made.

Type: improvement

Signed-off-by: Maxime Peim <mpeim@cisco.com>
Change-Id: I4cc8fda0fc7c635a4110da3e757356b150f9b606
2023-02-02 00:22:06 +00:00
Benoît Ganne
3220d9f16b fib: keep AddressSanitizer happy
adj_delegate_remove() makes 'ad' invalid, invalidate it only after its
use.

Type: fix

Change-Id: I6908d3dd2962ebd3fdf37e946cb19dae727bda09
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-02-02 00:09:40 +00:00
Damjan Marion
ab4d9174d8 memif: improve error reporting
Type: improvement
Change-Id: I12b120d988347cced3df82810e86dc2fd5cfca80
Signed-off-by: Damjan Marion <dmarion@me.com>
2023-02-01 14:50:33 +00:00
Artem Glazychev
4d290c3aa7 wireguard: update ESTABLISHED flag
We cannot confidently say that if we have received and processed
the handshake_initiation message, then the connection has been established.
Because we also send a response.
The fact that the connection is established can only be considered if a keepalive packet was received.

Type: fix


Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I61731916071990f28cdebcd1d0e4d302fa1dee15
2023-02-01 11:33:46 +00:00
Dave Wallace
8430c402fc tests: refactor quic tests to use app-socket-api
- clean up nomenclature & use f-strings where applicable

Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I561b7808cfc3fbfa463f7698732d19759d9ddcd4
2023-01-31 17:12:09 +00:00
Benoît Ganne
946f918a27 vppinfra: keep AddressSanitizer happy
The vector size must be increased before setting the element so that
AddressSanitizer can keep track of the accessible memory.

Type: fix

Change-Id: I7b13ce98ff29d98e643f399ec1ecb4681d3cec92
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-01-30 18:18:14 +00:00
Damjan Marion
a254de408e vlib: chdir to runtime_dir
Type: improvement
Change-Id: Id8ab75ef4384a1029ab7ee84048f347708307830
Signed-off-by: Damjan Marion <dmarion@me.com>
2023-01-30 17:03:25 +00:00
Benoît Ganne
a769a508f4 api: keep AddressSanitizer happy
Playing with vector length prevents AddressSanitizer to track accessible
memory. Make sure we update the size of the vector once we received the
data.

Type: fix

Change-Id: If7808254d46d7ab37d516e3de49e3583d07bb9ff
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-01-27 16:38:28 +00:00
Benoît Ganne
8a1d07922b api: keep AddressSanitizer happy
socket_tx_buffer is a vector, update its length accordingly so that
AddressSanitizer can keep track of the allowed memory area.
By doing so we can get rid of socket_tx_nbytes which becomes redundant
with the vector length.

Type: fix

Change-Id: Ied7cb430b5dd40d5ed1390aa15bd5f455a0dba62
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-01-27 16:37:15 +00:00
Benoît Ganne
49bbf9e98a api: keep AddressSanitizer happy
Type: fix

Change-Id: I793206068b8dca15b2f7f525ae1049139333c5b8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-01-27 16:35:35 +00:00
Benoît Ganne
16daaaacd1 dns: keep AddressSanitizer happy
Type: fix

Change-Id: I0ae4071ee317f38daa882fec17087a55afe75d1d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-01-26 19:31:51 +01:00
Nathan Skrzypczak
4fe09e9f29 dpdk: add intf tag to dev{} subinput
This patch allows to pass a tag when specifying
the dpdk `dev {  }` interface configuration.

It allows a control plane generating a vpp.conf
file to retreive the resulting mapping between
dpdk interfaces & sw_if_indices in VPP without
having to change the interface name exposed
to the user.

Type: feature

Change-Id: I55907417de0083b82d4a127172816cec3459acf3
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2023-01-26 15:21:02 +00:00
Artem Glazychev
53badfc683 wireguard: sending the first handshake
After creating a peer, we send a handshake request. But it's not quite right
to call wg_send_keepalive() directly.
According to documentation, handshake initiation is sent after (REKEY_TIMEOUT + jitter) ms.
Since it's the first one - we don't need to take REKEY_TIMEOUT into account,
but we still have jitter.

It also makes no sense to immediately send keepalives,
because the connection is not created yet.

Type: fix

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I61707e4be79be65abc3396b5f1dbd48ecbf7ba60
2023-01-26 10:02:55 +00:00
Filip Tehlar
5616041aed hs-test: handle error in config serialization
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: If5bbf390df08acd1f67d31428b763f246dbcedf2
2023-01-25 13:56:38 +01:00
Maxime Peim
ddc16cfcf9 api: pcap capture api update
Allow enabling and disabling pcap capture via the API.
A little bug is fixed along the way in
vl_api_classify_pcap_set_table_t_handler.

Type: improvement

Signed-off-by: Maxime Peim <mpeim@cisco.com>
Change-Id: I096129c82aecdc82bee5dbfb5e19c76a51d80aab
2023-01-25 11:04:05 +00:00
Chen Yahui
7cbd3cc419 af_xdp: fix xdp socket create fail
In libbpf code, xsk_socket__create will call xsk_link_lookup to get the
xdp_sock bpf prog. But xsk_link_lookup can't get any bpf prog. This will
cause Libbpf not to insert the fd into xsks_map and return ERROR.

The solution to this problem is to insert fd into xsks_map ourselves
instead of libbpf.

Type: fix
Change-Id: Ic5d279c6ddc02d67371262d6106a5b53b70e7913
Signed-off-by: Chen Yahui <goodluckwillcomesoon@gmail.com>
2023-01-24 08:53:26 +00:00
Stanislav Zaikin
139b2da5c5 vppapigen: enable codegen for stream message types
Enable codegen for C type from 'rpc A returns B stream C' notation

Type: improvement

Change-Id: I05cfce71c385d414d7b177a080009628bc8c8fad
Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
2023-01-23 21:01:06 +01:00
Dmitry Valter
3b5ab65bd3 vppinfra: fix random buffer OOB crash with ASAN
Don't truncate with vec_set_len bytes before they can be used. When
built with ASAN, it these bytes are poisoned and trigger SIGSEGV when
read.

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: I912dbbd83822b884f214b3ddcde02e3527848592
2023-01-22 13:09:15 +00:00
Benoît Ganne
6a782ca3b0 vlib: make pending_interrupts valid for AddressSanitizer
vec_alloc_aligned() pre-allocates the vector memory but does not
update its size, making ASan unhappy when trying to access it.

Type: fix

Change-Id: I80e753cf2458cf516d1180a24cfaca4f382339d5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-01-21 03:28:11 +00:00
Maxime Peim
6080ed6341 vppinfra: clib_bitmap fix
In clib_bitmap_set_region and clib_bitmap_set_multiple the index of
the last bit to set was off by 1. If this index was pointing to the
last bit of the bitmap, another uword would have been allocated,
even though it was unnecessary.

Moreover, in clib_bitmap_set_region, bits in the last word were not
properly set. Indeed, the n_bits_left value is wrong since n_bits
is not decreased by the number of already set bits.

Type: fix

Signed-off-by: Maxime Peim <mpeim@cisco.com>
Change-Id: I8d7ef6f47abb9f1f64f38297da2c59509d74dd72
2023-01-20 16:48:21 +00:00
Steven Luong
8bd4db5996 vxlan: convert vxlan to a plugin
per https://jira.fd.io/browse/VPP-2058

Type: improvement

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ica0828de218d25ada2d0d1491e373c3b78179ac1
2023-01-19 21:37:25 +00:00
Mohsin Kazmi
dd2eff6d06 ip: add the missing offload check
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I64283648985c98e81f315da32a451cef6e60f933
2023-01-19 16:42:10 +00:00
Mohsin Kazmi
8a0fd06690 af_packet: add the missing header-len for packets with checksum offload
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ifb790c25b38b2b1865cda7d95891bddd4195c601
2023-01-18 19:34:00 +00:00
Andrew Yourtchenko
2ebb95228f misc: Initial 23.06-rc0 commit
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I28c5cc0d54963389fe513c7de634f1a84c0bf11b
2023-01-18 13:01:05 +00:00
743 changed files with 46226 additions and 13039 deletions

View File

@ -13,13 +13,17 @@ ForEachMacros:
- 'clib_bitmap_foreach'
- 'pool_foreach'
- 'pool_foreach_index'
- 'pool_foreach_pointer'
- 'vec_foreach'
- 'vec_foreach_backwards'
- 'vec_foreach_index'
- 'vec_foreach_index_backwards'
- 'vec_foreach_pointer'
- 'vlib_foreach_rx_tx'
- 'foreach_vlib_main'
- 'foreach_set_bit_index'
- 'foreach_vlib_frame_bitmap_set_bit_index'
- 'FOREACH_ARRAY_ELT'
- 'RTE_ETH_FOREACH_DEV'
StatementMacros:

21
.gitignore vendored
View File

@ -16,14 +16,8 @@
/build-root/*.tar.xz
/build-root/*.changes
/build-root/rpmbuild/
/build-root/test-doc/
/build-root/test-cov/
/build-root/test-coverage/
/build-root/test/
/test/run/
/test/build/
/test/coverage/
/test/vapi_test/
/test/doc/build/
/build-config.mk
/build/external/*.tar.gz
/build/external/*.tar.xz
@ -128,3 +122,16 @@ compile_commands.json
/extras/hs-test/vpp-data
/extras/hs-test/hs-test
/extras/hs-test/http_server
/extras/hs-test/.build.vpp
# ./configure
/CMakeFiles
/bin
/lib
/.ninja_deps
/.ninja_log
/CMakeCache.txt
/build.ninja
/cmake_install.cmake
/startup.conf
/startup.vpp

View File

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

View File

@ -86,6 +86,10 @@ committers:
company: 'intel'
email: 'roy.fan.zhang@intel.com'
id: 'royzhang1980'
- name: 'Mohammed HAWARI'
company: 'cisco'
email: 'momohawari@gmail.com'
id: 'momohawari'
tsc:
# yamllint disable rule:line-length
approval: 'https://wiki.fd.io/view/TSC/Meeting_Minutes'
@ -96,3 +100,6 @@ tsc:
- type: 'Addition'
name: 'Fan Zhang'
link: 'https://lists.fd.io/g/vpp-dev/message/19068'
- type: 'Approval'
name: 'Mohammed HAWARI'
link: 'https://ircbot.wl.linuxfoundation.org/meetings/fdio-meeting/2023/fd_io_tsc/fdio-meeting-fd_io_tsc.2023-06-01-15.00.html'

View File

@ -107,7 +107,7 @@ F: src/vnet/devices/
AF PACKET Drivers
I: af_packet
Y: src/plugins/af_packet/FEATURE.yaml
M: Mohsin Kazmi <sykazmi@cisco.com>
M: Mohsin Kazmi <mohsin.kazmi14@gmail.com>
F: src/plugins/af_packet
VNET TAP Drivers
@ -115,7 +115,7 @@ I: tap
Y: src/vnet/devices/tap/FEATURE.yaml
M: Damjan Marion <damarion@cisco.com>
M: Steven Luong <sluong@cisco.com>
M: Mohsin Kazmi <sykazmi@cisco.com>
M: Mohsin Kazmi <mohsin.kazmi14@gmail.com>
F: src/vnet/devices/tap/
VNET Vhost User Driver
@ -127,7 +127,7 @@ F: src/plugins/vhost
VNET Native Virtio Drivers
I: virtio
Y: src/vnet/devices/virtio/FEATURE.yaml
M: Mohsin Kazmi <sykazmi@cisco.com>
M: Mohsin Kazmi <mohsin.kazmi14@gmail.com>
M: Damjan Marion <damarion@cisco.com>
F: src/vnet/devices/virtio/
@ -248,7 +248,7 @@ F: src/vnet/gre/
VNET GSO
I: gso
M: Andrew Yourtchenko <ayourtch@gmail.com>
M: Mohsin Kazmi <sykazmi@cisco.com>
M: Mohsin Kazmi <mohsin.kazmi14@gmail.com>
F: src/vnet/gso/
Plugin - MAP
@ -288,9 +288,10 @@ F: src/vnet/udp
VNET VXLAN
I: vxlan
Y: src/plugins/vxlan/FEATURE.yaml
M: John Lo <lojultra2020@outlook.com>
M: Steven Luong <sluong@cisco.com>
F: src/vnet/vxlan/
F: src/plugins/vxlan/
VNET VXLAN-GPE
I: vxlan-gpe
@ -357,7 +358,7 @@ F: src/vnet/flow/
VNET Hash
I: hash
M: Mohsin Kazmi <sykazmi@cisco.com>
M: Mohsin Kazmi <mohsin.kazmi14@gmail.com>
M: Damjan Marion <damarion@cisco.com>
F: src/vnet/hash/
@ -417,7 +418,6 @@ F: src/plugins/dpdk/
Plugin - DPDK Crypto
I: dpdk-cryptodev
M: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@outlook.com>
M: Radu Nicolau <radu.nicolau@intel.com>
M: Fan Zhang <roy.fan.zhang@intel.com>
F: src/plugins/dpdk/cryptodev/
@ -428,6 +428,11 @@ Y: src/plugins/flowprobe/FEATURE.yaml
M: Ole Troan <otroan@employees.org>
F: src/plugins/flowprobe/
Plugin - fateshare
I: fateshare
M: Andrew Yourtchenko <ayourtch@gmail.com>
F: src/plugins/fateshare/
Plugin - http_static
I: http_static
M: Dave Barach <vpp@barachs.net>
@ -571,6 +576,11 @@ M: Dave Barach <vpp@barachs.net>
M: Florin Coras <fcoras@cisco.com>
F: src/plugins/unittest/
Plugin - IDPF Device driver
I: idpf
M: Ting Xu <ting.xu@intel.com>
F: src/plugins/idpf/
Plugin - Intel DMA engines
I: dma_intel
M: Marvin Liu <yong.liu@intel.com>
@ -770,6 +780,11 @@ I: geneve
M: community vpp-dev@lists.fd.io
F: src/plugins/geneve/
Plugin - IP session redirect
I: ip_session_redirect
M: Benoît Ganne <bganne@cisco.com>
F: src/plugins/ip_session_redirect/
Plugin - linux-cp
I: linux-cp
M: Neale Ranns <neale@graphiant.com>
@ -801,6 +816,21 @@ I: prom
M: Florin Coras <fcoras@cisco.com>
F: src/plugins/prom
Plugin - BPF Trace Filter
I: bpf_trace_filter
M: Mohammed Hawari <mohammed@hawari.fr>
F: src/plugins/bpf_trace_filter
Plugin - NPTv6
I: npt66
M: Ole Troan <otroan@employees.org>
F: src/plugins/npt66
Plugin - Trace node
I: tracenode
M: Maxime Peim <mpeim@cisco.com>
F: src/plugins/tracenode
cJSON
I: cjson
M: Ole Troan <ot@cisco.com>

View File

@ -40,6 +40,7 @@ unix { \
$(if $(wildcard startup.vpp),"exec startup.vpp",) \
} \
$(if $(DPDK_CONFIG), "dpdk { $(DPDK_CONFIG) }",) \
$(if $(EXTRA_VPP_CONFIG), "$(EXTRA_VPP_CONFIG)",) \
$(call disable_plugins,$(DISABLED_PLUGINS)) \
"
@ -54,9 +55,9 @@ OS_ID = $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"
OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
endif
ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
ifeq ($(filter ubuntu debian linuxmint,$(OS_ID)),$(OS_ID))
PKG=deb
else ifeq ($(filter rhel centos fedora opensuse-leap,$(OS_ID)),$(OS_ID))
else ifeq ($(filter rhel centos fedora opensuse-leap rocky,$(OS_ID)),$(OS_ID))
PKG=rpm
endif
@ -65,10 +66,10 @@ endif
DEB_DEPENDS = curl build-essential autoconf automake ccache
DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-python
DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config
DEB_DEPENDS += lcov chrpath autoconf libnuma-dev
DEB_DEPENDS += gcovr lcov chrpath autoconf libnuma-dev
DEB_DEPENDS += python3-all python3-setuptools check
DEB_DEPENDS += libffi-dev python3-ply
DEB_DEPENDS += cmake ninja-build uuid-dev python3-jsonschema python3-yaml
DEB_DEPENDS += cmake ninja-build python3-jsonschema python3-yaml
DEB_DEPENDS += python3-venv # ensurepip
DEB_DEPENDS += python3-dev python3-pip
DEB_DEPENDS += libnl-3-dev libnl-route-3-dev libmnl-dev
@ -79,6 +80,7 @@ DEB_DEPENDS += libelf-dev libpcap-dev # for libxdp (af_xdp)
DEB_DEPENDS += iperf3 # for 'make test TEST=vcl'
DEB_DEPENDS += nasm
DEB_DEPENDS += iperf ethtool # for 'make test TEST=vm_vpp_interfaces'
DEB_DEPENDS += libpcap-dev
LIBFFI=libffi6 # works on all but 20.04 and debian-testing
@ -111,16 +113,15 @@ endif
DEB_DEPENDS += $(LIBFFI)
RPM_DEPENDS = redhat-lsb glibc-static
RPM_DEPENDS = glibc-static
RPM_DEPENDS += apr-devel
RPM_DEPENDS += numactl-devel
RPM_DEPENDS += check check-devel
RPM_DEPENDS += selinux-policy selinux-policy-devel
RPM_DEPENDS += ninja-build
RPM_DEPENDS += libuuid-devel
RPM_DEPENDS += ccache
RPM_DEPENDS += xmlto
RPM_DEPENDS += elfutils-libelf-devel
RPM_DEPENDS += elfutils-libelf-devel libpcap-devel
RPM_DEPENDS += libnl3-devel libmnl-devel
RPM_DEPENDS += nasm
@ -133,6 +134,15 @@ ifeq ($(OS_ID),fedora)
RPM_DEPENDS += python3-virtualenv python3-jsonschema
RPM_DEPENDS += cmake
RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries'
else ifeq ($(OS_ID),rocky)
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
@ -140,6 +150,7 @@ else ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
RPM_DEPENDS += python3-virtualenv python3-jsonschema
RPM_DEPENDS += libarchive cmake
RPM_DEPENDS += infiniband-diags libibumad
RPM_DEPENDS += libpcap-devel llvm-toolset
RPM_DEPENDS_GROUPS = 'Development Tools'
else
RPM_DEPENDS += yum-utils
@ -165,7 +176,8 @@ RPM_SUSE_BUILDTOOLS_DEPS = autoconf automake ccache check-devel chrpath
RPM_SUSE_BUILDTOOLS_DEPS += clang cmake indent libtool make ninja python3-ply
RPM_SUSE_DEVEL_DEPS = glibc-devel-static libnuma-devel libelf-devel
RPM_SUSE_DEVEL_DEPS += libopenssl-devel libuuid-devel lsb-release
RPM_SUSE_DEVEL_DEPS += libopenssl-devel lsb-release
RPM_SUSE_DEVEL_DEPS += libpcap-devel llvm-devel
RPM_SUSE_DEVEL_DEPS += curl libstdc++-devel bison gcc-c++ zlib-devel
RPM_SUSE_PYTHON_DEPS = python3-devel python3-pip python3-rpm-macros
@ -280,7 +292,7 @@ $(BR)/.deps.ok:
ifeq ($(findstring y,$(UNATTENDED)),y)
make install-dep
endif
ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
ifeq ($(filter ubuntu debian linuxmint,$(OS_ID)),$(OS_ID))
@MISSING=$$(apt-get install -y -qq -s $(DEB_DEPENDS) | grep "^Inst ") ; \
if [ -n "$$MISSING" ] ; then \
echo "\nPlease install missing packages: \n$$MISSING\n" ; \
@ -308,7 +320,7 @@ bootstrap:
.PHONY: install-dep
install-dep:
ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
ifeq ($(filter ubuntu debian linuxmint,$(OS_ID)),$(OS_ID))
@sudo -E apt-get update
@sudo -E apt-get $(APT_ARGS) $(CONFIRM) $(FORCE) install $(DEB_DEPENDS)
else ifneq ("$(wildcard /etc/redhat-release)","")
@ -317,6 +329,12 @@ ifeq ($(OS_ID),rhel)
@sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
@sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
@sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs zlib
else ifeq ($(OS_ID),rocky)
@sudo -E dnf install $(CONFIRM) dnf-plugins-core epel-release
@sudo -E dnf config-manager --set-enabled \
$(shell dnf repolist all 2>/dev/null|grep -i crb|cut -d' ' -f1|grep -v source)
@sudo -E dnf groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
@sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)
else ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
@sudo -E dnf install $(CONFIRM) dnf-plugins-core epel-release
@sudo -E dnf config-manager --set-enabled \
@ -410,13 +428,14 @@ rebuild-release: wipe-release build-release
export TEST_DIR ?= $(WS_ROOT)/test
define test
$(if $(filter-out $(2),retest),make -C $(BR) PLATFORM=vpp TAG=$(1) vpp-install,)
$(if $(filter-out $(2),retest),make -C $(BR) PLATFORM=vpp TAG=$(1) CC=$(CC) vpp-install,)
$(eval libs:=lib lib64)
make -C test \
VPP_BUILD_DIR=$(BR)/build-$(1)-native/vpp \
VPP_BIN=$(BR)/install-$(1)-native/vpp/bin/vpp \
VPP_INSTALL_PATH=$(BR)/install-$(1)-native/ \
EXTENDED_TESTS=$(EXTENDED_TESTS) \
TEST_GCOV=$(TEST_GCOV) \
PYTHON=$(PYTHON) \
OS_ID=$(OS_ID) \
RND_SEED=$(RND_SEED) \
@ -433,10 +452,28 @@ test:
test-debug:
$(call test,vpp_debug,test)
.PHONY: test-gcov
test-gcov:
.PHONY: test-cov
test-cov:
$(eval CC=gcc)
$(eval TEST_GCOV=1)
$(call test,vpp_gcov,cov)
.PHONY: test-cov-build
test-cov-build:
$(eval CC=gcc)
$(eval TEST_GCOV=1)
$(call test,vpp_gcov,test)
.PHONY: test-cov-prep
test-cov-prep:
$(eval CC=gcc)
$(call test,vpp_gcov,cov-prep)
.PHONY: test-cov-post
test-cov-post:
$(eval CC=gcc)
$(call test,vpp_gcov,cov-post)
.PHONY: test-all
test-all:
$(eval EXTENDED_TESTS=1)
@ -447,6 +484,13 @@ test-all-debug:
$(eval EXTENDED_TESTS=1)
$(call test,vpp_debug,test)
.PHONY: test-all-cov
test-all-cov:
$(eval CC=gcc)
$(eval TEST_GCOV=1)
$(eval EXTENDED_TESTS=1)
$(call test,vpp_gcov,test)
.PHONY: papi-wipe
papi-wipe: test-wipe-papi
$(call banner,"This command is deprecated. Please use 'test-wipe-papi'")
@ -471,8 +515,10 @@ test-shell:
test-shell-debug:
$(call test,vpp_debug,shell)
.PHONY: test-shell-gcov
test-shell-gcov:
.PHONY: test-shell-cov
test-shell-cov:
$(eval CC=gcc)
$(eval TEST_GCOV=1)
$(call test,vpp_gcov,shell)
.PHONY: test-dep
@ -489,13 +535,9 @@ test-wipe-doc:
@echo "make test-wipe-doc is DEPRECATED"
sleep 300
.PHONY: test-cov
test-cov:
$(eval EXTENDED_TESTS=1)
$(call test,vpp_gcov,cov)
.PHONY: test-wipe-cov
test-wipe-cov:
$(call make,$(PLATFORM)_gcov,$(addsuffix -wipe,$(TARGETS)))
@make -C test wipe-cov
.PHONY: test-wipe-all

View File

@ -26,6 +26,7 @@ override_dh_auto_configure:
override_dh_install:
make $(MAKE_ARGS) install
@mkdir -p $(INSTALL_DIR)
dh_install -p$(PKG) --autodest /opt
override_dh_shlibdeps:

View File

@ -1 +1,2 @@
rdma=41.0 dpdk=22.07
rdma=45.0 dpdk=23.03
rdma=46.1 dpdk=23.07

View File

@ -101,11 +101,18 @@ define $1_config_cmds
endef
endif
$(B)/.$1.config.ok: $(B)/.$1.patch.ok $(addsuffix -install,$($1_depends))
ifneq ($(filter $1,$(VPP_SKIP_EXTERNAL)), $1)
$(B)/.$1.config.ok: $(B)/.$1.patch.ok $(addprefix $(B)/.,$(addsuffix .install.ok,$($1_depends)))
$$(call h1,"configuring $1 $($1_version) - log: $$($1_config_log)")
@mkdir -p $$($1_build_dir)
$$(call $1_config_cmds)
@touch $$@
else
$(B)/.$1.config.ok:
$$(call h1,"Skipping $1 $($1_version)")
@mkdir -p $(B)
@touch $$@
endif
.PHONY: $1-config
$1-config: $(B)/.$1.config.ok
@ -120,10 +127,17 @@ define $1_build_cmds
endef
endif
ifneq ($(filter $1,$(VPP_SKIP_EXTERNAL)), $1)
$(B)/.$1.build.ok: $(B)/.$1.config.ok
$$(call h1,"building $1 $($1_version) - log: $$($1_build_log)")
$$(call $1_build_cmds)
@touch $$@
else
$(B)/.$1.build.ok:
$$(call h1,"Skipping $1 $($1_version)")
@mkdir -p $(B)
@touch $$@
endif
.PHONY: $1-build
$1-build: $(B)/.$1.build.ok
@ -138,10 +152,17 @@ define $1_install_cmds
endef
endif
ifneq ($(filter $1,$(VPP_SKIP_EXTERNAL)), $1)
$(B)/.$1.install.ok: $(B)/.$1.build.ok
$$(call h1,"installing $1 $($1_version) - log: $$($1_install_log)")
$$(call $1_install_cmds)
@touch $$@
else
$(B)/.$1.install.ok:
$$(call h1,"Skipping $1 $($1_version)")
@mkdir -p $(B)
@touch $$@
endif
.PHONY: $1-install
$1-install: $(B)/.$1.install.ok

View File

@ -19,14 +19,15 @@ DPDK_FAILSAFE_PMD ?= n
DPDK_MACHINE ?= default
DPDK_MLX_IBV_LINK ?= static
dpdk_version ?= 22.07
dpdk_version ?= 23.07
dpdk_base_url ?= http://fast.dpdk.org/rel
dpdk_tarball := dpdk-$(dpdk_version).tar.xz
dpdk_tarball_md5sum_23.07 := 2b6d57f077585cb15b885482362fd47f
dpdk_tarball_md5sum_23.03 := 3cf8ebbcd412d5726db230f2eeb90cc9
dpdk_tarball_md5sum_22.11.1 := 0594708fe42ce186a55b0235c6e20cfe
dpdk_tarball_md5sum_22.07 := fb73b58b80b1349cd05fe9cf6984afd4
dpdk_tarball_md5sum_22.03 := a07ca8839f98062f46e1cc359735cce8
dpdk_tarball_md5sum_21.11 := 58660bbbe9e95abce86e47692b196555
dpdk_tarball_md5sum_21.08 := de33433a1806280996a0ecbe66e3642f
dpdk_tarball_md5sum_21.05 := a78bba290b11d9717d1272cc6bfaf7c3
dpdk_tarball_md5sum := $(dpdk_tarball_md5sum_$(dpdk_version))
dpdk_url := $(dpdk_base_url)/$(dpdk_tarball)
dpdk_tarball_strip_dirs := 1
@ -164,6 +165,7 @@ DPDK_MESON_ARGS = \
--libdir lib \
--prefix $(dpdk_install_dir) \
-Dtests=false \
-Denable_driver_sdk=true \
"-Ddisable_drivers=$(DPDK_DRIVERS_DISABLED)" \
"-Ddisable_libs=$(DPDK_LIBS_DISABLED)" \
-Db_pie=true \
@ -180,8 +182,8 @@ define dpdk_config_cmds
mkdir -p ../dpdk-meson-venv && \
python3 -m venv ../dpdk-meson-venv && \
source ../dpdk-meson-venv/bin/activate && \
(if ! ls $(PIP_DOWNLOAD_DIR)meson* ; then pip3 download -d $(PIP_DOWNLOAD_DIR) -f $(DL_CACHE_DIR) meson==0.55 setuptools wheel pyelftools; fi) && \
pip3 install --no-index --find-links=$(PIP_DOWNLOAD_DIR) meson==0.55 pyelftools && \
(if ! ls $(PIP_DOWNLOAD_DIR)meson* ; then pip3 download -d $(PIP_DOWNLOAD_DIR) -f $(DL_CACHE_DIR) meson==0.55.3 setuptools wheel pyelftools; fi) && \
pip3 install --no-index --find-links=$(PIP_DOWNLOAD_DIR) meson==0.55.3 pyelftools && \
PKG_CONFIG_PATH=$(dpdk_install_dir)/lib/pkgconfig meson setup $(dpdk_src_dir) \
$(dpdk_build_dir) \
$(DPDK_MESON_ARGS) \

View File

@ -13,10 +13,21 @@
RDMA_CORE_DEBUG?=n
rdma-core_version := 41.0
# NOTE: When updating the rdma-core version in conjunction with an update of the
# dpdk version, please update ../mlx_rdma_dpdk_matrix.txt to include the
# updated version matrix with the dpdk and rdma-core version.
#
# Also, please verify that the DPDK RDMA driver is built into the dpdk plugin
# as follows:
# 1. from workspace root directory, 'make -C build/external build-deb'
# 2. Verify that the file build/external/dpdk_mlx_default.sh was generated
# and contains 'DPDK_MLX_DEFAULT=y'
#
rdma-core_version := 46.1
rdma-core_tarball := rdma-core-$(rdma-core_version).tar.gz
rdma-core_tarball_md5sum_39.1 := 63ba4632fd01173a2331e5b990373330
rdma-core_tarball_md5sum_41.0 := 2250389cb61a7130133e6411fdeef2f9
rdma-core_tarball_md5sum_43.0 := 3785fd2b35cd41043ab53226fc112d41
rdma-core_tarball_md5sum_45.0 := 2b170e6d2ad66fb688580520a16d1ad5
rdma-core_tarball_md5sum_46.1 := 3ac7c00717ea2720df5d90f8a43ae33a
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)

View File

@ -0,0 +1,54 @@
From baa172f1a9e370a0549a31840c3cd148046d1d84 Mon Sep 17 00:00:00 2001
From: Xinyao Cai <xinyao.cai@intel.com>
Date: Tue, 18 Apr 2023 16:37:17 +0800
Subject: [PATCH] allow the use of -a and -b flag the same time in EAL
parameters.
---
lib/eal/common/eal_common_options.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index 0305933698..0d8f9c5a38 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -1623,24 +1623,15 @@ int
eal_parse_common_option(int opt, const char *optarg,
struct internal_config *conf)
{
- static int b_used;
- static int a_used;
-
switch (opt) {
case 'b':
- if (a_used)
- goto ba_conflict;
if (eal_option_device_add(RTE_DEVTYPE_BLOCKED, optarg) < 0)
return -1;
- b_used = 1;
break;
case 'a':
- if (b_used)
- goto ba_conflict;
if (eal_option_device_add(RTE_DEVTYPE_ALLOWED, optarg) < 0)
return -1;
- a_used = 1;
break;
/* coremask */
case 'c': {
@@ -1929,11 +1920,6 @@ eal_parse_common_option(int opt, const char *optarg,
}
return 0;
-
-ba_conflict:
- RTE_LOG(ERR, EAL,
- "Options allow (-a) and block (-b) can't be used at the same time\n");
- return -1;
}
static void
--
2.34.1

View File

@ -0,0 +1,54 @@
From baa172f1a9e370a0549a31840c3cd148046d1d84 Mon Sep 17 00:00:00 2001
From: Xinyao Cai <xinyao.cai@intel.com>
Date: Tue, 18 Apr 2023 16:37:17 +0800
Subject: [PATCH] allow the use of -a and -b flag the same time in EAL
parameters.
---
lib/eal/common/eal_common_options.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index 0305933698..0d8f9c5a38 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -1623,24 +1623,15 @@ int
eal_parse_common_option(int opt, const char *optarg,
struct internal_config *conf)
{
- static int b_used;
- static int a_used;
-
switch (opt) {
case 'b':
- if (a_used)
- goto ba_conflict;
if (eal_option_device_add(RTE_DEVTYPE_BLOCKED, optarg) < 0)
return -1;
- b_used = 1;
break;
case 'a':
- if (b_used)
- goto ba_conflict;
if (eal_option_device_add(RTE_DEVTYPE_ALLOWED, optarg) < 0)
return -1;
- a_used = 1;
break;
/* coremask */
case 'c': {
@@ -1929,11 +1920,6 @@ eal_parse_common_option(int opt, const char *optarg,
}
return 0;
-
-ba_conflict:
- RTE_LOG(ERR, EAL,
- "Options allow (-a) and block (-b) can't be used at the same time\n");
- return -1;
}
static void
--
2.34.1

10
configure vendored
View File

@ -30,6 +30,7 @@ OPTIONS:
--build-type, -t Build type (release, debug, ...)
--native-only, -n Only compile for Native CPU (no multiarch)
--wipe, -w Wipe whole repo (except startup.* files)
--sanitize, -s Enable sanitizer (mem)
__EOF__
}
@ -83,6 +84,15 @@ while (( "$#" )); do
wipe=yes
shift 1
;;
-s|--sanitize)
shift 1
case "$1" in
mem)
shift 1
args+=("-DVPP_ENABLE_SANITIZE_ADDR=ON")
;;
esac
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1

View File

@ -1,49 +1,2 @@
Building VPP Documents
These instructions show how the VPP documentation sources are built.
To build your files, you can either Create a Virtual Environment using
virtualenv, which installs all the required applications for you.
Create a Virtual Environment using virtualenv
============================
For more information on how to use the Python virtual environment check
out https://packaging.python.org/guides/installing-using-pip-and-virtualenv
Get the Documents
------------------------------
For example start with a clone of the vpp.
$ git clone https://gerrit.fd.io/r/vpp
$ cd vpp
Install the virtual environment
----------------------------------------------
$ python -m pip install --user virtualenv
$ python -m virtualenv env
$ source env/bin/activate
$ pip install -r docs/etc/requirements.txt
$ cd docs
Which installs all the required applications into it's own, isolated,
virtual environment, so as to not interfere with other builds that may
use different versions of software.
Build the html files
----------------------------
Be sure you are in your vpp/docs directory, since that is where Sphinx will
look for your conf.py file, and build the documents into an index.html file
$ make html
View the results
------------------------
If there are no errors during the build process, you should now have an
index.html file in your vpp/docs/_build/html directory, which you can
then view in your browser.
If you want to build a VPP documentation source, please refer to the VPP user documentation:
https://fd.io/docs/vpp/master/contributing/writingdocs.html

View File

@ -251,7 +251,6 @@ class Siphon(object):
output."""
def process(self, out=None):
if out is None:
out = sys.stdout

View File

@ -19,7 +19,6 @@ import os
class SiphonCLICMD(process.Siphon):
name = "clicmd"
identifier = "VLIB_CLI_COMMAND"

View File

@ -18,7 +18,6 @@ from . import process, parsers
class SiphonSYSCFG(process.Siphon):
name = "syscfg"
identifier = "VLIB_CONFIG_FUNCTION"

View File

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

View File

@ -6,6 +6,8 @@ Past releases
.. toctree::
:maxdepth: 1
v22.06
v22.02
v21.10.1
v21.10
v21.06
@ -39,4 +41,3 @@ Past releases
v17.01
v16.09
v16.06

View File

@ -0,0 +1,12 @@
Release notes for VPP 22.06.1
=============================
This is bug fix release.
Of particular importance, this release contains the fix for
`JIRA VPP-2307: CVE-2022-46397 FD.io VPP (Vector Packet Processor) IPSec generates a predictable IV in AES-CBC mode <https://jira.fd.io/browse/VPP-2037>`__
For the full list of fixed issues please refer to:
- fd.io `JIRA <https://jira.fd.io>`__
- git `commit log <https://git.fd.io/vpp/log/?h=stable/2206>`__

View File

@ -0,0 +1,12 @@
Release notes for VPP 22.10.1
=============================
This is bug fix release.
Of particular importance, this release contains the fix for
`JIRA VPP-2307: CVE-2022-46397 FD.io VPP (Vector Packet Processor) IPSec generates a predictable IV in AES-CBC mode <https://jira.fd.io/browse/VPP-2037>`__
For the full list of fixed issues please refer to:
- fd.io `JIRA <https://jira.fd.io>`__
- git `commit log <https://git.fd.io/vpp/log/?h=stable/2210>`__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -69,7 +69,7 @@ master_doc = "index"
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "English"
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.

View File

@ -33,7 +33,7 @@ Delete all the generated files with the following:
View the results
----------------
If there are no errors during the build process, you should now have an ``index.html`` file in your ``vpp/docs/_build/html`` directory, which you can then view in your browser.
If there are no errors during the build process, you should now have an ``index.html`` file in your ``vpp/build-root/docs/html`` directory, which you can then view in your browser.
Whenever you make changes to your ``.rst`` files that you want to see, repeat this build process.

View File

@ -116,6 +116,22 @@ To get the VPP sources that are used to create the build, run the following comm
$ git clone https://gerrit.fd.io/r/vpp
$ cd vpp
As VPP version is derived from git description (which is based on git tags),
if the github generated tarballs are used, the version information
will be missing from the version file (.../src/scripts/.version)
which is required by the version script when building
in a non-git based workspace or the build will fail.
In that case, put the desired version string into
.../src/scripts/.version to satisfy the requirements of the version script.
Alternatively, the ``make dist`` command in a cloned git workspace
will generate an xz compressed tarball of the source
including the .../src/scripts/.version file containing the git hash
using the standard nomenclature for VPP images.
Extract the tarball using the -J option to decompress it using xz. For example,
``tar xvJf ./build-root/vpp-23.10-rc0~184-g48cd559fb.tar.xz``
Build VPP Dependencies
--------------------------------------
@ -255,7 +271,7 @@ Once the packages are built they can be found in the build-root directory.
.. code-block:: console
$ ls *.deb
$ ls build-root/*.deb
If the packages are built correctly, then this should be the corresponding output:
@ -271,12 +287,10 @@ For Ubuntu:
.. code-block:: console
$ sudo bash
# dpkg -i *.deb
$ sudo dpkg -i build-root/*.deb
For Centos or Redhat:
.. code-block:: console
$ sudo bash
# rpm -ivh *.rpm
$ sudo rpm -ivh build-root/*.rpm

View File

@ -0,0 +1,45 @@
.. _lcov_code_coverage:
Code coverage with lcov
=======================
Prerequisites
-------------
Ensure required packages are installed:
::
$ make install-deps
The Linux gcov and lcov tools can be fussy about gcc / g++ compiler
versions. As of this writing, Ubuntu 22.04 gcov / lcov works with
the latest gcc version (``11.3.0``).
Generate coverage for a test case
---------------------------------
As a first run, in order to generate the coverage report of
a specific plugin or test, run for example
::
$ make test-cov TEST=fib
Then open the file ``.build-root/test-coverage/html/index.html`` in a Chrome browser.
Improving test coverage
-----------------------
When doing modifications on the test cases, you can run
::
# This will run the test & report the result in the coverage data
$ make test-cov-build TEST=fib
# This will generate the html report with the current coverage data
$ make test-cov-post
# To reset the coverage data use
$ make test-cov-prep

View File

@ -12,3 +12,4 @@ Build, Run & Debug
testing_vpp
gdb_examples
cross_compile_macos
code_coverage

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