]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
17 months agox86: add more definitions for XCR0 bits
Konstantin Belousov [Fri, 27 Jan 2023 10:43:56 +0000 (12:43 +0200)]
x86: add more definitions for XCR0 bits

This covers all currently defined bits, adding PKRU and TILE.

Reviewed by: jhb, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38219

17 months agoRevert "Don't omit bsd.compiler.mk for the nested delete-old in buildworld."
John Baldwin [Fri, 27 Jan 2023 17:41:47 +0000 (09:41 -0800)]
Revert "Don't omit bsd.compiler.mk for the nested delete-old in buildworld."

The original motivation (src.opts.mk needing bsd.comppiler.mk to
determine if CXX is supported) is no longer relevant now that CXX is
non-optional.

This reverts commit b9cb80883bce6dc992cf05ae2e59089a60d311ec.

17 months agoMFV: zstd 1.5.2
Allan Jude [Fri, 27 Jan 2023 17:22:31 +0000 (17:22 +0000)]
MFV: zstd 1.5.2

Merge commit 'b3392d84da5bf2162baf937c77e0557f3fd8a52b' into zstd_1.5.2

full changelog: https://github.com/facebook/zstd/compare/v1.4.8...v1.5.2

Updated sys/kern/subr_compressor.c to new API

MFC after: 3 days
Relnotes: yes
Sponsored by: Klara, Inc.

17 months agonetstat: make netstat -rn use netlink instead of rtsock
Alexander V. Chernikov [Fri, 27 Jan 2023 15:14:39 +0000 (15:14 +0000)]
netstat: make netstat -rn use netlink instead of rtsock

This change switches route listing in netstat to netlink, with fallback to rtsock.
The outputs are mostly identical, with an exception of not showing kernel
 nexthop indexes for multipath routes.

Differential Revision: https://reviews.freebsd.org/D36529

17 months agoLinuxKPI: linux_pci.c: fix whitespace
Bjoern A. Zeeb [Fri, 27 Jan 2023 15:18:44 +0000 (15:18 +0000)]
LinuxKPI: linux_pci.c: fix whitespace

Properly indent a line.  No functional change.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

17 months agosysctl: use correct types and names in sysctl_*sec_to_sbintime
Gleb Smirnoff [Fri, 27 Jan 2023 15:09:22 +0000 (07:09 -0800)]
sysctl: use correct types and names in sysctl_*sec_to_sbintime

The functions are intended to report kernel variables that are
stored as sbintime_t (pointed to by arg1) as human readable
nanoseconds or milliseconds (reported via sysctl_handle_64).
The variable types and names were reversed.  I guess there is
no functional change here, as all types flipped around were
signed 64.  Note that these function aren't used yet anywhere
in the kernel.

Reviewed by: mav
Differential revision: https://reviews.freebsd.org/D38217

17 months agoRevert "rc.d: Put growfs script in FreeBSD-ufs"
Emmanuel Vadot [Fri, 27 Jan 2023 10:30:24 +0000 (11:30 +0100)]
Revert "rc.d: Put growfs script in FreeBSD-ufs"

The growfs script also support zfs.

This reverts commit 36a7fa1e16a0b4446f2cb618fc84a6bc1a2cbf86.

Reported by: emaste, Mina Galić

17 months agorc.d: Put resolv script in FreeBSD-resolvconf
Emmanuel Vadot [Fri, 28 Oct 2022 07:33:38 +0000 (09:33 +0200)]
rc.d: Put resolv script in FreeBSD-resolvconf

Differential Revision: https://reviews.freebsd.org/D37190

17 months agorc.d: Put growfs script in FreeBSD-ufs
Emmanuel Vadot [Fri, 28 Oct 2022 07:33:20 +0000 (09:33 +0200)]
rc.d: Put growfs script in FreeBSD-ufs

Differential Revision: https://reviews.freebsd.org/D37189

17 months agorc.d: Put ggated script in FreeBSD-ggate
Emmanuel Vadot [Fri, 28 Oct 2022 07:33:02 +0000 (09:33 +0200)]
rc.d: Put ggated script in FreeBSD-ggate

Differential Revision: https://reviews.freebsd.org/D37188

17 months agorc.d: Put dhclient script in FreeBSD-dhclient
Emmanuel Vadot [Fri, 28 Oct 2022 07:32:27 +0000 (09:32 +0200)]
rc.d: Put dhclient script in FreeBSD-dhclient

Differential Revision: https://reviews.freebsd.org/D37187

17 months agorc.d: Put devmatch script in FreeBSD-devmatch
Emmanuel Vadot [Fri, 28 Oct 2022 07:31:59 +0000 (09:31 +0200)]
rc.d: Put devmatch script in FreeBSD-devmatch

Differential Revision: https://reviews.freebsd.org/D37192

17 months agorc.d: Put devd script in FreeBSD-devd package
Emmanuel Vadot [Fri, 28 Oct 2022 07:31:17 +0000 (09:31 +0200)]
rc.d: Put devd script in FreeBSD-devd package

Differential Revision: https://reviews.freebsd.org/D37186

17 months agoRetire WITHOUT_CXX option
Ed Maste [Wed, 16 Nov 2022 14:20:39 +0000 (09:20 -0500)]
Retire WITHOUT_CXX option

Several important base system components are written in C++, and the
WITHOUT_CXX option produced a system that was not fully functional.
Just accept this, and remove the option to build without C++ support.

This reverts commit adc3c128c6603054586a993d117e5dd808deac17.

Reviewed by: brooks, kevans, jhb (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33108

17 months ago<sys/cdefs.h>: Decay expression passed to fallback version of __generic()
John Baldwin [Fri, 27 Jan 2023 00:28:22 +0000 (16:28 -0800)]
<sys/cdefs.h>: Decay expression passed to fallback version of __generic()

This ensures that __generic() more closely matches _Generic() when
using the fallback version when _Generic() is not available (such as
GCC).

Co-authored by: jrtc27
Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D38215

17 months agoRevert "stdlib.h: Fix qsort_r compatibility with GCC 12."
John Baldwin [Fri, 27 Jan 2023 00:28:03 +0000 (16:28 -0800)]
Revert "stdlib.h: Fix qsort_r compatibility with GCC 12."

This reverts commit 43703bc489ec504b947b869045c492ed38c1a69c.

Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D38216

17 months agotcp: improve error handling of net.inet.tcp.udp_tunneling_port
Michael Tuexen [Thu, 26 Jan 2023 21:55:22 +0000 (22:55 +0100)]
tcp: improve error handling of net.inet.tcp.udp_tunneling_port

In case the new port can't be set, set the port to 0.

MFC after: 3 days
Sponsored by: Netflix, Inc.

17 months agotcp: protect TCP over UDP configuration with a lock
Gleb Smirnoff [Thu, 26 Jan 2023 18:16:32 +0000 (10:16 -0800)]
tcp: protect TCP over UDP configuration with a lock

The sysctl modifies global sockets without any locks.  The removed
comment suggests that previously it relied on a lock that doesn't
exist today.

17 months agoudp: don't forget to initialize udpcb for UDPv6
Gleb Smirnoff [Thu, 26 Jan 2023 18:16:32 +0000 (10:16 -0800)]
udp: don't forget to initialize udpcb for UDPv6

Reported by: tuexen
Fixes: 483fe96511ec02a3f077f9a59f1a96acb3640dea

17 months agolua: reduce diffs between luaconf.h copies
Ed Maste [Wed, 25 Jan 2023 22:01:00 +0000 (17:01 -0500)]
lua: reduce diffs between luaconf.h copies

Upstream luaconf.h is contrib/lua/src/luaconf.h.dist, while userland lua
and loader lua have copies in lib/liblua/luaconf.h and
stand/liblua/luaconf.h.

Adjust whitespace, VCS tags, etc. to match upstream's version, for ease
of comparison.

Reviewed By: imp
Sponsored By: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38206

17 months agotcp: reduce the size of t_rttupdated in tcpcb
Richard Scheffenegger [Thu, 26 Jan 2023 17:07:11 +0000 (18:07 +0100)]
tcp: reduce the size of t_rttupdated in tcpcb

During tcp session start, various mechanisms need to
track a few initial RTTs before becoming active.
Prevent overflows of the corresponding tracking counter
and reduce the size of tcpcb simultaneously.

Reviewed By: #transport, tuexen, guest-ccui
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D21117

17 months agonetlink: Zero-initialize writer structures allocated on the stack
Mark Johnston [Thu, 26 Jan 2023 15:46:19 +0000 (10:46 -0500)]
netlink: Zero-initialize writer structures allocated on the stack

The prevailing pattern seems to be to simply initialize all fields to
zero.  Without this, it's possible to trigger a branch on uninitialized
memory, specifically, when testing nw->ignore_limit in
nlmsg_refill_buffer().

Initialize the writer structure in a couple of functions where this is
necessary.

Reported by: KMSAN
Reviewed by: melifaro
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38213

17 months agoLinuxKPI: pci.h move function declaration to top of file.
Bjoern A. Zeeb [Thu, 26 Jan 2023 14:31:26 +0000 (14:31 +0000)]
LinuxKPI: pci.h move function declaration to top of file.

No functional changes.

X-MFC-with: 49b6d5ed142d6c59b7a517ff5660165d8647bd01
Sponsored by: The FreeBSD Foundation

17 months agoRewrite to avoid Coverity false positive.
Kirk McKusick [Thu, 26 Jan 2023 00:57:26 +0000 (16:57 -0800)]
Rewrite to avoid Coverity false positive.

MFC after:    1 week
Reported by:  Coverity (CID 1502669)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37907

17 months agolindebugfs: Add `debugfs_create_file_size()`
Jean-Sébastien Pédron [Fri, 30 Dec 2022 09:57:49 +0000 (10:57 +0100)]
lindebugfs: Add `debugfs_create_file_size()`

This is the same as `debugfs_create_file()` but takes the initial size
of the file. In FreeBSD, the given size is ignored and
`debugfs_create_file()` is called.

Reviewed by: emaste, manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D37914

17 months agolinuxkpi: Define `PCI_STD_NUM_BARS` in <linux/pci.h>
Jean-Sébastien Pédron [Sun, 22 Jan 2023 13:46:14 +0000 (14:46 +0100)]
linuxkpi: Define `PCI_STD_NUM_BARS` in <linux/pci.h>

Reviewed by: emaste, manu
Approved by: emaste, manu
Differential Revision: https://reviews.freebsd.org/D38162

17 months agolinuxkpi: Define `pm_suspend_target_state` in <linux/suspend.h>
Jean-Sébastien Pédron [Fri, 20 Jan 2023 20:13:32 +0000 (21:13 +0100)]
linuxkpi: Define `pm_suspend_target_state` in <linux/suspend.h>

It is set to `PM_SUSPEND_ON`.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38161

17 months agolinuxkpi: Add `msix_cap` to `struct pci_dev`
Jean-Sébastien Pédron [Fri, 20 Jan 2023 19:23:59 +0000 (20:23 +0100)]
linuxkpi: Add `msix_cap` to `struct pci_dev`

At the same time, define `PCI_MSIX_FLAGS`and `PCI_MSIX_FLAGS_ENABLE`.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38160

17 months agolinuxkpi: Add `sysfs_emit_at()` in <linux/sysfs.h>
Jean-Sébastien Pédron [Fri, 20 Jan 2023 19:23:17 +0000 (20:23 +0100)]
linuxkpi: Add `sysfs_emit_at()` in <linux/sysfs.h>

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38159

17 months agolinuxkpi: Define `is_cow_mapping(flags)` as false
Jean-Sébastien Pédron [Fri, 20 Jan 2023 19:22:41 +0000 (20:22 +0100)]
linuxkpi: Define `is_cow_mapping(flags)` as false

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38158

17 months agolinuxkpi: Include <linux/vmalloc.h> from <linux/pagemap.h>
Jean-Sébastien Pédron [Fri, 20 Jan 2023 17:51:40 +0000 (18:51 +0100)]
linuxkpi: Include <linux/vmalloc.h> from <linux/pagemap.h>

I'm not sure this is correct, but it gives access to the definition of
`PAGE_KERNEL` in `ttm_tt.c` in the DRM drivers.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38154

17 months agolinuxkpi: Add `seqcount_ww_mutex_t` in <linux/seqlock.h>
Jean-Sébastien Pédron [Fri, 20 Jan 2023 17:20:01 +0000 (18:20 +0100)]
linuxkpi: Add `seqcount_ww_mutex_t` in <linux/seqlock.h>

It is defined as a synonymous to `seqcount_mutex_t`.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38152

17 months agolinuxkpi: Define `DEFINE_WD_CLASS(name)` in <linux/ww_mutex.h>
Jean-Sébastien Pédron [Fri, 20 Jan 2023 17:19:01 +0000 (18:19 +0100)]
linuxkpi: Define `DEFINE_WD_CLASS(name)` in <linux/ww_mutex.h>

It is defined as a synonymous to `DEFINE_WW_CLASS(name)`.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38151

17 months agolinuxkpi: Adds more `SZ_*` macros
Jean-Sébastien Pédron [Fri, 20 Jan 2023 17:17:37 +0000 (18:17 +0100)]
linuxkpi: Adds more `SZ_*` macros

`SZ_2K` and `SZ_1G` were defined in irdma. They are removed from this
driver.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38150

17 months agolinuxkpi: Define ENOKEY to 126.
Jean-Sébastien Pédron [Fri, 20 Jan 2023 17:14:25 +0000 (18:14 +0100)]
linuxkpi: Define ENOKEY to 126.

This is the same error code as Linux. This value is unused on FreeBSD.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38149

17 months agolinuxkpi: Add `pci_device_is_present()`
Jean-Sébastien Pédron [Thu, 19 Jan 2023 17:46:37 +0000 (18:46 +0100)]
linuxkpi: Add `pci_device_is_present()`

This calls bus_child_present(9) internally.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38148

17 months agolinuxkpi: Define `dev_dbg_ratelimited()`
Jean-Sébastien Pédron [Thu, 19 Jan 2023 00:15:03 +0000 (01:15 +0100)]
linuxkpi: Define `dev_dbg_ratelimited()`

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38145

17 months agovt(4): Return errors from `vt_{,de}allocate()`
Jean-Sébastien Pédron [Sat, 14 Jan 2023 18:22:56 +0000 (19:22 +0100)]
vt(4): Return errors from `vt_{,de}allocate()`

This is useful to the DRM drivers to let them know if a device is
effectively used by the console.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38089

17 months agolinuxkpi: Fix `atomic_long_sub()` overflow
Jean-Sébastien Pédron [Sun, 15 Jan 2023 14:56:48 +0000 (15:56 +0100)]
linuxkpi: Fix `atomic_long_sub()` overflow

By (ab)using `atomic_long_add_return()`, `atomic_long_sub()` was making
the atomic long overflow. Indeed the underlying FreeBSD atomic is based
on an unsigned long.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38090

17 months agolinuxkpi: Add `io_mapping_map_user()` and `remap_pfn_range()`
Jean-Sébastien Pédron [Sat, 14 Jan 2023 12:22:19 +0000 (13:22 +0100)]
linuxkpi: Add `io_mapping_map_user()` and `remap_pfn_range()`

The code comes from the i915 DRM driver.

In Linux commits b739f125e4ebd73d10ed30a856574e13649119ed and
b12d691ea5e01db42ccf3b4207e57cb3ce7cfe91 (Linux 5.13), the i915 DRM
driver dropped specific implementations to use Linux generic functions.
Therefore I moved the FreeBSD code from that i915 driver to linuxkpi.

However, these commits were later reverted (also in Linux 5.13) so the
i915 driver doesn't use these functions. But perhaps it will help in the
future.

To sum up, the code comes from the i915 DRM driver but it doesn't use it
(i.e. it continues to use its internal implementation).

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38088

17 months agolinuxkpi: Add `sysfs_emit()`
Jean-Sébastien Pédron [Wed, 11 Jan 2023 23:23:33 +0000 (00:23 +0100)]
linuxkpi: Add `sysfs_emit()`

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38086

17 months agolinuxkpi: Add `complete` field to `struct dev_pm_ops`
Jean-Sébastien Pédron [Wed, 11 Jan 2023 22:23:57 +0000 (23:23 +0100)]
linuxkpi: Add `complete` field to `struct dev_pm_ops`

This change breaks the KBI.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38085

17 months agolinuxkpi: Add `pm_suspend_via_firmware()`
Jean-Sébastien Pédron [Wed, 11 Jan 2023 22:23:35 +0000 (23:23 +0100)]
linuxkpi: Add `pm_suspend_via_firmware()`

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38084

17 months agolinuxkpi: Add `pm_runtime_suspended()`
Jean-Sébastien Pédron [Wed, 11 Jan 2023 22:23:14 +0000 (23:23 +0100)]
linuxkpi: Add `pm_runtime_suspended()`

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38083

17 months agolinuxkpi: Define `tasklet_unlock_spin_wait()` as `tasklet_unlock_wait()`
Jean-Sébastien Pédron [Wed, 11 Jan 2023 00:48:43 +0000 (01:48 +0100)]
linuxkpi: Define `tasklet_unlock_spin_wait()` as `tasklet_unlock_wait()`

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38080

17 months agolinuxkpi: Define `synchronize_hardirq()`
Jean-Sébastien Pédron [Wed, 11 Jan 2023 00:27:40 +0000 (01:27 +0100)]
linuxkpi: Define `synchronize_hardirq()`

It currently does the same as `synchronize_irq()`.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38079

17 months agolindebugfs: Add missing `debugfs_create_u*()` and `debugfs_create_x*()`
Jean-Sébastien Pédron [Thu, 12 Jan 2023 23:41:32 +0000 (00:41 +0100)]
lindebugfs: Add missing `debugfs_create_u*()` and `debugfs_create_x*()`

The `debugfs_create_x*()` variants are the same as their
`debugfs_create_u*()` equivalent, but they work with lowercase
hexadecimal.

While here, fix a few style(9) issues.

Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38087

17 months agolindebugfs: Add `debugfs_create_atomic_t()`
Jean-Sébastien Pédron [Fri, 30 Dec 2022 10:00:57 +0000 (11:00 +0100)]
lindebugfs: Add `debugfs_create_atomic_t()`

Reviewed by: jfree
Approved by: jfree
Differential Revision: https://reviews.freebsd.org/D37915

17 months agozfs: merge openzfs/zfs@9cd71c860 (master)
Martin Matuska [Wed, 25 Jan 2023 18:50:29 +0000 (19:50 +0100)]
zfs: merge openzfs/zfs@9cd71c860 (master)

Notable upstream pull request merges:
  #13805 Configure zed's diagnosis engine with vdev properties
  #14110 zfs list: Allow more fields in ZFS_ITER_SIMPLE mode
  #14121 Batch enqueue/dequeue for bqueue
  #14123 arc_read()/arc_access() refactoring and cleanup
  #14159 Bypass metaslab throttle for removal allocations
  #14243 Implement uncached prefetch
  #14251 Cache dbuf_hash() calculation
  #14253 Allow reciever to override encryption property in case of replication
  #14254 Restrict visibility of per-dataset kstats inside FreeBSD jails
  #14255 Zero end of embedded block buffer in dump_write_embedded()
  #14263 Cleanups identified by CodeQL and Coverity
  #14264 Miscellaneous fixes
  #14272 Change ZEVENT_POOL_GUID to ZEVENT_POOL to display pool names
  #14287 FreeBSD: Remove stray debug printf
  #14288 Colorize zfs diff output
  #14289 deadlock between spa_errlog_lock and dp_config_rwlock
  #14291 FreeBSD: Fix potential boot panic with bad label
  #14292 Add tunable to allow changing micro ZAP's max size
  #14293 Turn default_bs and default_ibs into ZFS_MODULE_PARAMs
  #14295 zed: add hotplug support for spare vdevs
  #14304 Activate filesystem features only in syncing context
  #14311 zpool: do guid-based comparison in is_vdev_cb()
  #14317 Pack zrlock_t by 8 bytes
  #14320 Update arc_summary and arcstat outputs
  #14328 FreeBSD: catch up to 1400077
  #14376 Use setproctitle to report progress of zfs send
  #14340 Remove some dead ARC code
  #14358 Wait for txg sync if the last DRR_FREEOBJECTS might result in a hole
  #14360 libzpool: fix ddi_strtoull to update nptr
  #14364 Fix unprotected zfs_znode_dmu_fini
  #14379 zfs_receive_one: Check for the more likely error first
  #14380 Cleanup of dead code suggested by Clang Static Analyzer
  #14397 Avoid passing an uninitialized index to dsl_prop_known_index
  #14404 Fix reading uninitialized variable in receive_read
  #14407 free_blocks(): Fix reports from 2016 PVS Studio FreeBSD report
  #14418 Introduce minimal ZIL block commit delay
  #14422 x86 assembly: fix .size placement and replace .align with .balign

Obtained from: OpenZFS
OpenZFS commit: 9cd71c8604d52def22ffaddc35755712f0fb9349

17 months agoipfw.8: there never was a "skip-action" action
Ceri Davies [Wed, 25 Jan 2023 18:15:18 +0000 (18:15 +0000)]
ipfw.8: there never was a "skip-action" action

It was renamed during review of D1776 but this entry slipped through.

PR: 243284
Reported by: pprocacci@gmail.com
Obtained from: Chad Jacob Milios <milios@ccsys.com>

17 months agoFix cross-build from STABLE or older CURRENT.
Dag-Erling Smørgrav [Wed, 25 Jan 2023 17:03:10 +0000 (18:03 +0100)]
Fix cross-build from STABLE or older CURRENT.

Previously, zic and tzsetup were both listed as install tools and basic
bootstrap tools.  Actually, tzsetup is an install tool while zic is a
non-basic bootstrap tool.

Fixes: 783c318fd118
Sponsored by: Klara, Inc.
Reviewed by: jrtc27, emaste
Differential Revision: https://reviews.freebsd.org/D38195

17 months agozoneinfo: Always produce fat zoneinfo files.
Dag-Erling Smørgrav [Wed, 25 Jan 2023 17:03:05 +0000 (18:03 +0100)]
zoneinfo: Always produce fat zoneinfo files.

These aren't just needed for compatibility with i386 binaries (which need
the 32-bit section), but potentially also for compatibility with older
binaries on all platforms.

Sponsored by: Klara, Inc.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38194

17 months agow: Unlike err(3), xo_err(3) won't accept a null format string.
Dag-Erling Smørgrav [Wed, 25 Jan 2023 17:03:00 +0000 (18:03 +0100)]
w: Unlike err(3), xo_err(3) won't accept a null format string.

MFC after: 1 week
X-MFC-with: d90ff31ae5cd
Sponsored by: Klara, Inc.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D38192

17 months agotzcode: Document zic's -D option.
Dag-Erling Smørgrav [Wed, 25 Jan 2023 17:02:55 +0000 (18:02 +0100)]
tzcode: Document zic's -D option.

Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D38141

17 months agopytest: delete interfaces from inside the jail.
Alexander V. Chernikov [Wed, 25 Jan 2023 16:32:52 +0000 (16:32 +0000)]
pytest: delete interfaces from inside the jail.

This change follows the approach used in 80fc25025ffc, to
 minimise the impact of the delayed interface migration.

MFC after: 2 weeks

17 months agozoneinfo: On amd64, include 32-bit data.
Dag-Erling Smørgrav [Wed, 25 Jan 2023 15:54:52 +0000 (16:54 +0100)]
zoneinfo: On amd64, include 32-bit data.

While there, drop the unnecessary posixrules option.

Sponsored by: Klara, Inc.
Reviewed by: imp, allanjude
Differential Revision: https://reviews.freebsd.org/D38142

17 months agostand/uboot: Remove -fPIC here
Warner Losh [Wed, 25 Jan 2023 15:03:08 +0000 (08:03 -0700)]
stand/uboot: Remove -fPIC here

When needed, -fPIC is added in defs.mk. While not in main, mips on
stable/13 can't tolerate it. Remove it here.

MFC After: now (it's a build issue)
Sponsored by: Netflix

17 months agostand: Add testing for i386 as well to full-test.sh
Warner Losh [Wed, 25 Jan 2023 15:02:08 +0000 (08:02 -0700)]
stand: Add testing for i386 as well to full-test.sh

Sponsored by: Netflix

17 months agopytest: add an example test fetching test directory and ATF vars.
Alexander V. Chernikov [Wed, 25 Jan 2023 13:55:33 +0000 (13:55 +0000)]
pytest: add an example test fetching test directory and ATF vars.

MFC after: 2 weeks

17 months agostrfmon(3): Match the return type
Jose Luis Duran [Tue, 8 Nov 2022 20:16:49 +0000 (17:16 -0300)]
strfmon(3): Match the return type

Reviewed by: kib
MFC after: 1 week

17 months agostrfmon(3): Wording improvements
Jose Luis Duran [Tue, 8 Nov 2022 20:53:17 +0000 (17:53 -0300)]
strfmon(3): Wording improvements

Use the same terminology as the other `_l` xlocale(3) functions.

Reviewed by: kib
MFC after: 1 week

17 months agostrfmon(3): Add an EXAMPLES section
Jose Luis Duran [Tue, 8 Nov 2022 20:36:57 +0000 (17:36 -0300)]
strfmon(3): Add an EXAMPLES section

Reviewed by: kib
MFC after: 1 week

17 months agopci_vendors: update to 2023-01-18
Baptiste Daroussin [Wed, 25 Jan 2023 08:58:39 +0000 (09:58 +0100)]
pci_vendors: update to 2023-01-18

17 months agoarm64: Move device scmi to std.arm
Emmanuel Vadot [Wed, 25 Jan 2023 07:28:22 +0000 (08:28 +0100)]
arm64: Move device scmi to std.arm

The scmi driver in its current form requires the arm_doorbell
driver to communicate with the firmware.
The arm_doorbell is only found in ARM Juno reference board (and
apparently on Morello too).
If we want to use scmi on other platform (like some rockchip or imx
soc), the driver needs to be updated to support svc/shmem communication
with the firmware.
For now since it can be only used with arm_doorbell move the device to
std.arm otherwise kernel configs like ALLWINNER or ROCKCHIP fails to build.

Reviewed by: br, imp
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37953

17 months agolibc: Update mktime(3) / timegm(3) tests.
Dag-Erling Smørgrav [Wed, 25 Jan 2023 06:21:23 +0000 (07:21 +0100)]
libc: Update mktime(3) / timegm(3) tests.

Sponsored by: Klara, Inc.
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D38177

17 months agow: Complete libxo transition.
Dag-Erling Smørgrav [Wed, 25 Jan 2023 06:21:13 +0000 (07:21 +0100)]
w: Complete libxo transition.

MFC after: 1 week
Sponsred by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38172

17 months agoImport zstd 1.5.2
Allan Jude [Wed, 25 Jan 2023 01:20:16 +0000 (01:20 +0000)]
Import zstd 1.5.2

17 months agolibcxx: add comment explaining why umtx is only used for 64bits
Konstantin Belousov [Tue, 24 Jan 2023 15:36:24 +0000 (17:36 +0200)]
libcxx: add comment explaining why umtx is only used for 64bits

Requested by: imp
Reviewed by: arichardson, emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38178

17 months agolibcxx: use __SIZEOF_LONG__ == 8 instead of __LP64__
Konstantin Belousov [Tue, 24 Jan 2023 10:03:45 +0000 (12:03 +0200)]
libcxx: use __SIZEOF_LONG__ == 8 instead of __LP64__

for CHERI.

Requested by: arichardson
Reviewed by: arichardson, emaste, imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38178

17 months agoiflib: Add null check to iflib_stop()
Przemyslaw Lewandowski [Tue, 24 Jan 2023 23:41:15 +0000 (15:41 -0800)]
iflib: Add null check to iflib_stop()

Ever since gtaskqueue_drain() was added to iflib_stop(), a kernel panic
occurs when the ice(4) driver is in recovery mode. Queues are not
initialized in this mode, so gt_taskqueue is not initialized, and
gtaskqueue_drain() will panic.

Fix this by only doing a drain if an RX queue's gt_taskqueue is
initialized.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: erj@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D37892

17 months agoice_ddp: Update package to 1.3.30.0
Eric Joyner [Tue, 24 Jan 2023 22:01:57 +0000 (14:01 -0800)]
ice_ddp: Update package to 1.3.30.0

This updated DDP is intended to be used with the forthcoming ice(4)
driver update to 1.37.7-k. (But it will still work with the current
version.)

Co-authored-by: Piotr Kubaj <pkubaj@FreeBSD.org>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC after: 1 week
Sponsored by: Intel Corporation

17 months agoMechanically convert ixgbe(4) to IfAPI
Justin Hibbits [Sat, 20 Aug 2022 02:02:03 +0000 (22:02 -0400)]
Mechanically convert ixgbe(4) to IfAPI

Reviewed by: erj
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37845

17 months agoMechanically convert dtsec(4) to IfAPI
Justin Hibbits [Wed, 17 Aug 2022 20:13:23 +0000 (16:13 -0400)]
Mechanically convert dtsec(4) to IfAPI

Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37815

17 months agodebugnet: Add ifnet accessor to set debugnet methods
Justin Hibbits [Fri, 13 Jan 2023 16:30:58 +0000 (11:30 -0500)]
debugnet: Add ifnet accessor to set debugnet methods

As part of the effort to hide the internals of the ifnet struct, convert
the DEBUGNET_SET() macro to use an accessor instead of directly touching
the methods member.

Reviewed by: glebius (older version)
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38105

17 months agoifnet/API: Move struct ifnet definition to a <net/if_private.h>
Justin Hibbits [Fri, 13 Jan 2023 15:43:51 +0000 (10:43 -0500)]
ifnet/API: Move struct ifnet definition to a <net/if_private.h>

Hide the ifnet structure definition, no user serviceable parts inside,
it's a netstack implementation detail.  Include it temporarily in
<net/if_var.h> until all drivers are updated to use the accessors
exclusively.

Reviewed by: glebius
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38046

17 months agoifnet API: Change if_init() to take context argument
Justin Hibbits [Thu, 12 Jan 2023 18:33:30 +0000 (13:33 -0500)]
ifnet API: Change if_init() to take context argument

Some drivers, like iflib drivers, take a 'context' argument instead of a
ifnet argument, as a single interface may have multiple contexts.
Follow this scheme by passing the context argument down.  Most drivers
will likely pass 'ifp' as the context.

Reviewed by: glebius
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38102

17 months agoMechanically convert etherswitch drivers to IfAPI
Justin Hibbits [Mon, 30 May 2022 19:40:45 +0000 (14:40 -0500)]
Mechanically convert etherswitch drivers to IfAPI

Reviewed by: kd
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37813

17 months agoMechanically convert iavf(4) to IfAPI
Justin Hibbits [Fri, 19 Aug 2022 15:55:36 +0000 (11:55 -0400)]
Mechanically convert iavf(4) to IfAPI

Reviewed by: erj
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37858

17 months agoMechanically convert ixl(4) to IfAPI
Justin Hibbits [Fri, 19 Aug 2022 15:54:42 +0000 (11:54 -0400)]
Mechanically convert ixl(4) to IfAPI

Reviewed by: erj
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37857

17 months agoMechanically convert neta(4) to IfAPI
Justin Hibbits [Wed, 17 Aug 2022 20:34:32 +0000 (16:34 -0400)]
Mechanically convert neta(4) to IfAPI

Reviewed by: mw
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37825

17 months agoMechanically convert if_cpsw(4) to IfAPI
Justin Hibbits [Fri, 25 Feb 2022 18:00:25 +0000 (12:00 -0600)]
Mechanically convert if_cpsw(4) to IfAPI

Reviewed By: manu
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37789

17 months agoMechanically convert if_vtnet(4) to IfAPI
Justin Hibbits [Tue, 1 Mar 2022 17:02:48 +0000 (11:02 -0600)]
Mechanically convert if_vtnet(4) to IfAPI

Reviewed By: bryanv
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37799

17 months agoMechanically convert if_emac(4) to IfAPI
Justin Hibbits [Fri, 25 Feb 2022 17:58:14 +0000 (11:58 -0600)]
Mechanically convert if_emac(4) to IfAPI

Reviewed by: manu
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37788

17 months agoConvert xl(4) to IfAPI
Justin Hibbits [Tue, 26 Oct 2021 14:43:38 +0000 (09:43 -0500)]
Convert xl(4) to IfAPI

Reviewed by: melifaro
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37785

17 months agolinux 6.2 compat: zpl_set_acl arg2 is now struct dentry
Coleman Kane [Tue, 24 Jan 2023 19:20:50 +0000 (14:20 -0500)]
linux 6.2 compat:  zpl_set_acl arg2 is now struct dentry

Linux 6.2 changes the second argument of the set_acl operation to be a
"struct dentry *" rather than a "struct inode *". The inode* parameter
is still available as dentry->d_inode, so adjust the call to the _impl
function call to dereference and pass that pointer to it.

Also document that the get_acl -> get_inode_acl member name change from
commit 884a693 was an API change also introduced in Linux 6.2.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes #14415

17 months agoIntroduce minimal ZIL block commit delay
Alexander Motin [Tue, 24 Jan 2023 17:20:32 +0000 (12:20 -0500)]
Introduce minimal ZIL block commit delay

Despite all optimizations, tests on actual hardware show that FreeBSD
kernel can't sleep for less then ~2us.  Similar tests on Linux show
~50us delay at least from nanosleep() (haven't tested inside kernel).
It means that on very fast log device ZIL may not be able to satisfy
zfs_commit_timeout_pct block commit timeout, increasing log latency
more than desired.

Handle that by introduction of zil_min_commit_timeout parameter,
specifying minimal timeout value where additional delays to aggregate
writes may be skipped.  Also skip delays if the LWB is more than 7/8
full, that often happens if I/O sizes are constant and match one of
LWB sizes.  Both things are applied only if there were no already
outstanding log blocks, that may indicate single-threaded workload,
that by definition can not benefit from the commit delays.

While there, add short time moving average to zl_last_lwb_latency to
make it more stable.

Tests of single-threaded 4KB writes to NVDIMM SLOG on FreeBSD show IOPS
increase by 9% instead of expected 5%.  For zfs_commit_timeout_pct of
1 there IOPS increase by 5.5% instead of expected 1%.

Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Prakash Surya <prakash.surya@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #14418

17 months agox86 asm: Replace .align with .balign
Attila Fülöp [Mon, 23 Jan 2023 19:25:21 +0000 (20:25 +0100)]
x86 asm: Replace .align with .balign

The .align directive used to align storage locations is
ambiguous. On some platforms and assemblers it takes a byte count,
on others the argument is interpreted as a shift value. The current
usage expects the first interpretation.

Replace it with the unambiguous .balign directive which always
expects a byte count, regardless of platform and assembler.

Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #14422

17 months agoIPC: blake3 x86 asm: fix placement of .size directives
Attila Fülöp [Mon, 23 Jan 2023 18:48:39 +0000 (19:48 +0100)]
IPC: blake3 x86 asm: fix placement of .size directives

The .size directive used by the SET_SIZE C macro uses the special
dot symbol to calculate the size of a function. The dot symbol
refers to the current address, so for the calculation to be
meaningful the SET_SIZE macro must be placed immediately after the
end of the function the size is calculated for.

Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #14422

17 months agoqat: Add Intel® 4xxx Series platform support
Michal Gulbicki [Tue, 24 Jan 2023 14:31:38 +0000 (09:31 -0500)]
qat: Add Intel® 4xxx Series platform support

Overview:
Intel(R) QuickAssist Technology (Intel(R) QAT) provides hardware
acceleration for offloading security, authentication and compression
services from the CPU, thus significantly increasing the performance and
efficiency of standard platform solutions.

This commit introduces:
- Intel® 4xxx Series platform support.
- QuickAssist kernel API implementation update for Generation 4 device.
  Enabled services: symmetric cryptography and data compression.
- Increased default number of crypto instances in static configuration
  for performance purposes.

OCF backend changes:
- changed GCM/CCM MAC validation policy to generate MAC by HW
  and validate by SW due to the QAT HW limitations.

Patch co-authored by: Krzysztof Zdziarski <krzysztofx.zdziarski@intel.com>
Patch co-authored by: Michal Jaraczewski <michalx.jaraczewski@intel.com>
Patch co-authored by: Michal Gulbicki <michalx.gulbicki@intel.com>
Patch co-authored by: Julian Grajkowski <julianx.grajkowski@intel.com>
Patch co-authored by: Piotr Kasierski <piotrx.kasierski@intel.com>
Patch co-authored by: Adam Czupryna <adamx.czupryna@intel.com>
Patch co-authored by: Konrad Zelazny <konradx.zelazny@intel.com>
Patch co-authored by: Katarzyna Rucinska <katarzynax.kargol@intel.com>
Patch co-authored by: Lukasz Kolodzinski <lukaszx.kolodzinski@intel.com>
Patch co-authored by: Zbigniew Jedlinski <zbigniewx.jedlinski@intel.com>

Sponsored by: Intel Corporation
Reviewed by: markj, jhb
Differential Revision: https://reviews.freebsd.org/D36254

17 months agomixer(3): Add HEADNAME to TAILQ_HEAD declarations in man page
Christos Margiolis [Tue, 24 Jan 2023 14:10:49 +0000 (09:10 -0500)]
mixer(3): Add HEADNAME to TAILQ_HEAD declarations in man page

Forgot to modify the man page in commit 249526dace5d6f.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38118

17 months agodtrace: Improve a verifier error message
Domagoj Stolfa [Tue, 24 Jan 2023 14:09:27 +0000 (09:09 -0500)]
dtrace: Improve a verifier error message

Using '%r0' in efunc causes it to parse %r as a 'r' specifier.

This diff just adds a '%' in front of '%r0' in order to create the
correct output.

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38176

17 months agofind: Logic nit in man page.
Dag-Erling Smørgrav [Tue, 24 Jan 2023 08:53:35 +0000 (09:53 +0100)]
find: Logic nit in man page.

Arguments follow primaries, not the other way around.

MFC after: 1 week
Sponsored by: Klara, Inc.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38173

17 months agodtrace: remove stray {
Kristof Provost [Tue, 24 Jan 2023 07:39:37 +0000 (08:39 +0100)]
dtrace: remove stray {

Fixes: da81cc6035f8283b6adda1ef466977e8c1c5389e
PR: 269128

17 months agopfctl: rule.label is a two-dimensional array
Kristof Provost [Tue, 24 Jan 2023 06:46:46 +0000 (07:46 +0100)]
pfctl: rule.label is a two-dimensional array

Fix checking for a non-empty first string.

PR: 269075
MFC after: 1 week
Reported by: nreilly@blackberry.com

17 months agodtrace: conditionally load the systrace_linux klds when loading dtrace.
Andrew Gallatin [Tue, 24 Jan 2023 01:27:17 +0000 (20:27 -0500)]
dtrace: conditionally load the systrace_linux klds when loading dtrace.

When dtrace starts, it tries to detect if the dtrace klds are loaded,
and if not, it loads them by loading the dtraceall kld. This module
depends on most dtrace modules, including systrace for the native
freebsd and freebsd32 ABIs. However, it does not depend on the
systrace_linux klds, as they in turn depend on the linux ABI klds, and
we don't want to load an ABI module that the user has not explicitly
requested. This can leave a naive user in a state where they think all
syscall providers have been loaded, yet linux ABI syscalls are
"invisible" to dtrace.

To fix this, check to see if the linux ABI modules are loaded. If they
are, then load their systrace klds.

Reviewed by: markj, (emaste & jhb, earlier versions)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37986

17 months agolibcxx: Implement atomic::wait/notify using _umtx_op(2) for 64bit arches
Konstantin Belousov [Fri, 20 Jan 2023 02:57:26 +0000 (04:57 +0200)]
libcxx: Implement atomic::wait/notify using _umtx_op(2) for 64bit arches

Only 64bit architectures can be supported this way, because libcxx
defines __cxx_contention_t to be int64_t for FreeBSD, and 32bit arches
do not have a kind of UMTX_OP_WAIT_INT64_PRIVATE operation.

LLVM review: https://reviews.llvm.org/D142134

Tested by: emaste
Reviewed by: dim, emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38132

17 months agoUPDATING: fix typo
Warner Losh [Tue, 24 Jan 2023 00:08:12 +0000 (17:08 -0700)]
UPDATING: fix typo

I'd forgotten to fix this from the review, and a couple of people have
pointed it out after the commit.

Sponsored by: Netflix

17 months agoWait for txg sync if the last DRR_FREEOBJECTS might result in a hole
David Hedberg [Mon, 23 Jan 2023 21:19:43 +0000 (22:19 +0100)]
Wait for txg sync if the last DRR_FREEOBJECTS might result in a hole

If we receive a DRR_FREEOBJECTS as the first entry in an object range,
this might end up producing a hole if the freed objects were the
only existing objects in the block.

If the txg starts syncing before we've processed any following
DRR_OBJECT records, this leads to a possible race where the backing
arc_buf_t gets its psize set to 0 in the arc_write_ready() callback
while still being referenced from a dirty record in the open txg.

To prevent this, we insert a txg_wait_synced call if the first
record in the range was a DRR_FREEOBJECTS that actually
resulted in one or more freed objects.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: David Hedberg <david.hedberg@findity.com>
Sponsored by: Findity AB
Closes #11893
Closes #14358

17 months agoReject streams that set ->drr_payloadlen to unreasonably large values
Richard Yao [Mon, 23 Jan 2023 21:16:22 +0000 (16:16 -0500)]
Reject streams that set ->drr_payloadlen to unreasonably large values

In the zstream code, Coverity reported:

"The argument could be controlled by an attacker, who could invoke the
function with arbitrary values (for example, a very high or negative
buffer size)."

It did not report this in the kernel. This is likely because the
userspace code stored this in an int before passing it into the
allocator, while the kernel code stored it in a uint32_t.

However, this did reveal a potentially real problem. On 32-bit systems
and systems with only 4GB of physical memory or less in general, it is
possible to pass a large enough value that the system will hang. Even
worse, on Linux systems, the kernel memory allocator is not able to
support allocations up to the maximum 4GB allocation size that this
allows.

This had already been limited in userspace to 64MB by
`ZFS_SENDRECV_MAX_NVLIST`, but we need a hard limit in the kernel to
protect systems. After some discussion, we settle on 256MB as a hard
upper limit. Attempting to receive a stream that requires more memory
than that will result in E2BIG being returned to user space.

Reported-by: Coverity (CID-1529836)
Reported-by: Coverity (CID-1529837)
Reported-by: Coverity (CID-1529838)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14285

17 months agoConfigure zed's diagnosis engine with vdev properties
rob-wing [Mon, 23 Jan 2023 21:14:25 +0000 (12:14 -0900)]
Configure zed's diagnosis engine with vdev properties

Introduce four new vdev properties:
    checksum_n
    checksum_t
    io_n
    io_t

These properties can be used for configuring the thresholds of zed's
diagnosis engine and are interpeted as <N> events in T <seconds>.

When this property is set to a non-default value on a top-level vdev,
those thresholds will also apply to its leaf vdevs. This behavior can be
overridden by explicitly setting the property on the leaf vdev.

Note that, these properties do not persist across vdev replacement. For
this reason, it is advisable to set the property on the top-level vdev
instead of the leaf vdev.

The default values for zed's diagnosis engine (10 events, 600 seconds)
remains unchanged.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Signed-off-by: Rob Wing <rob.wing@klarasystems.com>
Sponsored-by: Seagate Technology LLC
Closes #13805