Commit graph

284771 commits

Author SHA1 Message Date
Stéphane Rochoy 32c3d315ed superio(4): Document supported Nuvoton and Winbond chips
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/719
2023-07-01 11:19:48 -06:00
VexedUXR 3bf9e84f08 Stand: Silence undefined symbols check command
No need to print this...

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/786
2023-07-01 11:16:58 -06:00
santhoshkumar-mani d3eb9d3db3 bios: Don't keep sending BIO_FLUSH after first ENOTSUPP.
When a storage device reports that it does not support cache flush, the
GEOM disk layer by default returns ENOTSUPP in response to a BIO_FLUSH
command.

On AWS, local volumes do not advertise themselves as having write-cache
enabled.  When they are selected for L3 on all HDD nodes, the L3
subsystem may inadvertently kick these L3 devices if a BIO_FLUSH command
fails with an ENOTSUPP return code.  The fix is to make GEOM disk return
success (0) when this condition occurs and add a sysctl to make this
error handling config-driven

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/710
2023-07-01 11:14:49 -06:00
Mark O'Donovan 6f9388d505 qlnxe: remove unused variable from ecore_ll2.c
Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:07:00 -06:00
Mark O'Donovan b0d3d44dfe qlnxe: add driver to amd64 NOTES
Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:59 -06:00
Mark O'Donovan e4017d9b69 qlnxe: Fix building as in-kernel component
Add some extra files for building the driver as part of the kernel.
Change some #defines to match those used when building as a module.

PR: 268354

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:59 -06:00
Mark O'Donovan dc58675cfb qlnxe: Fix unused but set variable warning
Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:58 -06:00
Mark O'Donovan b75c387a66 qlnxe: Remove #ifdef ECORE_PACKAGE
I do not know why this is here but it blocks compilation.
Removing it makes the builtin option the same as the module build

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:57 -06:00
Mark O'Donovan c1be7151d5 qlnxe: Fix too many args in call to internal_ram_wr()
internal_ram_wr() only takes 3 args when ECORE_CONFIG_DIRECT_HWFN
is defined

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:56 -06:00
Mark O'Donovan 99e5ffe1ba qlnxe: Move sriov includes to qlnx_os.c
SRIOV is being enabled in ecore.h but by then
the qlnx_os.h header has been processed and not
included the relevant headers

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:56 -06:00
Mark O'Donovan 134b093699 qlnxe: Remove -Wno-case-qual from module build
Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:55 -06:00
Martin Matuska 0a97523d46 zfs: merge openzfs/zfs@009d3288d
Notable upstream pull request merges:
  #14654 Pack our DDT ZAPs a bit denser
  #14979 Again fix race between zil_commit() and zil_suspend()
  #14985 Some ZIO micro-optimizations
  #15000 Fix remount when setting multiple properties
  #15004 ddt_addref: remove unnecessary phys fill when refcount is 0
  #15007 Do not report bytes skipped by scan as issued
  #15023 Enable tuning of ZVOL open timeout value

Obtained from:	OpenZFS
OpenZFS commit:	009d3288de
OpenZFS tag:	zfs-2.2.0-rc1
2023-07-01 15:24:26 +02:00
Michael Tuexen cd9da8d072 siftr: unbreak dtrace support
This patch adds back some fields needed by the siftr probe, which were
removed in
https://cgit.freebsd.org/src/commit/?id=aa61cff4249c92689d7a1f15db49d65d082184cb

With this fix, you can run dtrace scripts again when the siftr
module is loaded. And the siftr probe works again.

Reviewed by:		rscheff
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D40826
2023-07-01 09:50:54 +02:00
Dmitry Chagin f049c92ad6 csu: Add the prologue and epilogue to the _init and _fini on x86_64
Normally, modern unwinders uses Dwarf information to unwind stack,
however in case when the code is not annotated by Dwarf instructions,
unwinders fallbacks to a frame-pointer based algorithm.

That is allows libunwind to unwind stack from global constructors and
destructors. Also it makes gdb happy as it printed nonexistent frame
before.

Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40795
2023-07-01 10:52:10 +03:00
Dmitry Chagin 3bdf68086d rtld: Add a stop indicator to rtld_start to satisfy unwinders on x86_64
The right unwinding stop indicator should be CFI-undefined PC.
https://dwarfstd.org/doc/Dwarf3.pdf - page 118:
If a Return Address register is defined in the virtual unwind table,
and its rule is undefined (for example, by DW_CFA_undefined), then
there is no return address and no call address, and the virtual
unwind of stack activations is complete.

That is allows gdb and libunwind successfully stop when unwinding stack
from global constructors and destructors.

Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40794
2023-07-01 10:51:35 +03:00
Michael Tuexen f85b82daf1 dtrace: third update to the siftr probe
This adds the changes corresponding to
https://cgit.freebsd.org/src/commit/?id=60167184abd54ca12c6bf7ab60f2a08b41342f84
to the siftr probe.
This concludes the series up updates.

Reviewed by:		rscheff
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D40825
2023-07-01 09:30:34 +02:00
Alexander V. Chernikov bb06a80cf6 netinet[6]: make in[6]_control use ucred instead of td.
Reviewed by:	markj, zlei
Differential Revision: https://reviews.freebsd.org/D40793
MFC after:	2 weeks
2023-07-01 06:52:24 +00:00
Michael Tuexen 643d067119 dtrace: another update of the siftr probe
This adds the changes corresponding to
https://cgit.freebsd.org/src/commit/?id=d090464ecd4af5cd400ef5cbbfe8409d019eac34
to the siftr probe.

Reviewed by:		rscheff
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D40824
2023-07-01 02:45:16 +02:00
Michael Tuexen cade9a8e37 dtrace: update siftr probe
This adds the changes corresponding to
https://cgit.freebsd.org/src/commit/?id=1241e8e7aed5d709a6cf62024e9ae750981c03ae
to the siftr probe.

Reviewed by:		rscheff
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D40823
2023-07-01 02:26:52 +02:00
Michael Tuexen 0631830a7a siftr: document siftr probe to man page of the tcp provider
This man page documents what is currently implemented in siftr.d.
It doesn't work right now in head, but in stable/13. Follow-up
commits will fix it for head.

Reviewed by:		cc, pauamma_gundo.com
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D40809
2023-07-01 00:18:15 +02:00
Marius Strobl eb33b693b3 test: remove remainder of testfloat
These bits are unused since the sparc64-specific glue has been deleted
in f33b14f0.
2023-06-30 22:43:50 +02:00
Michael Tuexen f5541b85a5 dtrace: fix constants used by the siftr probe
The constants used in the C code were changed in
https://svnweb.freebsd.org/changeset/base/343646
but changing them also in the dtrace translator was missed.

Reviewed by:		cc, rscheff
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D40805
2023-06-30 22:15:47 +02:00
Michael Tuexen dc2d26df43 siftr: provide dtrace with the correct pointer to data
This fixes a bug which was introduced in the commit
https://svnweb.freebsd.org/changeset/base/282276

Reviewed by:		cc, rscheff
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D40806
2023-06-30 22:03:04 +02:00
Brian Behlendorf 009d3288de Tag 2.2.0-rc1
New features:
- Fully adaptive ARC eviction (#14359)
- Block cloning (#13392)
- Scrub error log (#12812, #12355)
- Linux container support (#14070, #14097, #12263)
- BLAKE3 Checksums (#12918)
- Corrective "zfs receive" (#9372)

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2023-06-30 12:07:09 -07:00
Prakash Surya 945e39fc3a
Enable tuning of ZVOL open timeout value
The default timeout for ZVOL opens may not be sufficient for all cases,
so we should enable the value to be more easily tuned to account for
systems where the default value is insufficient.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Prakash Surya <prakash.surya@delphix.com>
Closes #15023
2023-06-30 11:34:05 -07:00
Brian Behlendorf ac8ae18d22 Revert "spa.h: use IN_BASE instead of IN_FREEBSD_BASE"
This reverts commit 77a3bb1f47.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2023-06-30 10:03:46 -07:00
John Baldwin f4de136aa8 linux: binutils as requires %eflags instead of %flags for CFI.
This applies the changes to linux32_locore.asm from commit
a35572b16e to the i386 copy.
2023-06-30 09:43:58 -07:00
John Baldwin 533f1f686f i386 acpi: Remove unneeded function declaration.
The declaration didn't use matching array bounds as the later
definition raising a -Warray-parameters warning from GCC.  However,
the function is also defined before it is used, so the declaration
isn't strictly needed.
2023-06-30 09:43:52 -07:00
Rich Ercolani 2b10e32561
Pack our DDT ZAPs a bit denser.
The DDT is really inefficient on 4k and up vdevs, because it always
allocates 4k blocks, and while compression could save us somewhat
at ashift 9, that stops being true.

So let's change the default to 32 KiB, which seems like a reasonable
compromise between improved space savings and inflated write sizes
for DDT updates.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #14654
2023-06-30 09:42:02 -07:00
Rob N 61ab05cac7
ddt_addref: remove unnecessary phys fill when refcount is 0
The previous comment wondered if this case could happen; it turns out
that it really can't.

This block can only be entered if dde_type and dde_class are "real";
that only happens when a ddt entry has been previously synced to a ddt
store, that is, it was created on a previous txg. Since its gone through
that sync, its dde_refcount must be >0.

ddt_addref() is called from brt_pending_apply(), which is called at the
beginning of spa_sync(), before pending DMU writes/frees are issued.
Freeing a dedup block is the only thing that can decrement dde_refcount,
so there's no way for it to drop to zero before applying the clone bumps
it.

Further, even if it _could_ go to zero, it wouldn't be necessary to fill
the entry from the block. The phys content is not cleared until the free
is issued, which happens when the refcount goes to zero, when the last
real free comes through. The cloned block should be identical to what's
in the phys already, so the fill should be a no-op anyway.

I've replaced this with an assertion because this is all very dependent
on the ordering in which BRT and DDT changes are applied, and that might
change in the future.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-By: Klara, Inc.
Closes #15004
2023-06-30 09:01:58 -07:00
Alexander Motin 233425a153
Again fix race between zil_commit() and zil_suspend().
With zl_suspend read in zil_commit() not protected by any locks it
is possible for new ZIL writes to be in progress while zil_destroy()
called by zil_suspend() freeing them.  This patch closes the race
by taking zl_issuer_lock in zil_suspend() and adding the second
zl_suspend check to zil_get_commit_list(), protected by the lock.
It allows all already queued transactions to be logged normally,
while blocks any new ones, calling txg_wait_synced() for the TXGs.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #14979
2023-06-30 08:59:39 -07:00
Alexander Motin b4a0873092
Some ZIO micro-optimizations.
- Pack struct zio_prop by 4 bytes from 84 to 80.
 - Skip new child ZIO locking while linking to parent.  The newly
allocated ZIO is not externally visible yet, so nobody should care.
 - Skip io_bp_copy writes when not used (write && non-debug).

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #14985
2023-06-30 08:54:00 -07:00
Alexander Motin fa7b2390d4
Do not report bytes skipped by scan as issued.
Scan process may skip blocks based on their birth time, DVA, etc.
Traditionally those blocks were accounted as issued, that caused
reporting of hugely over-inflated numbers, having nothing to do
with actual disk I/O.  This change utilizes never used field in
struct dsl_scan_phys to account such skipped bytes, allowing to
report how much data were actually scrubbed/resilvered and what
is the actual I/O speed.  While formally it is an on-disk format
change, it should be compatible both ways, so should not need a
feature flag.

This should partially address the same issue as c85ac731a0, but
from a different perspective, complementing it.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Akash B <akash-b@hpe.com>
Signed-off-by:  Alexander Motin <mav@FreeBSD.org>
Sponsored by:   iXsystems, Inc.
Closes #15007
2023-06-30 08:47:13 -07:00
Arshad Hussain 6052060c13
Don't use hard-coded 'size' value in snprintf()
This patch changes the passing of "size" to snprintf
from hard-coded (openended) to sizeof(errbuf). This
is bringing to standard with rest of the code where-
ever 'errbuf' is used.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Closes #15003
2023-06-30 08:37:26 -07:00
Alexander Motin eda32dca92
Fix remount when setting multiple properties.
The previous code was checking zfs_is_namespace_prop() only for the
last property on the list.  If one was not "namespace", then remount
wasn't called.  To fix that move zfs_is_namespace_prop() inside the
loop and remount if at least one of properties was "namespace".

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15000
2023-06-30 08:36:43 -07:00
Simon J. Gerraty 56f3f2d249 libsecureboot: avoid set but not used errors
Reviewed by:	stevek
2023-06-29 23:52:17 -07:00
Simon J. Gerraty fcc8d72702 Separate dependencies on tools built for host.
When generated files depend on tools that need to be built for host,
we need to carefully separate them for the DIRDEPS_BUILD so we
only build them once.

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
2023-06-29 23:52:03 -07:00
Yuri Pankov af2939f227 Revert "openzfs: use IN_BASE instead of IN_FREEBSD_BASE in spa.h"
Further testing (sadly, after committing) shows that I missed the fact
that IN_BASE is used as userland/kernel delimiter (and not just for
FreeBSD-specific code unlike the IN_FREEBSD_BASE).  Revert until I have
a full (and proper) fix.

This reverts commit d2a45e9e81.
2023-06-29 23:04:35 +02:00
Yuri Pankov d2a45e9e81 openzfs: use IN_BASE instead of IN_FREEBSD_BASE in spa.h
Consistently use IN_BASE to allow libzfs to get the same default
autotrim value as kernel does.

Note that this does not change the default value itself, rather
fixing the source of value and the value itself in e.g. zpool get
output if it was not set explicitly.  (And as a reminder, default
value of autotrim on FreeBSD is 'on', despite what zpoolprops(7)
says currently.)

PR:		264234
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D40075
2023-06-29 22:14:18 +02:00
vimproved 24554082bd
contrib: dracut: Conditionalize copying of libgcc_s.so.1 to glibc only
The issue that this is designed to work around is only applicable to
glibc, since it's caused by glibc's pthread_cancel() implementation
using dlopen on libgcc_s.so.1 (and therefor not triggering dracut to
include it in the initramfs). This commit adds an extra condition to the
workaround that tests for glibc via "ldconfig -p | grep -qF 'libc.so.6'"
(which should only be present on glibc systems).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Violet Purcell <vimproved@inventati.org>
Closes #14992
2023-06-29 12:54:37 -07:00
Simon J. Gerraty 84c84ae15b BOOT_MACHINE_DIR should be stand not boot
Reviewed by:	stevek
2023-06-29 12:02:27 -07:00
Yuri Pankov 77a3bb1f47
spa.h: use IN_BASE instead of IN_FREEBSD_BASE
Consistently get the proper default value for autotrim.

Currently, only the kernel module is built with IN_FREEBSD_BASE,
and libzfs get the wrong default value, leading to confusion and
incorrect output when autotrim value was not set explicitly.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Yuri Pankov <yuripv@FreeBSD.org>
Closes #15016
2023-06-29 11:50:52 -07:00
Mitchell Horne 529f11385c tcp(4): fix a misnomer
This is almost certainly not the meaning of PCB used here.

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40786
2023-06-29 15:25:54 -03:00
Mateusz Piotrowski 62ace21a14
zdb: Add missing poolname to -C synopsis
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Mateusz Piotrowski <0mp@FreeBSD.org>
Sponsored-by: Klara Inc.
Closes #15014
2023-06-29 10:54:43 -07:00
Alan Cox e59d202312 arm64: make VM_NFREEORDER and the comment describing it match
The setting of VM_NFREEORDER and the comment describing it were copied
from sparc64 where both the page size and the number of page table
entries that fit in a cache line are different from arm64.

Reviewed by:	andrew, kib, markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D40782
2023-06-29 12:48:48 -05:00
Mitchell Horne 651d1efd96 hier(7): adjust overlays/ subdirectory
Device tree overlays are installed in /boot/dtb/overlays by default.
Adjust the comment to mention fdt_overlays and loader.conf, but do not
repeat what is said in the parent directory's description.

PR:		261349
Reviewed by:	grahamperrin, kevans
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40785
2023-06-29 13:55:17 -03:00
Dmitry Chagin a18b956b73 libexecinfo: Enable backtrace_test.backtrace_fmt_basic on amd64 again
Due to unwind tables generation enabled after c969310c for csu.

PR:			241562, 246322, 246537
Reviewed by:		kib, ngie
Differential Revision:	https://reviews.freebsd.org/D40758
2023-06-29 19:53:07 +03:00
Dmitry Chagin c969310c99 csu: Implement _start using as to satisfy unwinders on x86_64
The right unwinding stop indicator should be CFI-undefined PC.
https://dwarfstd.org/doc/Dwarf3.pdf - page 118:
If a Return Address register is defined in the virtual unwind table,
and its rule is undefined (for example, by DW_CFA_undefined), then
there is no return address and no call address, and the virtual
unwind of stack activations is complete.

This requires the crt code be built with unwind tables, for that remove
-fno-asynchronous-unwind-tables to enable unwind tables generation.

PR:			241562, 246322, 246537
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40780
2023-06-29 19:34:39 +03:00
Dag-Erling Smørgrav c09909ed88 libstdbuf: Add proper SEE ALSO section.
Sponsored by:	Klara, Inc.
Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D40800
2023-06-29 16:23:45 +00:00
Dag-Erling Smørgrav 78baa63209 stdbuf: Code cleanup.
* Factor out path-setting code.
* Normalize usage().
* Remove unnecessary switch case.

Sponsored by:	Klara, Inc.
Reviewed by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D40799
2023-06-29 15:30:05 +00:00