12036 Commits

Author SHA1 Message Date
Vladislav Grishenko
a5bfe6cd0e ip: add barrier sync, ip4_ply_pool expand case
ply_create() is not thread safe when the ip4_ply_pool expands.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Ie11cc8b1ba587d5e9239a60f4e288492da61368e
2022-03-28 07:33:49 +00:00
Dmitry Valter
3ace4d62e2 tests: fix core file message
Prevent crashing on nonexistent VPP binary path class member when creating
testsuite core message.

Type: fix
Fixes: b23ffd7ef216463c35b75c831e6a27e58971f4ec
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: Ib9b3dc8c69317e6561e5404bbdcbf672e417cbcd
2022-03-27 09:21:34 +00:00
Dmitry Valter
30bb344ab6 linux-cp: fix name formatting
Format host interface name as vector rather than c-string.
Otherwise non-null-terminated vector overrun triggers ASAN.

Type: fix
Fixes: 1705a6baefe205bb6792b547c7376eee3f328a71
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: Ib204e57ee17c7ed3bfeb568dcdd834d7d7519102
2022-03-27 09:21:06 +00:00
Florin Coras
5b47a6d014 session: simplify safe pool realloc
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1c55c054fea6c6886d8287a9b6e264a308f89504
2022-03-26 20:10:59 +00:00
Florin Coras
416e1fffec hsa: echo client connects as rpc
Do connects in an session layer rpc instead of doing cli process sleeps.
Performance with 4 workers goes from ~120k/180k first run/warmed up to
~135k/240k

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id184913e9898f8db099e29a605f3a9b1fc67be63
2022-03-25 19:11:46 -07:00
Damjan Marion
5b12d2694e build: update .clang-format
Type: make
Change-Id: Iedf7af3f070cc3875f44adba38523b72f5e5ab43
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-25 21:07:38 +00:00
Damjan Marion
64841a9004 crypto-native: avoid mem overflow when loading IV
Type: improvement
Change-Id: I946d91e67c332ecac0b09d50980529b9d4e74f9c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-25 20:17:27 +01:00
Damjan Marion
f211f77777 vppinfra: add vec128_t, vec256_t and vec512_t types
Convenient for type conversion

Type: improvement
Change-Id: I35a770e06e6318fb4249b70021ed6f6c93b07162
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-25 19:12:32 +00:00
Damjan Marion
38235c38e1 l2: avoid overflow read of mac address
Type: improvement
Change-Id: I99d2c69ede39b3ba5604e1811ce12209c47f5caf
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-25 17:08:44 +00:00
Nathan Skrzypczak
3d390ba8de docs: Add getting started with GoVPP
Type: docs

Change-Id: I8e739ccf78b8dadf81cf4a4c32407355b2576942
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-25 16:12:35 +00:00
Nathan Skrzypczak
2586bd6e1c docs: Fix macos clang-format docs
Type: docs

Change-Id: Iaa2f5e2bb92342c1612cb3addbb9bfdc26623d99
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-25 16:12:03 +00:00
Alexander Chernavin
d373ebef01 linux-cp: handle ipv4 routes when link goes down
Type: improvement

Currently, when the link goes down on an interface, routes that resolve
through that interface and created with Nexthop API are removed by the
kernel. However, IPv4 routes remain in the FIB because the kernel
doesn't send any notifications about that.

And for the plugin working with user-space applications that create
routes in the kernel using Nexthop API there should be a mechanism to
synchronize the FIB and the kernel in this case.

With this change, add two new startup configuration options to the
plugin to be able to control what should happen with static and dynamic
routes managed by the plugin on link down:
  - del-static-on-link-down (disabled by default, delete routes created
    with the linux-cp static FIB source on link down),
  - del-dynamic-on-link-down (disabled by default, delete routes created
    with the linux-cp dynamic FIB source on link down).

Then, monitor link state changes on interfaces for which a linux-cp pair
exists. If the link goes down on one of the interfaces, process routes
that resolve through that interface according to the new configurations.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I0fbaeeca3f3d1fcd22e8eebb08a0a4a3d0dfe5b8
2022-03-25 13:15:21 +00:00
Damjan Marion
d545f04d3c build: print compiler version
Type: make
Change-Id: I1bad5f84797a1bfeb41420f408540604d461f440
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-25 11:18:46 +00:00
Vladislav Grishenko
b9feb61e8f fib: fix ip6-ll fib selection for non-ethernet interfaces
Fixes case when packet to link-local address is received over
gre/mpls or other non-ethernet interface and ip6-ll fib for it
is undefined.
If by a chance ip6-ll fib index is valid, packet will be passed
to some ip6 fib with possibilities to be sent out over unrelated
interface or be looped again into ip6-link-local dpo till oom
and crash.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Ie985f0373ea45e2926db7fb0a1ff951eca0e38f6
2022-03-25 07:57:58 +00:00
Mohsin Kazmi
89d74bdee8 devices: fix high vector rate per dispatch
Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ibd23648483b38696271154237e81081480bb16e0
2022-03-25 02:15:57 +00:00
Florin Coras
f55183a245 session: reorganize local port allocation
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5bbf8d584efdec57908c61f8626bcc81590401b3
2022-03-25 00:04:30 +00:00
Klement Sekera
b3262478ea misc: update my email-address
Type: fix
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I756bff7ecedf36cc685a20ba63c9d5229fc2ff32
2022-03-24 18:01:16 +01:00
Paul Atkins
0d03284efc bfd: use local error index when incrementing node counters
When incrementing node counters with vlib_node_increment_counter
the local error index should be passed in. vlib_node_increment_counter
adds the local index to the nodes base index to get the counter to
write to. If we pass in the global counter index, the offset gets
added again in the fn, and we then potentially write into memory that
is not part of the counter vector.

Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I43be33a51bcb52d520495d326b971c1d848d96b5
2022-03-24 19:12:47 +00:00
Florin Coras
05ead78945 session: safe reallocs for transport endpoint pool
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6c86d0691bd0594d8b2c05d83d004be1aa8c5e21
2022-03-24 16:08:12 +00:00
Neale Ranns
aa7cfd04e7 ip: The check for 'same packet' must include the FIB index
Type: fix

otherwise if two packets arrive with the same source address but from different VRFs, then they are treated as the same and they use the same LB and thus share the same fate. but the lookup, when done, results in two different LBs, and hence the fate can be different.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Id6e16f7c577a561d9ddd7066339fa4385361d07f
2022-03-24 15:39:16 +00:00
Alexander Chernavin
e99f762346 ip6-nd: stop sending RA by default
Type: improvement

Currently, RA message sending is enabled by default - both periodic and
in response to RS message. However, RFC 4861 section 6.2.1 says the
following:

  Note that AdvSendAdvertisements MUST be FALSE by default so that a
  node will not accidentally start acting as a router unless it is
  explicitly configured by system management to send Router
  Advertisements.

With this change, RA message sending is disabled by default and
"test_ip6.TestIPv6.test_rs" updated appropriately.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I2a8865199cb665c59268504aefe2976e5ee96dc2
2022-03-24 14:26:28 +00:00
Neale Ranns
fbc633f554 mpls: Set the MTU field in the frag-needed ICMP when doing MPLS fragmentation
Type: fix

The reported MTU should include the MPLS label overhead

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I3df6d2e0b13f49701e187a766a157498dcaafbc0
2022-03-24 13:56:43 +00:00
Benoît Ganne
bb498ccb1c crypto-native: fix index in VAES aes-cbc encrypt
Type: fix

Change-Id: Id7ae0d4c53cbca3785964f0bef92e9cd589d4ce9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-24 13:34:09 +00:00
Andrew Yourtchenko
534dfc1f18 build: set OS_ID_LIKE on to be OS_ID on Debian proper
OS_ID_LIKE from /etc/os-release is used to determine
the type of packaging. On Debian it ends up being empty,
so the "ninja package" does not work for out of tree plugin
builds.

Solution: if OS_ID_LIKE is not set, set it to OS_ID

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I077d4fdb509ea94b187d11391b1f49edb94c4e30
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-03-24 12:34:54 +00:00
Paul Atkins
4e26a78525 dpdk: enable int mode for virtio
The way of specifying which interface supports what has changed.
Re-add support for adaptive mode in virtio.

Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I2f8ffa6311a4081b93fb08a7e92408b8bffbae64
2022-03-24 12:27:31 +00:00
Dave Wallace
5d0fa2f85c build: exclude dlmalloc.[ch] from checkstyle verification
- dlmalloc.[ch] is an imported open source library which
  somehow manages to choke clang-format-diff to the point
  of consuming ~1 minute to run against a single character
  diff.

Type: make

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I16c6d6da664da8634aa682dce9d2120072626730
2022-03-24 11:43:33 +00:00
Neale Ranns
60bb453427 fib: Fix crash when removing a covering prefix
Type: fix

When a covering entry is removed from the table, the covered entries first see it 'updated' and then 'removed'.
the crash occurs because the covered prefixes share (simple pointer copy) the covereds hash table of path extensions. During the cervers deletion this hash table has been removed and the update of the covered crashes when recaluationg forwarding becuase it uses the free'd hash.
Fix is to refetch the shared hash table (which is NULL) when the covered is updated.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Icefca9d7b21da975111d0e974d75f663fc0cc00c
2022-03-24 11:29:27 +00:00
Paul Atkins
03b22e62e1 dpdk: copy the enable_rxq_int flag from driver to conf
The support for interrupt mode is not being respected as it is not
copied into the driver conf, which is what is checked when trying to
enable it.

Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I2e502306e27bd98f8037d1a0a396201e099b50b5
2022-03-23 21:45:18 +00:00
Benoît Ganne
89a561f204 classify: fix typo in AVX-512 find entry
Type: fix
Fixes: 26bc9f3c855496fb56f5fc648f75a299d4d539f8

Change-Id: Idab52bf856c03ded7b181608c3db1313aa2e33de
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-23 21:41:55 +00:00
Jing Peng
4859d8d8e8 vlib: send full error message to syslog
Currently the last character of the error message string
is temporarily changed to a null byte '\0' before the string
is sent to syslog(3), resulting in confusingly incomplete log
entries.

This patch changes the syslog format to "%.*s" so that the
maximum number of characters to be printed could be controlled.

Type: improvement

Signed-off-by: Jing Peng <pj.hades@gmail.com>
Change-Id: I1bd6295c19b51b962a3d8ee3016cd91ffb2a4eaf
2022-03-23 18:52:50 +00:00
Mohsin Kazmi
9deb2ec335 devices: add tx trace for af-packet
Type: improvement

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ib96ee54eaf967bf435d6da910a6b582e87fbedc0
2022-03-23 18:47:15 +00:00
Mohsin Kazmi
c1fd17bd10 devices: add support for offloads
Type: improvement

This patch adds support for:
  1) GSO
  2) checksum offload

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ib00629888c62da04d58db36ce021993769e736c9
2022-03-23 18:47:15 +00:00
Mohsin Kazmi
219cbcb29f devices: af-packet v3 support
Type: feature

CPU usage ~20% less than v2.
Performance improvement 20% more than v2.
High vector rate.

Change-Id: I24bc594200f42664b59d07b44d44578e61068bbc
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2022-03-23 18:47:15 +00:00
Damjan Marion
8d7cdc808f vppinfra: deprecate clib_mem_is_vec
Use of clib_mem_is_heap_object is not reliable enough for production use
as it relies on just few bytes of memory allocator chunk header.

Type: improvement
Change-Id: I48c8adde8b6348b15477e3a015ba515eb7ee7ec2
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23 18:41:13 +00:00
Damjan Marion
f87acfaf73 vppinfra: change vlib_register_node so it takes format string for node name
This allows specifying both c string and vector for node name
and removes need for crafting temporary string.

Type: improvement
Change-Id: I0b016cd70aeda0f68eb6f9171c5152f303be7369
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23 18:40:16 +00:00
Tianyu Li
ba465b970e dpdk: fix rx/tx burst function name
Type: fix
Fixes: 65105c95fe03 ("dpdk: improve logging")
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I69d616c7e6e7b5395ebf083b1ac5c3e85f99bbdd
2022-03-23 18:33:45 +00:00
Benoît Ganne
495c320a7f vppinfra: fix bihash key comparison for 512-bits vectors
bihash keys are less than 64-bytes, do not overflow.

Type: fix

Change-Id: Ic55407eb9ccca38058f7e62b363ec05c8445fbcb
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-23 18:33:03 +00:00
Damjan Marion
d24b86ecce vlib: avoid use of vector of voids
Type: fix
Change-Id: I76e28854db8a1e9134c816c0c5d81b031dc4e27d
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23 18:32:05 +00:00
Nathan Skrzypczak
e2d0c6e51e ip: Add unformat for flow_hash_config
Type: improvement

This also makes the is_white_space function
public

Change-Id: Ifc1c0d4509f3ecae14f09bb5fa7a2eea33c49b09
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-03-23 18:29:08 +00:00
Neale Ranns
8e0af7a7ff vnet: Remove the unused fields from opaque2
Type: refactor

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ibb6d19de053c306e9758dbfa827ab7bcab5de856
2022-03-23 18:27:52 +00:00
Vladislav Grishenko
49ebbf7048 vlib: mitigate outdated new cli session events
Possible races while concurrent additon to the new sessions vector
in a one process and remove from it in an another need to be avoided.
Let the vector be changed in the new session process function only.
Also cli_file_pool element may be freed already at the new session
event arrive timepoint, still causing unexpected cli banner for
noninteracive cli sessions.

Type: fix
Fixes: 17a67218587d40541ff522c6a86f354720481fbb
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I022d16dd3aad9c9330834d35c58938f04b015b08
2022-03-23 18:27:15 +00:00
Vladislav Grishenko
2973350c81 vlib: fix memory leak on process nodes reforking
The processes vector leaked on reforking and needs to be
freed before recloning from main node processes.

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: Id69bc3fd42e2efacfcd521f98e6e51a9c712fef5
2022-03-23 18:25:57 +00:00
Vladislav Grishenko
8486283cd5 vlib: leave SIGCONT signal with its default handler
Systemd always sends SIGCONT after KillSignal, to ensure that even suspended
tasks can be terminated cleanly. However, the default action of SIGCONT
handler in VPP such as unix_signal_handler() is process termination with
coredump, what is not really desired. So, leave it alike SIGSTOP with its
default handler.

Type: feature
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I54c06d21669ec3c709322d746db9e28448c31bb8
2022-03-23 18:24:56 +00:00
Benoît Ganne
7f9256e31c api: better segregate client and server code
- move memory and server specific vl_msg_api_handler_with_vm_node()
   to memory server code only
 - keep api_global_main static

Apart from being cleaner, this also helps avoiding symbols conflict
when both client and server libs are loaded in the same process, as is
done by the prom plugin.
Those symbols conflict confuse ASan and can be nasty to debug.

Type: improvement

Change-Id: Iaf58596cc753ad8d3fedd8d65c4bf480ac129c2c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-23 18:23:29 +00:00
Damjan Marion
8296a1d043 perfmon: null-terminate string
Type: fix
Change-Id: I43ebb2c2922f3b8b8eddf26ccdf044f31d7b7a10
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23 17:21:23 +00:00
Damjan Marion
fa7f21bb6b stats: fix crash due to pointer taken before validate
Type: fix
Change-Id: Iee9eab18da142bfe0645761deea13b0fe911a43b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23 16:38:56 +01:00
Damjan Marion
2e7c5d33cc vppinfra: deprecate vppinfra/graph.[ch]
Type: refactor
Change-Id: Iba0466b60354955ba73f851435a7127435b7066d
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-23 15:07:39 +00:00
Benoît Ganne
ed59dac627 crypto-native: fix dst index typo in VAES
Type: fix

Change-Id: Ib025d8c1bc9bd651b6448d6a41fd1efa6f0b7362
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-23 14:19:15 +01:00
Florin Coras
6bd8d3fbba session: use safe realloc for pools
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I313c916d268c4b2b448b93e90bc67da341b803e3
2022-03-22 15:14:25 +00:00
Filip Tehlar
b1c0b9afac tests: add http tps test
Type: test

Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I56a585a8a1f588e682552913cfbdd4551e057ead
2022-03-22 14:31:45 +00:00