12075 Commits

Author SHA1 Message Date
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
Dave Wallace
4a332319cc build: remove clang-format-10
- No longer used now that ubuntu-18.04 is deprecated.
- Change default to clang-format-11 in checkstyle.sh

Type: make

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I202244563738417bf4ae5b22fc8e2804bff2d25f
2022-03-22 14:28:37 +00:00
Mohsin Kazmi
b495e34b00 memif: fix the maxmimum number of txqs
Type: fix

With multi-txq in VPP, user should be able to create
more txqs than vpp threads. MEMIF_MAX_M2S_RING should
be defined to 256 instead of number of vpp threads.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I337c3a5ea691470815653ff2dbfa862bb324b240
2022-03-22 14:12:37 +00:00
Vladislav Grishenko
15732f5d05 fib: refetech the adj after the walk in case the pool realloc'd
Follow e3aeb38fa82b77ae84643f5140d9674056b6b5ca

Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I743911cacc026af5da392d26eaf47ab83ea1de99
2022-03-22 09:02:30 +00:00
Klement Sekera
b9ff03c805 build: fix clang-format-diff[.py] detection
Fix clang-format-diff autodetection error in case of non-standard
clang-format-diff path. Also allow finding clang-format-diff.py in
non-standard location.

Type: improvement
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Change-Id: I3cb76aa152a8245e62db62f5fe2ba96b1ff86428
2022-03-22 01:34:57 +00:00
Klement Sekera
b3fc65817e tests: fix DEBUG=attach functionality
Make make test-start-vpp-in-gdb work again.
Fix incorrect temp directory when using DEBUG=attach.

Type: fix
Fixes: b23ffd7ef216463c35b75c831e6a27e58971f4ec
Change-Id: Ie98b637acbbe0221606ccdc7b54f63885e5951a4
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
2022-03-22 00:50:23 +00:00
Damjan Marion
f0574da2b7 stats: fix vlib_stats_validate_will_expand_internal
Type: fix
Change-Id: If4c0b23aaa4fc57c0783efcbe349aba5e5885b30
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-21 21:13:31 +00:00
Florin Coras
e09bd48e35 session: linked list of events to be handled by main
Minimize amount of rpcs from first worker to main

Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3794ff028a17d18b7bff69ede2b62e1e2d45ae77
2022-03-21 12:53:15 -07:00
Francesco Lombardo
38659d8f2c sr: fix srv6 definition of behavior associated to a LocalSID
The behavior associateted to a LocalSID accordig to the definition should be u8 instead of u16;

Type: fix

Signed-off-by: Francesco Lombardo <franclombardo@gmail.com>
Change-Id: I6dd60d5facc1c3f20900cb393619349e82eef38c
Signed-off-by: Francesco Lombardo <franclombardo@gmail.com>
2022-03-21 18:18:00 +00:00
Damjan Marion
8a96c6d0e7 vppinfra: use clib_mem_alloc
Type: refactor
Change-Id: I26a2a410f8f4070d10696f796d5887842cad3916
Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-03-21 17:46:23 +00:00
Jon Loeliger
d23c55fa56 wireguard: dont stacksmash bad peer base64 keys
Just like commit 252647482b24bb3474e8f13bc86100718176832f
did for Wireguard interface keys, prevent stack smashing
the peer keys.

Integer math on 32 bytes of base64 data might yield 33 bytes
of data in some poorly formed user input of private key values.
Rather than smashing the stack (detected) and aborting, simply
allow for the possible yet irrelevant 33-rd byte of data.

Type: fix
Fixes: edca1325cf296bd0f5ff422fc12de2ce7a7bad88
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I9f77b3faaaa01d3123b356c958db60c87238db9c
2022-03-21 16:25:21 +00:00
Jon Loeliger
f479179598 wireguard: improve peer dump details
- Add peer_index, table_id, and keep-alive.
- Fix some lingering cut-n-paste issues in the API file.

Type: improvement
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I6fc0729ba0268bbcda0248f680979c44e68b6b0c
2022-03-21 15:56:36 +00:00