]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 months agopf: remove DIOCGETRULE and DIOCGETSTATUS
Kristof Provost [Tue, 29 Aug 2023 15:17:24 +0000 (17:17 +0200)]
pf: remove DIOCGETRULE and DIOCGETSTATUS

These calls have nvlist variants that completely supersede them.
Remove the old code.

Reviewed by: mjg
MFC after: never
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41651

10 months agosnmp_pf: use libpfctl's pfctl_get_status() rather than DIOCGETSTATUS
Kristof Provost [Tue, 29 Aug 2023 15:16:19 +0000 (17:16 +0200)]
snmp_pf: use libpfctl's pfctl_get_status() rather than DIOCGETSTATUS

Prefer libpfctl functions over direct access to the ioctl whenever
possible. This will allow subsequent removal of DIOCGETSTATUS (in 15) as
there already is an nvlist-based alternative.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41650

10 months agolibpfctl: implement status counter accessor functions
Kristof Provost [Tue, 29 Aug 2023 15:04:17 +0000 (17:04 +0200)]
libpfctl: implement status counter accessor functions

The new nvlist-based status call allows us to easily add new counters.
However, the libpfctl interface defines a TAILQ, so it's not quite
trivial to find the counter consumers are interested in.

Provide convenience functions to access the counters.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41649

10 months agolibpfctl: allow pfctl_free_status(NULL)
Kristof Provost [Tue, 29 Aug 2023 15:02:34 +0000 (17:02 +0200)]
libpfctl: allow pfctl_free_status(NULL)

Mimic free() and friends, and allow free()ing of NULL.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41648

10 months agopf (t)ftp-proxy: use libpfctl instead of DIOCGETSTATUS
Kristof Provost [Tue, 29 Aug 2023 15:00:44 +0000 (17:00 +0200)]
pf (t)ftp-proxy: use libpfctl instead of DIOCGETSTATUS

Prefer libpfctl functions over direct access to the ioctl whenever
possible. This will allow subsequent removal of DIOCGETSTATUS (in 15) as
there already is an nvlist-based alternative.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41647

10 months agovmxnet3: do restart on VLAN changes
Kristof Provost [Thu, 31 Aug 2023 07:32:54 +0000 (09:32 +0200)]
vmxnet3: do restart on VLAN changes

At least one user reports issues with vmx interfaces after 725e4008ef,
where we default to not resetting the interface on VLAN changes. This
was on an ESXi 7.0.3 setup.

Reported by: Marcos Mendoza <mmendoza@netgate.com>
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

10 months agonss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent().
Dag-Erling Smørgrav [Thu, 31 Aug 2023 07:49:41 +0000 (07:49 +0000)]
nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent().

These aren't really needed, since TACACS+ does not support enumeration, but providing placeholders keeps nsdispatch() from complaining that they're missing.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D41658

10 months agounbreak BEGEMOT-LM75-MIB.txt
Eugene Grosbein [Thu, 31 Aug 2023 02:47:57 +0000 (09:47 +0700)]
unbreak BEGEMOT-LM75-MIB.txt

The MIB has several bugs making it unusable. Fix it.

Reported-by: Eugene M. Zheganin <eugene@zhegan.in>
MFC-after: 2 weeks

10 months agoice_ddp: Update to 1.3.35.0
Eric Joyner [Tue, 22 Aug 2023 04:55:34 +0000 (21:55 -0700)]
ice_ddp: Update to 1.3.35.0

This is intended to be used with the upcoming updated ice(4) version
1.38.16-k.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC after: 3 days
Sponsored by: Intel Corporation

10 months agoAdd sys.dirdeps.mk to share/mk FILES
Simon J. Gerraty [Wed, 30 Aug 2023 14:46:08 +0000 (07:46 -0700)]
Add sys.dirdeps.mk to share/mk FILES

A few recent makefiles should have been added to FILES.
Rename sys.machine.mk to local.sys.machine.mk as it is very
tree specific so does not belong in /usr/share/mk/

Reviewed by: stevek
Differential Revision: https://reviews.freebsd.org/D41642

10 months agonet: Remove vlan metadata on pcp / vlan encapsulation
Zhenlei Huang [Wed, 30 Aug 2023 09:36:38 +0000 (17:36 +0800)]
net: Remove vlan metadata on pcp / vlan encapsulation

For oubound traffic, the flag M_VLANTAG is set in mbuf packet header to
indicate the underlaying interface do hardware VLAN tag insertion if
capable, otherwise the net stack will do 802.1Q encapsulation instead.

Commit 868aabb4708d introduced per-flow priority which set the priority ID
in the mbuf packet header. There's a corner case that when the driver is
disabled to do hardware VLAN tag insertion, and the net stack do 802.1Q
encapsulation, then it will result double tagged packets if the driver do
not check the enabled capability (hardware VLAN tag insertion).

Unfortunately some drivers, currently known cxgbe(4) re(4) ure(4) igc(4)
and vmx(4), have this issue. From a quick review for other interface
drivers I believe a lot more drivers have the same issue. It makes more
sense to fix in net stack than to try to change every single driver.

PR: 270736
Reviewed by: kp
Fixes: 868aabb4708d Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39499

10 months agoigmp: do not upgrade IGMP version beyond net.inet.igmp.default_version
Kristof Provost [Tue, 29 Aug 2023 09:23:49 +0000 (11:23 +0200)]
igmp: do not upgrade IGMP version beyond net.inet.igmp.default_version

IGMP requires hosts to use the lowest version they've seen on the
network. When the IGMP timers expire we take the opportunity to upgrade again.
However, we did not take the net.inet.igmp.default_version sysctl
setting into account, so we could end up switching to IGMPv3 even if the
user had requested IGMPv2 or IGMPv1 via the sysctl.

Check V_igmp_default_version before we upgrade the IGMP version.

Reviewed by: adrian
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41628

10 months agolibcrypto: Switch back to the generated assembly in sys/crypto/openssl
John Baldwin [Tue, 29 Aug 2023 21:46:44 +0000 (14:46 -0700)]
libcrypto: Switch back to the generated assembly in sys/crypto/openssl

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

10 months agoossl: Update the generated assembly files from OpenSSL 3.0.
John Baldwin [Tue, 29 Aug 2023 21:44:15 +0000 (14:44 -0700)]
ossl: Update the generated assembly files from OpenSSL 3.0.

Tested with: cryptocheck -d ossl0 -a all -z on amd64
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41568

10 months agolibcrypto: Add buildasm and cleanasm targets
John Baldwin [Tue, 29 Aug 2023 21:39:54 +0000 (14:39 -0700)]
libcrypto: Add buildasm and cleanasm targets

These targets generate all the assembly files in sys/crypto/openssl.

Reviewed by: markj, emaste (earlier version)
Differential Revision: https://reviews.freebsd.org/D41590

10 months agolibcrypto: Refactor Makefile.asm so it can be run outside of buildenv
John Baldwin [Tue, 29 Aug 2023 21:39:36 +0000 (14:39 -0700)]
libcrypto: Refactor Makefile.asm so it can be run outside of buildenv

Currently Makefile.asm relies on the current buildenv to set CFLAGS
for i386.  The current approach also leaves various temporary *.s
files around in the current directory.  To make this a bit better:

- Instead of using CFLAGS from buildenv for i386, define the actual
  flags the perl scripts need: -DOPENSSL_IA32_SSE2 to enable SSE2.

- Change i386 to have the perl scripts write to /dev/stdout to avoid
  creating temporaries.  Previously i386 was generating the temporary
  files in the OpenSSL contrib src.

- Cleanup temporary *.s files in the all target after generating the
  real *.S files for architectures which need them.

- Remove a duplicate rule for aes-armv4.S.

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

10 months agoMakefile.asm: Simplify variable expansions in generated headers
John Baldwin [Tue, 29 Aug 2023 21:38:27 +0000 (14:38 -0700)]
Makefile.asm: Simplify variable expansions in generated headers

The :R:S expressions removed the .pl extension only to add it back
again, so just trim them to using :T alone.

Reviewed by: Pierre Pronchery <pierre@freebsdfoundation.org>, markj, emaste
Differential Revision: https://reviews.freebsd.org/D41588

10 months agoOpenSSL: Fix handling of the "0:" label in arm-xlate.pl
Tom Cosgrove [Tue, 29 Aug 2023 21:38:11 +0000 (14:38 -0700)]
OpenSSL: Fix handling of the "0:" label in arm-xlate.pl

When $label == "0", $label is not truthy, so `if ($label)` thinks there isn't
a label. Correct this by looking at the result of the s/// command.

Verified that there are no changes in the .S files created during a normal
build, and that the "0:" labels appear in the translation given in the error
report (and they are the only difference in the before and after output).

Obtained from: OpenSSL commit 9607f5ccf285ac9988a86f95c5ad9f92b556a843

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

10 months agoreleng-gce: Add ZFS support to GCE image buliding and uploading
Li-Wen Hsu [Tue, 29 Aug 2023 17:41:43 +0000 (01:41 +0800)]
releng-gce: Add ZFS support to GCE image buliding and uploading

Approved by: delphij (re), gjb (re)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41527

10 months agoreleng-azure: Add ZFS support to Azure image buliding and uploading
Li-Wen Hsu [Tue, 29 Aug 2023 17:40:39 +0000 (01:40 +0800)]
releng-azure: Add ZFS support to Azure image buliding and uploading

Approved by: gjb (re)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41454

10 months agoreleng-azure: Use port name to install Azure CLI
Li-Wen Hsu [Tue, 29 Aug 2023 17:39:11 +0000 (01:39 +0800)]
releng-azure: Use port name to install Azure CLI

To overcome package name changing on default Python version updates.

Approved by: gjb (re)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41453

10 months agox86: Introduce APIC ID limit by default on AMD hardware
Ed Maste [Fri, 18 Aug 2023 03:39:08 +0000 (23:39 -0400)]
x86: Introduce APIC ID limit by default on AMD hardware

Lack of an AMD IOMMU driver means we cannot successfully route
interrupts to APIC IDs 255 and over.  Do not add the corresponding CPUs
to the per-domain lists of CPUs to which interrupts can be assigned.

This change should be reverted (or, at least the APIC ID limit) once we
have an AMD IOMMU / interrupt remapping driver.

See also commits fa5f94140a83 ("msi: handle error from BUS_REMAP_INTR in
msi_assign_cpu") and 4258eb5a0d97 ("x86: handle domains with no CPUs
usable for intr delivery.").

Reviewed by: markj, jhb
Tested by: cperciva (earlier version)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41618

10 months agoiostat: getopt() / usage() cleanup.
Dag-Erling Smørgrav [Tue, 29 Aug 2023 17:23:23 +0000 (17:23 +0000)]
iostat: getopt() / usage() cleanup.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D41636

10 months agowmistat: don't restrict reading to the pid that opened the fd.
Dag-Erling Smørgrav [Tue, 29 Aug 2023 17:23:16 +0000 (17:23 +0000)]
wmistat: don't restrict reading to the pid that opened the fd.

PR: 273405
MFC after: 1 week
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D41621

10 months agopf: Remove DIOCCLRSTATES and DIOCKILLSTATES
Kristof Provost [Mon, 28 Aug 2023 13:30:50 +0000 (15:30 +0200)]
pf: Remove DIOCCLRSTATES and DIOCKILLSTATES

These now have nvlist based alternatives, so remove them.

Reviewed by: mjg, Pau Amma <pauamma@gundo.com> (man page)
MFC after: never
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30056

10 months agoaesni: Push FPU sections down further
Mark Johnston [Tue, 29 Aug 2023 01:26:53 +0000 (21:26 -0400)]
aesni: Push FPU sections down further

After commit 937b4473be21 aesni_cipher_crypt() and aesni_cipher_mac()
execute in a FPU_KERN_NOCTX section, which means that they must run with
preemption disabled.  These functions handle discontiguous I/O buffers
by allocating a contiguous buffer and copying as necessary, but this
allocation cannot happen with preemption disabled.  Fix the problem by
pushing the FPU section down into aesni_cipher_crypt() and
aesni_cipher_mac().  In particular, encrypt-then-auth transforms need
not be handled with a single FPU section.

Reported by: syzbot+78258dbb02eb92157357@syzkaller.appspotmail.com
Discussed with: jhb
Fixes: 937b4473be21 ("aesni: Switch to using FPU_KERN_NOCTX.")

10 months agolibc: Fix fixed-width case in the new integer parser.
Dag-Erling Smørgrav [Mon, 28 Aug 2023 23:38:09 +0000 (23:38 +0000)]
libc: Fix fixed-width case in the new integer parser.

Fixes: d9dc1603d6e4
Differential Revision: https://reviews.freebsd.org/D41622

10 months agospibus: Make ofw_spibus probe just a little more favored
Justin Hibbits [Mon, 28 Aug 2023 23:27:11 +0000 (19:27 -0400)]
spibus: Make ofw_spibus probe just a little more favored

With ade70a1ad(svn r332196) ofw_spibus probes at the BUS_PROBE_DEFAULT
instead of 0.  However, this races with spibus, resulting in ofw_spibus
often times losing the race and the OFW node not being referenced.  This
in turn causes child device tree nodes to not be attached.  Solve this
by returning 1 higher than spibus, just like acpi_spibus.

Sponsored by: Juniper Networks, Inc.
MFC after: 1 week

10 months agoblake2: Remove dieing flag and rw lock
John Baldwin [Mon, 28 Aug 2023 23:24:42 +0000 (16:24 -0700)]
blake2: Remove dieing flag and rw lock

crypto_unregister_all already disables new sessions and waits for
existing sessions to be destroyed before returning.

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

10 months agoblake2: Switch to using FPU_KERN_NOCTX
John Baldwin [Mon, 28 Aug 2023 23:24:32 +0000 (16:24 -0700)]
blake2: Switch to using FPU_KERN_NOCTX

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

10 months agoarmv8_crypto: Remove dieing flag and rw lock
John Baldwin [Mon, 28 Aug 2023 23:23:43 +0000 (16:23 -0700)]
armv8_crypto: Remove dieing flag and rw lock

crypto_unregister_all already disables new sessions and waits for
existing sessions to be destroyed before returning.

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

10 months agoarmv8_crypto: Switch to using FPU_KERN_NOCTX
John Baldwin [Mon, 28 Aug 2023 23:22:33 +0000 (16:22 -0700)]
armv8_crypto: Switch to using FPU_KERN_NOCTX

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

10 months agoaesni: Switch to using FPU_KERN_NOCTX.
John Baldwin [Mon, 28 Aug 2023 23:22:15 +0000 (16:22 -0700)]
aesni: Switch to using FPU_KERN_NOCTX.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D41577

10 months agoefirt_machdep.c: Trim some unused includes
John Baldwin [Mon, 28 Aug 2023 23:22:03 +0000 (16:22 -0700)]
efirt_machdep.c: Trim some unused includes

Reviewed by: imp, kib, markj
Differential Revision: https://reviews.freebsd.org/D41596

10 months agolibrt: Hoist SHLIBDIR?= so it actually works
Jessica Clarke [Mon, 28 Aug 2023 19:27:50 +0000 (20:27 +0100)]
librt: Hoist SHLIBDIR?= so it actually works

src.opts.mk includes bsd.own.mk, which sets SHLIBDIR, so having this
line after it does nothing. Hoist it like other libraries so it takes
effect.

Reported by: vishwin
Fixes: 2964804ef95c ("librt: unbreak LIB32 build")

10 months agojail: make jail(8) man page more readable and more correct
Jamie Gritton [Mon, 28 Aug 2023 18:22:36 +0000 (11:22 -0700)]
jail: make jail(8) man page more readable and more correct

The synopsis section of jail(8) is fine at showing everything that could
be on the command line, but doesn't make much sense. Add some sub-
ections for the different uses of the command.

Also fix up the paragraph about command-line parameter specification,
including removing some clearly erroneous information.

Reviewed by: dvl
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41606

10 months agoRevert "libc/locale tests: temporarily skip lib.libc.locale.c16rtomb_test.c16rtomb_ut...
Li-Wen Hsu [Mon, 28 Aug 2023 17:18:42 +0000 (01:18 +0800)]
Revert "libc/locale tests: temporarily skip lib.libc.locale.c16rtomb_test.c16rtomb_utf_8_test"

This reverts commit b80572fe3b3a93e0490c90901c7e5336f0210303.

This has been fixed in e2030ca246a777c50a7aacb3a35f88addded21cf.

PR: 265871

10 months agolibc: Document support for binary integers.
Dag-Erling Smørgrav [Mon, 28 Aug 2023 15:34:17 +0000 (15:34 +0000)]
libc: Document support for binary integers.

Reviewed by: debdrup, emaste
Differential Revision: https://reviews.freebsd.org/D41522

10 months agolibc: Add unit tests for N2630 and possible collateral damage.
Dag-Erling Smørgrav [Mon, 28 Aug 2023 15:34:05 +0000 (15:34 +0000)]
libc: Add unit tests for N2630 and possible collateral damage.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41512

10 months agolibc: Implement N2630.
Dag-Erling Smørgrav [Mon, 28 Aug 2023 15:32:23 +0000 (15:32 +0000)]
libc: Implement N2630.

This adds formatted input/output of binary integer numbers to the printf(), scanf(), and strtol() families, including their wide-character counterparts.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41511

10 months agolibrt: unbreak LIB32 build
Dag-Erling Smørgrav [Mon, 28 Aug 2023 15:11:32 +0000 (15:11 +0000)]
librt: unbreak LIB32 build

Fixes: f006023b2281
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41616

10 months agogeli tests: Add a regression test for geli setkey -J
Mark Johnston [Mon, 28 Aug 2023 14:58:43 +0000 (10:58 -0400)]
geli tests: Add a regression test for geli setkey -J

Make sure that it can be used to change the passphrase of both attached
and detached providers.

PR: 254966
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

10 months agogeli: Fix geli setkey -J for detached providers
Arjan de Vet [Mon, 28 Aug 2023 14:54:18 +0000 (10:54 -0400)]
geli: Fix geli setkey -J for detached providers

Clear cached_passphrase before generating a new key, otherwise the
operation nonsensically tries to reuse the old passphrase.

PR: 254966
Pull Request: https://github.com/freebsd/freebsd-src/pull/780
MFC after: 1 week

10 months agolibrt: Chase 315ee00fa961, fixing boot
Cy Schubert [Mon, 28 Aug 2023 03:02:17 +0000 (20:02 -0700)]
librt: Chase 315ee00fa961, fixing boot

libzfs uses librt as a dependency. Following 315ee00fa961 systems with
a separate / and /usr will fail to load the libzfs.so library because
librt.so is not available due to the fact that /usr is not mounted yet.
Install librt in /lib making it available to libzfs.

Reported by: emaste, imp
Fixes: 315ee00fa961
Differential Revision: https://reviews.freebsd.org/D41612

10 months agonetcat: add --crlf to convert LF into CRLF
Pietro Cerutti [Thu, 17 Aug 2023 11:42:23 +0000 (11:42 +0000)]
netcat: add --crlf to convert LF into CRLF

This adds the --crlf option to netcat, which triggers translation of \n
characters into \r\n sequences in the input -> network direction.
The Linux version of nc also supports this functionality with --crlf and
-C. The OpenBSD version uses -C to specify client certificates. Our
version is too old and doesn't have it, but I avoided adding -C anyway
to ease future syncs with upstream.

Attempts to upstream the feature were unsuccessful:
https://marc.info/?t=169282068500001

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

10 months agomana: batch ringing RX queue doorbell on receiving packets
Wei Hu [Mon, 28 Aug 2023 09:15:16 +0000 (09:15 +0000)]
mana: batch ringing RX queue doorbell on receiving packets

It's inefficient to ring the doorbell page every time a WQE is posted to
the received queue. Excessive MMIO writes result in CPU spending more
time waiting on LOCK instructions (atomic operations), resulting in
poor scaling performance.

Move the code for ringing doorbell page to where after we have posted all
WQEs to the receive queue in mana_poll_rx_cq().

In addition, use the correct WQE count for ringing RQ doorbell.
The hardware specification specifies that WQE_COUNT should set to 0 for
the Receive Queue. Although currently the hardware doesn't enforce the
check, in the future releases it may check on this value.

Tested by: whu
MFC after: 1 week
Sponsored by: Microsoft

10 months agozfs: merge openzfs/zfs@804414aad
Martin Matuska [Sat, 26 Aug 2023 21:20:04 +0000 (23:20 +0200)]
zfs: merge openzfs/zfs@804414aad

Notable upstream pull request merges:
  #15024 Add missed DMU_PROJECTUSED_OBJECT prefetch
  #15029 Do not request data L1 buffers on scan prefetch
  #15036 FreeBSD: catch up to __FreeBSD_version 1400093
  #15039 Fix raw receive with different indirect block size
  #15047 FreeBSD: Fix build on stable/13 after 1302506
  #15049 Fix the ZFS checksum error histograms with larger record sizes
  #15052 Reduce bloat in ereport.fs.zfs.checksum events
  #15056 Avoid extra snprintf() in dsl_deadlist_merge()
  #15061 Ignore pool ashift property during vdev attachment
  #15063 Don't panic if setting vdev properties is unsupported for this vdev type
  #15067 spa_min_alloc should be GCD, not min
  #15071 Add explicit prefetches to bpobj_iterate()
  #15072 Adjust prefetch parameters
  #15076 Refactor dmu_prefetch()
  #15079 set autotrim default to 'off' everywhere
  #15080 ZIL: Fix config lock deadlock
  #15088 metaslab: tuneable to better control force ganging
  #15096 Avoid waiting in dmu_sync_late_arrival()
  #15097 BRT should return EOPNOTSUPP
  #15103 Remove zl_issuer_lock from zil_suspend()
  #15107 Remove fastwrite mechanism
  #15113 libzfs: sendrecv: send_progress_thread: handle SIGINFO/SIGUSR1
  #15122 ZIL: Second attempt to reduce scope of zl_issuer_lock
  #15129 zpool_vdev_remove() should handle EALREADY error return
  #15132 ZIL: Replay blocks without next block pointer
  #15148 zfs_clone_range should return descriptive error codes
  #15153 ZIL: Avoid dbuf_read() before dmu_sync()
  #15172 copy_file_range: fix fallback when source create on same txg
  #15180 Update outdated assertion from zio_write_compress

Obtained from: OpenZFS
OpenZFS commit: 804414aad224b432590afe3f9ec114ffb49e0f13

10 months agokqueue(9): sweep references to knlist_remove_inevent()
Robert Wing [Sat, 26 Aug 2023 19:11:50 +0000 (11:11 -0800)]
kqueue(9): sweep references to knlist_remove_inevent()

knlist_remove_inevent() gone in 9e590ff04b687e910579a5851d95cedf9eb10bfd

10 months agodtsec: Support multicast receive.
Justin Hibbits [Fri, 25 Aug 2023 15:36:35 +0000 (11:36 -0400)]
dtsec: Support multicast receive.

Implemented based on the tsec(4) multicast support.  This is the minimum
required to support VLANs.  The hardware does support vlan tagging,
among other acceleration features, which will be added at a later time.

MFC after: 2 weeks

10 months agoFix MNT_IGNORE for devfs, fdescfs and nullfs
Doug Rabson [Sat, 26 Aug 2023 09:32:32 +0000 (10:32 +0100)]
Fix MNT_IGNORE for devfs, fdescfs and nullfs

The MNT_IGNORE flag can be used to mark certain filesystem mounts so
that utilities such as df(1) and mount(8) can filter out those mounts by
default. This can be used, for instance, to reduce the noise from
running container workloads inside jails which often have at least three
and sometimes as many as ten mounts per container.

The flag is supplied by the nmount(2) system call and is recorded so
that it can be reported by statfs(2). Unfortunately several filesystems
override the default behaviour and mask out the flag, defeating its
purpose. This change preserves the MNT_IGNORE flag for those filesystems
so that it can be reported correctly.

MFC after: 1 week

10 months agocaroot: regenerate the root bundle with OpenSSL 3
Kyle Evans [Sat, 26 Aug 2023 01:15:39 +0000 (20:15 -0500)]
caroot: regenerate the root bundle with OpenSSL 3

No functional change intended.

10 months agocaroot: update the root bundle
Kyle Evans [Sat, 26 Aug 2023 01:01:47 +0000 (20:01 -0500)]
caroot: update the root bundle

Summary:
- Six (6) new roots
- Four (4) distrusted roots

Note that this was intentionally generated with OpenSSL 1.1.1 to avoid
mixing updates and non-functional changes -- there will be some churn
with OpenSSL 3.  The next commit will update the current batch of
trusted certs with the format OpenSSL 3 produces, which I've tested
against OpenSSL 1.1.1 to be sure that that doesn't hurt us in older
branches.

10 months agocaroot: drop the VERSION tag from already-processed certs
Kyle Evans [Sat, 26 Aug 2023 00:55:32 +0000 (19:55 -0500)]
caroot: drop the VERSION tag from already-processed certs

An update is imminent; drop these now to make it easier to audit the
results.

10 months agocaroot: drop VERSION tags from certs
Kyle Evans [Sat, 26 Aug 2023 00:55:32 +0000 (19:55 -0500)]
caroot: drop VERSION tags from certs

With this change, we'll drop the "with $FreeBSD$" lines from trusted/
certs in the next update. untrusted/ will need to be done manually, but
I'll likely just do them all manually, commit, then run the script and
commit any legitimate updates after confirming the output matches what
I did manually.

Reported by: imp
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41597

10 months agoOptionalObsoleteFiles.inc: Add libprivate{cbor,fido2}_p.a
John Baldwin [Fri, 25 Aug 2023 23:22:01 +0000 (16:22 -0700)]
OptionalObsoleteFiles.inc: Add libprivate{cbor,fido2}_p.a

Two more profile libraries that should be removed by WITHOUT_PROFILE.
Found when upgrading a stable/13 VM to stable/14.

10 months agoTwo more $FreeBSD$ stragglers
Warner Losh [Fri, 25 Aug 2023 21:14:19 +0000 (15:14 -0600)]
Two more $FreeBSD$ stragglers

10 months agopccarddevs2h.awk: Remove
Warner Losh [Fri, 25 Aug 2023 21:02:34 +0000 (15:02 -0600)]
pccarddevs2h.awk: Remove

pccard support was removed in 31b35400cf77on Dec 14, 2021, but this
wasn't.  Belatedly remove it.

MFC After: 1 week
Sponsored by: Netflix

10 months agodtrace: Remove $FreeBSD$ from genmakefiles.sh.
Domagoj Stolfa [Fri, 25 Aug 2023 20:53:51 +0000 (14:53 -0600)]
dtrace: Remove $FreeBSD$ from genmakefiles.sh.

$FreeBSD$ is gone in head, so this should be removed as well.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41595

10 months agoclk_fixed: reduce and clarify messages due to missing clk-frequency
Mike Karels [Fri, 25 Aug 2023 20:11:46 +0000 (15:11 -0500)]
clk_fixed: reduce and clarify messages due to missing clk-frequency

The current dts for Raspberry 3B+ and 4B have 2 disabled fixed-clock
nodes which have no clock-frequency value.  Such nodes are non-standard.
This results in about 150 messages during autoconfiguration:

    clk_fixed2: <Fixed clock> disabled on ofwbus0
    clk_fixed2: Cannot FDT parameters.
    device_attach: clk_fixed2 attach returned 6

Defensively check for clock-frequency in the probe routine, and if
none, return an error with a more direct error message (1 line per
occurrence, 50 lines total):

    clk_fixed2: clock-fixed has no clock-frequency

Based on a patch by manu.

MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41594

10 months agonehemiah RNG: Switch to using FPU_KERN_NOCTX
John Baldwin [Fri, 25 Aug 2023 19:34:16 +0000 (12:34 -0700)]
nehemiah RNG: Switch to using FPU_KERN_NOCTX

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D41583

10 months agopadlock: Switch to using FPU_KERN_NOCTX
John Baldwin [Fri, 25 Aug 2023 19:34:05 +0000 (12:34 -0700)]
padlock: Switch to using FPU_KERN_NOCTX

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D41582

10 months agoefirt: Move comment about fpu_kern_enter to where it is called
John Baldwin [Fri, 25 Aug 2023 19:33:00 +0000 (12:33 -0700)]
efirt: Move comment about fpu_kern_enter to where it is called

Reviewed by: imp, kib, andrew, markj
Differential Revision: https://reviews.freebsd.org/D41576

10 months agolib/libc/amd64/string/strchrnul.S: fix edge case in scalar code
Robert Clausecker [Fri, 25 Aug 2023 16:22:22 +0000 (16:22 +0000)]
lib/libc/amd64/string/strchrnul.S: fix edge case in scalar code

When the buffer is immediately preceeded by the character we
are looking for and begins with one higher than that character,
and the buffer is misaligned, a match was errorneously detected
in the first character.  Fix this by changing the way we prevent
matches before the buffer from being detected: instead of
removing the corresponding bit from the 0x80..80 mask, set the
LSB of bytes before the buffer after xoring with the character we
look for.

The bug only affects amd64 with ARCHLEVEL=scalar (cf. simd(7)).
The change comes at a 2% performance impact for short strings
if ARCHLEVEL is set to scalar.  The default configuration is not
affected.

os: FreeBSD
arch: amd64
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
        │ strchrnul.scalar.0.out │       strchrnul.scalar.2.out       │
        │         sec/op         │   sec/op     vs base               │
Short                57.89µ ± 2%   59.08µ ± 1%  +2.07% (p=0.030 n=20)
Mid                  19.24µ ± 0%   19.73µ ± 0%  +2.53% (p=0.000 n=20)
Long                 11.03µ ± 0%   11.03µ ± 0%       ~ (p=0.547 n=20)
geomean              23.07µ        23.43µ       +1.53%

        │ strchrnul.scalar.0.out │       strchrnul.scalar.2.out        │
        │          B/s           │     B/s       vs base               │
Short               2.011Gi ± 2%   1.970Gi ± 1%  -2.02% (p=0.030 n=20)
Mid                 6.049Gi ± 0%   5.900Gi ± 0%  -2.47% (p=0.000 n=20)
Long                10.56Gi ± 0%   10.56Gi ± 0%       ~ (p=0.547 n=20)
geomean             5.045Gi        4.969Gi       -1.50%

MFC to: stable/14
MFC after: 3 days
Approved by: mjg (blanket, via IRC)
Sponsored by: The FreeBSD Foundation

10 months agoarm unwind: Reject unaligned stack pointers
John Baldwin [Fri, 25 Aug 2023 19:00:37 +0000 (12:00 -0700)]
arm unwind: Reject unaligned stack pointers

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D41533

10 months agoifconfig: fix 'ifconfig -l link'
Gleb Smirnoff [Fri, 25 Aug 2023 17:31:55 +0000 (10:31 -0700)]
ifconfig: fix 'ifconfig -l link'

The rtnetlink(4) RTM_GETADDR does not list link level addresses, thus
the correct match for interfaces that have a link level address should
be based on what was returned by RTM_GETLINK.

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D41586

10 months agotests/block_cloning: rename and document get_same_blocks helper
Rob N [Fri, 25 Aug 2023 17:31:29 +0000 (03:31 +1000)]
tests/block_cloning: rename and document get_same_blocks helper

`get_same_blocks` is a helper to compare two files and return a list of
the blocks that are clones of each other. Its very necessary for block
cloning tests.

Previously it was incorrectly called `unique_blocks`, which is the
_inverse_ of what it does (an early version did list unique blocks; it
was changed but the name was not). So if nothing else, it should be
called `duplicate_blocks`.

But, keeping the details of a clone operation in your head is actually
quite difficult, without the additional overhead of wondering how the
tools work. So I've renamed it to better describe what it does, added a
usage note, and changed it to return block indexes from 0 instead of 1,
to match how L0 blocks are normally counted.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Reviewed-by: Kay Pedersen <mail@mkwg.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #15181

10 months agoifconfig: fix 'ifconfig -l ether'
Gleb Smirnoff [Fri, 25 Aug 2023 17:31:26 +0000 (10:31 -0700)]
ifconfig: fix 'ifconfig -l ether'

When matching interfaces for being Ethernet, use same trick that
the link module does - pass if_type through convert_iftype().
That restores historicaly behaviour of listing lagg(4) ports.

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D41585

10 months agoifconfig: fix logical error in interface matching for '-l ether'
Gleb Smirnoff [Fri, 25 Aug 2023 17:30:25 +0000 (10:30 -0700)]
ifconfig: fix logical error in interface matching for '-l ether'

This affects only ifconfig(8) compiled WITHOUT_NETLINK_SUPPORT, which
is not the default.

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D41584
Fixes: d1cd0344f7b7d81beda04c3cb8cfee99351c3eb8

10 months agoUpdate outdated assertion from zio_write_compress
Serapheim Dimitropoulos [Fri, 25 Aug 2023 17:28:36 +0000 (10:28 -0700)]
Update outdated assertion from zio_write_compress

As part of some internal gang block testing within Delphix
we hit the assertion removed by this patch. The assertion
was triggered by a ZIO that had two copies and was a gang
block making the following expression equal to 3:
```
MIN(zp->zp_copies + BP_IS_GANG(bp), spa_max_replication(spa))
```
and failing when we expected the above to be equal to
`BP_GET_NDVAS(bp)`.

The assertion is no longer valid since the following commit:
```
commit 14872aaa4f909d72c6b5e4105dadcfa13c7d9d66
Author: Matthew Ahrens <matthew.ahrens@delphix.com>
Date:   Mon Feb 6 09:37:06 2023 -0800

  EIO caused by encryption + recursive gang
```

The above commit changed gang block headers so they can't
have more than 2 copies but the assertion in question from
this PR was never updated.

Reviewed-by: George Wilson <george.wilson@delphix.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #15180

10 months agomac_ipacl: Use IfAPI
Justin Hibbits [Fri, 25 Aug 2023 16:44:17 +0000 (12:44 -0400)]
mac_ipacl: Use IfAPI

Use `if_t` instead of `struct ifnet *`, and if_name() accessor.

Sponsored by: Juniper Networks, Inc.

10 months agoIfAPI: Retire if_etherbpfmtap() and if_bpfmtap()
Justin Hibbits [Fri, 21 Jul 2023 18:16:25 +0000 (14:16 -0400)]
IfAPI: Retire if_etherbpfmtap() and if_bpfmtap()

Summary:
These came in the original DrvAPI commits in 2014, and are obsoleted by
bpf_mtap_if() and ether_bpf_mtap_if().  The `_if` suffix, rather than
prefix, conveys that it's operating on the bpf of the interface, instead
than the interface itself.

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

10 months agonvme: Add exclusion for ISR
Warner Losh [Fri, 25 Aug 2023 16:10:16 +0000 (10:10 -0600)]
nvme: Add exclusion for ISR

Add a basically uncontended spinlock that we take out while the ISR is
running. This has two effects: First, when we get a timeout, we can
safely call the nvme_qpair_process_completions w/o racing any ISRs.
Second, we can use it to ensure that we don't reset the card while
the ISRs are active (right now we just sleep and hope for the best,
which usually is fine, but not always).

Sponsored by: Netflix
MFC After: 2 weeks
Reviewed by: chuck, gallatin
Differential Revision: https://reviews.freebsd.org/D41452

10 months agonvme: Greatly improve error recovery
Warner Losh [Fri, 25 Aug 2023 16:10:08 +0000 (10:10 -0600)]
nvme: Greatly improve error recovery

Next phase of error recovery: Eliminate the REOVERY_START phase, since
we don't need to wait to start recovery. Eliminate the RECOVERY_RESET
phase since it is transient, we now transition from RECOVERY_NORMAL into
RECOVERY_WAITING.

In normal mode, read the status of the controller. If it is in failed
state, or appears to be hot-plugged, jump directly to reset which will
sort out the proper things to do. This will cause all pending I/O to
complete with an abort status before the reset.

When in the NORMAL state, call the interrupt handler. This will complete
all pending transactions when interrupts are broken or temporarily
misbehaving. We then check all the pending completions for timeouts. If
we have abort enabled, then we'll send an abort. Otherwise we'll assume
the controller is wedged and needs a reset. By calling the interrupt
handler here, we'll avoid an issue with the current code where we
transitioned to RECOVERY_START which prevented any completions from
happening. Now completions happen. In addition and follow-on I/O that is
scheduled in the completion routines will be submitted, rather than
queued, because the recovery state is correct. This also fixes a problem
where I/O would timeout, but never complete, leading to hung I/O.

Resetting remains the same as before, just when we chose to reset has
changed.

A nice side effect of these changes is that we now do I/O when
interrupts to the card are totally broken. Followon commits will improve
the error reporting and logging when this happens. Performance will be
aweful, but will at least be minimally functional.

There is a small race when we're checking the completions if interrupts
are working, but this is handled in a future commit.

Sponsored by: Netflix
MFC After: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36922

10 months agonvme: Timeout expired transactions
Warner Losh [Fri, 25 Aug 2023 16:09:50 +0000 (10:09 -0600)]
nvme: Timeout expired transactions

When we went to having a shared timeout routine, failing the timed-out
transaction code was inadvertantly dropped. Reinstate it.

Fixes: 502dc84a8b670
Sponsored by: Netflix
MFC After: 2 weeks
Reviewed by: chuck, jhb
Differential Revision: https://reviews.freebsd.org/D36921

10 months agosmartpqi: Fix build issues highlighted by gcc12
Warner Losh [Fri, 25 Aug 2023 15:45:28 +0000 (09:45 -0600)]
smartpqi: Fix build issues highlighted by gcc12

Make inline functions defined in a header file as static inline.
Mark inline functions used only in the compilation unit they are
defined in as merely static (the compiler can figure out it these
days).

Sponsored by: Netflix

10 months agosctp: cleanup
Michael Tuexen [Fri, 25 Aug 2023 15:31:19 +0000 (17:31 +0200)]
sctp: cleanup

In particular, don't use a socket level flag, use the inp level one.
After adding appropriate locking, this will close a race condition.

MFC after: 1 week

10 months agosctp: cleanup
Michael Tuexen [Fri, 25 Aug 2023 15:23:34 +0000 (17:23 +0200)]
sctp: cleanup

No functional change intended. Just asserting the conditions when
being called.

MFC after: 1 week

10 months agotimerfd: compute fflags before calling falloc
Mateusz Guzik [Fri, 25 Aug 2023 15:09:21 +0000 (15:09 +0000)]
timerfd: compute fflags before calling falloc

While here dodge list locking in timerfd_adjust if empty.

10 months agotimerfd: fix up a memory leak and missing locking
Mateusz Guzik [Fri, 25 Aug 2023 14:21:39 +0000 (14:21 +0000)]
timerfd: fix up a memory leak and missing locking

timerfd01 from ltp passes (and some other don't), but none of the tests
crash the kernel.

This is a bare minimum patch to fix up the immediate regression.

Reported by: yasu

10 months agoAdd mac_grantbylabel
Simon J. Gerraty [Fri, 25 Aug 2023 00:41:22 +0000 (17:41 -0700)]
Add mac_grantbylabel

This module allows controlled privilege escallation via mac labels
securely associated with a process via mac_veriexec.

There are over 700 PRIV_* but we can compress many of them into
a single GBL_* thus constraining the size of gbl labels.

The goal is to allow a daemon to run as an unprivileged process while
still being able a set of privileged operations needed.

We add APIs to libveriexec so that userland processes can check labels
and an exec_script API that allows a suitably labeled process to run
something like a python interpreter directly if necessary;
overcomming the 'indirect' flag applied to the interpreter.

Add -l option to sbin/veriexec to report labels.

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

10 months agoZIL: Second attempt to reduce scope of zl_issuer_lock.
Alexander Motin [Fri, 25 Aug 2023 00:08:49 +0000 (20:08 -0400)]
ZIL: Second attempt to reduce scope of zl_issuer_lock.

The previous patch #14841 appeared to have significant flaw, causing
deadlocks if zl_get_data callback got blocked waiting for TXG sync.  I
already handled some of such cases in the original patch, but issue
 #14982 shown cases that were impossible to solve in that design.

This patch fixes the problem by postponing log blocks allocation till
the very end, just before the zios issue, leaving nothing blocking after
that point to cause deadlocks.  Before that point though any sleeps are
now allowed, not causing sync thread blockage.  This require slightly
more complicated lwb state machine to allocate blocks and issue zios
in proper order.  But with removal of special early issue workarounds
the new code is much cleaner now, and should even be more efficient.

Since this patch uses null zios between write, I've found that null
zios do not wait for logical children ready status in zio_ready(),
that makes parent write to proceed prematurely, producing incorrect
log blocks.  Added ZIO_CHILD_LOGICAL_BIT to zio_wait_for_children()
fixes it.

Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Reviewed-by: George Wilson <george.wilson@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15122

10 months agoUPDATING: add entry for 15.0-CURRENT
Glen Barber [Thu, 24 Aug 2023 23:45:12 +0000 (19:45 -0400)]
UPDATING: add entry for 15.0-CURRENT

Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by: PayPal https://paypal.me/gjbbsd

10 months agoupdate main to 15
Glen Barber [Thu, 24 Aug 2023 23:10:35 +0000 (19:10 -0400)]
update main to 15

Approved by: re (implicit)
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd
Sponsored by: PayPal https://paypal.me/gjbbsd

10 months agovfs: retried++ -> retried = true for the boolean
Mateusz Guzik [Thu, 24 Aug 2023 22:49:47 +0000 (22:49 +0000)]
vfs: retried++ -> retried = true for the boolean

No real changes.

Noted by: rpokala

10 months agofreebsd32: Remove mac_syscall from the unimpl list
Stephen J. Kiernan [Thu, 24 Aug 2023 15:32:26 +0000 (11:32 -0400)]
freebsd32: Remove mac_syscall from the unimpl list

The mac_syscall system call works fine as long as any MAC module
that provides a mpo_syscall method handles compat32 appropriately.

Regenerate system call files for freebsd32.

Reviewed by: sjg
Obtained from: Juniper Networks, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41575

10 months agosmartpqi: Use today's date
Warner Losh [Thu, 24 Aug 2023 22:15:11 +0000 (16:15 -0600)]
smartpqi: Use today's date

We don't have any other man pages that uses $Mdocdate$ so just inline
today's date and remove $Id$ while I'm here.

10 months agovfs: try harder to find free vnodes when recycling
Mateusz Guzik [Thu, 24 Aug 2023 05:34:08 +0000 (05:34 +0000)]
vfs: try harder to find free vnodes when recycling

The free vnode marker can slide past eligible entries.

Artificially reducing vnode limit to 300k and spawning 104 workers each
creating a million files results in all of them trying to recycle, which
often fails when it should not have to.

Because of the excessive traffic in this scenario, the trylock to
requeue is virtually guaranteed to fail, meaning nothing gets pushed
forward.

Since no vnodes were found, the most unfortunate sleep for 1 second is
induced (see vn_alloc_hard, the "vlruwk" msleep).

Without the fix the machine is mostly idle with almost everyone stuck
off CPU waiting for the sleep to finish. With the fix it is busy
creating files.

Unrelated to the above problem the marker could have landed in a
similarly problematic spot for because of any failure in vtryrecycle.

Originally reported as poudriere builders stalling in a vnode-count
restricted setup.

Fixes: 138a5dafba31 ("vfs: trylock vnode requeue")
Reported by: Mark Millard

10 months agolibc: Add timespec_getres(3) as per C23.
Dag-Erling Smørgrav [Thu, 24 Aug 2023 21:31:11 +0000 (21:31 +0000)]
libc: Add timespec_getres(3) as per C23.

This also adds support for TIME_MONOTONIC to timespec_get(3).

Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D41524

10 months agolibc: Fix parsing of hexadecimal numbers in strtol() family.
Dag-Erling Smørgrav [Thu, 24 Aug 2023 21:31:03 +0000 (21:31 +0000)]
libc: Fix parsing of hexadecimal numbers in strtol() family.

This had previously been partly fixed in 2571c7f7200f.

MFC after: 1 week
Reviewed by: imp, allanjude, emaste
Differential Revision: https://reviews.freebsd.org/D41510

10 months agosmartpqi: update to version 4410.0.2005
John Hall [Thu, 24 Aug 2023 21:18:16 +0000 (15:18 -0600)]
smartpqi: update to version 4410.0.2005

This updates the smartpqi driver to Microsemi's latest code. This will
be the driver for FreeBSD 14 (with updates), but no MFC is planned.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41550

10 months agoiflib: invert default restart on VLAN changes
Kevin Bowling [Thu, 24 Aug 2023 20:42:23 +0000 (13:42 -0700)]
iflib: invert default restart on VLAN changes

In rS360398, a new iflib device method was added to opt out of VLAN
events needing an interface reset.

I am switching the default to not requiring a restart for:
* VLAN events
* unknown events

After fixing various bugs, I do not think this would be a common need
of hardware and it is undesirable from the user's perspective causing
link flaps and much slower VLAN configuration. Currently, there are no
other restart events besides VLAN events, and setting the
ifdi_needs_restart default to false will alleviate the need to churn
every driver if an odd event is added in the future for specific
hardware.

markj points out this could cause churn in the other direction; I will
solve that problem with an event registration system as he mentions in
the review should we need it in the future.

These drivers will opt into restart and need further inspection or work:
* ixv (needs code audit, 61a8231 fixed principal issue; re-init probably
not necessary)
* axgbe (needs code audit; re-init probably not necessary)
* iavf - (needs code audit; interaction with Malicious Driver Detection
mentioned in rS360398)
* mgb - no VLAN functions are currently implemented. Left a comment.

MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D41558

10 months agoice: Don't restart on VLAN changes
Kevin Bowling [Thu, 24 Aug 2023 20:40:35 +0000 (13:40 -0700)]
ice: Don't restart on VLAN changes

In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This re-init is unnecessary for ice(4).

MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D41558

10 months agoiavf: Add explicit ifdi_needs_reset for VLAN changes
Kevin Bowling [Thu, 24 Aug 2023 20:36:00 +0000 (13:36 -0700)]
iavf: Add explicit ifdi_needs_reset for VLAN changes

In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

iavf(4) was the original need for this, because VLAN filter changes
currently have negative interactions with Malicious Driver Detection.

Add iavf_if_needs_restart and explicitly enable VLAN re-init.

MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D41558

10 months agoenic: Don't restart on VLAN changes
Kevin Bowling [Thu, 24 Aug 2023 20:29:10 +0000 (13:29 -0700)]
enic: Don't restart on VLAN changes

In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This re-init is unintentional for vmxnet3(4).

MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D41558

10 months agovmxnet3: Don't restart on VLAN changes
Kevin Bowling [Thu, 24 Aug 2023 20:25:21 +0000 (13:25 -0700)]
vmxnet3: Don't restart on VLAN changes

In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This re-init is unintentional for vmxnet3(4).

MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D41558

10 months agoenetc: Don't restart on VLAN changes
Kevin Bowling [Thu, 24 Aug 2023 20:24:48 +0000 (13:24 -0700)]
enetc: Don't restart on VLAN changes

In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This re-init is unintentional for enetc(4).

MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D41558

10 months agobnxt: Don't restart on VLAN changes
Kevin Bowling [Thu, 24 Aug 2023 20:16:24 +0000 (13:16 -0700)]
bnxt: Don't restart on VLAN changes

In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.

This is unintentional for bnxt(4) and is causing another bug in its VLAN
initialization code to affect the common case of adding and removing
VLANs on an existing interface.

PR: 269133
Tested by: kp
MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D41558

10 months agotimerfd: Add manual page.
Jake Freeland [Thu, 24 Aug 2023 19:59:20 +0000 (13:59 -0600)]
timerfd: Add manual page.

This manual page accompanies the timerfd system calls.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D40218

10 months agotimerfd: Move implementation from linux compat to sys/kern
Jake Freeland [Thu, 24 Aug 2023 04:39:54 +0000 (22:39 -0600)]
timerfd: Move implementation from linux compat to sys/kern

Move the timerfd impelemntation from linux compat code to sys/kern. Use
it to implement the new system calls for timerfd. Add a hook to kern_tc
to allow timerfd to know when the system time has stepped. Add kqueue
support to timerfd. Adjust a few names to be less Linux centric.

RelNotes: YES
Reviewed by: markj (on irc), imp, kib (with reservations), jhb (slack)
Differential Revision: https://reviews.freebsd.org/D38459

10 months agozed: Add zedlet to power off slot when drive is faulted
Tony Hutter [Thu, 24 Aug 2023 18:59:03 +0000 (11:59 -0700)]
zed: Add zedlet to power off slot when drive is faulted

If ZED_POWER_OFF_ENCLOUSRE_SLOT_ON_FAULT is enabled in zed.rc, then
power off the drive's slot in the enclosure if it becomes FAULTED.
This can help silence misbehaving drives.  This assumes your drive
enclosure fully supports slot power control via sysfs.

Reviewed-by: @AllKind
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #15200